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
remove generator meta tag
function child_manage_woocommerce_styles() { remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); //first check that woo exists to prevent fatal errors if ( function_exists( 'is_woocommerce' ) ) { //dequeue scripts and styles if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { wp_dequeue_style( 'woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_generator_meta() {\n\t\tremove_action('wp_head', 'wp_generator');\n\t}", "function wooadmin_remove_woo_commerce_generator_tag()\n{\n remove_action('wp_head',array($GLOBALS['eshopbox'], 'generator'));\n}", "function sunset_remove_meta_version(){\n return '' ;\n}", "public function removeMetaTag($name)\n\t{\n\t\tif($this->metaTags->offsetExists($name))\n\t\t\t$this->metaTags->offsetUnset($name);\n\n\t\tif($this->pageInitialized)\n\t\t{\n\t\t\t$meta = $this->document->xpath('.//meta[@name=\"' . $name . '\" or @http-equiv=\"' . $name . '\" or @property=\"' . $name . '\"]');\n\n\t\t\tif($meta->length == 1)\n\t\t\t\t$meta->item(0)->remove();\n\t\t}\n\t}", "function lessie_html_head_alter(&$head_elements) {\r\n unset($head_elements['system_meta_generator']);\r\n}", "function bajweb_remove_meta_version() {\n\treturn '';\n}", "public function removeGenerator() {\n\t\treturn $this->doc->setGenerator(null);\n\t}", "function magazine_remove_entry_meta() {\n\tif ( ! is_single() ) {\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_post_meta' );\n\t\tremove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );\n\t}\n\n}", "function remove_generators() {\n\treturn '';\n}", "function wfs_remove_meta_version() {\n\treturn '';\n}", "public function testGenerateMetaTags()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "function remove_yoast_acesso_camera() {\r\n remove_meta_box( 'wpseo_meta' , 'acesso_camera' , 'normal' ); \r\n}", "public static function remove_head_meta() {\r\n if (!is_admin()):\r\n remove_action('wp_head', 'rsd_link');\r\n remove_action('wp_head', 'wp_generator');\r\n //remove_action('wp_head', 'feed_links', 2);\r\n remove_action('wp_head', 'index_rel_link');\r\n remove_action('wp_head', 'wlwmanifest_link');\r\n remove_action('wp_head', 'feed_links_extra', 3);\r\n remove_action('wp_head', 'start_post_rel_link', 10, 0);\r\n remove_action('wp_head', 'parent_post_rel_link', 10, 0);\r\n remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);\r\n endif;\r\n }", "public function removeMeta(string $key)\n {\n if (isset($this->meta[$key])) {\n unset($this->meta[$key]);\n }\n }", "function removeMeta($element, $name) {\n\t\tif ($name === 'style') {\n\t\t\t$element = str_replace([\n\t\t\t\t' type=\"text/css\"',\n\t\t\t\t\"' type='text/css'\"\n\t\t\t],\n\t\t\t['', ''], $element);\n\t\t} elseif ($name === 'script') {\n\t\t\t$element = str_replace([\n\t\t\t\t' type=\"text/javascript\"',\n\t\t\t\t\" type='text/javascript'\"\n\t\t\t],\n\t\t\t['', ''], $element);\n\t\t}\n\t\treturn $element;\n\t}", "function ngng_remove_yoast_metabox_page_headers() {\n\tremove_meta_box( 'wpseo_meta', 'page_header', 'normal' );\n}", "function ssep_force_hide_meta() {\n\tglobal $post, $ss_blog;\n\n\t$hide_meta = ssep_hide_meta( $post->ID );\n\n\tif ( $hide_meta ) {\n\t\tremove_action( 'shoestrap_entry_meta', array( $ss_blog, 'meta_custom_render' ) );\n\t\tadd_filter( 'shoestrap_the_tags', '__return_null' );\n\t\tadd_filter( 'shoestrap_the_cats', '__return_null' );\n\t}\n}", "function mizzouRemoveGenerator()\n{\n return '';\n}", "function uninstall_hook()\n\t\t{\n\t\t\t// Delete plugin options\t\t\t\n\t\t\tdelete_option('verify-meta-tags');\n\t\t}", "function board_agenda_front_genesis_meta() {\n\t\tremove_action( 'genesis_loop', 'genesis_do_loop' );\n\n\t\t//* Remove the post content (requires HTML5 theme support)\n\t\tremove_action( 'genesis_entry_content', 'genesis_do_post_content' );\n\n\t\t//add_action( 'genesis_entry_content', 'sanders_front_content' );\n\t\tadd_action( 'genesis_loop', 'board_agenda_resource_centre' );\n\n\t\tadd_action('genesis_before_footer','board_agenda_front_latest_insight',1);\n\n}", "function board_agenda_front_genesis_meta() {\n\t\tremove_action( 'genesis_loop', 'genesis_do_loop' );\n\n\t\t//* Remove the post content (requires HTML5 theme support)\n\t\tremove_action( 'genesis_entry_content', 'genesis_do_post_content' );\n\n\t\t//add_action( 'genesis_entry_content', 'sanders_front_content' );\n\t\tadd_action( 'genesis_loop', 'board_agenda_resource_centre' );\n\n\t\tadd_action('genesis_before_footer','board_agenda_front_latest_insight',1);\n\n}", "function remove_yoast(){\n global $wpseo_front;\n remove_action( 'wpseo_head', array($wpseo_front, 'debug_marker') , 2 );\n}", "function my_remove_meta_boxes() {\n\tremove_meta_box('tagsdiv-awards_sponsor_type', 'awards_sponsors', 'side');\n}", "public function delMetadata() {}", "public function delMetadata() {}", "public function delMetadata() {}", "function lgm_theme_remove_tags_metabox() {\n\t remove_meta_box('tagsdiv-post_tag', 'post', 'side');\n\t}", "function ngng_remove_revslider_metabox_page_headers() {\n\tremove_meta_box( 'mymetabox_revslider_0', 'page_header', 'normal' );\n}", "public function hooks() {\n\t\t\\add_filter( 'the_generator', '__return_false' );\n\t\t\\remove_action('wp_head', 'wp_generator');\n\t}", "function remove_yoast_metabox_reservations(){\n\tremove_meta_box('wpseo_meta', 'hub_notification', 'normal');\n}", "function humcore_remove_meta_boxes() {\n\n\tremove_meta_box( 'humcore_deposit_subjectdiv', 'humcore_deposit', 'side' );\n\tremove_meta_box( 'tagsdiv-humcore_deposit_tag', 'humcore_deposit', 'side' );\n\n}", "public function clearMetas(): void\n {\n $this->metas()->delete();\n }", "function bsg_remove_genesis_customizer_controls( $wp_customize ) {\n // remove Site Title/Logo: Dynamic Text or Image Logo option from Customizer\n $wp_customize->remove_control( 'blog_title' );\n return $wp_customize;\n}", "function add_meta_to_plugin_pages() {\r\n echo '<meta name=\"robots\" content=\"noindex\"/>';\r\n echo '<meta name=\"robots\" content=\"nofollow\"/>';\r\n }", "public function removeAllMeta() {\n // Get the amount of meta tags that is going to be removed\n $removed = sizeof($this->meta);\n\n // Remove all the meta tags\n $this->meta = array();\n\n // Return the amount of removed tags\n return $removed;\n }", "function custom_remove() { \n remove_meta_box('add-sfwd-certificates', 'nav-menus', 'side');\n remove_meta_box('add-sfwd-assignment', 'nav-menus', 'side'); \n}", "function _upgrade_422_remove_genericons()\n {\n }", "public function cleanup()\n\t{\n\t\tif ($this->isHtml())\n\t\t{\n\t\t\t$responseBody = preg_replace('/<link rel=[\"\\' ](pingback|alternate|EditURI|wlwmanifest|index|profile|prev)[\"\\' ](.*?)>/si', '', $this->getResponseBody());\n\t\t\t$responseBody = preg_replace('/<meta name=[\"\\' ]generator[\"\\' ](.*?)>/si', '', $responseBody);\n\t\t\t$this->setResponseBody($responseBody);\n\t\t}\n\t}", "function delete_meta($mid)\n {\n }", "public function remove_meta_box() {\n\t\tremove_meta_box( $this->tax_name . 'div', 'ctrs-projects', 'side' );\n\t}", "public function remove_meta_box() {\r\n\r\n\t\tif( ! is_wp_error( $this->tax_obj ) && isset($this->tax_obj->object_type) ) foreach ( $this->tax_obj->object_type as $post_type ):\r\n\t\t\t$id = ! is_taxonomy_hierarchical( $this->taxonomy ) ? 'tagsdiv-'.$this->taxonomy : $this->taxonomy .'div' ;\r\n\t \t\tremove_meta_box( $id, $post_type, 'side' );\r\n\t \tendforeach;\r\n\t}", "public function remove_meta_boxes(){\r\n remove_meta_box('slugdiv', 'cycloneslider', 'normal');\r\n }", "public function unregister_meta_boxes()\n {\n }", "function remove_dashboard_meta() {\r\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\r\n\t\t\t\tremove_meta_box( 'dashboard_welcome', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8\r\n}", "public function remove_screen_reader_content()\n {\n }", "function wck_remove_meta(){\r\n\t\tcheck_ajax_referer( \"wck-delete-entry\" );\r\n\t\tif( !empty( $_POST['meta'] ) )\r\n\t\t\t$meta = sanitize_text_field( $_POST['meta'] );\r\n\t\telse \r\n\t\t\t$meta = '';\r\n\t\tif( !empty( $_POST['id'] ) )\r\n\t\t\t$id = absint( $_POST['id'] );\r\n\t\telse \r\n\t\t\t$id = '';\r\n\t\tif( isset( $_POST['element_id'] ) )\r\n\t\t\t$element_id = absint( $_POST['element_id'] );\r\n\t\telse \r\n\t\t\t$element_id = '';\r\n\r\n\t\t// Security checks\r\n\t\tif( true !== ( $error = self::wck_verify_user_capabilities( $this->args['context'], $meta, $id ) ) ) {\r\n\t\t\theader( 'Content-type: application/json' );\r\n\t\t\tdie( json_encode( $error ) );\r\n\t\t}\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $element_id ) );\r\n\t\t\r\n\t\t$old_results = $results;\r\n\t\tunset($results[$element_id]);\r\n\t\t/* reset the keys for the array */\r\n\t\t$results = array_values($results);\r\n\r\n\t\t/* make sure this does not output anything so it won't break the json response below\r\n\t\twill keep it do_action for compatibility reasons\r\n\t\t */\r\n\t\tob_start();\r\n\t\t\tdo_action( 'wck_before_remove_meta', $meta, $id, $element_id );\r\n\t\t$wck_before_remove_meta = ob_get_clean(); //don't output it\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\tupdate_post_meta($id, $meta, $results);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\tupdate_option( apply_filters( 'wck_option_meta' , $meta, $results, $element_id ), wp_unslash( $results ) );\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t/* TODO: optimize so that it updates from the deleted element forward */\r\n\t\t/* if unserialize_fields is true delete the coresponding post metas */\r\n\t\tif( $this->args['unserialize_fields'] && $this->args['context'] == 'post_meta' ){\t\t\t\r\n\t\t\t\r\n\t\t\t$meta_suffix = 1;\t\t\t\r\n\r\n\t\t\tif( !empty( $results ) ){\r\n\t\t\t\tforeach( $results as $result ){\r\n\t\t\t\t\tforeach ( $result as $name => $value){\r\n\t\t\t\t\t\tupdate_post_meta($id, $meta.'_'.$name.'_'.$meta_suffix, $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$meta_suffix++;\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( count( $results ) == 0 )\r\n\t\t\t\t$results = $old_results;\r\n\t\t\t\r\n\t\t\tif( !empty( $results ) ){\r\n\t\t\t\tforeach( $results as $result ){\t\t\t\t\r\n\t\t\t\t\tforeach ( $result as $name => $value){\r\n\t\t\t\t\t\tdelete_post_meta( $id, $meta.'_'.$name.'_'.$meta_suffix );\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$entry_list = $this->wck_refresh_list( $meta, $id );\r\n\t\t$add_form = $this->wck_add_form( $meta, $id );\r\n\r\n\t\theader( 'Content-type: application/json' );\r\n\t\tdie( json_encode( array( 'entry_list' => $entry_list, 'add_form' => $add_form ) ) );\r\n\t}", "protected function deleteMeta() {\n Meta::deleteAll([\n 'owner' => $this->tableName(),\n 'owner_id' => $this->{static::meta_id_field()}\n ]);\n }", "public function unsetMetadata(): void\n {\n $this->metadata = [];\n }", "public function remove($tag) { //+\n\t\tunset($this->arShortcodes[$tag]);\n\t}", "function unregister_term_meta($taxonomy, $meta_key)\n {\n }", "public static function tag_remove_start() {\n\t//--\n\treturn '<!-- PDF REMOVE START -->';\n\t//--\n}", "function remove_yoast_meta_boxes() {\n\t$post_types = array(\n\t\t'ucf_resource_link',\n\t\t'ucf_section'\n\t);\n\tforeach ( $post_types as $post_type ) {\n\t\tremove_meta_box( 'wpseo_meta', $post_type, 'normal' );\n\t}\n}", "function remove_dashboard_meta() {\nremove_meta_box( ‘dashboard_incoming_links’, ‘dashboard’, ‘normal’ );\nremove_meta_box( ‘dashboard_plugins’, ‘dashboard’, ‘normal’ );\nremove_meta_box( ‘dashboard_primary’, ‘dashboard’, ‘side’ );\nremove_meta_box( ‘dashboard_secondary’, ‘dashboard’, ‘normal’ );\nremove_meta_box( ‘dashboard_quick_press’, ‘dashboard’, ‘side’ );\nremove_meta_box( ‘dashboard_recent_drafts’, ‘dashboard’, ‘side’ );\nremove_meta_box( ‘dashboard_recent_comments’, ‘dashboard’, ‘normal’ );\nremove_meta_box( ‘dashboard_right_now’, ‘dashboard’, ‘normal’ );\nremove_meta_box( ‘dashboard_activity’, ‘dashboard’, ‘normal’);//since 3.8\n}", "public function remove_author_meta_box() {\n\t\tremove_meta_box( 'authordiv', my_multi_author()->get_multi_author_post_types(), 'normal' );\n\t}", "public function hideMetaBoxes()\n {\n remove_meta_box( 'pageparentdiv', 'playscripts', 'side' );\n // for some odd reason this doesn't always work. Very annoying.\n remove_meta_box( 'postimagediv', 'playscripts', 'side' );\n }", "public function removeTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_tag]);\n\t\t}\n\t}", "public function add_meta_keyword() {\n // Get global settings\n $swpm_settings = get_option('swpm-settings');\n\n // Settings - Disable meta tag version\n $settings_meta = isset($swpm_settings['show-version']) ? '' : '<!-- <meta name=\"swpm\" version=\"' . SWPMFB_VERSION . '\" /> -->' . \"\\n\";\n\n echo apply_filters('swpm_show_version', $settings_meta);\n }", "function i_want_no_generators()\r\n{\r\n \t\treturn '';\r\n\t}", "function gtags_remove_tags_from_admin_bar() {\n\tglobal $bp;\n\tunset ( $bp->bp_options_nav['groups']['98564'] );\n}", "public function removeGeneratedDate($html)\n {\n // removes the date in the chapter being translated\n $html = preg_replace('~^\\s*Generated.+?$~m', '', $html);\n $html = preg_replace('~^\\s*@copyright.+?$~m', '', $html);\n\n return $html;\n }", "function unregister_post_meta($post_type, $meta_key)\n {\n }", "public function add_meta_keyword() {\n\t\t// Get global settings\n\t\t$vfb_settings \t= get_option( 'vfb-settings' );\n\n\t\t// Settings - Disable meta tag version\n\t\t$settings_meta\t= isset( $vfb_settings['show-version'] ) ? '' : '<!-- <meta name=\"vfbPro\" version=\"'. VFB_PRO_VERSION . '\" /> -->' . \"\\n\";\n\n\t\techo apply_filters( 'vfb_show_version', $settings_meta );\n\t}", "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}", "function no_generator() { return ''; }", "function no_generator() { return ''; }", "public function delete_meta( &$object, $meta ) {\n\t\t}", "public function forgetMeta(string $key): void\n {\n $this->metas()->where('key', $key)->delete();\n }", "function gtpressMenu_disable_metas() {\r\n\r\n\tif (current_user_can('manage_options') && get_option('gtpressMenu_admins_see_everything'))\r\n\t\treturn;\r\n\r\n\tremove_action('admin_head', 'index_js');\r\n\r\n\t$disabled_metas = get_option('gtpressMenu_disabled_metas');\r\n\tif (!empty($disabled_metas)) {\r\n\t\t$metas = implode(',', $disabled_metas);\r\n\t\techo '<style type=\"text/css\">'.$metas.' {display: none !important}</style>';\r\n\t}\r\n\r\n}", "function remove_postcustom() {\n\tremove_meta_box( 'postcustom', null, 'normal' );\n}", "function GTPress_hide_pagemeta() {\r\n\tif ($options['hide_pagemeta'] == \"true\") {\r\n\t\tremove_meta_box( 'commentstatusdiv' , 'page' , 'normal' ); // allow comments for pages\r\n\t\tremove_meta_box( 'commentsdiv' , 'page' , 'normal' ); // recent comments for pages\r\n\t\tremove_meta_box( 'postcustom' , 'page' , 'normal' ); // custom fields for pages\r\n\t\tremove_meta_box( 'trackbacksdiv' , 'page' , 'normal' ); // page trackbacks\r\n\t\tremove_meta_box( 'postexcerpt' , 'page' , 'normal' ); // page excerpts\r\n\t\tremove_meta_box( 'tagsdiv-post_tag' , 'page' , 'side' ); // page tags\r\n\t\tremove_meta_box( 'pageparentdiv','page','side'); // Page Parent\r\n\t\tremove_meta_box( 'slugdiv','page','normal'); // page slug\r\n\t}\r\n}", "public function destroy(SeoMetaTag $seoMetaTag)\n {\n //\n }", "function d4tw_remove_dash_meta() {\r\n remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );\r\n remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );\r\n remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8\r\n}", "function remove_custom_image_header()\n {\n }", "function swm_remove_divi_viewport_meta() {\n\tremove_action( 'wp_head', 'et_add_viewport_meta' );\n}", "function clear_unknown_post_metas()\n {\n global $wpdb;\n\n $query = \"SELECT count(*) FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0\";\n $count = $wpdb->get_var($query);\n\n if($count)\n {\n $query = \"DELETE FROM {$wpdb->postmeta} WHERE ( meta_key LIKE 'prli%' OR meta_key LIKE 'pretty-link%' OR meta_key LIKE '_prli%' OR meta_key LIKE '_pretty-link%' ) AND post_id=0\";\n $wpdb->query($query);\n }\n }", "function remove_metaboxes() {\n //remove_meta_box( 'postcustom' , 'product' , 'normal' );\n remove_meta_box( 'postexcerpt' , 'product' , 'normal' );\n //remove_meta_box( 'commentsdiv' , 'product' , 'normal' );\n //remove_meta_box( 'tagsdiv-product_tag' , 'product' , 'normal' );\n}", "public function head_cleanup() {\n\n\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\tremove_action( 'wp_head', 'wp_generator' );\n\t}", "function ptthemes_noindex_head() {\n\n\t$meta_string = '';\n\tif ( (is_category() && get_option( 'ptthemes_noindex_category' )) ||\n\t\t(is_tag() && get_option( 'ptthemes_noindex_tag' )) ||\n\t\t(is_day() && get_option( 'ptthemes_noindex_daily' )) ||\n\t\t(is_month() && get_option( 'ptthemes_noindex_monthly' )) ||\n\t\t(is_year() && get_option( 'ptthemes_noindex_yearly' )) ||\n\t\t(is_author() && get_option( 'ptthemes_noindex_author' )) ||\n\t\t(is_search() && get_option( 'ptthemes_noindex_search' )) ) {\n\n\t\t$meta_string .= '<meta name=\"robots\" content=\"noindex,follow\" />';\n\t}\n\n\t\techo $meta_string;\n\n}", "function delete_site_meta_by_key($meta_key)\n {\n }", "function ap_core_meta_tags() {\r\n $output = '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">';\r\n $output .= '<link rel=\"pingback\" href=\"' . get_bloginfo('pingback_url') . '\" />';\r\n\r\n if ( has_filter( 'ap_core_filter_meta_tags' ) ) {\r\n $output = apply_filters( 'ap_core_filter_meta_tags', 10, 2 );\r\n }\r\n return $output;\r\n}", "public static function spanTagCorrectlyRemovedWhenRmTagIfNoAttribIsConfiguredDataProvider() {}", "function remove_guttenberg_from_pages() {\n\tremove_post_type_support( 'youthclub', 'editor' );\n}", "function generer_bing(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['bing']['id'])\n\t\treturn '<meta name=\"msvalidate.01\" content=\"' . $config['bing']['id'] . '\" />\n\t\t';\n}", "public function MetaDeletable() {\n\t\t\treturn true;\n\t\t}", "function remove_genesis_features() {\n remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );\n remove_action('genesis_footer', 'genesis_do_footer');\n remove_action('genesis_footer', 'genesis_footer_markup_open', 5);\n remove_action('genesis_footer', 'genesis_footer_markup_close', 15);\n remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );\n remove_action( 'genesis_entry_footer', 'genesis_post_meta' );\n}", "public function remove_packlink_meta_data() {\n\t\t$query = \"DELETE FROM `{$this->db->postmeta}` WHERE `meta_key` LIKE \\\"%_packlink_%\\\"\";\n\n\t\t$this->db->query( $query );\n\t}", "function remove_meta_box($id, $screen, $context)\n {\n }", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}", "private function prepareMeta() {\n\t\tif (is_array($this->meta) && count($this->meta)) {\n\t\t\tforeach ($this->meta as $label => $value) {\n\t\t\t\t$this->meta[$label] = str_replace(\"\\r\", '', str_replace(\"\\n\", '<br />', $value));\n\t\t\t}\n\t\t}\n\n\t\t// add generator string\n\t\t$this->meta['generator'] = 'LFEditor';\n\n\t\treturn $this->meta;\n\t}", "function remove_attachment_title_attr( $attr ) {\n\tunset($attr['title']);\n\treturn $attr;\n}", "function admin_speedup_remove_post_meta_box() {\n\tglobal $post_type;\n\tif ( is_admin() && post_type_supports( $post_type, 'custom-fields' )) {\n\t\tremove_meta_box( 'postcustom', $post_type, 'normal' );\n\t}\n}", "protected function deleteMeta()\n {\n $sql = sprintf(\n 'DELETE FROM %sfaqattachment WHERE id = %d',\n PMF_Db::getTablePrefix(),\n $this->id\n );\n\n $this->db->query($sql);\n }", "function startertheme_remove_version() {\nreturn '';\n}", "function remove_metaboxes(){\n // remove_meta_box( 'tagsdiv-keywords', 'ticket', 'side' );\n remove_meta_box( 'versiondiv', 'ticket', 'side' );\n remove_meta_box( 'milestonediv', 'ticket', 'side' );\n remove_meta_box( 'componentdiv', 'ticket', 'side' );\n remove_meta_box( 'prioritydiv', 'ticket', 'side' );\n remove_meta_box( 'severitydiv', 'ticket', 'side' );\n remove_meta_box( 'ticket_typediv', 'ticket', 'side' );\n remove_meta_box( 'resolutiondiv', 'ticket', 'side' );\n //remove_meta_box( 'severitydiv', 'ticket', 'side' );\n //remove_meta_box( 'severitydiv', 'ticket', 'side' );\n }", "public function remove_rewrite_tag($tag)\n {\n }", "public function deletePostMeta() {\n delete_post_meta($this->id, $this->_post_meta_name);\n }", "public function remove_taxonomy_metabox() {\n\n\t\tforeach ( $this->remove_mb as $key => $mb ) {\n\t\t\tremove_meta_box( $mb . 'div', 'ticket', 'side' );\n\t\t}\n\n\t}", "public function purgeMeta(): int\n {\n /** @var HasMetadataInterface $this */\n return Meta::metable(static::class, $this->id)\n ->delete();\n }", "public function testprocessMeta() {\n $url_rewriter = $this->createMock(URLRewriter::class);\n // mock the AssetDownloader class which is passed to processor\n $asset_downloader = $this->createMock(AssetDownloader::class);\n\n $dom = new DOMDocument('1.0', 'utf-8');\n\n // create parent <head> \n $head = $dom->createElement( 'head', ' ' );\n $body = $dom->createElement( 'body', ' ' );\n\n // create the <link> with rel Element\n $link = $dom->createElement('link');\n $link->setAttribute('rel', 'canonical') ;\n $link->setAttribute('href', 'https://somedomain.com/alink') ;\n $head->appendChild( $link );\n\n // create dummy <a>\n $anchor = $dom->createElement('a', 'Some anchor text');\n $anchor->setAttribute('href', 'https://somedomain.com/alink') ;\n $body->appendChild( $anchor );\n\n // create WordPress <meta>'s\n $generator_meta = $dom->createElement('meta', '');\n $generator_meta->setAttribute('name', 'generator') ;\n $generator_meta->setAttribute('content', 'WordPress 5.2') ;\n $robots_meta = $dom->createElement('meta', '');\n $robots_meta->setAttribute('name', 'robots') ;\n $robots_meta->setAttribute('content', 'noindex') ;\n $head->appendChild( $generator_meta );\n $head->appendChild( $robots_meta );\n\n $html = $dom->createElement( 'html' );\n $html->appendChild( $head );\n $html->appendChild( $body );\n $dom->appendChild( $html );\n\n $meta_processor = new MetaProcessor(\n 'https://somedomain.com/', // site_url\n 'somedomain.com', // site_url_host\n 'https://somedomain.com/apage', // $page_url\n [\n 'site_url_patterns' => [\n 'https://somedomain.com',\n ],\n 'destination_url_patterns' => [\n 'https://google.com',\n ],\n ], // $rewriteRules,\n true, // $includeDiscoveredAssets,\n true, // $includeDiscoveredAssets,\n $url_rewriter\n );\n\n $meta_processor->processMeta( $generator_meta );\n $meta_processor->processMeta( $robots_meta );\n\n $result = $dom->saveHtml();\n\n $this->assertEquals(\n '<html><head> <link rel=\"canonical\" href=\"https://somedomain.com/alink\"></head><body> <a href=\"https://somedomain.com/alink\">Some anchor text</a></body></html>' . PHP_EOL,\n $result\n );\n }", "function remove_head_links() {\n\t\t\n\t\t\tremove_action('wp_head', 'rsd_link');\n\n\t\t\tremove_action('wp_head', 'wlwmanifest_link');\n\n\t\t\tremove_action('wp_head','wp_generator');\n\t\t\t\n\t\t}", "private function cleanHead()\n {\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link.\n remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link.\n remove_action('wp_head', 'wp_generator'); //removes meta name generator.\n remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink.\n remove_action('wp_head', 'feed_links', 2); //removes feed links.\n remove_action('wp_head', 'feed_links_extra', 3); //removes comments feed.\n }" ]
[ "0.83115333", "0.71560496", "0.69236887", "0.68502927", "0.68327254", "0.68086493", "0.67820764", "0.66032714", "0.6590257", "0.65888155", "0.64749736", "0.63825434", "0.634984", "0.62173784", "0.61655414", "0.6136781", "0.61357534", "0.609761", "0.60716504", "0.5982813", "0.5982813", "0.5968224", "0.59227145", "0.5907921", "0.5907921", "0.5907921", "0.58872205", "0.5886205", "0.5868543", "0.5866099", "0.58616394", "0.58440804", "0.5840145", "0.58190745", "0.5804768", "0.57775575", "0.5770396", "0.576155", "0.57577014", "0.5751786", "0.5740941", "0.5737092", "0.5735989", "0.57359755", "0.57196873", "0.5699467", "0.568906", "0.56881213", "0.5634461", "0.5619477", "0.5616038", "0.5608876", "0.5603218", "0.5587589", "0.55796665", "0.55745775", "0.55625117", "0.5555276", "0.55536926", "0.5553472", "0.5548957", "0.55460244", "0.55443287", "0.55381787", "0.55381787", "0.5530433", "0.55282867", "0.552239", "0.5521137", "0.55165136", "0.5514586", "0.55086577", "0.54932827", "0.54867405", "0.54715353", "0.5470497", "0.54565626", "0.54255503", "0.5421201", "0.53998876", "0.53972465", "0.5383492", "0.53748614", "0.5369839", "0.5369032", "0.53589", "0.5358108", "0.53493863", "0.5345089", "0.5337495", "0.53374714", "0.5328621", "0.5320842", "0.5312777", "0.5308855", "0.53081095", "0.52992666", "0.5297788", "0.5293804", "0.5285265", "0.52836937" ]
0.0
-1
/ Functions with real dynamic content
function echo_summary_view_for_contest($id) { $image = get_corresponding_header_icon_url_for_contest_functionid(get_functionid_for_contestid($id)); echo "<img class=\"summary\" src=\"$image\">"; if (contest_is_upcoming($id)) { echo return_upcoming_contest_info_for_id($id); } else if (contest_is_recent($id)) { echo return_recent_contest_info_for_id($id); } else { echo return_info_for_contest($id); echo return_summary_for_contestid($id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function content();", "function content();", "function getContent() ;", "abstract protected function displayContent();", "public function content();", "abstract protected function view_generatePageContent();", "protected function content_template() {}", "protected function content_template() {}", "abstract function getContent();", "abstract protected function RenderContent();", "public function render_content() {\n\t}", "public function renderContent() {}", "public abstract function getContent();", "abstract protected function showContent(): self;", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected abstract function renderContent();", "function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }", "protected function content_template() {\n\t}", "function moduleContent() {\n \tglobal $LANG;\n switch((string)$this->MOD_SETTINGS[\"function\"]) {\n \tdefault:\n case 1:\n \t\t\t\t$content .= '<p><a href=\"#\" onclick=\"jumpToUrl(\\'\\/typo3\\/alt_doc.php?returnUrl=\\'+T3_THIS_LOCATION+\\'&edit[tx_x4econgress_congresses]['.$this->id.']=new\\',\\'txx4econgressM1\\',\\'txx4econgressM1\\');\"><img src=\"http://histsem.unibas.ch/fileadmin/histsem/_templates/images/icon_new.gif\"> '.$LANG->getLL(\"new\").'</a></p>';\n\n $this->content.=$this->doc->section(\"\",$content,0,1);\n\t\t\t\tisset($_GET[remSeries]) ? $series = 1 : $series = '';\n\t\t\t\t$content = $this->showCongresses();\n\t\t\t\t$this->content.=$this->doc->section($LANG->getLL(\"show\"),$content,0,1);\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n break;\n }\n }", "protected function _content_template()\n {\n\n }", "public function getGathercontentTemplate();", "protected function _content_template() {\n \n }", "protected function content_template()\n\t{\n\t\t//\n\t}", "public static function renderContent() {}", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function _content_template() {\n\t}", "abstract protected function render_page_content(): void;", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "public function getContent();", "function widget_content() {\nstatic $content_list_count=0;\nglobal $today;\n\t$para=para(func_get_args(),'data-model=items','show-url=paper/$nodeId','data-limit=5','show-style=div');\n\n\t$ret = '';\n\n\tif ($para->{'data-show'}) {\n\t\tforeach (explode(';',$para->{'data-show'}) as $showStr) {\n\t\t\t$showKey=substr($showStr,0,strpos($showStr,'='));\n\t\t\t$showValue=substr($showStr,strlen($showKey)+1);\n\t\t\t$para->{'show-'.$showKey}=$showValue;\n\t\t}\n\t}\n\t$dateformat=($para->{'show-dateformat'}?'':'@').\\SG\\getFirst($para->{'show-dateformat'},cfg('dateformat'));\n\n\t$patterns = (Object) [\n\t\t'short' => (Object) [],\n\t\t'slide' => (Object) [],\n\t\t'reply' => (Object) [],\n\t\t'shortview' => (Object) [],\n\t\t'detail' => (Object) [],\n\t\t'div' => (Object) [],\n\t\t'ul' => (Object) [],\n\t];\n\n\t$patterns->short->{'show-style'}='ul';\n\t$patterns->short->value='\" <span class=\\\"timestamp\\\"><span class=\\\"date\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</span><span class=\\\"sep\\\"> | </span><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\"<span class=\\\"sep\\\"> | </span><span class=\\\"reply\\\">\".$reply.\" replies</span>\":\"\").\"</span>\"';\n\n\t$patterns->slide->{'show-style'}='ul';\n\t$patterns->slide->header='h3';\n\t$patterns->slide->value='\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>\n<div class=\\\"summary\\\"><a href=\\\"$_url\\\" title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a>{$summary}</div>\n<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$patterns->reply->{'show-style'}='ul';\n\t$patterns->reply->value='\" <span class=\\\"timestamp\\\">\".sg_date($last_reply,\\''.$dateformat.'\\').\" | <span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" replies</span>\":\"\").\"</span>\"';\n\n\t$patterns->shortview->{'show-style'}='ul';\n\t$patterns->shortview->value='\" <span class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\" (<span class=\\\"view\\\">\".$view.\"</span>\".($reply?\"|<span class=\\\"reply\\\">\".$reply.\"</span>\":\"\").\")</span>\"';\n\n\t$patterns->detail->{'show-style'}='dl';\n\t$patterns->detail->header='dt';\n\t$patterns->detail->value='\"<dd class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</dd>\n<dd class=\\\"summary\\\">{$photo}{$summary}</dd>\n<dd class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></dd>\"';\n\n\t$patterns->div->{'show-style'}='div';\n\t$patterns->div->header='h3';\n\t$patterns->div->value = '\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>'\n\t\t. '<div class=\\\"photo\\\">'\n\t\t. '<a '.($para->{'show-webview'} ? 'class=\\\"sg-action\\\"' : '').' href=\\\"$_url\\\" '.($para->{'show-webview'} ? 'data-webview=\\\"true\\\" data-webview-title=\\\"News\\\"' : '').' title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a>'\n\t\t. '</div>'\n\t\t. '<div class=\\\"summary\\\">{$summary}</div>'\n\t\t. '<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$patterns->ul->{'show-style'}='ul';\n\t$patterns->ul->header='h3';\n\t$patterns->ul->value='\"<div class=\\\"timestamp\\\">\".sg_date($created,\\''.$dateformat.'\\').\"</div>\n<div class=\\\"photo\\\"><a href=\\\"$_url\\\" title=\\\"\".htmlspecialchars($title).\"\\\">{$photo}</a></div>\n<div class=\\\"summary\\\">{$summary}</div>\n<div class=\\\"footer\\\"><span class=\\\"view\\\">\".$view.\" views</span>\".($reply?\" | <span class=\\\"reply\\\">\".$reply.\" comments</span>\":\"\").\" | <span class=\\\"readmore\\\"><a href=\\\"$_url\\\">read more &raquo;</a></span></div>\"';\n\n\t$topics = (Object) [];\n\n\tif ($para->{'data-model'}) {\n\t\timport('model:paper.php');\n\t\t$model = $para->{'data-model'};\n\t\t$conditions = [\n\t\t\t'tags' => $para->{'data-tags'},\n\t\t\t'type' => $para->{'data-type'},\n\t\t\t'node' => $para->{'data-node'},\n\t\t\t'options' => [\n\t\t\t\t'field' => $para->{'data-field'},\n\t\t\t\t'items' => $para->{'data-limit'},\n\t\t\t],\n\t\t];\n\t\t$topics = PaperModel::$model($conditions);\n\t}\n\t// debugMsg('$model = '.$model);\n\t// debugMsg($para, '$para');\n\t// debugMsg($topics->_query);\n\t// debugMsg($topics,'$topics');\n\n\t// if ($topics->_type == 'record') $topics = mydb::convert_record_to_recordset($topics);\n\t// if ($topics->_empty) return;\n\n\tif (is_string($para->{'show-style'})) $pattern=$patterns->{$para->{'show-style'}};\n\telse if (is_object($para->{'show-style'})) $pattern=$para->{'show-style'};\n\telse if (is_array($para->{'show-style'})) $pattern=(object)$para->{'show-style'};\n\telse if (!isset($para->{'show-style'})) $pattern=$patterns->short;\n\n\tif (isset($para->{'show-style-value'})) $pattern->value=$para->{'show-style-value'};\n\t$pattern->title=isset($para->{'show-style-title'})?$para->{'show-style-title'}:'\"<a '.($para->{'show-webview'} ? 'class=\\\"sg-action\\\"' : '').' href=\\\"{$topic->_url}\\\" '.($para->{'show-webview'} ? 'data-webview=\\\"true\\\" data-webview-title=\\\"News\\\"' : '').'>{$topic->title}</a>\"';\n\n\t// new condition : items number , today , lastdate , day number , least day(number) , last items(number)\n\t$new=(object)NULL;\n\tif ($para->{'show-new'}) {\n\t\tlist($new->type,$new->text)=explode(',',$para->{'show-new'});\n\t\tlist($new->value,$new->type)=explode(' ',$new->type);\n\t\tif (intval($new->value)==0) {$new->type=$new->value;$new->value=NULL;}\n\t\tif (in_array(sg_file_extension($new->text),array('gif','jpg','png'))) $new->text='<img class=\"new\" src=\"'.$new->text.'\" alt=\"new topic\" />';\n\t\tif (empty($new->text)) $new->text='<span class=\"new\">Update</span>';\n\n\t\tswitch ($new->type) {\n\t\t\tcase 'items' : $new->value=intval($new->value); break;\n\t\t\tcase 'today' : $new->time=date('U',mktime(0, 0, 0, date('m')+0, date('d')+0, date('Y')+0)); break;\n\t\t\tcase 'hour' : $new->time=date('U') - intval($new->value)*60*60; break;\n\t\t\tcase 'minute' : $new->time=date('U') - intval($new->value)*60; break;\n\t\t\tcase 'day' : $new->time=date('U') - intval($new->value)*24*60*60; break;\n\t\t\tcase 'lastdate' :\n\t\t\t\t$first_topic=array_slice($topics->items,0,1);\n\t\t\t\t$first_topic=$first_topic[0];\n\t\t\t\tlist($last_date)=explode(' ',$first_topic->created);\n\t\t\t\t$new->time=sg_date($last_date,'U') - intval($new->value)*24*60*60;\n\t\t\t\tbreak;\n\t\t\tcase 'least' : $new->time= date('U',mktime(date('H')+0, date('s')+0, date('i')+0, date('m')+0 , date('d')+0 - intval($new->value), date('Y')+0));break;\n\t\t}\n\t}\n\n\t/* generate list header */\n\t$ret .= '<!-- start of widget::content #'.$content_list_count.'-->'._NL;\n\tif ($pattern->{'show-style'}!='div') $ret .= '<'.$pattern->{'show-style'}.'>'._NL;\n\n\tlist($last_date)=explode(' ',$topics->items[0]->created);\n\t$start = SG\\getFirst($para->{'show-start'},1);\n\t$count = SG\\getFirst($para->{'show-count'},$topics->count);\n\t$no=0;\n\t$debug = SG\\getFirst($para->{'option-debug'}=='eval',debug('eval'));\n\tif ($para->{'data-field'}=='body,photo' && empty($para->{'show-photo'})) $para->{'show-photo'}='image';\n\tif ($para->{'show-photo'}) list($para->{'show-photo'},$showPhotoOption)=explode(',',$para->{'show-photo'});\n\n\t/* generate each item */\n\tforeach ($topics->items as $topic) {\n\t\t// debugMsg($topic, '$topic');\n\t\t$no++;\n\t\tif ($no<$start) continue;\n\t\tif ($no>$start+$count-1) break;\n\t\t// check is new topic by new condition\n\t\t$is_new_topic=false;\n\t\t//\t\t$topic->_url=url(preg_replace('/\\$([a-zA-Z0-9_]*)/e','$topic->\\\\1',$para->{'show-url'}));\n\t\t$topic->_url=url(preg_replace_callback('/\\$([a-zA-Z0-9_]*)/',function($m) use ($topic) {return $topic->{$m[1]};},$para->{'show-url'}));\n\n\t\tif ( $para->{'show-new'} ) {\n\t\t\t$topic_time = sg_date($topic->created,'U');\n\t\t\tif ($new->time && $topic_time >= $new->time) $is_new_topic=true;\n\t\t\telse if ($new->type=='items' && $no<=intval($new->value) ) $is_new_topic=true;\n\t\t}\n\t\t// $ret .= print_o($topic, '$topic');\n\t\tif ($para->{'show-photo'}) {\n\t\t\tif ($topic->photo) {\n\t\t\t\tswitch ($para->{'show-photo'}) {\n\t\t\t\t\tcase 'image' :\n\t\t\t\t\t\t// $photo=array_shift($topic->photo->items);\n\t\t\t\t\t\t$topic->photo= '<div class=\"photo-th\"><img class=\"'.$para->{'show-photo'}.'\" src=\"'.$topic->photo->url.'\" alt=\"\" /></div>';break;\n\t\t\t\t\tcase 'slide' : $topic->photo=view::photo_slide(NULL,$para->{'show-photo-width'},$para->{'show-photo-height'},'get/photoslide/'.$topic->nodeId.'/imagerotator');break;\n\t\t\t\t\tcase 'list' : break;\n\t\t\t\t}\n\t\t\t} else if ($showPhotoOption=='alway') {\n\t\t\t\t$topic->photo= '<div class=\"photo-th\"><img class=\"'.$para->{'show-photo'}.'\" src=\"/css/img/none.gif\" alt=\"\" /></div>';\n\t\t\t} else {\n\t\t\t\t$topic->photo=NULL;\n\t\t\t}\n\t\t} else $topic->photo=null;\n\n\t\tswitch ($pattern->{'show-style'}) {\n\t\t\tcase 'ul' : $ret .= '<li>';break;\n\t\t\tcase 'div' : $ret .= '<div id=\"'.$para->id.'-'.$no.'\" class=\"widget-item widget-item-'.$no.'\">';break;\n\t\t}\n\n\t\t/* generate each topic title */\n\t\tif ($pattern->header) $ret.='<'.$pattern->header.'>';\n\t\t$ret .= '<a href=\"'.$topic->_url.'\"'.($pattern->{'show-style'}=='div'?' title=\"'.htmlspecialchars($topic->title).'\"':'').'>';\n\n\t\t$ret .= $para->{'show-style'}=='short'&&$para->{'show-photo'}&&$topic->photo?$topic->photo:'';\n\t\tif ($showTitle = SG\\getFirst($para->{'show-title'},$pattern->{'show-title'})) {\n\t\t\t// generate each topic title\n\t\t\t$old_error=error_reporting();\n\t\t\t$show= preg_replace('/\\$([a-zA-Z0-9_]*)/','$topic->\\\\1',$showTitle);\n\t\t\t$eval='$show_value='.$show.';';\n\t\t\teval($eval);\n\t\t\terror_reporting($old_error);\n\t\t\t$ret .= $show_value;\n\t\t} else {\n\t\t\t$ret.=$topic->title;\n\t\t}\n\t\t$ret .= '</a>';\n\t\tif ($pattern->header) $ret.='</'.$pattern->header.'>';\n\n\t\t// generate each topic detail\n\t\t$old_error=error_reporting();\n\t\t$show= preg_replace('/\\$([a-zA-Z0-9_]*)/','$topic->\\\\1',$pattern->value);\n\t\t$eval='$show_value='.$show.';';\n\t\tif ($debug) print_o($topic,'$topic',1);\n\t\tif ($debug) echo '<p>'.htmlspecialchars($eval).'</p>';\n\t\tif ($debug) error_reporting(E_ALL); else error_reporting(0);\n\t\teval($eval);\n\t\terror_reporting($old_error);\n\t\t$ret .= $show_value;\n\t\tif ($para->{'show-new'} && $is_new_topic ) $ret .= ' '.$new->text;\n\t\t$ret.=_NL;\n\n\t\tswitch ($pattern->{'show-style'}) {\n\t\t\tcase 'ul' : $ret .= '</li>'._NL;break;\n\t\t\tcase 'div' : $ret .= '</div><!--topic-list-'.$no.'-->'._NL;\n\t\t}\n\t}\n\n\tif ($pattern->{'show-style'}!='div') $ret .= '</'.$pattern->{'show-style'}.'><!--end of widget-item -->'._NL;\n\t$showReadAll = SG\\getFirst($para->{'data-show-readall'},$para->{'data-cfg-readall'},$para->{'show-readall'});\n\tif ($showReadAll) {\n\t\t$readAllitems=explode(',',$showReadAll);\n\t\tif (count($readAllitems)==1) {\n\t\t\tlist($readalltext,$readallurl)=explode(':',$showReadAll);\n\t\t\t$ret.='<p class=\"readall\"><a href=\"'.url($readallurl).'\">'.$readalltext.'</a><span class=\"arrow-right \"></span></p>';\n\t\t} else {\n\t\t\t$ui=new ui();\n\t\t\tforeach ($readAllitems as $readAllItem) {\n\t\t\t\tlist($readalltext,$readallurl)=explode(':',$readAllItem);\n\t\t\t\t$ui->add('<a href=\"'.url($readallurl).'\">'.$readalltext.'</a><span class=\"arrow-right \"></span>');\n\t\t\t}\n\t\t\t$ret.='<div class=\"readall\">'.trim($ui->build('ul')).'</div>';\n\t\t}\n\t}\n\tif ($para->{'data-footer'}) $ret .= $para->{'data-footer'}._NL;\n\t$ret.='<!--end of widget::content #'.$content_list_count.'-->';\n\treturn array($ret,$para);\n}", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\n\t\t// get HTML template\n\t\t$this->templateFile = $this->conf['templateFile'];\n\t\t$this->templateCode = $this->cObj->fileResource($this->templateFile);\n\t\t\n\t\t// include css\n\t\t$this->cssFile = t3lib_extMgm::siteRelPath($this->extKey).'res/css/kiwi_gigs.css';\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$this->cssFile.'\" />';\n\t\n\t\t// generate content \n\t\tif ($this->piVars['showUid']) $content = $this->showSingle();\n\t\telse $content = $this->listview();\n\t\t\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}", "function moduleContent()\t{\n\t\t$this->content .= $this->makeList();\n\t}", "function getContent() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\tglobal $applImages;\r\r\n\t$applImages = $PView->getApplImages(); // trigger only, no return!\r\r\n\r\r\n\t// Javascript source for DHTML\r\r\n\t// Standard\r\r\n\t$JS = \"<script src = 'pview.js' type='text/javascript'></script>\";\r\r\n\r\r\n\t// Template\r\r\n\tif (file_exists(e_PLUGIN . \"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/template.js\")){\r\r\n\t\t$template_JS = \"<script src = '\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/template.js' type='text/javascript'></script>\";\r\r\n\t}\r\r\n\r\r\n\t// Enhanced Gallery Start Page ---------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"gallery\" && $pv_Appl[1] == \"0\" && $PView->getPView_config(\"start_page\")==\"advanced\" && $_GET['gallery'] <>\"classic\") {\r\r\n\t\t// prepare list order\r\r\n\t\t$listArray = $PView->getFrontpageArray();\r\r\n\t\t$PView->getStatistic_Totals(); // trigger only, no return!\r\r\n\t\t\r\r\n\t\t$AG = \"<table style='width:98%;'>\";\r\r\n\t\tforeach ($listArray as $key => $dataset) {\r\r\n\t\t\t$elementArray = explode(\"|\",$dataset);\r\r\n\t\t\tif ($elementArray[1]){\r\r\n\t\t\t\t$AG.= \"<tr><td class='fborder' style='padding:2px;'>\".$Template->getModuleContent($key).\"</td></tr>\";\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t$AG.= \"</table>\";\r\r\n\r\r\n\t\treturn $AG;\r\r\n\t}\r\r\n\r\r\n\t// Main Gallery Layout (Classic) -------------------------------------------------------------------\r\r\n\t// also used in advanced mode with: pviewgallery.php?gallery=classic for gallery handling!\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif (($pv_Appl[0] == \"gallery\" && $pv_Appl[1] == \"0\" && $PView->getPView_config(\"start_page\")==\"classic\") OR ($pv_Appl[0] == \"gallery\" && $_GET['gallery'] == \"classic\")) {\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"gallery\",0,\"View\")) {\r\r\n\t\t\t$MG = \"<table cellspacing='0px' style='width:98%;' class='fborder'>\";\r\r\n\t\t\t$MG.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gallery.png' border='0px'> {pv_MainGalleryName} (\".LAN_GALLERY_3.\": {pv_RootalbumCount})</td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_MainGalleryMenu}</td></tr>\";\r\r\n\t\t\t$MG.= \"{pv_RootAlbums}\";\r\r\n\t\t\t$MG.= \"</table><br/>\";\r\r\n\t\t}\r\r\n\t\t// List of Category and User View\r\r\n\t\t$LV = \"<table cellspacing='0px' style='width:98%;' class='fborder'>\";\r\r\n\t\t$LV.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/image_multi.png' border='0px'> \".LAN_GALLERY_14.\"</td></tr>\";\r\r\n\t\t$LV.= \"<tr><td style='padding-top:5px;'>\";\r\r\n\t\t$LV.= \"<table style='width:100%'>\";\r\r\n\t\t$LV.= \"<tr><td class='forumheader'><a href='pviewgallery.php?cat=list'>\".LAN_GALLERY_15.\":</a> \".LAN_GALLERY_17.\"</td></tr>\";\r\r\n\t\t$LV.= \"<tr><td class='forumheader'><a href='pviewgallery.php?user=list'>\".LAN_GALLERY_16.\":</a> \".LAN_GALLERY_18.\"</td></tr>\";\t\r\r\n\t\t$LV.= \"</table>\";\r\r\n\t\t$LV.= \"</td></tr>\";\r\r\n\t\t$LV.= \"</table><br/>\";\r\r\n\t\t\r\r\n\t\t// List of Usergalleries\r\r\n\t\tif ($PView -> getPView_config(\"member_galleries\") OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))) {\r\r\n\t\t\t$UG = \"<table cellspacing='0px' style='width:98%;' class='fborder'>\";\r\r\n\t\t\t$UG.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gallery.png' border='0px'> {pv_MemberGalleryName} ({pv_UserGalleryCount})</td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_UserGalleryMenu}</td></tr>\";\r\r\n\t\t\t$UG.= \"{pv_UserGalleries}\";\r\r\n\t\t\t$UG.= \"</table>\";\r\r\n\t\t}\t\r\r\n\t\treturn $MG.$LV.$UG;\r\r\n\t}\r\r\n\t// User Gallery Layout -------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"gallery\" && $pv_Appl[1] <> \"0\") {\r\r\n\t\t// redirect to gallery startpage if gallery not exist\r\r\n\t\tif (!$PView -> getGalleryName($pv_Appl[1])) { \r\r\n\t\t\theader(\"location:\" . e_PLUGIN . \"pviewgallery/pviewgallery.php\");\r\r\n\t\t}\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"gallery\",$pv_Appl[1],\"View\")) {\r\r\n\t\t\t$UG = \"<table cellspacing='0px' style='width:98%;' class='fborder'>\";\r\r\n\t\t\t$UG.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gallery.png' border='0px'> {pv_UserGalleryName} (\".LAN_GALLERY_3.\": {pv_RootalbumCount})</td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_MainGalleryMenu}</td></tr>\";\r\r\n\t\t\t$UG.= \"{pv_RootAlbums}\";\r\r\n\t\t\t$UG.= \"</table><br/>\";\r\r\n\r\r\n\t\t\treturn $UG;\r\r\n\t\t}\r\r\n\t\treturn $PView -> getNoPerm(\"gallery\"); // forbidden action\r\r\n\t}\r\r\n\r\r\n\t// Album Layout -------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"album\") {\r\r\n\t\t// redirect to gallery startpage if album not exist\r\r\n\t\tif (!$PView -> getAlbumData($pv_Appl[1])) { \r\r\n\t\t\theader(\"location:\" . e_PLUGIN . \"pviewgallery/pviewgallery.php\");\r\r\n\t\t}\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"album\",$pv_Appl[1],\"View\")) {\r\r\n\t\t\t$ALBUM = \"<table style='width:100%;' class='fborder'>\";\r\r\n\t\t\t$ALBUM.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/album.png' border='0px'> {pv_AlbumName} <span class='smalltext'>(\".LAN_ALBUM_1.\": {pv_AlbumImageCount} / \".LAN_ALBUM_2.\": {pv_SubAlbumCount})</span></td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_AlbumMenu}</td></tr>\";\r\r\n\t\t\t$ALBUM.= \"{pv_SubAlbums}\";\r\r\n\t\t\t$ALBUM.= \"<tr><td colspan='2' class='forumheader'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/image_multi.png' border='0px'> \".LAN_ALBUM_1.\":</td></tr><tr><td colspan='2'><table style='width:100%'>\";\r\r\n\t\t\t$ALBUM.= \"{pv_AlbumImages}\";\r\r\n\t\t\t$ALBUM.= \"</table></td></tr>\";\r\r\n\t\t\t$ALBUM.= \"<tr style='height:30px;'><td colspan='2' style='text-align:center;'>{pv_Pages}</td></tr>\";\r\r\n\t\t\t$ALBUM.= \"</table>\";\r\r\n\r\r\n\t\t\treturn $ALBUM;\r\r\n\t\t}\r\r\n\t\treturn $PView -> getNoPerm(\"album\"); // forbidden action\r\r\n\t}\r\r\n\r\r\n\t// Image Layout -------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"image\") {\r\r\n\t\t// redirect to gallery startpage if image not exist\r\r\n\t\tif (!$PView -> getImageData($pv_Appl[1])) { \r\r\n\t\t\theader(\"location:\" . e_PLUGIN . \"pviewgallery/pviewgallery.php\");\r\r\n\t\t\texit;\r\r\n\t\t}\r\r\n\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"image\",$pv_Appl[1],\"View\")) {\r\r\n\t\t\tif ($PView -> getPermission(\"config\",\"permComment\",\"\")) {\r\r\n\t\t\t\t// save comment and redirect to image\r\r\n\t\t\t\tif ($_POST['submit'] == LAN_IMAGE_40) {\r\r\n\t\t\t\t\t$PView -> setImageComment($_POST['appl']);\r\r\n\t\t\t\t\theader(\"location:\".$PView -> getLink('cancel'));\r\r\n\t\t\t\t\texit;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t// delete comment after confirmation\r\r\n\t\t\t\tif ($_GET['deletecomment'] && ADMIN) {\r\r\n\t\t\t\t\tif ($_GET['confirm'] == 1) {\r\r\n\t\t\t\t\t\t$PView -> deleteComment($_GET['deletecomment']);\r\r\n\t\t\t\t\t\theader(\"location:\".$PView -> getLink('cancel'));\r\r\n\t\t\t\t\t\texit;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\treturn $PView -> getDelConfirm(LAN_IMAGE_41.\" \".$_GET['deletecomment']);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\t$IMG.= \"<table cellspacing='0px' style='width:98%;' class='fborder'>\";\r\r\n\t\t\t$IMG.= \"<tr><td class='fcaption' style='border: 0px;'><img src='\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/image.png' border='0px'> {pv_ImageName}</td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_ImageMenu}</td></tr>\";\r\r\n\t\t\t$IMG.= \"<tr><td colspan='2' class='forumheader' style='border-left: 0px; border-right: 0px;'>{pv_NavMenu}</td></tr>\";\r\r\n\t\t\t$IMG.= \"<tr><td colspan='2' style='text-align:center;'><div style='padding-top:20px; padding-bottom:20px; overflow:hidden;'>{pv_ResizeImage}</div></td></tr>\";\r\r\n\t\t\t$IMG.= \"<tr><td colspan='2'><table cellspacing='0px' style='width:98%;' class='fborder'><tr><td><table width='85%'>{pv_ImageData}</table></td></tr></table><br /></td></tr>\";\r\r\n\t\t\tif ($PView -> getPView_config(\"Comments\")) {\r\r\n\t\t\t\t$IMG.= \"<tr><td class='fcaption' style='border: 0px;'>\".LAN_IMAGE_4.\" <span class='smalltext'>( {pv_CommentCount} )</span></td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_AddComment}</td></tr>\";\r\r\n\t\t\t\t$IMG.= \"<tr><td colspan='2' style='text-align:center;'>{pv_Comments}</td></tr>\";\r\r\n\t\t\t}\r\r\n\t\t\t$IMG.= \"</table>\";\r\r\n\r\r\n\t\t\treturn $JS.$template_JS.$IMG;\r\r\n\t\t}\r\r\n\t\treturn $PView -> getNoPerm(\"image\"); // forbidden action\r\r\n\r\r\n\t}\r\r\n\r\r\n\t// Userimages Layout -------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"user\" && $pv_Appl[1] <> \"list\") {\r\r\n\t\t// redirect to gallery startpage if user not exist\r\r\n\t\t$userData = $PView -> getUserData($pv_Appl[1]);\r\r\n\t\tif ($userData['user_class'] == '255') { \r\r\n\t\t\theader(\"location:\" . e_PLUGIN . \"pviewgallery/pviewgallery.php\");\r\r\n\t\t\texit;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$UIMG.= \"<table style='width:100%;' class='fborder'>\";\r\r\n\t\t$UIMG.= \"<tr><td class='fcaption' style='border: 0px;'>{pv_UserName} <span class='smalltext'>(\".LAN_ALBUM_1.\": {pv_UserImageCount})</span></td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_UserMenu}</td></tr>\";\r\r\n\t\t$UIMG.= \"<tr><td colspan='2' class='forumheader'>\".LAN_ALBUM_1.\":</td></tr><tr><td colspan='2'><table style='width:100%'>\";\r\r\n\t\t$UIMG.= \"{pv_UserImages}\";\r\r\n\t\t$UIMG.= \"</table></td></tr>\";\r\r\n\t\t$UIMG.= \"<tr style='height:30px;'><td colspan='2' style='text-align:center;'>{pv_Pages}</td></tr>\";\r\r\n\t\t$UIMG.= \"</table>\";\r\r\n\t\t\r\r\n\t\treturn $UIMG;\r\r\n\t}\r\r\n\tif ($pv_Appl[0] == \"user\" && $pv_Appl[1] == \"list\") {\r\r\n\t\t// message, if no user uploaded images\r\r\n\t\tif (!strip_tags($tmpList = $Template->getAllUsers())){\r\r\n\t\t\t$LUIMG.= \"<div style='padding:10px;'><p>\".LAN_GALLERY_19.\"</p>\";\r\r\n\t\t\t$LUIMG.= \"<p><a href='pviewgallery.php'>\".LAN_ACTION_8.\"</a></p>\";\r\r\n\t\t\t$LUIMG.= \"</div>\";\r\r\n\t\t}else {\r\r\n\t\t\t$LUIMG.= $tmpList;\r\r\n\t\t}\r\r\n\t\treturn $LUIMG;\r\r\n\t}\r\r\n\r\r\n\t// Category Layout -------------------------------------------------------------------\r\r\n\t// don't forget to include your css styles in theme.css\r\r\n\tif ($pv_Appl[0] == \"cat\" && $pv_Appl[1] <> \"list\") {\r\r\n\t\t// redirect to gallery startpage if category not exist\r\r\n\t\t$catArray = $PView -> getCatArray();\r\r\n\t\tif (!array_key_exists($pv_Appl[1],$catArray)) {\r\r\n\t\t\theader(\"location:\" . e_PLUGIN . \"pviewgallery/pviewgallery.php\");\r\r\n\t\t\texit;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t$CATIMG.= \"<table style='width:100%;' class='fborder'>\";\r\r\n\t\t$CATIMG.= \"<tr><td class='fcaption' style='border: 0px;'>{pv_CatName} <span class='smalltext'>(\".LAN_ALBUM_1.\": {pv_CatImageCount})</span></td><td class='fcaption' style='border: 0px; text-align:right; padding-right:5px;'>{pv_CatMenu}</td></tr>\";\r\r\n\t\t$CATIMG.= \"<tr><td colspan='2' class='forumheader'>\".LAN_ALBUM_1.\":</td></tr><tr><td colspan='2'><table style='width:100%'>\";\r\r\n\t\t$CATIMG.= \"{pv_CatImages}\";\r\r\n\t\t$CATIMG.= \"</table></td></tr>\";\r\r\n\t\t$CATIMG.= \"<tr style='height:30px;'><td colspan='2' style='text-align:center;'>{pv_Pages}</td></tr>\";\r\r\n\t\t$CATIMG.= \"</table>\";\r\r\n\t\t\r\r\n\t\treturn $CATIMG;\r\r\n\t}\r\r\n\tif ($pv_Appl[0] == \"cat\" && $pv_Appl[1] == \"list\") {\r\r\n\t\t$catArray = $PView -> getCatArray();\r\r\n\t\t// message, if no categories\r\r\n\t\tif (!count($catArray)){\r\r\n\t\t\t$LCATIMG.= \"<div style='padding:10px;'><p>\".LAN_GALLERY_11.\"</p>\";\r\r\n\t\t\t$LCATIMG.= \"<p><a href='pviewgallery.php'>\".LAN_ACTION_8.\"</a></p>\";\r\r\n\t\t\t$LCATIMG.= \"</div>\";\r\r\n\t\t} else {\r\r\n\t\t\t$LCATIMG.= \"{pv_CatList}\";\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn $LCATIMG;\r\r\n\t}\r\r\n}", "function content() {\r\n\t\t/* Reimplement this function in subclasses. */\r\n\t}", "protected function setContent() {}", "abstract function setContent();", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "function listContent()\n {\n }", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\t\t$this->content_template();\n\t}", "function _content($p){\n\t\t\n \tif($p[0] == 'about_us') \n\t\t\t\t$this->_aboutUs();\n\t\t\t\n\t\telse if($p[0] == 'our_team')\n\t\t\t\t$this->_team();\n\t\t\n\t\telse if($p[0] == 'contacts')\n\t\t\t\t$this->_contact();\n\t\t\n\t\telse if($p[0] == 'services')\n\t\t\t\t$this->_services();\n\t\t\n\t\telse if($p[0] == 'products')\n\t\t\t\t$this->_products();\n\t\t\n\t\telse if($p[0] == 'help')\n\t\t\t\t$this->_help();\n\t\t\n\t\telse if($p[0] == 'terms')\n\t\t\t\t$this->_terms();\n\t\t\n\t\telse if($p[0] == 'privacy')\n\t\t\t\t$this->_privacy();\n }", "function createContent($page)\n{\n\tswitch ($page) \n\t{ \n\t\tcase \"Bio-Home\":\n\t\t\treturn createBioHomeContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New\":\n\t\t\treturn createBioNewContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Organism\":\n\t\t\treturn createBioNewOrgContent();\t\n\t\t\tbreak;\n\t\tcase \"Bio-New-Tank\":\n\t\t\treturn createBioNewTankContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Plate\":\n\t\t\treturn createBioNewPlateContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Bacteria\":\n\t\t\treturn createBioNewBacteriaContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Colony\":\n\t\t\treturn createBioNewColonyContent();\n\t\t\tbreak;\n\t\tcase \"Bio-New-Sequence\":\n\t\t\treturn createBioNewSequenceContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Edit\":\n\t\t\treturn createBioEditContent();\n\t\t\tbreak;\n\t\tcase \"Bio-Blast\":\n\t\t\treturn createBioBlastContent();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn createErrorContent();\n\t\t\tbreak;\n\t}\n\t\n\n}", "protected function getModuleContent() {}", "public function prePageContent();", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "protected function renderInformationContent() {}", "function getContentObject() ;", "public function getContent(){ }", "public function getContent(){ }", "public function extObjContent() {}", "public function extObjContent() {}", "public function realPageCacheContent() {}", "function main($content, $conf) {\n\t\t$this->conf = $conf;\n\t\t$this->init();\n\t\t//$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;\n\t\t// load the JS into the header\n\t $this->loadJS($this->conf,$this->config);\n\n\t\t// load css width and height to header\n\t\t$this->loadCSS($this->config['width'], $this->config['height']);\n\n\t\t// get the content elements\n\t\t$content.= $this->getRecords($this->config['contentelements'] , $this->config['description'], $this->conf );\n\n\t\t// wrap them\n\t\t$content = $this->cObj->stdWrap($content, $this->conf['slider.']);\n\n\t\treturn $content;\n\t}", "public function getContent() {}" ]
[ "0.73958635", "0.7244878", "0.715818", "0.7072995", "0.70001614", "0.69993204", "0.6981715", "0.6981715", "0.69708335", "0.6883392", "0.6775866", "0.6716481", "0.66473573", "0.6608085", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6605489", "0.6583948", "0.6583948", "0.6583948", "0.6583029", "0.6567061", "0.6540275", "0.65339166", "0.6528125", "0.65186346", "0.65101266", "0.6502527", "0.650081", "0.64998186", "0.6474803", "0.6474803", "0.6474803", "0.6474803", "0.6474803", "0.6474803", "0.64297575", "0.6424306", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6393265", "0.6363341", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63490534", "0.63307273", "0.6316165", "0.6308108", "0.6305582", "0.62689084", "0.6246721", "0.62201923", "0.62143713", "0.6213412", "0.62007135", "0.6185835", "0.6179987", "0.61793184", "0.6176661", "0.6171201", "0.6142457", "0.61324865", "0.61324865", "0.612042", "0.6119881", "0.610574", "0.61032104", "0.6098147" ]
0.0
-1
/ More Static ones here..
function echo_contest_summary_for_id($id) { echo_summary_view_for_contest($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "private function __() {\n }", "protected function init()\n\t{\n\t\t\n\t}", "public function init() {\t\t\n\n }", "static public function init() {\n }", "protected function _init()\r\n\t{\r\n\t}", "public function __init(){}", "public function custom()\n\t{\n\t}", "public function init() {\n\t\t\n\t}", "protected function __init__() { }", "final private function __construct(){\r\r\n\t}", "public function init(){\n\t\t\n\t}", "private function __construct()\t{}", "private function init()\n\t{\n\t\treturn;\n\t}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "protected function init() {return;}", "public function init()\n { \t\n }", "function init()\r\n \t{\r\n \t}", "abstract protected function _init( );", "public static function init(){\n \n }", "public function init()\n {\n \treturn;\n }", "public function _init() {\r\n\r\n }", "abstract protected function _init();", "abstract protected function _init();", "function init() {\n\t\t\n\t}", "private function public_hooks()\n\t{\n\t}", "public function init()\n\t\t{\n\t\n\t\t}", "public function init ()\r\n {\r\n }", "protected function _init()\n {\n }", "public function theInit()\n {\n\n }", "public function theInit()\n {\n\n }", "public function init()\n\t{\n\n\t}", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "public function fooStatic() {\r\n return parent::$my_static; //this uses the parent keyword to access the public static\r\n }", "public function init(){\n\t}", "public function init(){\n\t}", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function init() {\r\n\t}", "public function init(){\n\t\t\t\t}", "private function __construct() {\r\n\t\t\r\n\t}", "public static function __constructStatic() : void;", "public function forgetInstances();", "function init()\n\t{\n\t\t\n\t}", "public static function init ()\n {\n }", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init()\n\t{\n\t}", "public function init() {\n\n\t}", "public function init() {\n\n\t}", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "function __construct() ;", "function _construct() {\n \t\n\t\t\n\t}", "public function init() {\r\n\r\n\t\t}", "public function init(){\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "final private function __construct() {}", "final private function __construct() {}", "public function init()\n {\n \t\n }", "public function init()\n {\n \t\n }", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "public function init() {\n\t}", "private function __construct() { \n\t\t\n\n\t}", "final function velcom(){\n }", "public function init()\r\n\t {\r\n\t }", "protected function __construct() {\r\r\n // contain shared code in its constructor\r\r\n parent::__construct();\t\r\r\n\t}", "public function init ()\n {\n }", "public function init ()\n {\n }", "public static function understandStaticAndSelf() {\n echo 'Bonjour, je suis codé dans la classe '.self::class.' (self::class) mais je suis appelé depuis la classe '.static::class.' (static::class)<br>';\n }", "private function __construct () {}", "public function __init()\n {\n\n }", "private function __construct( )\n {\n\t}", "protected function init()\n {\n\n }" ]
[ "0.738008", "0.67231965", "0.62631583", "0.6245449", "0.61097896", "0.6073725", "0.6050689", "0.6047523", "0.6024668", "0.6015519", "0.6001484", "0.59837675", "0.5918047", "0.5902412", "0.589915", "0.5892147", "0.58873355", "0.58873355", "0.58873355", "0.58873355", "0.58873355", "0.58873355", "0.58867514", "0.58867514", "0.58867514", "0.58867514", "0.5886641", "0.5886641", "0.5882363", "0.5882363", "0.5880036", "0.5875764", "0.5868578", "0.58627903", "0.58402", "0.58309793", "0.5820893", "0.5817727", "0.5817727", "0.5813621", "0.5804355", "0.5803189", "0.57861793", "0.5785065", "0.57778406", "0.57778406", "0.5759962", "0.57526755", "0.57526755", "0.57526755", "0.57526755", "0.57526755", "0.57526755", "0.5737212", "0.57368255", "0.57368255", "0.5731467", "0.57299256", "0.57294184", "0.5724277", "0.57205194", "0.5718188", "0.5717847", "0.5708157", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703851", "0.5703118", "0.5703118", "0.5700731", "0.56958747", "0.56943405", "0.5689691", "0.5686146", "0.56820387", "0.56671226", "0.56671226", "0.5662928", "0.5662928", "0.5656014", "0.5656014", "0.5656014", "0.5656014", "0.5656014", "0.5653314", "0.5639201", "0.56382567", "0.56330866", "0.5626895", "0.5626895", "0.5610082", "0.5608631", "0.56086105", "0.5607452", "0.5597509" ]
0.0
-1
Display a listing of the resource.
public function index() { // $data=Peminjaman::with('buku','anggota')->get(); return view('Peminjaman.index',compact('data')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // $data=Peminjaman::all(); $data1=Buku::all(); $data2=Anggota::all(); return view('Peminjaman.tambah',compact('data','data1','data2')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $peminjaman) { // $aturan=[ 'buku_id'=>'numeric', 'anggota_id'=>'numeric' ]; $pesan=[ 'numeric'=>'wajib di isi' ]; $this->validate($peminjaman,$aturan,$pesan); Peminjaman::create($peminjaman->all()); return redirect('peminjaman'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Peminjaman $peminjaman) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // $pin =Peminjaman::find($id); $data1=Buku::all(); $data2=Anggota::all(); return view('Peminjaman.ubah', compact('pin','data1','data2')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $peminjaman,$id) { // $aturan=[ 'buku_id'=>'numeric', 'anggota_id'=>'numeric' ]; $pesan=[ 'numeric'=>'wajib di isi' ]; $this->validate($peminjaman,$aturan,$pesan); $pin = $peminjaman->all(); // UPDATE tbl_mahasiwa SET nama_kolom=$mhs Peminjaman::find($id)->update($pin); return redirect('peminjaman'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // Peminjaman::find($id)->delete(); return redirect('peminjaman'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Return an associative array of all storable object properties, with references to the actual object property values.
public function &getProperties($includePrimaryKey = false) { $pk =& $this->primaryKey; $props = array(); foreach($this->__reflection()->getProperties() as $prop) { if($prop->isPublic() && !$prop->isStatic()) { $name = $prop->getName(); if(!$includePrimaryKey && $name == $pk) continue; $props[$name] =& $this->$name; } } return $props; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllProperties(): array\n {\n return get_object_vars($this);\n }", "public function get_properties()\r\n\t{\r\n\t\treturn get_object_vars($this);\r\n\t}", "public function getProperties()\n {\n return get_object_vars($this);\n }", "public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }", "public function objectToArray()\n {\n return get_object_vars($this);\n }", "public function get_properties(): array {\n\t\t$properties = array();\n\n\t\tforeach ( $this->properties as $key => $property ) {\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$properties = array_merge( $properties, $property->get_properties() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$properties[ $key ] = $property;\n\t\t}\n\n\t\treturn $properties;\n\t}", "public function toArray() {\n\t\t$array = [ ];\n\t\t$vars = get_object_vars($this);\n\t\tforeach ( $vars as $property => $value ) {\n\t\t\t$array[$property] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function jsonSerialize()\n {\n $publicProperties = get_object_vars($this);\n unset($publicProperties['properties']);\n\n return array_merge($publicProperties, $this->getPropertiesField());\n }", "public function toArray()\n {\n $result = [];\n foreach ($this->visibleProperties() as $property) {\n $value = $this->get($property);\n if (is_array($value)) {\n $result[$property] = [];\n foreach ($value as $k => $object) {\n $result[$property][$k] = $object;\n }\n } else {\n $result[$property] = $value;\n }\n }\n\n return $result;\n }", "public function getExposedProperties(): array;", "public static function getProperties() : array {\r\n return self::$properties;\r\n }", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray()\n {\n return array_merge(get_object_vars($this), parent::toArray());\n }", "public function toArray() {\n return get_object_vars($this);\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() \n\t{\n\t\t$properties = array_merge(parent::toArray(), $this->properties);\n\t\tforeach ($properties as $name => $rawValue) {\n\t\t\t$value = $this->get($name, $rawValue);\n\t\t\t\n\t\t\tif ($value instanceof \\Bliss\\Component || $value instanceof \\Bliss\\Collection) {\n\t\t\t\t$properties[$name] = $value->toArray();\n\t\t\t} else {\n\t\t\t\t$properties[$name] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $properties;\n\t}", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "public function properties() : array\n {\n return array_keys($this->_properties);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function getProperties(): array\n {\n return $this->properties;\n }", "public function getProperties() : array;", "public function dump()\r\n {\r\n return get_object_vars($this);\r\n }", "protected function getPublicProperties() {\n\t\t$getPublicProperties = function($obj) { return get_object_vars($obj); };\n\t\treturn $getPublicProperties($this);\n\t}", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function toArray(): array\n\t{\n\t\t$values = [];\n\n\t\tforeach ((array) $this as $key => $value) {\n\t\t\t// Private and protected properties have ugly array key prefixes which we remove\n\t\t\t$key = preg_replace('~^.+\\0~', '', $key);\n\t\t\t$values[$key] = $value;\n\t\t}\n\n\t\treturn $values;\n\t}", "public function getProperties()\n {\n return $this->_propDict;\n }", "public function getProperties()\n {\n return $this->_propDict;\n }", "public function toArray() {\n $vars = get_object_vars($this);\n unset(\n $vars['rawdata'], \n $vars['inputFilter'],\n $vars['__initializer__'], \n $vars['__cloner__'], \n $vars['__isInitialized__']\n );\n foreach($vars as $key =>$val){\n if(is_object($val))\n $vars[$key] = $val->toArray();\n }\n return $vars;\n }", "public function getProperties(): array;", "public function getProperties(): array;", "protected function _getReadonlyProperties()\n {\n return array();\n }", "public function get_all(){\n return get_object_vars($this);\n }", "protected function getReflectedProperties()\n {\n if (is_null($this->_ReflectedPropertiesCache)) {\n $this->_ReflectedPropertiesCache = array();\n\n $refectionClass = new ReflectionClass($this);\n $propertiesArray = $refectionClass->getProperties();\n if (is_array($propertiesArray) and count($propertiesArray) > 0) {\n while (list(, $property) = each($propertiesArray)) {\n $refectionProperty = new ReflectionProperty($property->class, $property->name);\n if ($refectionProperty->isPublic() || $refectionProperty->isProtected()) {\n $this->_ReflectedPropertiesCache[] = $property->name;\n }\n }\n }\n }\n\n return $this->_ReflectedPropertiesCache;\n }", "protected function property_map() { return array(); }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function toArray(): array\n {\n $serialized = collect($this->properties);\n\n //partial serialization only for initialized properties\n if ($this->isPartial) {\n $serialized = $serialized->intersectByKeys(array_flip($this->initializedProperties));\n }\n\n $serialized = $serialized->mapWithKeys(function ($value, $property) {\n if ($value instanceof Arrayable) {\n $value = $value->toArray();\n }\n\n if ($this->snakeOnSerialize) {\n $property = Str::snake($property);\n }\n\n return [$property => $value];\n });\n\n $this->resetSerializationConditions();\n\n return $serialized->toArray();\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function toArray() {\n\t\t\t\n\t\t\treturn array_merge(get_object_vars($this), array(\n\t\t\t\t'base' => $this->getBase()\n\t\t\t));\n \t\t\n\t\t}", "public function toArray()\n {\n $data = array();\n\n collect($this->touchedBySetter)\n ->each(function ($property) use (&$data): void {\n $data[$property] = $this->{$property};\n });\n\n return $data;\n }", "public function getProperties(): array {\n\t\treturn array_keys($this->properties);\n\t}", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function _getProperties() {}", "public function getProperties() {\n return array_keys($this->_properties);\n }", "public function getProperties()\n {\n $vars = get_object_vars($this);\n\n foreach ($vars as $key => $value) {\n if (strcmp(\"db\", $key) == 0) {\n unset($vars[$key]);\n break;\n }\n }\n\n return $vars;\n }", "public function jsonSerialize()\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n $vars = get_object_vars ( $this );\n $array = array ();\n foreach ( $vars as $key => $value ) {\n $array [ltrim ( $key, '_' )] = $value;\n }\n return $array;\n }", "public function populatableProperties() : array;", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function getProperties()\n {\n return array_keys($this->toArray());\n }", "public function jsonSerialize() {\n return get_object_vars($this);\n }", "public function jsonSerialize() {\n return get_object_vars($this);\n }", "public function toArray(): array\n\t{\n\t\t$array = [];\n\n\t\tforeach ($this->propertyData as $key => $value) {\n\t\t\t$value = $this->$key;\n\n\t\t\tif (is_object($value) === true) {\n\t\t\t\t$value = $value->toArray();\n\t\t\t}\n\n\t\t\t$array[$key] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "protected function properties(){\n //return get_object_vars($this);\n $properties = array();\n //foreach(self::$db_table_fields as $db_field){\n foreach(static::$db_table_fields as $db_field){\n if(property_exists($this, $db_field)){\n \n $properties[$db_field] = $this->$db_field;\n }\n }\n return $properties;\n\n }", "protected function toArray()\n {\n $properties = array();\n\n foreach ( $this as $property => $value ) {\n $properties[$property] = $value;\n }\n\n return $properties;\n }", "public function toArray(): array\n {\n $array = [];\n $str = new Str();\n\n foreach (\\get_object_vars($this) as $property => $value) {\n $array[$str->snake($property)] = $value;\n }\n\n return $array;\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function jsonSerialize()\n {\n return get_object_vars($this);\n }", "public function __debugInfo()\n {\n $properties = $this->_properties;\n foreach ($this->_virtual as $field) {\n $properties[$field] = $this->$field;\n }\n\n return $properties;\n }", "public function getCachedProperties() {\n return $this->cachedProperties ?? [];\n }", "public function jsonSerialize()\n\t{\n\n\t\treturn get_object_vars($this);\n\n\t}", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function getArrayCopy()\n {\n $obj_vars = parent::getArrayCopy();\n array_merge($obj_vars, get_object_vars($this));\n\n return $obj_vars;\n }", "public function jsonSerialize(): array\n {\n return get_object_vars($this);\n }", "public function getDirtyArray()\n {\n $result = [];\n\n foreach ($this->getDirty() as $key) {\n if (strpos($key, '.')) {\n $path = explode('.', $key);\n } else {\n $path = [$key];\n }\n\n $result[$path[0]] = $this->_properties[$path[0]];\n }\n\n return $result;\n }", "function _getProperties() ;", "public function toArray()\n {\n $array = $this->getProperties();\n foreach ($array as $key => $value) {\n if ($value instanceof self) {\n $array[$key] = $value->toArray();\n }\n }\n\n return $array;\n }", "public function getProperties() {\n if (is_array($this->_props)) {\n return $this->_props;\n } else {\n return array();\n }\n }", "public function getPropertiesArray()\n {\n $propertiesArray = array();\n \n $propertiesArray['contextid'] = $this->getContextid();\n $propertiesArray['name'] = $this->getName();\n $propertiesArray['deleted'] = $this->isDeleted();\n $propertiesArray['context_timestamp'] = $this->getLastModified();\n\n return $propertiesArray;\n }", "function dismount($object) {\n $reflectionClass = new \\ReflectionClass(get_class($object));\n $array = array();\n foreach ($reflectionClass->getProperties() as $property) {\n $property->setAccessible(true);\n $array[$property->getName()] = $property->getValue($object);\n $property->setAccessible(false);\n }\n return $array;\n }", "public function getFields() : array\n {\n return get_object_vars($this);\n }", "public function getObjectInfo($obj) : array {\n return get_object_vars($obj);\n }", "public function toArray() : array\n {\n $result = [];\n foreach ($this->visibleProperties() as $property) {\n $value = $this->$property;\n if (is_array($value) or $value instanceof Collection) {\n foreach ($value as $k => $v) {\n if ($v instanceof Entity) {\n $result[$property][$k] = $v->toArray();\n }\n }\n continue;\n }\n if ($value instanceof Entity) {\n $value = $value->toArray();\n }\n $result[$property] = $value;\n }\n\n return $result;\n }", "public function all_property_values()\n {\n return $this->property_values();\n }", "function jsonSerialize()\n {\n return get_object_vars($this);\n }", "function jsonSerialize()\n {\n return get_object_vars($this);\n }" ]
[ "0.7882886", "0.73982847", "0.7386481", "0.7196698", "0.7188134", "0.7149823", "0.70256364", "0.6848243", "0.68415624", "0.6803964", "0.68035597", "0.67745614", "0.6747662", "0.6737376", "0.6734362", "0.67330337", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.67230314", "0.6686421", "0.6682993", "0.66812235", "0.6668847", "0.6660735", "0.66597146", "0.66597146", "0.6658034", "0.6649032", "0.6649032", "0.66377336", "0.66377336", "0.6604728", "0.66041243", "0.65988845", "0.65890115", "0.65872186", "0.65870327", "0.65845674", "0.65845674", "0.6577025", "0.6576533", "0.6576533", "0.65707445", "0.65647084", "0.656442", "0.6556465", "0.6556189", "0.6556189", "0.6549103", "0.6538711", "0.65315807", "0.65313786", "0.6512519", "0.6509161", "0.6509061", "0.6506714", "0.6505606", "0.64952415", "0.64922494", "0.6478084", "0.6470882", "0.6470882", "0.64686406", "0.6466462", "0.6466462", "0.64658624", "0.64641464", "0.64583224", "0.64494234", "0.64475393", "0.64475393", "0.64475393", "0.64475393", "0.64475393", "0.64475393", "0.64397377", "0.64048076", "0.6399949", "0.6388088", "0.6388088", "0.6388088", "0.6388088", "0.6385259", "0.6370406", "0.6370387", "0.63545996", "0.63502914", "0.63502663", "0.6345487", "0.6335775", "0.6327042", "0.63177514", "0.6311028", "0.6300691", "0.6300691" ]
0.0
-1
Pre update event process
public function preUpdate(PreUpdateEventArgs $args) { $entity = $args->getEntity(); $user = $this->getUser(); if (!$entity instanceof ContainUpdaterInterface || !$user) { return $this; } $entity->setUpdatedBy($user); $em = $args->getEntityManager(); $uow = $em->getUnitOfWork(); $meta = $em->getClassMetadata(get_class($entity)); $uow->recomputeSingleEntityChangeSet($meta, $entity); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _preupdate() {\n }", "public function preUpdate()\n {\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "public function preUpdateCallback()\n {\n $this->performPreUpdateCallback();\n }", "function before_update() {}", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }", "public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->dateModification = new \\DateTime();\n }", "public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function onPreUpdate()\n {\n $this->updateAt = new Carbon();\n }", "public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }", "protected function beforeUpdate()\n {\n }", "public function preUpdate(PreUpdateEventArgs $args)\n {\n $obj = $args->getDocument();\n \n $this->doPreUpdate($obj);\n }", "public function onPreUpdate()\n {\n $now = new \\DateTime();\n $this->setUpdatedAt($now);\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function beforeUpdate()\n {\n $this->update_at=time();\n }", "protected function preUpdateHook($object) { }", "public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }", "protected function beforeUpdating()\n {\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function preUpdate(PreUpdateEventArgs $eventArgs)\n {\n $this->dispatchEntityEvent($eventArgs->getEntity(), 'onPreUpdate', [$eventArgs]);\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "function after_update() {}", "function update_start()\n {\n }", "public function preUpdate($entity, PreUpdateEventArgs $eventArgs);", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function preUpdate(Doctrine_Event $event)\n {\n if ( ! $this->_options['updated']['disabled']) {\n $updatedName = $event->getInvoker()->getTable()->getFieldName($this->_options['updated']['name']);\n $modified = $event->getInvoker()->getModified();\n if ( ! isset($modified[$updatedName])) {\n $event->getInvoker()->$updatedName = $this->getUserId();\n }\n }\n }", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime;\n }", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function preCacheUpdate()\n\t{\n\t\t$this->template->assign('updateCache', true);\n\t}", "protected function getUpdateBeforeFunction()\n {\n \n }", "public function after_update() {}", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "protected function preUpdate( ModelInterface &$model ) {\n }", "protected function preProcess() {}", "public function beforeUpdate()\n {\n $this->modified_in = date('Y-m-d H:i:s');\n }", "protected function _postUpdate()\n\t{\n\t}", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }", "public function preProcess();", "public function preProcess();", "public function preUpdate()\n {\n $this->parroqNomb = Utility::upperCase($this->parroqNomb);\n }", "public function preUpdate(LifecycleEventArgs $args): void\n {\n $entity = $args->getEntity();\n\n if (property_exists($entity, self::UPDATED_AT_FIELD)) {\n $entity->setUpdatedAt(new \\DateTime());\n }\n }", "function validate_on_update() {}", "function update() {\n\n\t\t\t}", "public function beforeUpdateEvent($self, $pkeys){\n return true;\n }", "public function preUpdate(Model $model, $entry) {\n $logModel = $model->getOrmManager()->getModel(EntryLogModel::NAME);\n\n $this->preUpdateFields[$model->getName()][$entry->getId()] = $logModel->prepareLogUpdate($model, $entry);\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "protected function _update()\n\t{\n\t}", "protected function processUpdates()\n {\n $this->importStaticData();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "protected function beforeUpdate(): bool\n {\n return true;\n }", "function before_validation_on_update() {}", "public function preUpdate(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n\n if ($entity instanceof Files){\n $entity->setUpdatedAt($this->dateTime);\n\n return;\n }\n }", "protected function afterUpdating()\n {\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function preSave() {}", "protected function update() {}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function preUpdate(ModelLifecycleArguments $args)\n {\n $model = $args->getModel();\n if (false === $this->shouldProcess($model)) {\n return;\n }\n // Store changesets for later use.\n $this->changeSets[$model->getId()] = $model->getChangeSet();\n }", "protected function performPreUpdateCallback()\n {\n // echo 'updating a record ...';\n $this->validate();\n \n return true;\n }", "protected function afterUpdate() {\n\t}", "function preUpdate(){\n $this->alteradoEm = new \\DateTime('now');\n $this->alteradoEm->setTimezone(new \\DateTimeZone('America/Sao_Paulo'));\n }", "public function preSave() { }", "public function pre()\n {}", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "protected function preApply(): void {\n\t\t// this could take a bit\n\t\tset_time_limit(0);\n\t\t\n\t\t// unregister some events\n\t\telgg_unregister_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Rules::applyRules');\n\t\telgg_unregister_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata');\n\t}", "abstract protected function _preProcess();", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "protected function executePreRenderHook() {}", "protected function performUpdate() {}", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "function preSave()\n {\n }" ]
[ "0.8488921", "0.8399765", "0.8119015", "0.8119015", "0.7975724", "0.775655", "0.775655", "0.7678696", "0.7644174", "0.759656", "0.7551708", "0.7550216", "0.7550216", "0.74956584", "0.74874127", "0.74802184", "0.7421554", "0.7375182", "0.7331969", "0.73059535", "0.7263406", "0.7258624", "0.724066", "0.7183434", "0.7131572", "0.7131572", "0.7125933", "0.7123238", "0.7097065", "0.7077411", "0.7046479", "0.70320475", "0.7015559", "0.6994308", "0.6994308", "0.693593", "0.69230306", "0.692219", "0.68747175", "0.6867299", "0.6846945", "0.6839257", "0.67956805", "0.67956805", "0.67893946", "0.6785352", "0.6781365", "0.67695737", "0.67695737", "0.67695737", "0.6747638", "0.67390203", "0.67246985", "0.6708097", "0.6708097", "0.6663213", "0.6654189", "0.6653675", "0.65239364", "0.65093595", "0.6487575", "0.6487575", "0.6449719", "0.64360344", "0.6434532", "0.64022267", "0.63869315", "0.6378369", "0.6377245", "0.63751495", "0.63460374", "0.63231575", "0.6322752", "0.6322752", "0.623352", "0.62268525", "0.62171644", "0.6211792", "0.62096345", "0.62096345", "0.6208862", "0.6208862", "0.6198191", "0.61865574", "0.6186156", "0.61807936", "0.61771595", "0.61769223", "0.617397", "0.6164182", "0.6149729", "0.61314577", "0.611753", "0.6100313", "0.6098716", "0.6076568", "0.606357", "0.60507125", "0.6050596", "0.6034836", "0.60334355" ]
0.0
-1
Pre persist event process
public function prePersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); $user = $this->getUser(); if (!$entity instanceof ContainAuthorInterface || !$user) { return $this; } $entity->setCreatedBy($user); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersistCallback()\n {\n $this->performPrePersistCallback();\n }", "public function prePersist()\n {\n }", "public function preSave() {}", "public function preSave() { }", "public function onPrePersist()\n {\n $this->status = 1;\n $this->createdDateTime = new \\DateTime(\"now\");\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function preSaveCallback()\n {\n $this->performPreSaveCallback();\n }", "public function onBeforeSave($event);", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n $this->updated = new \\DateTime(\"now\");\n }", "public function prePersist() {\n $this->setScheduled(true);\n $this->setScheduleCount(1);\n $this->setScheduledAt(new MongoDate());\n if(!$this->getPriority()) {\n $this->setPriority(self::DEFAULT_PRIORITY);\n }\n }", "function preSave()\n {\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $obj = $args->getDocument();\n \n $this->doPrePersist($obj);\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->preUpdate($eventArgs);\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function onPreSave(StorageEvent $event)\n {\n // The ContentType of the record being saved\n $contenttype = $event->getContentType();\n\n // The record being saved\n $record = $event->getContent();\n\n // A flag to tell if the record was created, updated or deleted,\n // for more information see the page in the documentation\n $created = $event->isCreate();\n\n // Do whatever you want with this data\n // See page in the documentation for a logging example\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function PrePersist(){\n $this->login = strtolower($this->login);\n $this->activo = false;\n $this->creadoEl = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->dateCreated\n = $this->dateUpdated = new DateTime('now');\n }", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function prePersist()\n {\n $this->date_created = new \\DateTime();\n }", "public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function onBeforeSave();", "public function prePersist(LifecycleEventArgs $args): void\n {\n $this->setPassword('persist', $args);\n }", "public function prePersist(EventArgs $args)\n {\n $om = $this->getObjectManager($args);\n $object = $this->getObject($args);\n $meta = $om->getClassMetadata(get_class($object));\n \n if ($config = $this->getConfiguration($om, $meta->name)) {\n $this->getStrategy($om, $meta->name)->processPrePersist($om, $object);\n }\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->dispatchEntityEvent($eventArgs->getEntity(), 'onPrePersist', [$eventArgs]);\n }", "public function onPrePersist()\n {\n $this->created_at = new \\DateTime(\"now\");\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n\n if($this->getCreatedAt() == NULL)\n {\n $this->setCreatedAt(new \\DateTime('now'));\n }\n\n if($this->getSlug() == NULL) {\n $this->setSlug($this->generateSlug());\n }\n\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function onPrePersist()\n {\n $this->setCreated(new \\DateTime(\"now\"));\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime('now');\n $this->updatedAt = new \\DateTime('now');\n }", "public function _prePersist(): void\n {\n // Set date to now when none is set\n if ($this->date == null) {\n $this->setDate(new \\DateTime());\n }\n }", "public function onPrePersist(): void\n {\n $this->created = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "function preSave()\n\t{\n\n\t}", "public function prePersist()\n {\n $this->parroqNomb = Utility::upperCase($this->parroqNomb);\n }", "public function doPrePersist()\n {\n $this->maximized = null;\n }", "public function prePersist(LifecycleEventArgs $eventArgs)\n {\n $this->migrateMeta($eventArgs);\n }", "protected function onBeforeSave()\n {\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n $this->setTotalAmounts();\n }", "public function prePersist() \n {\n if (empty($this->RegisteredAt)) {\n $this->RegisteredAt = new \\DateTime();\n }\n }", "public function onPrePersist(): void\n {\n $this->token = Uuid::uuid1()->toString();\n $this->createdAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $now = new \\DateTime();\n $this->setCreatedAt($now);\n $this->setUpdatedAt($now);\n }", "public function prePersist()\n {\n $this->updatedAt = new \\DateTime();\n $this->createdAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime();\n $this->updatedAt = new \\DateTime();\n }", "public function onPrePersist(): void\n {\n $this->created = new DateTime(new DateTimeZone(\"UTC\"), \"now\");\n }", "function beforeSaveLoop()\r\n {\r\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist()\n {\n $this->createdAt = new DateTime();\n $this->updatedAt = new DateTime();\n }", "public function onPrePersist(LifecycleEventArgs $eventArgs) {\n\t\tparent::onPrePersist($eventArgs);\n\t\t$this->hashPassword();\n\t}", "public static function beforeSave($event)\r\n {\r\n }", "public function prePersist(LifecycleEventArgs $event) {\n\n $em = $event->getObjectManager();\n $entity = $event->getObject();\n\n if($entity instanceof SaleEntity || $entity instanceof SaleItemEntity) {\n\n // Automate creation of transition.\n $state = $entity->getState();\n\n if($entity instanceof SaleEntity) {\n $transition = new SaleWorkflowTransition();\n $transition->setSale($entity);\n } else {\n $transition = new SaleItemWorkflowTransition();\n $transition->setSaleItem($entity);\n }\n\n $transition->setAfterState($state);\n $transition->setCreatedAt(Carbon::now());\n $transition->setUpdatedAt(Carbon::now());\n\n $entity->addTransition($transition);\n\n }\n\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->createdAt = new \\DateTime(\"now\");\n }", "public function onPrePersist()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }", "protected function preSave() {\n\t\treturn true;\n\t}", "protected function _pre_store ()\n {\n parent::_pre_store ();\n\n if ($this->unpublished ())\n {\n $this->time_published->clear ();\n $this->publisher_id = 0;\n \n if ($this->_state_when_loaded != $this->state)\n {\n // State changed; check history items and revoke notification for published items\n \n $history_item_query = $this->history_item_query ();\n /** @var HISTORY_ITEM[] $history_items */\n $history_items = $history_item_query->objects ();\n \n foreach ($history_items as $history_item)\n {\n if (($history_item->kind == History_item_published) && ($history_item->publication_state == History_item_needs_send))\n {\n $history_item->publication_state = History_item_silent;\n $history_item->store();\n }\n }\n }\n }\n elseif (! $this->time_published->is_valid ())\n {\n $this->time_published->set_now ();\n if ($this->update_modifier_on_change)\n {\n $this->publisher_id = $this->login->id;\n }\n else\n {\n $this->publisher_id = $this->modifier_id;\n }\n }\n }", "public function preFlush(\\Doctrine\\ODM\\MongoDB\\Event\\PreFlushEventArgs $eventArgs);", "protected function preSave() {\n return TRUE;\n }", "public function preUpdate(\\Doctrine\\ODM\\MongoDB\\Event\\LifecycleEventArgs $eventArgs);", "public function onBeforeSaveEvent(Event $event)\n {\n $this->raiseEvent('onBeforeSaveEvent', $event);\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $entity = $args->getEntity();\n if ($entity instanceof WorkflowItem) {\n $this->updateWorkflowDefinition($args->getEntityManager(), $entity);\n }\n }", "public function prePersist()\n {\n $this->createdAt = new \\DateTime;\n $this->updatedAt = new \\DateTime;\n\n }", "protected function preProcess() {}", "protected function _saveBefore()\n {\n // nothing here\n }", "public function preProcess(ProcessEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "function persist() ;", "protected function hook_beforeSave(){}", "public function preSave(EntityStorageInterface $storage);", "protected function preApply(): void {\n\t\t// this could take a bit\n\t\tset_time_limit(0);\n\t\t\n\t\t// unregister some events\n\t\telgg_unregister_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Rules::applyRules');\n\t\telgg_unregister_event_handler('create', 'metadata', '\\ColdTrick\\TagTools\\Enqueue::createMetadata');\n\t}", "protected function preHandle(Event $ev) { return; }", "public function prePersist()\n {\n $this->muniNomb = Utility::upperCase($this->muniNomb);\n }", "public function onPrePersist()\r\n {\r\n $this->created_at = new \\DateTime(\"now\");\r\n }", "public function onBeforeSaveEntry(SproutForms_OnBeforeSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onBeforeSaveEntry', $event);\n\t}", "public function prePersist(LifecycleEventArgs $args): void\n {\n // Get the object and make sure it is what we need.\n $object = $args->getObject();\n if (!$object instanceof PublishableInterface) {\n return;\n }\n\n // Publish active objects immediately.\n if ($object->isActive()) {\n $object->setPublished(true);\n } else {\n $object->setPublished(false);\n }\n }", "protected function _beforeSave() {\n\t}", "public function postPersist(LifecycleEventArgs $event)\n {\n $entity = $event->getEntity();\n $this->processUploads($entity);\n }", "protected function _precreate() {\n }", "public function testOnPreUpdatedOnPrePersist()\n {\n $eavDocument = new EavDocument();\n\n $this->assertNull($eavDocument->getCreatedAt());\n $this->assertNull($eavDocument->getModifiedAt());\n\n $eavDocument->onPrePersist();\n $eavDocument->onPreUpdate();\n\n $createdAt = $eavDocument->getCreatedAt();\n $this->assertInstanceOf(DateTime::class, $createdAt);\n\n $modifiedAt = $eavDocument->getModifiedAt();\n $this->assertInstanceOf(DateTime::class, $modifiedAt);\n }", "public function beforeSave()\n {\n $this->getRecord()->clearCache() && $this->getRecord()->triggerEvent();\n return parent::beforeSave();\n }", "public function beforeVersionedSave()\n {\n $this->wasDirty = false;\n if ($this->isDirty && static::$createRevisionOnSave) {\n // update creation time\n $this->Created = time();\n $this->wasDirty = true;\n }\n }", "public function prePersist($entity);", "public function onPrePersist()\n {\n $this->createdAt = new Carbon();\n }", "protected function beforeSaveInDB(){}", "public function persist()\n {\n $this->eventManager->dispatchEvent(['persist_before'], [get_class($this)]);\n if (!empty($this->handlerInterface)) {\n $result = $this->handlerFactory->create($this->handlerInterface)->persist($this);\n if (!empty($result)) {\n foreach ($result as $key => $value) {\n $this->data[$key] = $value;\n }\n }\n }\n $this->eventManager->dispatchEvent(['persist_after'], [get_class($this)]);\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'created',\n 'level' => 'doctrine',\n ));\n }", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }", "public function onBeforeWrite() {\n if(!isset($this->FinishDateTime) || strtotime($this->FinishDateTime) < 1000) {\n $this->FinishDateTime = date('Y-m-d H:i:s', strtotime(date('Y-m-d', strtotime($this->StartDateTime)) . ' 23:59:59'));\n }\n\n /**\n * Increment the .ics calendar invite sequence number if any of the\n * key properties of this Event have been updated (after initital creation)\n */\n if(!empty($this->ID)) {\n $cf = $this->getChangedFields(true, 2);\n foreach(static::$key_properties as $property) {\n if(isset($cf[$property])) {\n $this->Sequence = $this->Sequence + 1;\n $this->UpdatedSequenceNotification($this);\n break;\n }\n }\n }\n\n\n parent::onBeforeWrite();\n\n }", "public function prePersist(Event\\LifecycleEventArgs $eventArgs)\n {\n $memberId = $this->session->get('memberId') ?: 0;\n $entity = $eventArgs->getEntity();\n\n if (method_exists($entity, 'setAddedBy')) {\n $entity->setAddedBy($memberId);\n }\n\n if (method_exists($entity, 'setAddedOn')) {\n $entity->setAddedOn(time());\n }\n\n if ($entity instanceof EffectiveEntity) {\n // If EffectiveTime has not been explicitly set,\n // set it to time().\n $entity->setEffectiveTime($entity->getEffectiveTime() ?: time());\n } else {\n if (method_exists($entity, 'setModifiedBy')) {\n $entity->setModifiedBy($memberId);\n }\n\n if (method_exists($entity, 'setModifiedOn')) {\n $entity->setModifiedOn(time());\n }\n }\n }", "public function onAfterSave();", "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "public function preProcess();" ]
[ "0.7314062", "0.7314062", "0.7176485", "0.71491396", "0.7013928", "0.6928474", "0.6805932", "0.6805932", "0.67344964", "0.67279154", "0.66322744", "0.6624566", "0.66186696", "0.6614982", "0.6612773", "0.66007257", "0.65774405", "0.6570396", "0.65577745", "0.6542936", "0.653232", "0.653152", "0.65272075", "0.65081143", "0.6492885", "0.6461602", "0.6461225", "0.6438274", "0.6419424", "0.6416345", "0.6408337", "0.63862485", "0.63862485", "0.6379759", "0.6369811", "0.63283116", "0.63234335", "0.63226426", "0.6319668", "0.6308272", "0.62968326", "0.6296172", "0.629504", "0.6280188", "0.6275833", "0.62756467", "0.62732553", "0.62702686", "0.6268087", "0.6268087", "0.626297", "0.6235103", "0.62296474", "0.62296474", "0.6207091", "0.6202959", "0.6201659", "0.61809236", "0.61809236", "0.61809236", "0.61809236", "0.61809236", "0.61809236", "0.61779946", "0.61747915", "0.6173471", "0.6171258", "0.617018", "0.6159174", "0.61393857", "0.6137765", "0.6136059", "0.60848606", "0.60761577", "0.6066382", "0.60625017", "0.6060185", "0.60459507", "0.60383004", "0.603454", "0.6015462", "0.6011289", "0.60101324", "0.59911925", "0.59748703", "0.597148", "0.5963518", "0.5960434", "0.59526116", "0.5944428", "0.5942812", "0.59290105", "0.59271574", "0.591808", "0.5887695", "0.5887351", "0.5883878", "0.585551", "0.584647", "0.58449364", "0.584078" ]
0.0
-1
Get the registered name of the component.
protected static function getFacadeAccessor() { return 'profil-pengguna'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getComponentName()\n {\n return $this->_componentName;\n }", "public function getComponentName()\n {\n $component = $this->argument('component') ?: app('components')->getUsedNow();\n\n $component = app('components')->findOrFail($component);\n\n return $component->getStudlyName();\n }", "public function get_component_name() {\n return $this->plugintype.'_'.$this->pluginname;\n }", "public function get_name() {\n if(get_config(constants::M_COMPONENT,'customname')){\n return get_config(constants::M_COMPONENT,'customname');\n }else {\n return get_string('pluginname', constants::M_COMPONENT);\n }\n }", "public function getComponentName(): string;", "public function get_component() : string\n {\n return $this->component;\n }", "protected function getComponentName(): string {\n if ($this->isPageTemplate()) {\n return \"{$this->layout}-{$this->post->post_type}\";\n }\n\n if (str_contains($this->componentId, '-')) {\n return implode('', \\__::chain($this->componentId)\n ->split('-')\n ->map(fn ($string) => \\__::capitalize($string))\n ->value());\n }\n\n return \\__::chain($this->componentId)\n ->camelCase()\n ->capitalize()\n ->value();\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public function getName()\n\t{\n\t\treturn isset($this->_name) ? $this->_name : spl_object_hash($this);\n\t}", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "protected static function _getName()\n {\n return isset(static::$_name) ? static::$_name : get_called_class();\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public static function getName(): string\n {\n return static::$name;\n }", "function getComponentName()\n {\n $p = get_class($this);\n\n $reflector = new ReflectionClass($p);\n $path = dirname($reflector->getFileName());\n\n $component = str_replace(BW_PATH_COMPONENTS . DS, '', $path);\n $component = str_replace(DS . 'models', '', $component);\n\n if (bwFolder::is(BW_PATH_COMPONENTS . DS . $component)) {\n return $component;\n } else {\n return NULL;\n }\n }", "public function getName() {\n return ($this->isInit()) ? $this->name : null;\n }", "function getName() {\n return $this->instance->getName();\n }", "public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function get_registered_component( $name );", "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 getName()\n {\n return $this->str_name;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "function get_name()\n {\n return $this->get_default_property(self :: PROPERTY_NAME);\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName(): string\n {\n return $this->getIdentifier()->getName();\n }", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public function get_name() {\n\n\t\treturn $this->name;\n\t}", "public static function getName();", "public function getName()\n {\n return implode(',', $this->components['CN']);\n }", "function get_name()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_NAME);\r\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}", "static public function getName(): string\n {\n return static::$name;\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function get_name() {\n return get_string('pluginname', 'forumngtype_' . $this->get_id());\n }", "public function getName()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-keyword') . ' : ' . $this->getInput('q');\n break;\n case $this->i8n('context-group'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-group') . ' : ' . $this->getKey('group');\n break;\n case $this->i8n('context-talk'):\n return $this->i8n('bridge-name') . ' - ' . $this->i8n('title-talk') . ' : ' . $this->getTalkTitle();\n break;\n default: // Return default value\n return static::NAME;\n }\n }", "public function getName(): string {\n\t\t\treturn $this->name;\n\t\t}", "public function get_component_name() {\n return 'user';\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function get_name() {\n\t\treturn $this->name;\n\t}", "public function getName(): string\n {\n\t\treturn $this->name;\n\t}", "public function getName ()\n {\n return $this->getLabel();\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName() {\n return self::NAME;\n }", "public function getName() {\n\t\treturn $this->current_name;\n\t}", "public function getName () {\n\t\treturn $this->name;\n\t}", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getName() {\n\t\treturn ($this->name);\n\t}", "public function getName()\n {\n return $this->getConfig ( 'name' );\n }", "public function getName(): string {\n return $this->name;\n }", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function get_name(): string\n {\n return $this->name;\n }", "function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getName()\n {\n return $this->getValue('name');\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}" ]
[ "0.8145252", "0.81059104", "0.79843503", "0.7875069", "0.7621859", "0.71461004", "0.7101458", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.705496", "0.70394325", "0.70209575", "0.69877225", "0.69877225", "0.69877225", "0.6984164", "0.6965933", "0.6965933", "0.69652396", "0.69386864", "0.69140494", "0.68974113", "0.68967915", "0.68593174", "0.68486273", "0.68120587", "0.68120587", "0.67868453", "0.6775167", "0.6775155", "0.6755135", "0.6755135", "0.6755135", "0.6752984", "0.674242", "0.6710877", "0.670616", "0.6703415", "0.67011756", "0.6691306", "0.668469", "0.66830266", "0.66830266", "0.66790146", "0.66775", "0.66692185", "0.6668179", "0.66607153", "0.6660571", "0.6660436", "0.6660436", "0.6660436", "0.6660436", "0.66595274", "0.6658804", "0.66557944", "0.6651633", "0.66399175", "0.6633721", "0.6629492", "0.662811", "0.66218275", "0.6617998", "0.66178477", "0.66178477", "0.6610472", "0.6607344", "0.6605626", "0.66048145", "0.66030926", "0.66030926", "0.66030926", "0.66030926", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65967", "0.65966654", "0.65966654" ]
0.0
-1
Lists all Event models.
public function actionIndex() { Yii::$app->cache->gc(true); $searchModel = new EventSearchForm(); $query = Event::find()->where(['>=', 'UNIX_TIMESTAMP(end_date)', time()]); $query = $query->joinWith('user'); $pagination = new Pagination([ 'defaultPageSize' => 10, 'totalCount' => $query->count(), ]); $goa = new GoaBaseApi(); if (Yii::$app->cache->get('goabase') == NULL) { //if not in cache load from api //list of goa parties, Type: ArrayList with Events $goaParties = $goa->getParties(); Yii::$app->cache->set('goabase', $goaParties, 300); } else { //load from cache $goaParties = Yii::$app->cache->get('goabase'); } // Event List ordered by date $eventList = $query->orderBy('start_date')->all(); // Daten für die Autovervollständiung foreach($eventList as $eventName) array_push($searchModel->eventNameList, $eventName->name); //-----Add GoaParties to eventList-------- $goaId = $query->count(); //append goaparties to eventList (intern parties) for ($i=0 ; $i < count($goaParties) ; $i++) { $eventList[$goaId] = $goaParties[$i]; ++$goaId; } // Sort Event List $eventList = $this->sortEventList($eventList); // Top Events $topList = $query->orderBy(['clicks' => SORT_DESC])->limit(3)->all(); // New Events $newList = $query->orderBy(['creation_date' => SORT_DESC])->limit(3)->all(); return $this->render('index', ['searchModel' => $searchModel, 'eventList' => $eventList, 'pagination' => $pagination, 'topList' => $topList, 'newList' => $newList]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all()\n {\n $model = new Event();\n $events = $model->readAll();\n return ['events'=>$events];\n }", "public function index()\n {\n return Event::all();\n }", "public static function list_events()\n\t{\n\t\treturn cms_orm('CmsDatabaseEvent')->find_all(array('order' => 'module_name, event_name'));\n\t}", "public function index()\n {\n Event::all();\n }", "public function getEvents()\n {\n //\n\n return Event::all();\n }", "public function index()\n {\n \n return EventResource::collection(Event::all());\n\n\n }", "public function index()\n {\n\n $event = Event::all();\n\n return $event;\n }", "public function getAllEvents()\n\t{\n\t\t$events = App_Model_Event_Mapper::getInstance()->getAll(true, \"actionId = $this->_actionId\", 'eventNo');\n\n\t\treturn $events;\n\t}", "public function getAll(){\n //old : \n // $events = $this->events;\n // return $events;\n $repo = $this->om->getRepository(Event::class); \n return $repo->findAll();\n }", "public function index()\n {\n $listing=Event::all();\n return view('events.list', compact('listing'));\n }", "public function actionIndex()\n {\n $searchModel = new EventSearch([\n 'start_date' => date('Y-m-d'),\n ]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return Events::orderBy('created_at','DESC')->get();\n }", "public function index()\n {\n $events = Event::all();\n return view('event.list',['events'=>$events]);\n }", "public function viewAllEvents();", "public function index()\n {\n return view(\"admin.event\")->with([\n \"events\" => Event::query()->orderBy(\"created_at\", \"desc\")->paginate()\n ]);\n }", "public function index()\n {\n $eventList = Event::all();\n return view('backEnd.events.events',compact('eventList'));\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n $events = Event::all();\n return view('events::list_events',compact('events'));\n\n }", "public function show()\r\n {\r\n $events = DB::table('app_event')\r\n ->orderBy('id', 'desc')\r\n ->paginate(10)->toJson();\r\n\r\n return $events;\r\n }", "public function index()\n {\n $events = Event::latest()->paginate(10);\n return view('event.events', compact('events'));\n }", "public function index()\n {\n $e = Event::all();\n return view('admin.events.index' , compact('e'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n\n return $this->render('events/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function index()\n {\n return $this->eventsToArray(Event::all());\n }", "public function index()\n {\n return Events::all()->jsonSerialize();\n }", "public function index(EventRequest $request)\n {\n $relations = $this->prepareRelations($request->get('with'));\n\n $events = Event::withRelations($relations)\n ->paginate(getPerPage());\n\n return $this->response->ok($events);\n }", "public function index()\n {\n $events = Event::all();\n return view('indexEvent')->with(compact('events'));\n }", "public function events() {\n return $this->hasMany(Event::class);\n }", "public function events()\n {\n return $this->hasMany(Event::class);\n }", "public function index()\n {\n $events = Event::all();\n\n return $this->respondWithJson($events);\n }", "public function index()\n {\n $events = $this->eventRepository->all();\n return view('admin.event.index',compact('events'));\n }", "public function index()\n {\n $events = Events::all();\n return response()->json($events);\n }", "public function getAll()\n\t{\n\t\tif($this->input->is_ajax_request())\n\t\t{\n\t\t\t$this->load->model('events_model');\n\t\t\t$events = $this->events_model->getAll();\n\t\t\techo json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t\"success\" => 1,\n\t\t\t\t\t\"result\" => $events\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "public function index()\n {\n $list = Event::paginate(3);\n return view('events.index', compact('list'));\n\n }", "public function index()\n\t{\n\t\t$eventos = Evento::all();\n\t\treturn \\View::make('Evento/list_evento',compact('eventos'));\n\t}", "public function index()\n {\n $events = Event::all();\n return view('events.index',compact('events'));\n }", "public function indexAction()\n {\n /* $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('EventBundle:Event')->findAll();\n\n return array(\n 'events' => $events,\n );*/\n return array();\n }", "public function index()\n {\n return response()->json(Event::all());\n }", "public function index()\n {\n $events = Event::get();\n\n return view('event.index', compact('events'));\n }", "public function index()\n {\n return Happening_event::all()\n ->toArray();\n }", "public function index()\n {\n $events = Event::all();\n \n return view('events.index', compact('events'));\n }", "public function index()\n {\n $events = Event::latest()->paginate(5);\n return view('events',compact('events'));\n }", "function loadEvents() {\n $events = Event::orderBy('date', 'desc')->paginate(10);\n \n return view('cms.events', ['events' => $events]);\n }", "public function index()\n\t{\n\t\t$events = Event::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('events.index', compact('events'));\n\t}", "public function index()\n {\n $events = Event::all();\n return view('events.index', compact('events'));\n }", "public function index()\n {\n $data['events'] = Event::orderBy('id', 'DESC')->get();\n return view(\"Event::index\", $data);\n }", "public function index() {\n $this->seo(array(\n \"title\" => \"All Events List\",\n \"keywords\" => \"events, new events, event management, create event, event tickets, book event tickets\",\n \"description\" => \"Display all the latest events. Filter the events by categories, location and much more. Register yourself to turn your passion into your business\",\n \"view\" => $this->getLayoutView()\n ));\n $view = $this->getActionView();\n\n $title = RequestMethods::get(\"title\", \"\");\n $category = RequestMethods::get(\"category\", \"\");\n $type = RequestMethods::get(\"type\", \"\");\n $limit = RequestMethods::get(\"limit\", 10);\n $page = RequestMethods::get(\"page\", 1);\n $where = array(\n \"title LIKE ?\" => \"%{$title}%\",\n \"category LIKE ?\" => \"%{$category}%\",\n \"type LIKE ?\" => \"%{$type}%\",\n \"live = ?\" => true\n );\n $events = Event::all($where, array(\"*\"), \"created\", \"desc\", $limit, $page);\n $count = Event::count($where);\n\n $view->set(\"events\", $events);\n $view->set(\"limit\", $limit);\n $view->set(\"page\", $page);\n $view->set(\"count\", $count);\n $view->set(\"title\", $title);\n $view->set(\"type\", $type);\n $view->set(\"category\", $category);\n }", "public function index()\n {\n $eventTypeList = $this->EventType->getAll();\n $eventCategoryList = $this->EventCategory->getAll();\n $eventGroupList = $this->EventGroup->getAll();\n $eventPriorityList = $this->EventPriority->getAll();\n $statusList = $this->Status->getAll();\n $groupEmployee = $this->EmployeeGroup->getAll();\n $data = [\n 'eventTypeList' => $eventTypeList,\n 'eventCategoryList' => $eventCategoryList,\n 'eventGroupList' => $eventGroupList,\n 'eventPriorityList' => $eventPriorityList,\n 'statusList' => $statusList,\n 'groupEmployee' => $groupEmployee\n ];\n return view('event::index', $data);\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "public function index()\n {\n \n $events = Event::all();\n return view('pages.events.index')->with(compact('events'));\n }", "public function actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "public function index()\n {\n $event = ModelEvent::paginate(9);\n \treturn view('index', ['event' => $event]);\n \n }", "public function events()\n {\n return $this->belongsToMany(\\App\\Models\\Event::class);\n }", "function admin_index() {\n\t\t$this->Event->recursive = 0;\n\t\t$this->set('events',$this->paginate());\n\t}", "public function index()\n\t{\n\t\treturn StandarResponse::OK(Evento::all());\n\t}", "public function events()\n {\n return $this->hasMany('App\\Event');\n }", "public function listAction()\r\n\t{\r\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\r\n\t\t$this -> view -> business = $business = Engine_Api::_() -> core() -> getSubject();\r\n\t\t$this -> view -> form = $form = new Ynbusinesspages_Form_Event_Search;\r\n\t\t$val = $this -> _getAllParams();\r\n\t\t// Populate form data\r\n\t\tif (!$form -> isValid($val))\r\n\t\t{\r\n\t\t\t$form -> populate($defaultValues);\r\n\t\t\t$this -> view -> formValues = $values = array();\r\n\t\t\t$this -> view -> message = \"The search value is not valid !\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$values = $form -> getValues();\r\n\t\t$values['business_id'] = $business -> getIdentity();\r\n\t\t// Prepare data\r\n\t\t$this -> view -> formValues = $values = array_merge($values, $_GET);\r\n\t\t\r\n\t\t// Check create event authorization\r\n\t\t$this -> view -> canCreate = $business -> isAllowed('event_create');\r\n\t\t//Get data\r\n\t\t$this -> view -> paginator = $paginator = Engine_Api::_()->getDbTable('mappings', 'ynbusinesspages') -> getEventsPaginator($values);\r\n\t\t$paginator -> setCurrentPageNumber($this -> _getParam('page'));\r\n\t}", "public function All() {\n return $this->get_all_events( 'start_date', 'DESC', false );\n }", "public function index()\n {\n $events=Event::orderby('id','desc')->paginate(20);\n\n return view('backend.events.index',compact('events'));\n }", "public function index()\n {\n $event = Event::all();\n\n return response()->json($event);\n }", "public function getEventList() {\n $response = $this->client->get(\n $this->apiUrl . \"events\");\n return $response->json();\n }", "public function index()\n {\n $events = \\App\\Event::orderBy('id','DESC')->paginate(10);\n return view('admin.events.index', ['events' => $events]);\n }", "public function index()\n {\n $events = Event::get();\n return response()->view('admin.events.index', ['events' => $events ]);\n }", "public function listEventsAction()\n {\n $events = $this->getDoctrine()->getRepository('AppBundle:Event')->findEventsByManager($this->getUser());\n\n return $this->render('AppBundle:frontend/manager:event_list.html.twig', [\n 'events' => $events,\n ]);\n }", "public function index()\n {\n $data['events'] = Events::with(['langs', 'type', 'restaurant'])->get();\n\n return view('admin.events.index', $data);\n }", "public function index()\n\t{\n\t\t$events = Eventadd::orderBy('date', 'asc')->get();\n return View::make('events.index', compact('events'));\n\t}", "public function index()\n {\n $eventos = evento::paginate(5);\n\n return view('system-mgmt/evento/index', ['eventos' => $eventos]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $events = $em->getRepository('MALrmBundle:CalendarEvent')->findAll();\n\n\n return $this->render('MALrmBundle:event:index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function index()\n {\n $events = Evenement::orderBy('created_at', 'desc')->paginate(10);\n return view('user.events.index')->with(compact('events' ) );\n }", "public function getEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 0')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public function actionIndex()\r\n {\r\n $events = Events::find()->all();\r\n\t\t$tasks = [];\r\n\t\tforeach ($events as $eve) {\r\n\t\t $event = new \\yii2fullcalendar\\models\\Event();\r\n\t\t $event->id = $eve->id;\r\n\t\t $event->title = $eve->title;\r\n\t\t $event->start = $eve->date_created;\r\n\t\t $tasks[] = $event;\t\t\r\n\t\t}\r\n\t\t\r\n return $this->render('index', [\r\n 'events' => $tasks,\r\n ]);\r\n }", "public function index()\n {\n if(isset($_GET['search'])){\n $model = DB::table('events')\n ->where('name', 'LIKE', '%'.$_GET['search'].'%')\n ->get();\n }else{\n $model = Model::get();\n }\n\n return view('events.index')->with(array('data'=>$model, 'controller' => 'events'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('AppBundle:Event')->findBy(\n ['archived' => '0'],\n ['startDate' => 'DESC']\n );\n\n return $this->render(\n 'event/index.html.twig',\n [\n 'events' => $events,\n ]\n );\n }", "public function indexAction() {\n\t\t// TODO Auto-generated IndexController::indexAction() default action\n\t\t\n\t\t\n\t\t$data = $this->table->fetchAllEvents($paginated = true, $page = $this->_request->page, $countPerPage = 3, $asArray = false);\n\t\t$this->view->data = $data;\n\t\t\n\t\t$this->view->form = new Events_Form_Search();\n\t}", "public function getAll()\n {\n return response()->json(['data'=>Event::orderBy('reserved_date')->get()]);\n }", "public function getEvents();", "public function getEvents();", "function getEvents($event) {\n $event_criteria = new CDbCriteria;\n $episode_id = $event->episode->id;\n $event_criteria->compare('episode_id', $episode_id);\n return Event::model()->findAll($event_criteria);\n }", "public function index()\n {\n $eventTypes = EventType::all();\n\n return view('admin.edit.eventtypeslist', ['eventTypes' => $eventTypes]);\n }", "public function listAllQuery() {\n \n $dql = \"select e\n from Vibby\\Bundle\\BookingBundle\\Entity\\Event e\n order by e.date_from\n \";\n\n return $this->getEntityManager()->createQuery($dql);\n \n }", "public function getEvents(){\n\t\t$events = Event::where('owner', Auth::user()->id)->where('deleted', 0)->get();\n\t\treturn response()->json(['data' => $events]);\n\t}", "public function index()\n\t{\n $events = $this->events->paginate(10);\n $no = $events->getFrom();\n return $this->view('events.index', compact('events', 'no'));\n\t}", "public function eventsList()\n {\n $alumniId = session('alumni_id');\n $alumni = AlumniBasicInfo::find($alumniId);\n $events = Event::where('dept_info_id',$alumni->dept_info_id)->latest()->paginate(3);\n return view('frontend.events.events-list',compact('events'));\n }", "public function events()\n {\n return $this->belongsToMany('App\\Event');\n }", "public function getEvents() \n {\n return $this->hasMany(Event::className(), ['category_id' => 'category_id']);\n }", "public function index()\n\t{\n\n\t\t$data['events'] = Event_Manager::paginate(15);\n\t\t$data['page_title'] = 'Events';\n\t\treturn View::make('clientside.events.index',$data);\n\t\t\n\t}", "public function index()\n {\n $events = \\App\\Models\\Event::all();\n return view('admins.events', ['events' => $events]);\n }", "public function getAllEvents() : Collection\n {\n return collect($this->events);\n }", "public function getEvents()\n {\n return $this->hasMany('App\\Models\\Event', 'creator_id', 'id');\n }", "public function index()\n {\n $eventos = Evento::all();\n return response()->json($eventos);\n }", "public function actionIndex()\r\n\t{\r\n\t\t$account_id = Yii::app()->user->id;\r\n\r\n\t\tif($account_id != null)\r\n\t\t{\r\n\t\t\t$events = Event::model()->findAll(\"status_id = 1\");\r\n\t\t\t\t\r\n\t\t\t$eventsDP = new CArrayDataProvider($events, array(\r\n\t\t\t\t\t'pagination' => array(\r\n\t\t\t\t\t\t'pageSize' => 10,\r\n\t\t\t\t\t)\r\n\t\t\t));\r\n\r\n\t\t\t$this->render('index',array(\r\n\t\t\t\t'eventsDP'=>$eventsDP,\r\n\t\t\t\t'events'=>$events,\r\n\t\t\t));\r\n\t\t}\r\n\t\telse\r\n\t\t\t$this->redirect(array('site/login'));\r\n\r\n\t}", "public function index()\n {\n return view('admin.event.index');\n }", "public function action_index()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t//return Response::forge(View::forge('event/index',$data));\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "public function index(Request $request)\n {\n $this->authorize('viewAny', Event::class);\n $events = $this->eventRepo->index();\n return Response::success(new EventCollection($events));\n }", "public function index()\n {\n Session::put('admin_page', 'event');\n $events = Event::all();\n return view('backend.events.index', compact('events'));\n }", "public function All() {\n if($user = Utils::GetUser()) {\n $this->Context->Model = $user->Events;\n }\n else {\n Message::SetMessage('Please, login or sign up');\n Utils::Redirect('/Home/Index');\n }\n }", "public function index()\n {\n //$events = Events::paginate(50);\n $events=Event::all();\n // return view('events.index')->with('events',$events);\n return $events;\n }", "public function getEvents()\n {\n $main_actions = [\n 'event' => \\adminer\\lang('Create event'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n \\adminer\\lang('Schedule'),\n \\adminer\\lang('Start'),\n // \\adminer\\lang('End'),\n ];\n\n // From db.inc.php\n $events = \\adminer\\support(\"event\") ? \\adminer\\get_rows(\"SHOW EVENTS\") : [];\n $details = [];\n foreach($events as $event)\n {\n $detail = [\n 'name' => \\adminer\\h($event[\"Name\"]),\n ];\n if(($event[\"Execute at\"]))\n {\n $detail['schedule'] = \\adminer\\lang('At given time');\n $detail['start'] = $event[\"Execute at\"];\n // $detail['end'] = '';\n }\n else\n {\n $detail['schedule'] = \\adminer\\lang('Every') . \" \" .\n $event[\"Interval value\"] . \" \" . $event[\"Interval field\"];\n $detail['start'] = $event[\"Starts\"];\n // $detail['end'] = '';\n }\n $details[] = $detail;\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "public function index() {\n\t\t$this->load->helper('date');\n\t\t$data['events'] = $this->event_model->get();\n\t\tfor($iii = 0; $iii < sizeof($data['events']); $iii++) {\n\t\t\t$event_info = $this->event_info_model->get_event($data['events'][$iii]['event_id']);\n\t\t\t$data['events'][$iii]['info'] = $event_info;\n\t\t\tif($event_info != NULL) {\n\t\t\t\t$data['events'][$iii]['account'] = $this->account_model->get($event_info->event_accounts_account_id);\n\t\t\t} else {\n\t\t\t\t$data['events'][$iii]['account'] = NULL;\n\t\t\t}\n\t\t}\n\n\t\t$data['content'] = 'events/index';\n\t\t$data['stylesheets'] = 'events/index_stylesheets';\n\t\t$data['scripts'] = 'events/index_scripts';\n\t\t$data['title'] = 'Events';\n\t\t$data['sub_title'] = 'The page for the events';\n\t\t$this->load->view($this->layout, $data);\n\t}", "public function actionIndex()\n {\n // Set Menu Collapse\n #$session = Yii::$app->session;\n #$session->set('collapse', 'sidebar-collapse');\n // \\.Set Menu Collapse\n\n\n $searchModel = new EventSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->orderBy(['order_date' => SORT_DESC]);\n $dataProvider->query->andWhere([\"comp_id\" => Yii::$app->session->get('Rules')['comp_id']]);\n $dataProvider->pagination->pageSize=10;\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\r\n {\r\n $events = Evento::orderBy('fecha', 'desc')\r\n ->paginate(20);\r\n \r\n return view('events/index')\r\n ->with('events', $events);\r\n }" ]
[ "0.77450883", "0.7733477", "0.7713843", "0.767619", "0.74362737", "0.72278905", "0.7187115", "0.71243876", "0.7094248", "0.7068907", "0.70083624", "0.69831514", "0.6962089", "0.6957023", "0.69384605", "0.6919972", "0.69112074", "0.689187", "0.6839851", "0.68231994", "0.6814981", "0.68067354", "0.679041", "0.6786644", "0.678324", "0.675457", "0.6751044", "0.675089", "0.6749704", "0.67410916", "0.6740192", "0.67171603", "0.6716273", "0.67100763", "0.67041516", "0.67002606", "0.66851544", "0.6678805", "0.66698116", "0.6668756", "0.66678095", "0.6666401", "0.6660896", "0.6655155", "0.6648759", "0.6647693", "0.66433734", "0.6637661", "0.66344285", "0.66336775", "0.6621631", "0.66206145", "0.6609308", "0.65973455", "0.6596542", "0.658969", "0.65886396", "0.65672874", "0.6566795", "0.6561912", "0.65530246", "0.654824", "0.65462834", "0.65407544", "0.6526981", "0.6517362", "0.6516439", "0.6515387", "0.6505161", "0.64797467", "0.64740443", "0.6448441", "0.6443574", "0.6438551", "0.6432749", "0.6432749", "0.6431831", "0.64196116", "0.64148396", "0.64124125", "0.6409387", "0.64055216", "0.6391099", "0.6387718", "0.63861406", "0.63747376", "0.63734686", "0.63709545", "0.6365995", "0.6363517", "0.6360074", "0.63596505", "0.6358324", "0.6346678", "0.63405806", "0.63399625", "0.6337509", "0.6333447", "0.6327876", "0.63254565" ]
0.6794318
22
Load Goa party from goabase api
public function actionLoadgoaparty($id){ $goaBaseApi = new GoaBaseApi(); $goaParty = $goaBaseApi->getParty($id); return $this->render('goaparty', ['party' => $goaParty]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function partyByName($party_name)\n {\n // ASCII = english name\n // UTF-8 = greek name\n if (mb_detect_encoding($party_name) == 'ASCII') {\n $party = Party::where('fullname_en', '=', $party_name)->first();\n } else if (mb_detect_encoding($party_name) == 'UTF-8') {\n $party = Party::where('fullname_el', '=', $party_name)->first();\n }\n \n return $this->apiHelper::returnResource('Party', $party);\n }", "public function load() { }", "public function LoadForReferens(){\n\n $client = new Client([\n 'base_uri' => 'https://geonode.wfp.org/geoserver/',\n ]);\n\n\n $reponse = $client->request('GET','wfs?srsName=EPSG%3A4326&typename=geonode%3Awld_trs_ports_wfp&outputFormat=json&version=1.0.0&service=WFS&request=GetFeature');\n $data= json_decode($reponse->getBody()->getContents(),true);\n\n foreach($data['features'] as $features){\n\n\n if($features['properties']['code'] == null){\n // echo null;\n }\n else{\n echo $features['properties']['portname'].'<br>';\n\n DB::table('maersk_cities')\n ->where('cityName', $features['properties']['portname'])\n ->update(['code' =>$features['properties']['code']]);\n\n }\n }\n\n }", "public function partyById($party_id)\n {\n $party = Party::findorfail($party_id);\n\n return $this->apiHelper::returnResource('Party', $party);\n }", "public function searchPartyByName($party_name) \n {\n // UTF-8 = greek name\n if (mb_detect_encoding($party_name) == 'ASCII') {\n $party = Party::where('fullname_en', 'like', '%'.$party_name.'%')->first();\n } else if (mb_detect_encoding($party_name) == 'UTF-8') {\n $party = Party::where('fullname_el', 'like', '%'.$party_name.'%')->first();\n }\n \n return $this->apiHelper::returnResource('Party', $party);\n }", "function load_gasto()\n {\n $response = $this->get('gastos/1/show')\n ->assertStatus(200);\n }", "function load_field($field) {\n if (($countries = get_transient('acf_cities_countries')) === false) {\n $url = 'http://api.londrinaweb.com.br/PUC/Paisesv2/0/1000';\n\n $response = wp_remote_get($url);\n\n // Return nothing if the request returns an error\n if (!is_wp_error($response)) {\n $body = wp_remote_retrieve_body($response);\n $data = json_decode($body);\n $countries = $data;\n\n set_transient('acf_cities_countries', $countries, 10 * MINUTE_IN_SECONDS);\n }\n }\n\n $field['countries'] = $countries;\n return $field;\n }", "function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}", "public function index()\n {\n //check if cache is set or not ($key,$seperator,$current_page,$no_pagination_var,$before_page,$isPagination)\n //CacheExpiration::checkCache('parties',false,0,0,0,false);\n\n // Get parties\n $parties = Cache::rememberForever('parties', function() {\n return Party::orderBy('fullname_el', 'asc')->get();\n });\n \n return $this->apiHelper::returnResource('Party', $parties);\n }", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function getGaid();", "function public_load() {\n\n\t}", "function queryElections() {\n $data = file_get_contents(sprintf(ELECTIONS_API, API_KEY));\n return $data;\n}", "public function load($uuid, $webspaceKey, $languageCode, $loadGhostContent = false);", "protected abstract function loadAvailableAds();", "function rest_api_loaded()\n {\n }", "function getGalley($id) {\n\t\t$galleyDao = \\DAORegistry::getDAO('ArticleGalleyDAO');\n\t\t$galley = $galleyDao->getGalley($id);\n\t\tif (method_exists($galley, 'getArticleId')) {\n\t\t\t$this->registerGalleys($galley, $galley->getArticleId());\n\t\t} else {\n\t\t\t$this->log->log(\"could not get galley nr \" . $id);\n\t\t}\n\t}", "public static function load()\n {\n\n // guard to check whether to init the rest api\n if (false === strpos(($_ENV['SCHEDULE_BUILDER_API'] ?? ''), 'locations')) {\n return;\n }\n\n\n add_action('rest_api_init', function () {\n // an instance of this endpoint\n $endpoint = new LocationEndpoint();\n\n register_rest_route('/schedule-builder/', '/locations', [\n 'methods' => 'GET',\n 'callback' => [$endpoint, 'findAllLocations']\n ]);\n });\n\n }", "private function load_mailchimp_api() {\n\t\t\n\t\t//Init vars\n\t\t$api_file_name \t= $this->api_file_name;\n\t\t$api_file_path\t= dirname(__FILE__) . \"/includes/{$api_file_name}\";\n\t\t\n\t\tif( file_exists($api_file_path) ) {\n\t\t\tinclude_once($api_file_path);\n\t\t}\n\t\t\n\t}", "function get_provinsi(){\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => \"http://api.rajaongkir.com/starter/province?id=12\",\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_ENCODING => \"\",\n\t\t\tCURLOPT_MAXREDIRS => 10,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"key: 8f22875183c8c65879ef1ed0615d3371\"\n\t\t\t\t),\n\t\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\t$err = curl_error($curl);\n\n\t\tcurl_close($curl);\n\n\t\tif ($err) {\n\t\t\techo \"cURL Error #:\" . $err;\n\t\t} else {\n\t\t\techo $response;\n\t\t}\n\t}", "private function get_vendor_api() {\n\n\t\t// Try to get the response from cache.\n\t\t$transient_name = 'fusion_l10n_api_' . sanitize_key( $this->slug );\n\t\t$results = get_site_transient( $transient_name );\n\n\t\t// If the cache is not populated or expired, get the data.\n\t\tif ( ! $results ) {\n\t\t\t$api_url = \"{$this->api_url}/api-{$this->slug}.json\";\n\n\t\t\t// Get the server response.\n\t\t\t$response = wp_remote_get( $api_url );\n\n\t\t\t// Make sure the response was OK and we have a body.\n\t\t\tif ( ! is_wp_error( $response ) && isset( $response['body'] ) ) {\n\n\t\t\t\t// JSON-decode the response's body.\n\t\t\t\t$results = json_decode( $response['body'], true );\n\n\t\t\t\t// Set cache for a day.\n\t\t\t\tset_site_transient( $transient_name, $results, DAY_IN_SECONDS );\n\t\t\t}\n\t\t}\n\n\t\t// Sanity check: If results is an array return them.\n\t\tif ( is_array( $results ) ) {\n\t\t\treturn $results;\n\t\t}\n\n\t\t// Fallback to returning false.\n\t\treturn false;\n\t}", "public function load()\n {\n }", "public function load()\n {\n }", "function permly_api($api_key=''){\n\t\t$this->api_key = $api_key;\n\t\t$this->url = $this->api_server_protocol.\"://\".$this->api_server.\"/?remote_service=rs_external_api&key=1&interface=eai_permly&version=\".$this->api_version;\n\t}", "public function loadTheInstance();", "public function woo_slg_load_vk() {\n\t\t\t\n\t\t\tglobal $woo_slg_options;\n\t\t\t\n\t\t\t//vk declaration\n\t\t\tif( !empty( $woo_slg_options['woo_slg_enable_vk'] ) && !empty( $woo_slg_options['woo_slg_vk_app_secret'] ) \n\t\t\t\t&& !empty( $woo_slg_options['woo_slg_vk_app_id'] ) ) {\n\t\t\t\n\t\t\t\t// loads the class\n\t\t\t\trequire_once ( WOO_SLG_SOCIAL_LIB_DIR . '/vk/classes/VkPhpSdk.php' ); \n\t\t\t\trequire_once ( WOO_SLG_SOCIAL_LIB_DIR . '/vk/classes/Oauth2Proxy.php' );\n\n\t\t\t\t// filter for VK application scope\n\t\t\t\t$vk_scope = apply_filters( 'woo_slg_vk_access_scope', 'email,photos,offline,friends,audio,video'); \t\t\t\t\t\n\t\t\t\t\n\t\t\t // VK Object\n\t\t\t $this->vk = new Oauth2Proxy(\n\t\t\t\t\t\t\t\t WOO_SLG_VK_APP_ID, // app id\n\t\t\t\t\t\t\t\t WOO_SLG_VK_APP_SECRET, // app secret\n\t\t\t\t\t\t\t\t 'https://oauth.vk.com/access_token', // access token url\n\t\t\t\t\t\t\t\t 'https://oauth.vk.com/authorize', // dialog uri\n\t\t\t\t\t\t\t\t 'code', // response type\n\t\t\t\t\t\t\t\t WOO_SLG_VK_REDIRECT_URL, // redirect url\n\t\t\t\t\t\t\t\t\t$vk_scope\n\t\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\treturn true;\t\n\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t}", "public function load($sessionID, $audience);", "public function _loadRealInstance() {}", "public function callAPI($partnerID,$key,$companyName,$ip){\n\t\ttry {\n\t\t\t$api = \"http://api.glassdoor.com/api/api.htm?v=1&format=json&t.p=\".$partnerID.\"&t.k=\".$key.\"&action=employers&q=\".$companyName.\"&userip=\".\"&useragent=Mozilla/%2F4.0\";\n\t\t\t$response = file_get_contents($api);\n\t\t\t$response = json_decode($response,true);\n\t\t\treturn $response;\n\t\t} catch (Exception $e) {\n\t\t\terror_log($e->getMessage(),3,\"/var/tmp/error.log\");\n\t\t\terror_log(\"\\n\");\n\t\t}\n\t}", "public abstract function load();", "public static function load() {\n self::initialLoad();\n self::vendor();\n self::loadLibs();\n //registra o SLP AUTO LOAD\n spl_autoload_register(array('\\wow\\Loader','autLoad'));\n }", "public function loadByUrl($url);", "public function getApi();", "public function getApi();", "public function getApi();", "public function show(party $party)\n {\n //\n }", "function load(){\n $sql = 'SELECT * FROM worlds where id=?';\n $w = $this->app['db']->fetchAssoc($sql, array($this->id));\n if(!$w){ \n return false;\n }\n $this->name = $w['name'];\n $this->world = $w['world_json'];\n return true;\n }", "function my_acf_google_map_api( $api ){\n\t\n $api['key'] = 'AIzaSyDJZT6rmdKIiev1YgfKkEeKKJ4UJDJzwhE';\n \n return $api;\n \n}", "public function fromAPI($data);", "public function manually_load_api() {\n\t\tif ( ! class_exists( 'WP_JSON_Server' ) ) {\n\t\t\tadd_filter( 'json_url', 'set_url_scheme' );\n\n\t\t\trequire( dirname( __FILE__ ) . '/../vendor/wp-api/wp-api/plugin.php' );\n\n\t\t\tadd_action( 'wp_json_server_before_serve', array( $this, 'api_init' ) );\n\t\t}\n\t}", "function EDD_Taxamo_EDD_Integration_load() {\n if ( ! class_exists( 'Easy_Digital_Downloads' ) ) {\n if ( ! class_exists( 'EDD_Extension_Activation' ) ) {\n require_once 'includes/class.extension-activation.php';\n }\n\n $activation = new EDD_Extension_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) );\n $activation = $activation->run();\n return EDD_Taxamo_EDD_Integration::instance();\n } else {\n return EDD_Taxamo_EDD_Integration::instance();\n }\n }", "protected function is_api_loaded()\n {\n }", "public function __load();", "public function load(): void;", "public function load(): void;", "function my_acf_google_map_api( $api ){\n\t\n\t$api['key'] = 'AIzaSyDBg7JakMFZ9desjEHnoPJHpm2GEtmYN-E';\n\t\n\treturn $api;\n\t\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 requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "public function init()\n {\n try {\n $id = $this->getIdOrName();\n $client = KongClient::getInstance();\n $res = $client->getService($id);\n dd($res);\n } catch (\\Exception $e) {\n dump($e->getMessage());\n }\n }", "function _gizra_access_strongarm() {\n $export = array();\n $strongarm = new stdClass;\n $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */\n $strongarm->api_version = 1;\n $strongarm->name = 'content_profile_use_profile';\n $strongarm->value = 1;\n\n $export['content_profile_use_profile'] = $strongarm;\n return $export;\n}", "public function index()\n {\n //\n $resultado = Party::all();\n \n return response()->json([\n 'success' => true,\n 'data' => $resultado\n ], 200);\n\n }", "function externalapis()\n\n {\n //get usd rate\n\n\n //koinok value\n $koinok = koinokapi();\n\n //idex\n $idex = idexapi();\n\n //mercatox\n $mercatox = mercatoxapi();\n\n //etherflyer\n $etherflyer = etherflyerapi();\n\n //bancor\n $bancor = bancorapi();\n// echo json_encode($koinok);\n\n $result = array('IDEX'=>$idex,'KOINOK'=>$koinok,'MERCATOX'=>$mercatox,'ETHERFLYER'=>$etherflyer,'BANCOR'=>$bancor);\n echo json_encode($result);\n\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "function wpcom_rest_api_v2_load_plugin( $class_name ) {\n\tglobal $wpcom_rest_api_v2_plugins;\n\n\tif ( ! isset( $wpcom_rest_api_v2_plugins ) ) {\n\t\t$_GLOBALS['wpcom_rest_api_v2_plugins'] = $wpcom_rest_api_v2_plugins = array();\n\t}\n\n\tif ( ! isset( $wpcom_rest_api_v2_plugins[ $class_name ] ) ) {\n\t\t$wpcom_rest_api_v2_plugins[ $class_name ] = new $class_name;\n\t}\n}", "public function video()\n {\n\n\n $ip = \\Request::ip();\n\n\n\n $details = @json_decode(file_get_contents(\n \"http://www.geoplugin.net/json.gp?ip=\" . $ip));\n\n if(!empty($details)){\n\n $county =$details->geoplugin_countryCode;\n\n if ($county == 'BD') {\n $api = get_bd_api();\n } else {\n $api= get_api();\n }\n } else {\n $api= get_api();\n }\n \n\n\n return response()->json($api);\n\n }", "abstract function getPairsFromAPI();", "function load() {\n\n\t}", "public function load() {\n $response = Gallery3_Helper::request(\"get\", $this->url, $this->token);\n $this->data = $response;\n $this->original_entity = isset($response->entity) ? (array)$response->entity : null;\n return $this;\n }", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "function get_data_from_oembed($_url) {\n\n $data0 = file_get_contents($_url);\n $data = json_decode($data0, true);\n\n return $data;\n}", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "public static function get_user_party($user_id){\n $user_party = array();\n $user = get_user_by('id', $user_id);\n if($user)\n $user_party = EntityAPI::get_by_field('party', 'user_name', $user->user_login);\n return $user_party;\n }", "public function getCampus(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/campus/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$campus = json_decode($output, true);\n\n\t\treturn $campus;\n\t}", "public function init()\n {\n try {\n if (!defined('ITEMBASE_PLUGIN_BUILD')) {\n throw new \\Exception(\"No build key is set!\");\n }\n\n if (!defined('ITEMBASE_PLUGIN_SERVICE')) {\n define('ITEMBASE_PLUGIN_SERVICE', self::PLUGIN_SERVER_URL);\n }\n\n try {\n $httpClient = new HttpClient();\n $response = $httpClient->sendData(ITEMBASE_PLUGIN_SERVICE . '/builds/' . ITEMBASE_PLUGIN_BUILD);\n $response = json_decode($response, true);\n\n if (empty($response)) {\n throw new \\Exception(\"No configuration data is available for the plugin!\");\n }\n\n if (!empty($response['constants'])) {\n foreach ($response['constants'] as $constant => $value) {\n if (!defined($constant)) {\n define('ITEMBASE_' . strtoupper($constant), $value);\n }\n }\n }\n\n if (!empty($response['client_id']) && !defined('ITEMBASE_BRANDED_ID')) {\n define('ITEMBASE_BRANDED_ID', $response['client_id']);\n }\n } catch (\\Exception $ex) {\n define('ITEMBASE_OAUTH_SERVER_URL', self::OAUTH_SERVER_URL);\n }\n\n if (!defined('ITEMBASE_VENDOR_DIR')) {\n // according to composer (and PSR-4) folder structure vendor dir is the 6th level from current file\n define('ITEMBASE_VENDOR_DIR', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));\n }\n\n $extensionLoader = new ExtensionsLoader($this->serviceContainer);\n $extensionLoader->loadExtensions();\n\n $this->eventDispatcher->initAwareServices();\n\n $this->serviceContainer->verifyServices(array(\n array(self::SERVICE_STORAGE => 'Itembase\\Psdk\\Platform\\StorageInterface'),\n array(self::SERVICE_MULTISHOP => 'Itembase\\Psdk\\Platform\\MultiShop\\MultishopAbstract'),\n array(self::SERVICE_PLATFORM => 'Itembase\\Psdk\\Platform\\PlatformInterface')\n ));\n\n // adding ping service to handle ping request\n $pingService = new PingHandler();\n $this->serviceContainer->bindService($pingService->getExtensionName(), $pingService);\n\n // we are ready to go\n $this->eventDispatcher->dispatch(self::EVENT_INITIALIZED);\n } catch (\\Exception $ex) {\n $this->logger->log(Logger::IB_LOG_ERR, $ex);\n\n $this->eventDispatcher->dispatch(self::EVENT_EXCEPTION, $ex);\n $this->httpHandler->sendResponses();\n exit;\n }\n\n return $this;\n }", "abstract protected function loadDiscoveryFromStorage(EditableDiscovery $discovery, array $initializers = array());", "protected function loadCountry()\n {\n $country = Country::findOne([\n 'code' => 'es'\n ]);\n $this->countryId = $country->id;\n }", "private function dc_load_dependencies() {\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'includes/dc_class_loader_dorancafe.php';\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'admin/dc_class_admin_dorancafe.php';\n\t\t// public class and functions\n\t\trequire_once DORANCAFE_PATH . 'public/dc_class_public_dorancafe.php';\n\n\t\t$this->loader = new Dorancafe_Loader();\n\t}", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "function bpGetInvoice($invoiceId, $apiKey=false) {\r\n\t\r\n}", "public function load()\n {\n Registry::getPostgres()->transactional(function ($postgres) {\n $majorApiConfig = Registry::getMajorApiConfig();\n\n // Purges the database.\n $postgres->createQueryBuilder()\n ->delete('web_account')\n ->execute();\n\n // Create a new Account entity.\n $account = [\n 'created' => Registry::getTimeString(),\n 'updated' => Registry::getTimeString(),\n 'status' => Registry::STATUS_ENABLED,\n 'email' => $majorApiConfig['test_account_email'],\n 'password_hash' => $majorApiConfig['test_account_password'],\n 'first_name' => 'Vic',\n 'last_name' => 'Cherubini',\n 'role' => 'ROLE_ACCOUNT'\n ];\n\n $postgres->insert('web_account', $account);\n $accountId = $postgres->lastInsertId('web_account_id_seq');\n\n // Create a new Application entity.\n $application = [\n 'created' => Registry::getTimeString(),\n 'updated' => Registry::getTimeString(),\n 'status' => Registry::STATUS_ENABLED,\n 'account_id' => $accountId,\n 'name' => $majorApiConfig['test_application_username'],\n 'username' => $majorApiConfig['test_application_username'],\n 'api_key' => uniqid(),\n 'quickbooks_token' => uniqid()\n ];\n\n $postgres->insert('web_application', $application);\n $applicationId = $postgres->lastInsertId('web_application_id_seq');\n });\n\n return true;\n }", "public static function get_party_user($party_id){\n $user_data = array();\n $party_data = EntityAPI::get_by_id('party', $party_id); \n \n if(isset($party_data['id'])){ \n $user = get_user_by('login', $party_data['user_name']); \n if($user){\n $user_data['id'] = $user->ID;\n $user_data['user_pass'] = $user->user_pass;\n $user_data['last_name'] = $user->last_name;\n $user_data['first_name'] = $user->first_name;\n $user_data['user_name'] = $user->user_login;\n $user_data['user_login'] = $user->user_login;\n }\n }\n return $user_data;\n }", "function aurum_get_google_api() {\n\treturn apply_filters( 'aurum_google_api_key', get_data( 'google_maps_api' ) );\n}", "abstract public function load();", "abstract public function load();", "function getBOCAccount($accountid = 'a746637b91b19a261a67d8bd') {\n\t//bankid bda8eb884efcef7082792d45\n\t//accountid a746637b91b19a261a67d8bd\n\t//viewid 5710bba5d42604e4072d1e92\n\t//\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\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t\t\t 'Auth-Provider-Name: 01460900080600',\n\t\t\t\t\t\t\t 'Auth-ID: 123456789',\n\t\t\t\t\t\t\t 'Ocp-Apim-Subscription-Key: f1817e51b3fb4d2ca3fc279d0df3a061'\n\t\t\t\t\t\t\t ),\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"http://api.bocapi.net/v1/api/banks/bda8eb884efcef7082792d45/accounts/$accountid/5710bba5d42604e4072d1e92/account\",\n\t // CURLOPT_URL => \"192.168.88.202:8080/customer/$custId/goals\",\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}", "public function load(Request $request)\r\n\t{\r\n $req = $request::instance();\r\n $data = json_decode($req->getContent());\r\n \r\n $levelid = 0;\r\n $order = \"id\";\r\n $direction = \"desc\";\r\n //exit;\r\n foreach($data as $item)\r\n {\r\n if(isset($item->levelid))\r\n $levelid = $item->levelid;\r\n \r\n \r\n }\r\n \r\n $query = GALevelAssociate::orderBy($order, $direction);\r\n \r\n \r\n if ($levelid > 0)\r\n $query->where('levelid', $levelid);\r\n \r\n \r\n $data = $query->get();\r\n \r\n return Response::json(['status' => 200, 'Records' => $data]);\r\n\t}", "function load()\n {\n }", "function load()\n { \n $sql = \"SELECT `id`,\n `skype_name`\n FROM `\".$this->tblSkypeCourse.\"`\n WHERE `course_id` = '\".addslashes($this->course_id).\"'\";\n\n $data = claro_sql_query_get_single_row($sql);\n\n if( !empty($data) )\n {\n $this->id = $data['id'];\n $this->skype_name = $data['skype_name'];\n\n return true;\n }\n else\n {\n return false;\n }\n }", "public function get_api( $name ) {\n\t\tswitch ( $name ) {\n\t\t\tcase 'username':\n\t\t\t\tif ( defined( 'EDGENET_PROD_USERNAME' ) ) {\n\t\t\t\t\treturn EDGENET_PROD_USERNAME;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'secret':\n\t\t\t\tif ( defined( 'EDGENET_PROD_SECRET' ) ) {\n\t\t\t\t\treturn EDGENET_PROD_SECRET;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'data_owner':\n\t\t\t\tif ( defined( 'EDGENET_DATA_OWNER' ) ) {\n\t\t\t\t\treturn EDGENET_DATA_OWNER;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'recipient':\n\t\t\t\tif ( defined( 'EDGENET_RECIPIENT' ) ) {\n\t\t\t\t\treturn EDGENET_RECIPIENT;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'requirement_set':\n\t\t\t\tif ( defined( 'EDGENET_REQUIREMENT_SET' ) ) {\n\t\t\t\t\treturn EDGENET_REQUIREMENT_SET;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'taxonomy_id':\n\t\t\t\tif ( defined( 'EDGENET_TAXONOMY_ID' ) ) {\n\t\t\t\t\treturn EDGENET_TAXONOMY_ID;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( isset( $this->api[ $name ] ) ) {\n\t\t\treturn $this->api[ $name ];\n\t\t}\n\n\t\treturn null;\n\t}", "function block_editor_rest_api_preload(array $preload_paths, $block_editor_context)\n {\n }", "function aurum_google_api_key_acf() {\n\t$api = array(\n\t\t'libraries' => 'places',\n\t\t'key' => aurum_get_google_api(),\n\t);\n\n\treturn $api;\n}" ]
[ "0.5505238", "0.5182065", "0.5158959", "0.51213515", "0.5101965", "0.4982141", "0.49760327", "0.49708676", "0.49707845", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49644774", "0.49612278", "0.49591187", "0.49335265", "0.4931071", "0.49272045", "0.49205348", "0.48998803", "0.48865712", "0.48767444", "0.48664796", "0.48613477", "0.48538902", "0.48538902", "0.48533154", "0.48507872", "0.48473153", "0.48297235", "0.48261443", "0.482505", "0.4821535", "0.48172688", "0.48154357", "0.48125184", "0.48125184", "0.48125184", "0.4807902", "0.4805469", "0.4799897", "0.4780824", "0.4775415", "0.4771972", "0.47645536", "0.47620028", "0.4749094", "0.4749094", "0.4747205", "0.47291777", "0.47271344", "0.4719025", "0.47150645", "0.47142327", "0.47051966", "0.47034267", "0.47034267", "0.47034267", "0.470302", "0.47008923", "0.4692257", "0.46921173", "0.46871546", "0.46622914", "0.46526214", "0.46525675", "0.46525675", "0.46525675", "0.46525675", "0.462611", "0.462263", "0.46143976", "0.46093926", "0.46031535", "0.46004897", "0.4598609", "0.45933098", "0.4591283", "0.45877224", "0.4586487", "0.45801586", "0.45761085", "0.45741168", "0.45741168", "0.4566905", "0.45668155", "0.45597112", "0.45571038", "0.455259", "0.45477217", "0.45475918" ]
0.5724518
0
Displays a single Event model.
public function actionView($id) { $model = $this->findModel($id); $socialMediaModels = SocialMedia::find()->where(['event_id' => $id])->orderBy('id')->all(); ++$model->clicks; $model->update(); // make "linked" link for hashtags foreach ($socialMediaModels as $socialMediaModel) { if ($socialMediaModel->site_name == 'twitter') { $url_regex = '/(http|https)?:?(\/\/)?(w*\.)?twitter\.com\/hashtag\/[a-zA-Z0-9\_\-]*\?src=hash/'; $user_regex = '/(\@)[a-zA-Z0-9\_\-]*/'; if (!preg_match($url_regex, $socialMediaModel->url)) { if (preg_match($user_regex, $socialMediaModel->url)) { $socialMediaModel->url = preg_replace( '/\@(\w+)/i', 'https://twitter.com/$1', $socialMediaModel->url); } else { $socialMediaModel->url = preg_replace( '/#?(\w+)/i', 'https://twitter.com/hashtag/$1?src=hash', $socialMediaModel->url); } } } } return $this->render('view', [ 'model' => $model, 'socialmedia' => Yii::$app->cache->get('socialmedia' . $id), 'socialMediaModels' => $socialMediaModels, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function show(Event $event)\n {\n echo view('event.show',['event'=>$event]);exit;\n }", "public function showAction(Event $event)\n {\n $deleteForm = $this->createDeleteForm($event);\n\n return $this->render('event/show.html.twig', array(\n 'event' => $event,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction(Event $event)\n {\n $deleteForm = $this->createDeleteForm($event);\n\n return $this->render('event/show.html.twig', array(\n 'event' => $event,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Event $event)\n {\n \n }", "public function show(Event $event)\n {\n //\n }", "public function show(Event $event)\n {\n //\n }", "public function show(Event $event)\n {\n //\n }", "public function show()\n {\n return view('events::show');\n }", "function single_event_view($event_id)\n\t\t{\n\t\t\t// call the calendar model\n\t\t\t$event_data = $this->calendar->get_single_event($event_id);\n\t\t\t\n\t\t\t$veiw_data['event'] = $event_data[0];\n\t\t\t\n\t\t\t//load the view for the single event with data\n\t\t\t$this->load->view('single_event', $veiw_data);\n\t\t}", "public function show(Event $event)\n {\n return view('event.show',compact('event'));\n }", "public function show(Events $events)\n {\n //\n }", "public function show($id)\n {\n $e = Event::find($id);\n return view('admin.events.show' , compact('e'));\n }", "public function show($id)\n {\n $event = $this->eventRepository->findById($id);\n return view('admin.event.view',compact('event'));\n }", "public function show(Event $event)\n { \n \n //$event = Event::where('slug',$slug )->firstOrFail();\n return view('events.show',compact('event'));\n }", "public function show(Event $event)\n {\n return view('events::show_event',compact('event'));\n }", "public function show(Event $event)\n {\n return view('events.show', compact('event'));\n }", "public function show(Event $event)\n {\n return view(\"admin.event_show\")->with([\n \"event\" => $event\n ]);\n }", "public function show($id)\r\n {\r\n // input the event\r\n $event = Evento::findOrFail($id);\r\n\r\n // show the view and pass the event to it\r\n return view('events.show')\r\n ->with('event', $event);\r\n }", "public function show(Event $event)\n {\n if(auth()->user()->isAdmin())\n {\n return view('events.show', compact('event'));\n }else{\n return redirect()->back();\n }\n \n }", "public function show(Event $event)\n {\n\n $banner = array(\n 'title' => '',\n 'subtitle' => 'Dont forget to replace me later',\n );\n\n $programs = $event->programs;\n\n return view('events.show', compact('event', 'banner', 'programs'));\n }", "public function show($id)\n {\n $event = Event::where('id', $id)->first();\n return view('event.show', compact('event'));\n }", "public function show($id)\n\t{\n\t\t$event = Event::findOrFail($id);\n\n\t\treturn view('events.show', compact('event'));\n\t}", "public function show($id)\n {\n $event = Event::where('idEvent', $id)->first();\n return view('showEvent')->with(compact('event'));\n }", "public function show(events $events)\n {\n //\n }", "public function show($id)\n {\n return view('event::show');\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('HospiceSiteBundle:Event')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Event entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('HospiceSiteBundle:Event:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function show(Event $event)\n {\n return view('show', [\n 'event' => $event\n ]);\n }", "public function action_detail()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n $get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t//return Response::forge(View::forge('event/detail',$data));\n\t\t$this->template->title = \"イベント詳細\";\n\t\t$this->template->content = View::forge('event/detail', $data);\n\t}", "public function event(){\n \t\n \t\t return view('event.event');\n }", "public function event()\n {\n return view('profile.event');\n }", "public function show($id)\n {\n $event = Event::find($id);\n\n return view('event.show', compact('event'));\n }", "public function show($id)\n {\n $event = Event::findOrFail($id);\n return view('events.show', compact('event'));\n }", "public function index(Event $event)\n {\n $items = $event->all();\n\n return view('admin.event.index', compact('items'));\n }", "public function indexAction() {\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t$limit =$this->_getParam('max',5);\n\t\t$currentDay = date('Y') . '-' . date('m') . '-' . date('d');\n\t\t\n\t\t$table = Engine_Api::_()->getItemTable('event');\n\t\t$select = $table->select()\n ->where('category_id = ?', $event->category_id)\n ->where('event_id != ?', $event->getIdentity())\n ->order(\"DATEDIFF('{$currentDay}', starttime) DESC\")\n ->limit($limit);\n\n\t\t$showedEvents = $table->fetchAll($select);\n\t\t$this->view->showedEvents = $showedEvents;\n\t\t// Hide if nothing to show\n\t\tif( count($showedEvents) <= 0 ) {\n\t return $this->setNoRender();\n\t }\n }", "public function show(Evento $evento)\n {\n //\n }", "public function ViewAsPage() {\n $this->getResponse()->removeHeader(\"X-Robots-Tag\");\n\n // Include CSS\n Requirements::css('event-management/dist/layout.min.css');\n\n $timestamp = (string)$this->getRequest()->param(\"InstanceTimestamp\");\n\n $eid = (int)$this->getRequest()->param(\"EventID\");\n $event = DataObject::get('Event')->byId($eid);\n if(!is_object($event) || !$event->exists()) {\n $this->getResponse()->setStatusCode(404);\n return $this->customise(\n array(\n \"getTitle\" => \"Event ID #\" . $eid . \" Not Found!\"\n )\n )->renderWith(array('EventPage', 'Page'));\n }\n\n if(!empty($timestamp)) {\n $event->setInstanceDateTimes($timestamp);\n }\n\n return $this->customise(\n array(\n \"Event\" => $event\n )\n )->renderWith(array('EventPage', 'Page'));\n\n }", "public function show(Event $event)\n {\n $this->authorize('view', $event);\n $event = $this->eventRepo->show($event->id);\n return Response::success(new EventResource($event));\n }", "public function actionEventDetails($event) {\n $baner_image = \\common\\models\\BanerImages::findOne(1);\n $event_details = \\common\\models\\NewsEvents::find()->where(['canonical_name' => $event])->one();\n $events = \\common\\models\\NewsEvents::find()->where(['status' => 1])->andWhere(['!=', 'id', $event_details->id])->limit(10)->all();\n \\Yii::$app->view->registerMetaTag(['name' => 'keywords', 'content' => $event_details->meta_keyword]);\n \\Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $event_details->meta_description]);\n return $this->render('news_detail', [\n 'event_details' => $event_details,\n 'baner_image' => $baner_image,\n 'events' => $events,\n ]);\n }", "public function index()\n {\n $events = $this->eventRepository->all();\n return view('admin.event.index',compact('events'));\n }", "public function show($id)\n {\n $event = Event::findOrFail($id);\n\n return view('/events.show', compact('event'));\n }", "public function show(Event $event)\n { \n $this->authorize('showApproved', $event);\n $category = Category::find($event->category_id);\n\n return view('events.show', [\n 'event' => $event,\n 'category' => $category,\n 'organizer' => Organizer::find($event->organizer_id),\n 'similarEvents' => Event::SimilarCity($event)->UniqueCity($event)->inRandomOrder()->limit(3)->get(),\n ]);\n }", "public function index()\n {\n $e = Event::all();\n return view('admin.events.index' , compact('e'));\n }", "public function showAction(CalendarEvent $event)\n {\n $deleteForm = $this->createDeleteForm($event);\n\n return $this->render('MALrmBundle:event:show.html.twig', array(\n 'event' => $event,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(evento $evento)\n {\n //\n }", "public function eventsAction()\n {\n $events = $this->manager->getRepository('Event\\Doctrine\\Orm\\Event')->findBy(array(), array('date' => 'ASC'));\n\n return $this->renderView('events', array(\n 'title' => 'Zusammenfassung der Grillveranstaltungen',\n 'events' => $events,\n 'meals' => $this->createMealsList($events),\n ));\n }", "public function newAction()\n {\n $entity = new Event();\n $form = $this->createCreateForm($entity);\n\n return $this->render('HospiceSiteBundle:Event:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function show($id)\n {\n $events = Events::findOrFail($id);\n return view('user.event.show', compact('events'));\n }", "public function actionAbout()\n\t{\n\t\t//$model=Event::model()->find('id=?',array(User::getUserSelectedEvent()));\n\t\t$this->render('pages/about');\n\t}", "public function show(Event $event_show)\n {\n $contacts = contact::lists('fname', 'id');\n return view('events.show', compact('event_show','contacts'));\n }", "public function actionEvents()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('events');\n\t}", "public function show($id)\n {\n $event = Event::findOrFail($id);\n\n $eventOwner = User::where('id', $event->user_id)->first()->toArray();\n\n\n return view ('show' , ['event' => $event, 'eventOwner' => $eventOwner]); \n\n }", "public function actionView($id)\n\t\t{\n\t\t\tif($id)\n\t\t\t{\n\t\t\t\t$eventItem=array();\n\t\t\t\t$eventItem = Events::getEventsItemByID($id);\n\t\t\t\t$view = new View();\n\t\t\t\t$view->viewRender('EventView.html',array('root_path'=>DEV_ROOT_PATH, 'event' => $eventItem));\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function ShowEvents()\n {\n $this->ReadEvents();\n echo\n $this->H(1,$this->MyLanguage_GetMessage(\"Events_Table_Title\")).\n $this->EventsHtmlTable(),\n \"\";\n }", "public function edit() {\n $this->authorize(PermissionEnum::getInstance(PermissionEnum::EventBookingImmediate)->key, User::class);\n $events = auth()->user()->eventsToBook()->getModels();\n return view('events.my', ['events' => $events]);\n }", "public function show(Event $event)\n {\n return view('department.events.show', compact('event'));\n }", "public function displayTask()\n\t{\n\t\t// Incoming\n\t\t$ids = Request::getArray('id', array(0));\n\t\t$id = $ids[0];\n\n\t\tif (!$id)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get filters\n\t\t$filters = array(\n\t\t\t'search' => urldecode(Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.search',\n\t\t\t\t'search',\n\t\t\t\t''\n\t\t\t)),\n\t\t\t// Get sorting variables\n\t\t\t'sort' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sort',\n\t\t\t\t'filter_order',\n\t\t\t\t'registered'\n\t\t\t),\n\t\t\t'sort_Dir' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sortdir',\n\t\t\t\t'filter_order_Dir',\n\t\t\t\t'DESC'\n\t\t\t)\n\t\t);\n\n\t\t$event = Event::oneOrFail($id);\n\n\t\t$rows = $event->respondents()\n\t\t\t->order($filters['sort'], $filters['sort_Dir'])\n\t\t\t->paginated('limitstart', 'limit')\n\t\t\t->rows();\n\n\t\t// Output the HTML\n\t\t$this->view\n\t\t\t->set('event', $event)\n\t\t\t->set('rows', $rows)\n\t\t\t->set('filters', $filters)\n\t\t\t->display();\n\t}", "public function index($event_id = NULL)\r\n\t{\r\n\t\tif ($this->model('User_model')->isLoggedIn() == false) {\r\n\t\t\theader('Location:'.ROOTURL.'/signin');\r\n\t\t}\r\n\t\t//===================================================\r\n\r\n\t\tif (!isset($event_id)) {\r\n\t\t\theader('Location:'.ROOTURL);\r\n\t\t}\r\n\r\n\r\n\t\t// Get event detail from db\r\n\t\t$data['event'] = $this->model('Events_model')->getEventDetailById($event_id);\r\n\t\t// var_dump($data['event']);\r\n\r\n\t\t//====================================================\r\n\t\t$data['eventid'] = $event_id;\r\n\r\n\t\tif ($data['event']==NULL) {\r\n\t\t\t$data['title'] = 'Karcisku - Unknown Event Id';\r\n\t\t\t$this->view('template/header',$data);\r\n\t\t\t$this->view('template/navigation');\r\n\t\t\t$this->view('event/notfound',$data);\r\n\t\t\t$this->view('template/footer');\r\n\t\t}else{\r\n\t\t\t$data['title'] = 'Karcisku - Event Detail';\r\n\t\t\t$this->view('template/header',$data);\r\n\t\t\t$this->view('template/navigation');\r\n\t\t\t$this->view('event/index',$data);\r\n\t\t\t$this->view('template/footer');\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public function show($event)\n {\n $applications = ExtraForm::where('event_id', $event)->with('User', 'User.Occupation', 'Event')->get();\n\n return view('events.show', ['applications' => $applications]);\n }", "public function show($id)\n\t{\n\t\t$event = CalendarEvent::find($id);\n if(!$event) {\n Session::flash('errorMessage', \"Post with id of $id is not found\");\n App::abort(404);\n }\n Log::info(\"Event of id $id found\");\n if (Request::wantsJson()) {\n return Response::json($event);\n } \n return View::make('events.show')->with(array('event' => $event));\n // return View::make('events.show');\n\t}", "public function edit(Event $event)\n { \n // $event = Event::findOrFail($id);\n return view('events.edit',compact('event'));\n }", "public function show(Event $event)\n {\n return new EventResource($event);\n }", "public function show($id)\n\t{\n\t\t//\n\n\t\t$exhibitionevent=ExhibitionEvent::find($id);\n\n\t\t// $systemtrack=new Systemtrack;\n // $systemtrack->user_id=Auth::User()->id;\n // // $systemtrack->spot_id=$booth->spot_id;\n // $systemtrack->do=Auth::User()->name.' '.'visit'.' '.$exhibitionevent->name.' Event '.'at'.' '.date(\"Y-m-d H:i:s\");\n // $systemtrack->comein_at=date(\"Y-m-d H:i:s\");\n\n // $systemtrack->type='exhibitionevent';\n // $systemtrack->type_id=$id;\n\n // $systemtrack->save();\n\n\n\t\treturn view('exhibitionevents.show',compact('exhibitionevent'));\n\t}", "public function show(Event $evento)\n {\n\n $evento = Event::with('participants')->find($evento->id);\n return view('adm.events.show')->with(compact('evento'));\n }", "public function action_edit()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t\tthrow new HTTP_Exception_404;\r\n\t\t\r\n\t\t// Can user edit this event's details?\r\n\t\tif ( ! $this->user->can('event_edit', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.edit.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Valid csrf, etc.\r\n\t\tif ($this->valid_post())\r\n\t\t{\r\n\t\t\t// Get event data from $_POST\r\n\t\t\t$event_post = Arr::get($this->request->post(), 'event', array());\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// Save data to event object\r\n\t\t\t\t$event->edit_event($event_post);\r\n\t\t\t\t\r\n\t\t\t\tNotices::success('event.edit.success');\r\n\t\t\t\t\r\n\t\t\t\t// Display edited event\r\n\t\t\t\t$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t}\r\n\t\t\tcatch(ORM_Validation_Exception $e)\r\n\t\t\t{\r\n\t\t\t\t$this->view->errors = $e->errors('event');\r\n\t\t\t\t$this->view->values = $event_post;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->view->values = $event->as_array();\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event object to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t\t\r\n\t}", "public function show($id)\n {\n $evento = Eventos::find($id);\n return view('Eventos.show',compact('evento'));\n }", "public function show($id)\n {\n $random = Event::inRandomOrder()->limit(5)->get();\n $event = Event::where('slug',$id)->first();\n return $event ? view('event',compact('event','random')) :view('errors.404') ;\n }", "public function show($id)\n {\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $logged_user = $user->id;\n }else{\n \n $logged_user = false;\n }\n\n $FillableDropdown = new FillableDropdown();\n $accessibility = $FillableDropdown->accessibility($default = 2);\n $travel = $FillableDropdown->travel($default = 2);\n\n if(isset($id)){\n\n $event = Events::findOrFail($id);\n }\n\n// dd($event->posts[0]->created_at->toFormattedDateString());\n return view('events.event_detail_page', compact('event', 'accessibility', 'logged_user', 'travel'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('ClassBundle:Events')->findAll();\n\n return $this->render('events/index.html.twig', array(\n 'events' => $events,\n ));\n }", "public function show(Event $event)\n {\n Session::put('admin_page', 'event');\n $images = $event->gallery->images->pluck('image');\n // dd($image);\n return view('backend.events.show', compact('event', 'images'));\n }", "public function index()\n {\n $events = Event::get();\n\n return view('event.index', compact('events'));\n }", "public function show($id)\n {\n $evento = evento::findOrFail($id);\n\n return view('evento.show', compact('evento'));\n }", "public function detailEvent($id)\n {\n $event =DaftarEvent::find($id);\n\n return view('/admin/detail_event',compact('event'));\n }", "public function index()\n {\n $data['events'] = Event::orderBy('id', 'DESC')->get();\n return view(\"Event::index\", $data);\n }", "public function editevent($id)\n {\n $row=DB::table('pmodels')->where('id',$id)->first();\n $data=['info'=>$row];\n return view('editevent',$data);\n }", "public function show(Event $event)\n {\n return response()->json(['message'=>null,'data'=>$event],200);\n }", "public function index()\n {\n return view('admin.event.index');\n }", "public function index()\n {\n $events = Event::all();\n return view('indexEvent')->with(compact('events'));\n }", "public function show($id)\n {\n $programEvent = ProgramEvent::find($id);\n\n return view('program-event.show', compact('programEvent'));\n }", "public function edit(Event $event)\n {\n Session::put('admin_page', 'event');\n $galleries = Gallery::all();\n $categories = Category::all();\n return view('backend.events.edit', compact('event', 'galleries', 'categories'));\n }", "public function show(Request $request)\n\t{\n\n\t\treturn view('events/live/show', compact('event'));\n\t}", "public function edit(Event $event)\n {\n return view('events::edit_event',['event' => $event]);\n }", "public function show($id)\n {\n $eventDetails = Event::find($id);\n $inviteeDetails = Invitees::showInviteeDetails($id);\n\n //render to view\n return view('events.show')\n ->with('event', $eventDetails)\n ->with('inviteesNameList', $inviteeDetails['inviteesNameList'])\n ->with('paymentReceivedList', $inviteeDetails['paymentReceivedList'])\n ->with('attendedList', $inviteeDetails['attendedList']);\n }", "public function edit(Event $event)\n {\n //dd($events);\n // return view('events.edit',['events'=>$event]);\n \n }", "public function show($id)\n {\n $event = Event::find($id);\n $jobs = Job::orderBy('id', 'desc')->limit(5)->get();\n $events = Event::orderBy('id', 'desc')->limit(5)->get();\n $news = News::orderBy('id', 'desc')->limit(5)->get();\n\n return view('events-show', compact('event', 'news', 'jobs', 'events'));\n }", "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function index()\n {\n if(isset($_GET['search'])){\n $model = DB::table('events')\n ->where('name', 'LIKE', '%'.$_GET['search'].'%')\n ->get();\n }else{\n $model = Model::get();\n }\n\n return view('events.index')->with(array('data'=>$model, 'controller' => 'events'));\n }", "public function actionIndex()\n\t{\n\t\t$selectedEvent=User::getUserSelectedEvent();\n\t\tif ($selectedEvent!=NULL)\n\t\t{\n\t\t\t// If the user has a selected event, retrieve that event\n\t\t\t$model=Event::model()->findByPk($selectedEvent);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If the user does not have a selected event, choose the first event available\n\t\t\t$model=Event::model()->find();\n\t\t\t$user=User::model()->find('LOWER(username)=?',array(Yii::app()->user->name));\n\t\t\t$user->selectedevent=$model->id;\n\t\t\t$user->save();\n\t\t}\n\n\t\t// if there are no events, navigate back to splash screen\n\t\tif(is_null($model) || !isset($model))\n\t\t{\n\t\t\t$this->redirect('splash');\n\t\t}\n\t\telse\n\t\t$this->render('index',array('model'=>$model));\n\t}", "public function index()\n {\n $events = Event::get();\n return response()->view('admin.events.index', ['events' => $events ]);\n }", "public function show(Evolution $evolution)\n {\n //\n }", "public function show($id)\n {\n $evento = Evento::findOrFail($id);\n return view('home.verEventos',compact('evento'));\n //return view('home.entrada',compact('evento'));\n }", "public function user_event() {\n $this->loadModel('Image');\n $id = $this->Auth->user('id');\n $this->layout = 'front_end';\n $allImage = $this->Image->getAllimage($id);\n $this->set('image', $allImage);\n $data = $this->User->userData($id);\n $this->set('user', $data);\n $this->loadModel('Event');\n $event = $this->Event->eventList();\n $this->set('events', $event);\n $this->render('/Users/user_event');\n }", "public function edit(Event $event)\n {\n return view('admin.event.edit', compact('event'));\n }", "public function index()\n {\n Session::put('admin_page', 'event');\n $events = Event::all();\n return view('backend.events.index', compact('events'));\n }", "public function index()\n {\n $events = \\App\\Event::orderBy('id','DESC')->paginate(10);\n return view('admin.events.index', ['events' => $events]);\n }", "public function edit(Event $event)\n {\n return view('event.edit',compact('event'));\n }", "public function index()\n\t{\n\t\t$events = Eventadd::orderBy('date', 'asc')->get();\n return View::make('events.index', compact('events'));\n\t}", "public function index()\n {\n \n $events = Event::all();\n return view('pages.events.index')->with(compact('events'));\n }", "public function index()\n {\n $events = Event::all();\n return view('events.index',compact('events'));\n }", "public function index()\n {\n $eventList = Event::all();\n return view('backEnd.events.events',compact('eventList'));\n }", "public function index()\n {\n $events = Event::all();\n return view('event.list',['events'=>$events]);\n }" ]
[ "0.80864143", "0.7893261", "0.7711113", "0.7711113", "0.74939424", "0.74646515", "0.74646515", "0.74646515", "0.7390202", "0.7303332", "0.73020774", "0.72810096", "0.7261841", "0.72399926", "0.72249234", "0.71939045", "0.7187111", "0.7161048", "0.71340775", "0.7092115", "0.70907265", "0.70821446", "0.7076801", "0.7059604", "0.705148", "0.7036641", "0.7018039", "0.70012844", "0.69999534", "0.69981354", "0.69956994", "0.69874847", "0.69326764", "0.69148254", "0.69113266", "0.68783104", "0.6869501", "0.68459415", "0.6843114", "0.6832876", "0.68291235", "0.682597", "0.6809608", "0.67992395", "0.67907685", "0.67875344", "0.6782675", "0.6781935", "0.67800575", "0.67752147", "0.6764451", "0.67596316", "0.6749176", "0.6733111", "0.67285526", "0.67238176", "0.67183816", "0.6706122", "0.6704731", "0.67044014", "0.66495275", "0.66451794", "0.6644924", "0.66436523", "0.66400397", "0.6638397", "0.6637202", "0.6609636", "0.66013616", "0.65869117", "0.65856576", "0.6583727", "0.6571656", "0.65688217", "0.6562554", "0.65595245", "0.65508217", "0.65283906", "0.65149844", "0.65045464", "0.65018564", "0.64976025", "0.6497108", "0.64822304", "0.648102", "0.6479573", "0.6477404", "0.6476858", "0.6472519", "0.6469252", "0.6467639", "0.64674073", "0.6456357", "0.64390963", "0.6438056", "0.64345133", "0.64319247", "0.6430458", "0.6427555", "0.6425924", "0.64244497" ]
0.0
-1
Creates a new Event model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { if (Yii::$app->user->can('admin')) { throw new ForbiddenHttpException('You are not allowed to perform this action.'); } $model = new Event(); $socialMediaModels = []; $model->max_num_socialMedia = 20; $model->num_socialMedia = 1; for ($i = 0; $i < $model->max_num_socialMedia; $i++) { $socialMediaModels[] = new SocialMedia(); } $postData = Yii::$app->request->post(); if ($model->load($postData) && $model->validate() && Model::loadMultiple($socialMediaModels, $postData) && Model::validateMultiple($socialMediaModels)) { $model->user_id = Yii::$app->user->id; $model->clicks = 0; // image $image = $model->uploadImage(); if ($model->save()) { if ($image != null) { $image->saveAs($model->getImagePath()); } foreach ($socialMediaModels as $socialMediaModel) { if ($socialMediaModel->url == '') { $socialMediaModel->delete(); } else { $socialMediaModel->event_id = $model->id; try { $socialMediaModel->save(); } catch (IntegrityException $e) { throw new \InvalidArgumentException('Url/Hashtag already exists'); } } } // delete cache of this event and create new cache Yii::$app->cache->delete('socialmedia' . $model->id); $socialMediaModels = SocialMedia::find()->where(['event_id' => $model->id])->orderBy('id')->all(); $this->findSocialMedia($model->id, $socialMediaModels); return $this->redirect(['view', 'id' => $model->id]); } } else { if (strtotime($model->start_date) != 0) { $model->start_date = date('d.m.Y G:i', strtotime($model->start_date)); } if (strtotime($model->end_date) != 0) { $model->end_date = date('d.m.Y G:i', strtotime($model->end_date)); } } return $this->render('create', ['model' => $model, 'socialMediaModels' => $socialMediaModels]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Events;\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Event;\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['Event']))\n\t\t{\t\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t\n\t\t\t$model->created_on = new CDbExpression('NOW()');\n\t\t\t$model->created_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('view', 'id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Event();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', '事件<'. $model->title .'>添加成功! ');\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model->loadDefaultValues(),\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n\n\t\t$model=new Event;\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\t\t$attr = array(); \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['Event']))\n\t\t{\n\t\t if(isset($_POST['Event']['attributes']))\n\t\t {\n\t\t $attr = $_POST['Event']['attributes'];\n\t\t }\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save()) {\n\t\t\t\t$this->addAttributes($attr, $model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t\t));\n\t\t}\n\t}", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function create()\n {\n\n $event = new Event;\n return view('events.create',compact('event'));\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "public function create()\n {\n return view('events.createevent');\n }", "public function create()\n {\n return view('admin.adminevent.create_event');\n }", "public function create()\n {\n //\n return view('events.create');\n }", "public function create()\n {\n return view('events::create_event');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function create()\n {\n return view('admin.event.create');\n }", "public function newAction()\n {\n $this->redirectToCreateNewRecord('tx_t3events_domain_model_event');\n }", "public function create()\n {\n return view(\"Event::create\");\n }", "public function create()\n {\n // return view('events.create');\n }", "public function actionCreate()\n {\n Yii::trace($_POST);\n if (isset($_POST['EventsCategories']['event_id'])) {\n\n if (is_array($_POST['EventsCategories']['event_id'])) {\n foreach ($_POST['EventsCategories']['event_id'] as $event) {\n $model = new EventsCategories();\n $model->event_id = $event;\n $model->category_id = $_POST['EventsCategories']['category_id'];\n $model->save();\n }\n return $this->redirect(['stats', 'id' => $_POST['EventsCategories']['category_id']]);\n } else {\n $model = new EventsCategories();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect([\n 'view',\n 'event_id' => $model->event_id,\n 'category_id' => $model->category_id\n ]);\n\n }\n }\n } else {\n $model = new EventsCategories();\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function create()\n {\n return view('event.create');\n }", "public function addEvent()\n\t{\n\t \n\t\t$data = array(\n\t\t\t 'title' => $this->input->post('event_title'),\n\t\t\t 'date' => $this->input->post('event_date'),\n\t\t\t 'time' => $this->input->post('event_time'),\n\t\t\t 'desc' => $this->input->post('event_desc')\n\t\t);\t\n\n\t \tif($this->event_model->addEv($data))\n\t\t{\t\t\t \n\t\t\techo true;\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo false;\n\t\t}\n\t}", "public function create()\n {\n return view ('event.create');\n }", "public function create()\n {\n return view('system-mgmt/evento/create');\n }", "public function actionCreate()\n {\n $this->enableCsrfValidation = false;\n if(Yii::$app->user->isGuest){\n $this->redirect(['site/login']);\n }\n $model = new Event();\n $event_category = [];\n $last_event_category = new EventCategory();\n for($i=0; $i<3; $i++)\n $event_category[] = new EventCategory();\n $pictures = $model->getPicturesForUpload(5);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->datetime = User::convertMyDatetime($model->datetime);\n $model->datetime_to = User::convertMyDatetime($model->datetime_to);\n $model->user_id = Yii::$app->user->id;\n if (Yii::$app->user->can('ModerateEvent'))\n $model->moderated = 1;\n $model->save();\n $last_event_category->attributes = EventCategory::findLastPost();\n $last_event_category->id_event = $model->id;\n $last_event_category->save();\n for($i=0; $i<count($pictures); $i++) {\n $pictures[$i]->imageFile = UploadedFile::getInstance($pictures[$i], \"[$i]imageFile\");\n if(isset($pictures[$i]) && isset($pictures[$i]->imageFile)) {\n $pictures[$i]->upload();\n $picture_event = new PictureEvent();\n $picture_event->id_picture = $pictures[$i]->id;\n $picture_event->id_event = $model->id;\n $picture_event->save();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'pictures' => $pictures,\n 'event_category' => $event_category\n ]);\n }\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('admin.events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('events.create');\n }", "public function create()\n {\n return view('event::create');\n }", "public function create()\n {\n return view('adm.events.create');\n }", "public function actionCreate($date, $createnew = 0)\r\n {\r\n //to avoid a continuos loop , set createnew to true to ensure we go straight to the\r\n\t\t// create new model. this is called from the update model\r\n\t\t// just in case we need ta add an event to the said date\r\n\t\tif ($createnew == 0) {\r\n\t\t\t//first find all or any models on the said date. If Available, \r\n\t\t\t//raise a popup with all the available models so the user chooses/which to update\r\n\t\t\t$allEventsModel = Events::find()->where(['date_created' => $date])->limit(1)->one();\r\n\t\t\t//print_r($allEventsModel);\r\n\t\t\tif ($allEventsModel !== null ) {\r\n\t\t\t\t//echo \"iko kitu<br>\";\r\n\t\t\t\treturn $this->indexEvents($date);\r\n\t\t\t} else {\r\n\t\t\t\t//echo \"hakuna<br>\";\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t//exit;\r\n\t\t//echo \"creafffffffffffffffffffffffffte\";\r\n\t\t$model = new Events();\r\n\t\t$model->date_created = $date;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('create', [\r\n 'model' => $model,\r\n ]);\r\n }", "function index()\n\t{\n\t\t $data['eventname'] = $this->EventsModel->get_eventname();\n\t \n\t\t //set validation rules\n\t\t$this->form_validation->set_rules('idevents', 'Event ID','trim|required|numeric');\n\t\t$this->form_validation->set_rules('eventname', 'Event Name','trim|required|callback_alpha_only_space');\n\t\t$this->form_validation->set_rules('eventstartdate', 'Date of Event','required');\n\n\t\t if ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t//fail validation\n\t\t\t$this->load->view('EventView', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t//pass validation\n\t\t\t\t$data = array(\n\t\t\t\t 'idevents' => $this->input->post('ID'),\n\t\t\t\t 'eventname' => $this->input->post('Title of Event'),\n\t\t\t\t 'eventstartdate' => @date('Y-m-d', @strtotime($this->input->post('Date'))),);\n\n\t\t\t\t //insert the form data into database\n\t\t\t\t$this->db->insert('events', $data);\n\n\t\t\t\t//display success message\n\t\t\t\t$this->session->set_flashdata('msg', '<div class=\"alert alert-success textcenter\">Event details added to Database.</div>');\n\t\t\t\tredirect('index.php/pages/eventview');\n\t\t}\n\t}", "public function postEvent() {\n\t\t$event_name = Input::get('event');\n\t\t$new_event = Myevent::create(array(\n\t\t\t'name' => $event_name\n\t\t));\n\n\t\treturn Redirect::to('/');\n\t}", "public function create()\n {\n $data['genders'] = Genders::all();\n $data['age_range'] = Age_Ranges::all();\n $data['categories'] = EventCategory::all();\n $data['currencies'] = Currency::all();\n\n return view('events::create', $data);\n }", "public function create()\n\t{\n\t\treturn View::make('events.create');\n\t}", "public function create()\n {\n return view('events::create');\n }", "public function action_add()\r\n\t{\t\tif ( ! $this->user->can('event_add'))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.add.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Valid csrf\r\n\t\tif ($this->valid_post())\r\n\t\t{\r\n\t\t\t// Extract event data from $_POST\r\n\t\t\t$event_post = Arr::get($this->request->post(), 'event', array());\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// Create new event object\r\n\t\t\t\t$event = ORM::factory('event')->create_event($this->user, $event_post);\r\n\t\t\t\t\r\n\t\t\t\t// Notification\r\n\t\t\t\tNotices::success('event.add.success');\r\n\t\t\t\t\r\n\t\t\t\t$event->enroll($this->user, $event_post['character'], Model_Status::READY, 'Event leader');\r\n\t\t\t\tNotices::success('event.enroll.success');\r\n\t\t\t\t\r\n\t\t\t\t// Display created event\r\n\t\t\t\t$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch(ORM_Validation_Exception $e)\r\n\t\t\t{\r\n\t\t\t\t\tNotices::error('event.add.fail');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->view->errors = $e->errors('validation');\r\n\t\t\t\t\t$this->view->values = $event_post;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t//Notices::error('event.enroll.on_create_failed');\r\n\t\t\t\t\t//$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Pass user to view object for character list, etc.\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function create()\n {\n return view(\"admin.event_create\")->with([\n\n ]);\n }", "public function create()\n {\n return view('pages.events.events');\n }", "public function create()\n {\n return view('evento.create');\n }", "public function create()\n {\n return view('event');\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$rules = array('title'=>'required|unique:events',\n\t\t\t\t\t 'event_start'=>'required',\n\t\t\t\t\t 'event_end'=>'required',\n\t\t\t\t\t 'event_details'=>'required',\n\t\t\t\t\t 'location'=>'required');\n\n\n\t\t$message = array(\"required\"=>Helpers::errorLabel(\" is required!\"),\n\t\t\t \"unique\"=>Helpers::errorLabel(\" has been taken!\"));\n\t\t$v = Validator::make($data,$rules,$message);\n\t\tif($v->fails()){\n\t\t\treturn Redirect::to('events/create')->withErrors($v)->withInput();\n\t\t}\n\t\telse{\n\t\t\t\t$e = new Event_Manager;\n\t\t\t\t$e->title = $data['title'];\n\t\t\t\t$e->location = $data['location'];\n\t\t\t\t$e->event_start = $data['event_start'];\n\t\t\t\t$e->event_end = $data['event_end'];\n\t\t\t\t$e->event_details = $data['event_details'];\n\t\t\t\t$e->save();\t\n\n\t\t\t\tSession::flash('message',Helpers::message(\"Event Successfully Added!\"));\n\t\t\t\treturn Redirect::to('events/create');\n\t\t\t}\n\t}", "public function create()\n {\n // $crud = new Events();\n // $crud->photo ='anniv.png';\n // $crud->title = 'Sogod Founding Anniversary Concert';\n // $crud->descriptions = 'secret';\n // $crud->venue = 'Sogod Covered Court';\n // $crud->date = date('04/02/2018');\n // $crud->time = time('h:i:s');\n\n // $crud->save(); \n }", "public function createEvent(Request $request)\n {\n $this->validator($request->all())->validate();\n\n $event = $this->create($request->all());\n \n return redirect('/cms/events');\n }", "public function create()\n {\n $EventCategories = EventCategory::all();\n $cities = City::all(); \n return view(\"admin.events.create\",compact('EventCategories','cities'));\n }", "public function create()\n {\n Session::put('admin_page', 'event');\n $galleries = Gallery::all();\n $categories = Category::all();\n return view('backend.events.create', compact('galleries', 'categories'));\n }", "public function create()\n {\n return view('calendar::calendar_events.create');\n }", "public function create()\n {\n if(auth()->user()->isAdmin())\n {\n $salles = Salle::all();\n\n $event_types = EventType::all();\n \n return view('events.create', compact('salles', 'event_types'));\n\n }else{\n return redirect()->back();\n }\n \n }", "public function store(CreateEventRequest $request)\n {\n $event = new Event;\n $event->nomEvenement = $request->input('TitleEventCE');\n $event->descriptionEvent = $request->input('DescriptionEventCE');\n $event->nbMaxInscrits = $request->input('maxinscCE');\n $event->ville_id = $request->input('lieueventCE');\n $event->dateDeb = $request->input('dateDebEventCE');\n $event->dateFin = $request->input('dateFinEventCE');\n $event->EvenementPayant = $request->input('eventpayantCE');\n $event->lienSitePayment= $request ->input('sitepaiementCE');\n\n $event->save();\n\n return redirect('/home');\n }", "public function create()\r\n {\r\n // Deberá escogerse una sede como lugar del evento.\r\n return view('events/create')\r\n ->with('sedes', Sede::all());\r\n }", "public function create()\n\t{\n return $this->view('events.create');\n\t}", "public function createEvent(){\n \t\n \t$data=$this->request->all();\n \t// print_r($data['event_discription']);die();\n \t$tag=$data['event_discription'];\n \t$events=strip_tags($tag);\n \t// print_r($events);die();\n \t$validator=Validator::make($data,[\n\t\t\t\t\t\t\t'event_Name' \t=> 'required',\n\t\t\t\t\t\t\t'event_date'\t\t=> 'required',\n\t\t\t\t\t\t\t'event_discription' => 'required|min:10',\n\t\t]);\n\n\t\tif(!$validator->fails()){\n\t\t\t$event=Event::create($data);\n\t\t\tif ($event) {\n\t\t\t\treturn \"Success\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn \"fail\";\n\t\t\t}\n\t\t}\n\n\t\telse{\n\t\t\treturn redirect('event')->withErrors($validator);\n\t\t}\n \t// print_r($data);die();\n }", "public function newAction()\n {\n $entity = new Event();\n $form = $this->createCreateForm($entity);\n\n return $this->render('HospiceSiteBundle:Event:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new Agenda();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n //read the post input (use this technique if you have no post variable name):\n\t\t$post = file_get_contents(\"php://input\");\n\n\t\t//decode json post input as php array:\n\t\t$data = CJSON::decode($post, true);\n\n\t\t//Event is a Yii model:\n\t\t$evento = new Evento();\n\n\t\t//load json data into model:\n\t\t$evento->attributes = $data;\n\n\t\t//this is for responding to the client:\n\t\t$response = array();\n\n\t\t//save model, if that fails, get its validation errors:\n\t\tif ($evento->save() == false) {\n\t\t\t$response['success'] = false;\n\t\t\t$response['errors'] = $evento->errors;\n\t\t} else {\n\t\t\t$response['success'] = true;\n\n\t\t\t//respond with the saved contact in case the model/db changed any values\n\t\t\t//$response['evento'] = $evento; \n\t\t}\n\n\t\t//respond with json content type:\n\t\theader('Content-type:application/json');\n\n\n\t\t//encode the response as json:\n\t\techo CJSON::encode($response);\n\n\t\texit();\n }", "public function create()\n {\n if (! Gate::allows('event_create')) {\n return abort(401);\n }\n $category = Category::pluck('name', 'id');\n $subcategory = Subcategory::pluck('title', 'id');\n return view('admin.events.create', compact('category', 'subcategory'));\n }", "public function create()\n {\n return view('doodleevents.create');\n }", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "public function create()\n\t{\n\t\treturn \\View::make('Evento/new_evento');\n\t}", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "public function actionCreate()\n {\n \n \t\n \t$post = file_get_contents(\"php://input\");\n \t\n \t//decode json post input as php array:\n \t$data =Json::decode($post, true);\n \t\n \t$model = new EventoAlarma();\n \t\n \t$model->attributes = $data;\n \t\n\n \t\n \t$timeZone = isset($_GET['tz'])?$_GET['tz']:'America/Mexico_City';\n \t\n\n \tdate_default_timezone_set($timeZone);\n \t\n \t$model->FECHA_SUCESO = date('Y-m-d H:i:s');\n \t\n \t$model->save();\n \t\n \t//load json data into model:\n \t\n \t \t\n \treturn [\"ID_EVENTO\"=>$model->ID_EVENTO,'FECHA'=>$model->FECHA_SUCESO];\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function store(CreateEventFormRequest $request)\n {\n\n \n $title= $request->title;\n $description = $request->description;\n Event::create([\n 'title' => $title,\n 'description' => $description,\n ]);\n\n Flashy::message('Evenement cree avec succes');\n \n return redirect(route('home'));\n }", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function actionCreate()\n {\n $model = new Schedule();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Schedule();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n \n return view('events');\n }", "public function create()\n {\n $event = Event::orderBy('created_at', 'desc')->first();\n if($event->status == '1')\n return back()->with('status', 'Event Registration is Over.');\n else{\n \n return view('entrepreneur/idea_submission',compact('event'));\n }\n }", "public function create()\n {\n return view('dashboard.eventsandoffers.create');\n }", "public function actionCreate()\n\t{\n\t\t$model=new ElearningExam;\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['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->elearningExamId));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function store()\n\t{\n\t\t// Create New Event\n\n\t\t$evnt = new Events;\n\t\t$evnt->user_id = Auth::id();\n\t\t$evnt->name = Input::get('name');\n\t\t$evnt->size = Input::get('size');\n\t\t$evnt->time_start = Input::get('start');\n\t\t$evnt->time_end = Input::get('end');\n\t\t$evnt->detail = Input::get('detail');\n\t\t$evnt->location = Input::get('loca');\n\t\t$evnt->category = Input::get('cate');\n\t\t$evnt->save();\n\n\t\t$eid = DB::select('select event_id from event where event_id = (select max(event_id) from event)');\n\t\t$join = new JoinEvent;\n\t\t$join->event_id = $eid[0]->event_id;\n\t\t$join->user_id = Auth::id();\n\t\t$join->active = 1;\n\t\t$join->status = 'owner';\n\t\t$join->save();\t\t\n\n\n\t\treturn Redirect::to('/myevent/create');\n\t\t// return $join;\n\t}", "public function create($event_id)\n {\n $event = Event::find($event_id);\n if($event->organiser->id != auth()->user()->id){\n return redirect()->route(\"events.index\");\n }\n $users = User::all();\n return view(\"presenters.create\",compact([\"event\",\"users\"]));\n }", "public function create()\n\t{\n\t\t//\n\t\t$exhibitions=Exhibition::all();\n\t\t$halls = Hall::all();\n\t\treturn view('exhibitionevents.create',compact('exhibitions','halls'));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Employe;\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['Employe']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employe'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_employe));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return View::make('eventos.create');\n }", "public function actionCreate()\n {\n $model = new Test();\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(Request $request)\n {\n $this->validate($request, [\n 'eventname'=>'required',\n 'venue' =>'required',\n 'sdate' =>'required',\n 'edate'=>'required',\n 'description'=>'required',\n 'eimage'=>'nullable'\n ]);\n\n $event = new Event;\n $event->EventName=$request->eventname;\n $event->Description=$request->description;\n $event->Venue=$request->venue;\n $event->Startdate=$request->sdate;\n $event->Enddate=$request->edate;\n $event->Image=$request->eimage;\n $event->save();\n\n return redirect(route('event_list'))->with('success', 'Event Added');\n }", "public function create()\n {\n $numberofevents = Event::all()->count();\n return view('events.create')->with('numberofevents',$numberofevents);\n }", "public function actionCreate() {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->dateformat($model, $_POST['Test']);\n $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 House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newAction(Request $request)\n {\n\n $this->denyAccessUnlessGranted('ROLE_USER', null, 'Unable to access this page!');\n\n $event = new Event();\n $form = $this->createForm('Yoda\\EventBundle\\Form\\EventType', $event);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $user = $this->getUser();\n $event->setOwner($user);\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($event);\n $em->flush();\n\n // create the EventCreatedEvent and dispatch it\n //$ecevent = new EventCreatedEvent($event);\n //$dispatcher->dispatch(EventCreatedEvent::NAME, $ecevent);\n\n return $this->redirectToRoute('event_show', array('slug' => $event->getSlug()));\n }\n\n return $this->render('event/new.html.twig', array(\n 'event' => $event,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Events;\n\t\t\n\t\t$ajax = isset($_POST['ajax']) ? $_POST['ajax'] : array();\n\t\t$idevents = null;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\t if(isset($_POST['Events']))\n\t\t{\n\t\t\t$count = sizeof($_POST['Events']['Events_type_idevents_type']);\n\n\t\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t{\n\t\t\t\t\t//echo $_POST['Events']['Events_type_idevents_type'][$i].\"<br>\";\n\t\t\t\t\tif ($_POST['Events']['Events_type_idevents_type'][$i] != \"\"){\n\n\t\t\t\t\t$idEve = $_POST['Events']['idevents'][$i];\n\t\t\t\t\t\n\t\t\t\t\techo Yii::trace(CVarDumper::dumpAsString($_POST['Statspitching']).\"-\".$i ,'IDEVE9');\n\t\t\t\t\t\n\t\t\t\t\tif ($idEve != '' && $idEve && isset($idEve) && $idEve !='undefined' ) {\n\t\t\t\t\t\t$model=$this->loadModel($idEve);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tif (!$idEve) $model=new Events;\n\t\t\t\t\t\n\t\t\t\t\t$model->attributes=$_POST['Events'];\n\t\t\t\t\t\n\t\t\t\t\tif (!$idEve) $model->idevents = NULL;\n\t\t\t\t\telse $model->idevents = $idEve;\n\t\t\t\t\t\n\t\t\t\t\t$model->play = \t$_POST['Events']['play'];\t\n\t\t\t\t\t$model->turntobat = $_POST['Events']['turntobat'];\n\t\t\t\t\t$model->Events_type_idevents_type =$_POST['Events']['Events_type_idevents_type'][$i];\n\t\t\t\t\t$model->Misce = $_POST['Events']['Misce'][$i]; \n\t\t\t\t\t$model->text = $_POST['Events']['text'][$i]; \n\t\t\t\t\t$model->RBI = $_POST['Events']['RBI'][$i]; \n\t\t\t\t\t$model->ER = $_POST['Events']['ER'][$i]; \n\t\t\t\t\t$model->Batter = $_POST['Events']['Batter'][$i]; \n\t\t\t\t\t$model->playerid = $_POST['Events']['playerid'][$i]; \n\t\t\t\t\t$model->batterNumberOut = $_POST['Events']['batterNumberOut'][$i];\n\t\t\t\t\t\n\t\t\t\t\t$idplayer=$_POST['Statshitting']['Players_idplayer'][0];\n\t\t\t\t\t\t\t\n\t\t\t\t\t//Check turntobat\n\t\t\t\t\tif ( $model->Batter > $tmpbat = $_POST['Events']['Batter'][$count-1] ){\n\t\t\t\t\t\t$model->turntobat = $model->turntobat - 1; \n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tswitch ($model->Events_type_idevents_type) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 2: //3B\n\t\t\t\t\t\t\t//$this->checkbases('3b');\n\t\t\t\t\t\t\t//Yii::app()->user->setState('hitterBase3',$idplayer);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber3',$model->Batter);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 3: //2B\n\t\t\t\t\t\t\t//$this->checkbases('2b');\n\t\t\t\t\t\t\t//Yii::app()->user->setState('hitterBase2',$idplayer);\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber2',$model->Batter);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 4: //1B\n\t\t\t\t\t\t\t//$this->checkbases('1b');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Yii::app()->user->setState('hitterBase1',$idplayer);\n\t\t\t\t\t\t\t//echo \"<script> alert('submit value of BatterNumber1'+$model->Batter) </script>\";\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber',$model->Batter);\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber1',$model->Batter);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 5; case 6 : //BB HP\n\t\t\t\t\t\t\t//$this->checkbases('1b');\n\t\t\t\t\t\t\t//Yii::app()->user->setState('hitterBase1',$idplayer);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber1',$model->Batter);\n\t\t\t\t\t\t\t//Yii::app()->user->setState('batterNumber',$model->Batter);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 37: //Event is out\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//increment outs\n\t\t\t\t\t\t\tYii::app()->user->setState('outs', Yii::app()->user->getState('outs')+1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//3 Outs change team\n\t\t\t\t\t\t\tif (Yii::app()->user->getState('outs') == 3) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// ???Yii::app()->user->setState('batter', 1); \n\t\t\t\t\t\t\t\tYii::app()->user->setState('outs', 0); //Clear outs\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// ??????Yii::app()->user->setState('inning', Yii::app()->user->getState('inning') + 1) ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (Yii::app()->user->getState('battingteam') == Yii::app()->user->getState('idteamhome')) {\n\t\t\t\t\t\t\t\t\tYii::app()->user->setState('battingteam' , Yii::app()->user->getState('idteamvisiting'));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else \n\t\t\t\t\t\t\t\t\tYii::app()->user->setState('battingteam', Yii::app()->user->getState('idteamhome')) ;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tYii::app()->user->setState('batter',1) ;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 38; case 39; case 40; case 41; case 42: //Ball Tray // run's \n\t\t\t\t\t\t$model->text = ''; \n\t\t\t\t\t\t$model->RBI = ''; \n\t\t\t\t\t\t$model->ER = ''; \n\t\t\t\t\t\t$model->ER = ''; \t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 77: //Last batter\n\t\t\t\t\t\t\tYii::app()->user->setState('outs', 0); //Clear outs\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (Yii::app()->user->getState('battingteam') == Yii::app()->user->getState('idteamhome')) {\n\t\t\t\t\t\t\t\tYii::app()->user->setState('battingteam' , Yii::app()->user->getState('idteamvisiting'));\n\t\t\t\t\t\t\t}else \n\t\t\t\t\t\t\t\tYii::app()->user->setState('battingteam', Yii::app()->user->getState('idteamhome')) ;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tYii::app()->user->setState('batter',1) ;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t/* $model->b1 = Yii::app()->user->getState('hitterBase1'); \n\t\t\t\t\t$model->b2 = Yii::app()->user->getState('hitterBase2'); \n\t\t\t\t\t$model->b3 = Yii::app()->user->getState('hitterBase3'); */\n\t\t\t\t\t$model->b1 = $_POST['Events']['b1'][$i]; \n\t\t\t\t\t$model->b2 = $_POST['Events']['b2'][$i];\n\t\t\t\t\t$model->b3 = $_POST['Events']['b3'][$i];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$model->B1text = $_POST['B1text'];\n\t\t\t\t\t$model->B2text = $_POST['B2text'];\n\t\t\t\t\t$model->B3text = $_POST['B3text'];\n\t\t\t\t\t$model->B4text = $_POST['B4text'];\n\t\t\t\t\t$model->OutText = $_POST['OutText'];\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tif ( $model->validate() ){\n\t\t\t\t\t\t\t$model->save();\n\t\t\t\t\t\t\t$idevents[] = $model->idevents;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tprint_r($model->errors);\n\t\t\t\t\t\t\t//echo \"ID: $model->idevents -id <br>\";\n\t\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$count = count($_POST['Statshitting']['Players_idplayer']);\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t{\n\t\t\t\t\tif ($_POST['Statshitting']['Players_idplayer']){\n\n\t\t\t\t\tif (!empty($_POST['Statshitting']['idstatshit'][$i])){\n\t\t\t\t\t\t$stats=Statshitting::model()->findByPk($_POST['Statshitting']['idstatshit'][$i]); // = Statshitting::findByPK();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//Find by ID player and ID game\n\t\t\t\t\t\t$criteria = new CDbCriteria();\n\t\t\t\t\t\t$id_player=$_POST['Statshitting']['Players_idplayer'][$i];\n\t\t\t\t\t\t$id_game=$_POST['Statshitting']['Games_idgame'][$i];\n\t\t\t\t\t\t$criteria->addcondition(\"Players_idplayer=\".$id_player.\" and Games_idgame = \".$id_game);\n\t\t\t\t\t\t$statsArr = Statshitting::model()->findAll($criteria);\n\t\t\t\t\t\t$stats = isset($statsArr[0]) ? $statsArr[0] : null;\n\t\t\t\t\t\tif (!$stats){\n\t\t\t\t\t\t\t$stats=new Statshitting;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$stats->AB= $_POST['Statshitting']['AB'][$i];\n\t\t\t\t\t$stats->G= 1;\n\t\t\t\t\t$stats->H= $_POST['Statshitting']['H'][$i];\n\t\t\t\t\t$stats->RBI= $_POST['Statshitting']['RBI'][$i];\n\t\t\t\t\t$stats->BB= $_POST['Statshitting']['BB'][$i];\n\t\t\t\t\t$stats->SO= $_POST['Statshitting']['SO'][$i];\n\t\t\t\t\t$stats->R= $_POST['Statshitting']['R'][$i];\n\t\t\t\t\t$stats->v2B= $_POST['Statshitting']['v2B'][$i];\n\t\t\t\t\t$stats->v3B= $_POST['Statshitting']['v3B'][$i];\n\t\t\t\t\t$stats->HR= $_POST['Statshitting']['HR'][$i];\n\t\t\t\t\t$stats->TB= $_POST['Statshitting']['TB'][$i];\n\t\t\t\t\t$stats->IBB= $_POST['Statshitting']['IBB'][$i];\n\t\t\t\t\t$stats->HP= $_POST['Statshitting']['HP'][$i];\n\t\t\t\t\t$stats->SH= $_POST['Statshitting']['SH'][$i];\n\t\t\t\t\t$stats->SF= $_POST['Statshitting']['SF'][$i];\n\t\t\t\t\t$stats->SB= $_POST['Statshitting']['SB'][$i];\n\t\t\t\t\t$stats->CS= $_POST['Statshitting']['CS'][$i];\n\t\t\t\t\t$stats->LOB= $_POST['Statshitting']['LOB'][$i];\n\t\t\t\t\t$stats->OE= $_POST['Statshitting']['OE'][$i];\n\t\t\t\t\t$stats->FC= $_POST['Statshitting']['FC'][$i];\n\t\t\t\t\t$stats->CO= $_POST['Statshitting']['CO'][$i];\n\t\t\t\t\t$stats->DP= $_POST['Statshitting']['DP'][$i];\n\t\t\t\t\t$stats->TP= $_POST['Statshitting']['TP'][$i];\n\t\t\t\t\t$stats->GDP= $_POST['Statshitting']['GDP'][$i];\n\t\t\t\t\t$stats->SAC= $_POST['Statshitting']['SAC'][$i];\n\t\t\t\t\t$stats->TP= $_POST['Statshitting']['TP'][$i];\n\t\t\t\t\t$stats->CS= $_POST['Statshitting']['CS'][$i];\n\t\t\t\t\t\n\t\t\t\t\techo Yii::trace(CVarDumper::dumpAsString($stats->H) ,'abzero');\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->AB != 0 ) {\n\t\t\t\t\t\t$stats->AVG = $stats->H / $stats->AB; // $_POST['Statshitting']['AVG'][$i];\n\t\t\t\t\t\t$stats->OBP = ( $stats->H + $stats->BB + $stats->HBP ) / ($stats->AB + $stats->BB + $stats->HBP + $stats->SF); //$_POST['Statshitting']['OBP'][$i];\n\t\t\t\t\t\t$stats->SLG = $stats->TB / $stats->AB;//$_POST['Statshitting']['SLG'][$i];\n\t\t\t\t\t\tif ( $stats->SLG ) $stats->OPS = $stats->OBP + $stats->SLG; \n\t\t\t\t\t\t$stats->PA = $stats->AB + $stats->BB + $stats->HBP + $stats->SF;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$stats->Players_idplayer = $_POST['Statshitting']['Players_idplayer'][$i];\n\t\t\t\t\t$stats->Games_idgame = $_POST['Statshitting']['Games_idgame'][$i];\n\t\t\t\t\t\n\t\t\t\t\t$stats->save();\n\t\t\t\t\t\n\t\t\t\t\t//Set the game in progress\n\t\t\t\t\t$game = Games::model()->findByPk( $stats->Games_idgame);\n\t\t\t\t\tif (! $game->status ) $game->status = 1;\n\t\t\t\t\t$game->save();\n\n //buscamos el jugador para poder meterlo en los stats por inning\n /*$criteria = new CDbCriteria();\n $id_player = $_POST['Statshitting']['Players_idplayer'][$i];\n $id_game = $_POST['Statshitting']['Games_idgame'][$i];\n $criteria->addcondition(\"Players_idplayer=$id_player and Games_idgame = $id_game\");\n $statsInningArr = Statshittinginning::model()->findAll($criteria);\n $stats_inning = $statsInningArr[0];\n\n if (!$stats_inning){*/\n $stats_inning = new Statshittinginning;\n // }\n\n $stats_inning->AB = $_POST['Statshitting']['AB'][$i];\n $stats_inning->G = 1;\n $stats_inning->H = $_POST['Statshitting']['H'][$i];\n $stats_inning->RBI = $_POST['Statshitting']['RBI'][$i];\n $stats_inning->BB = $_POST['Statshitting']['BB'][$i];\n $stats_inning->SO = $_POST['Statshitting']['SO'][$i];\n $stats_inning->R = $_POST['Statshitting']['R'][$i];\n $stats_inning->v2B = $_POST['Statshitting']['v2B'][$i];\n $stats_inning->v3B = $_POST['Statshitting']['v3B'][$i];\n $stats_inning->HR = $_POST['Statshitting']['HR'][$i];\n $stats_inning->TB = $_POST['Statshitting']['TB'][$i];\n $stats_inning->IBB = $_POST['Statshitting']['IBB'][$i];\n $stats_inning->HP = $_POST['Statshitting']['HP'][$i];\n $stats_inning->SH = $_POST['Statshitting']['SH'][$i];\n $stats_inning->SF = $_POST['Statshitting']['SF'][$i];\n $stats_inning->SB = $_POST['Statshitting']['SB'][$i];\n $stats_inning->CS = $_POST['Statshitting']['CS'][$i];\n $stats_inning->LOB = $_POST['Statshitting']['LOB'][$i];\n $stats_inning->OE = $_POST['Statshitting']['OE'][$i];\n $stats_inning->FC = $_POST['Statshitting']['FC'][$i];\n $stats_inning->CO = $_POST['Statshitting']['CO'][$i];\n $stats_inning->DP = $_POST['Statshitting']['DP'][$i];\n $stats_inning->TP = $_POST['Statshitting']['TP'][$i];\n $stats_inning->GDP = $_POST['Statshitting']['GDP'][$i];\n $stats_inning->SAC = $_POST['Statshitting']['SAC'][$i];\n $stats_inning->TP = $_POST['Statshitting']['TP'][$i];\n $stats_inning->CS = $_POST['Statshitting']['CS'][$i];\n $stats_inning->Players_idplayer = $_POST['Statshitting']['Players_idplayer'][$i];\n $stats_inning->Games_idgame = $_POST['Statshitting']['Games_idgame'][$i];\n\t\t\t\t\t\tif (!empty($model->Lineup_idlineup[$i])) {\n\t\t\t\t\t\t\t$stats_inning->Lineup_idlineup = $model->Lineup_idlineup[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!empty($model->Inning[$i])) {\n\t\t\t\t\t\t\t$stats_inning->Inning = $model->Inning[$i];\n\t\t\t\t\t\t}\n\n echo Yii::trace(CVarDumper::dumpAsString($stats_inning->H) ,'abzero');\n\n\n if ($stats_inning->AB != 0 ) {\n $stats_inning->AVG = $stats_inning->H / $stats_inning->AB; // $_POST['Statshitting']['AVG'][$i];\n $stats_inning->OBP = ( $stats_inning->H + $stats_inning->BB + $stats_inning->HBP ) / ($stats_inning->AB + $stats_inning->BB + $stats_inning->HBP + $stats_inning->SF); //$_POST['Statshitting']['OBP'][$i];\n $stats_inning->SLG = $stats_inning->TB / $stats_inning->AB;//$_POST['Statshitting']['SLG'][$i];\n if ( $stats_inning->SLG ) $stats_inning->OPS = $stats_inning->OBP + $stats_inning->SLG;\n $stats_inning->PA = $stats_inning->AB + $stats_inning->BB + $stats_inning->HBP + $stats_inning->SF;\n }\n\n //$stats_inning->Events_idevent = $model->idevents[$i];\n\n $stats_inning->save();\n //buscamos el jugador para poder meterlo en los stats por inning\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$count = count($_POST['Statspitching']['Players_idplayer']);\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t{\n\t\t\t\techo Yii::trace(CVarDumper::dumpAsString($_POST['Statspitching']) ,'entre1');\n\t\t\t\t\t\n\t\t\t\t\tif (!empty($_POST['Statspitching']['idstatspit'][$i])) {\n\t\t\t\t\t\t$stats=Statspitching::model()->findByPk($_POST['Statspitching']['idstatspit'][$i]); // = Statshitting::findByPK();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//Find by ID player and ID game\n\t\t\t\t\t\t$criteria = new CDbCriteria();\n\t\t\t\t\t\t$id_player=$_POST['Statspitching']['Players_idplayer'][$i];\n\t\t\t\t\t\t$id_game=$_POST['Statspitching']['Games_idgame'][$i];\n\t\t\t\t\t\t$criteria->addcondition(\"Players_idplayer=$id_player and Games_idgame = $id_game\");\n\t\t\t\t\t\t$statsArr = Statspitching::model()->findAll($criteria);\n\t\t\t\t\t\t$stats = isset($statsArr[0]) ? $statsArr[0] : null;\n\n\t\t\t\t\t\tif (!$stats){\n\t\t\t\t\t\t\t$stats=new Statspitching;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\n\t\t\t\t\t$stats->G= 1;\n\t\t\t\t\t$stats->IP = $_POST['Statspitching']['IP'][$i];\n\t\t\t\t\t$stats->H = $_POST['Statspitching']['H'][$i];\n\t\t\t\t\t$stats->R = $_POST['Statspitching']['R'][$i];\n\t\t\t\t\t$stats->BB = $_POST['Statspitching']['BB'][$i];\n\t\t\t\t\t$stats->SO = $_POST['Statspitching']['SO'][$i];\n\t\t\t\t\t$stats->B = $_POST['Statspitching']['B'][$i];\n\t\t\t\t\t$stats->S = $_POST['Statspitching']['S'][$i];\n\t\t\t\t\t$stats->BF = $_POST['Statspitching']['BF'][$i];\n\t\t\t\t\t$stats->ER = $_POST['Statspitching']['ER'][$i];\n\t\t\t\t\t$stats->v2B = $_POST['Statspitching']['v2B'][$i];\n\t\t\t\t\t$stats->v3B = $_POST['Statspitching']['v3B'][$i];\n\t\t\t\t\t$stats->HR = $_POST['Statspitching']['HR'][$i];\n\t\t\t\t\t//$stats->SH = $_POST['Statspitching']['SH'][$i];\n\t\t\t\t\t//$stats->SF = $_POST['Statspitching']['SF'][$i];\n\t\t\t\t\t$stats->HB = $_POST['Statspitching']['HB'][$i];\n\t\t\t\t\t$stats->HBP = $_POST['Statspitching']['HBP'][$i];\n\t\t\t\t\t$stats->WP = $_POST['Statspitching']['WP'][$i];\n\t\t\t\t\t//$stats->CO = $_POST['Statspitching']['CO'][$i];\n\t\t\t\t\t$stats->BK = $_POST['Statspitching']['BK'][$i];\n\t\t\t\t\t$stats->G = $_POST['Statspitching']['G'][$i];\n\t\t\t\t\t$stats->GS = $_POST['Statspitching']['GS'][$i];\n\t\t\t\t\t$stats->CS = $_POST['Statspitching']['CS'][$i];\n\t\t\t\t\t$stats->CG = $_POST['Statspitching']['CG'][$i];\n\t\t\t\t\t//$stats->CGL = $_POST['Statspitching']['CGL'][$i];\n\t\t\t\t\t$stats->W = $_POST['Statspitching']['W'][$i];\n\t\t\t\t\t//$stats->LS = $_POST['Statspitching']['LS'][$i];\n\t\t\t\t\t//$stats->HO = $_POST['Statspitching']['HO'][$i];\n\t\t\t\t\t$stats->SV = $_POST['Statspitching']['SV'][$i];\n\t\t\t\t\t$stats->AB = $_POST['Statspitching']['AB'][$i];\n\t\t\t\t\t$stats->SB = $_POST['Statspitching']['SB'][$i];\n\t\t\t\t\t$stats->NP = $_POST['Statspitching']['NP'][$i];\n\t\t\t\t\t$stats->GIDP = $_POST['Statspitching']['GIDP'][$i];\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->AB){\n\t\t\t\t\t\t$stats->AVG = number_format( $stats->H /$stats->AB,3);\n\t\t\t\t\t\t$stats->SLG = number_format( $stats->BF / $stats->AB,3);\n\t\t\t\t\t\tif ($stats->IP) $stats->WHIP = number_format( ($stats->H + $stats->W) / $stats->IP,3);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->W){\n\t\t\t\t\t\t$stats->WPCT = number_format( $stats->W / ($stats->W + $stats->L),3);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->AB || $stats->BB || $stats->HBP || $stats->SF){\n\t\t\t\t\t\t$stats->OBP = number_format( ( $stats->H + $stats->BB + $stats->HBP ) / ($stats->AB + $stats->HBP + $stats->BB + $stats->SF),3);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->SLG){\n\t\t\t\t\t\t$stats->OPS = number_format( $stats->OBP / $stats->SLG,3);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->IP) {\n\t\t\t\t\t\t$stats->ERA = ($stats->ER * 9 ) / $stats->IP;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$stats->BB_9 = number_format( $stats->BB / 9,3);\n\t\t\t\t\t$stats->H_9 = number_format( $stats->H / 9,3);\n\t\t\t\t\t$stats->K_9 = number_format( $stats->SO / 9,3);\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->BB) number_format( $stats->K_BB = $stats->SO / $stats->BB,3);\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->IP) number_format( $stats->P_IP = $stats->NP / $stats->IP,3);\n\t\t\t\t\t\n\t\t\t\t\t$stats->Players_idplayer = $_POST['Statspitching']['Players_idplayer'][$i];\n\t\t\t\t\t$stats->Games_idgame = $_POST['Statspitching']['Games_idgame'][$i];\n\t\t\t\t\t\n\t\t\t\t\t$stats->save();\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t$count = count($_POST['Statsfielding']['Players_idplayer']);\n\t\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t{\n\t\t\t\t\tif (!empty($_POST['Statsfielding']['idstatsfield'][$i])) {\n\t\t\t\t\t\t$stats=Statsfielding::model()->findByPk($_POST['Statsfielding']['idstatsfield'][$i]); // = Statshitting::findByPK();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Find by ID player and ID game\n\t\t\t\t\t\t$criteria = new CDbCriteria();\n\t\t\t\t\t\t$id_player=$_POST['Statsfielding']['Players_idplayer'][$i];\n\t\t\t\t\t\t$id_game=$_POST['Statsfielding']['Games_idgame'][$i];\n\t\t\t\t\t\t$criteria->addcondition(\"Players_idplayer=$id_player and Games_idgame = $id_game\");\n\t\t\t\t\t\t$statsArr = Statsfielding::model()->findAll($criteria);\n\t\t\t\t\t\t$stats = isset($statsArr[0]) ? $statsArr[0] : null;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!$stats){\n\t\t\t\t\t\t\t$stats=new Statsfielding;\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$stats->G= 1;\n\t\t\t\t\t\n\t\t\t\t\t$stats->PO = $_POST['Statsfielding']['PO'][$i];\n\t\t\t\t\t$stats->A = $_POST['Statsfielding']['A'][$i];\n\t\t\t\t\t$stats->PB = $_POST['Statsfielding']['PB'][$i];\n\t\t\t\t\t$stats->INN = $_POST['Statsfielding']['INN'][$i];\n\t\t\t\t\t$stats->E = $_POST['Statsfielding']['E'][$i];\n\t\t\t\t\t$stats->Games_idgame = $_POST['Statsfielding']['Games_idgame'][$i];\n\t\t\t\t\t$stats->Players_idplayer = $_POST['Statsfielding']['Players_idplayer'][$i];\n\t\t\t\t\t$stats->A = $_POST['Statsfielding']['A'][$i];\n\t\t\t\t\t$stats->DP = $_POST['Statsfielding']['DP'][$i];\n\t\t\t\t\t$stats->SB = $_POST['Statsfielding']['SB'][$i];\n\t\t\t\t\t$stats->CS = $_POST['Statsfielding']['CS'][$i];\n\t\t\t\t\t$stats->C_WP = $_POST['Statsfielding']['C_WP'][$i];\n\t\t\t\t\t\n\t\t\t\t\t$stats->TC = $stats->PO + $stats->A + $stats->E;\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->SB || $stats->CS) $stats->SBPCT = $stats->SB / ( $stats->SB + $stats->CS );\n\t\t\t\t\t\n\t\t\t\t\techo Yii::trace(CVarDumper::dumpAsString($stats->PO + $stats->A + $stats->E),'Event12');\n\t\t\t\t\tif ($stats->PO + $stats->A + $stats->E) $stats->FPCT= ( $stats->PO + $stats->A) / ($stats->PO + $stats->A + $stats->E);\n\t\t\t\t\t\n\t\t\t\t\tif ($stats->INN) $stats->RF = ( $stats->PO + $stats->A) / ($stats->INN);\n\t\t\t\t\t\n\t\t\t\t\t$stats->save();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$count = count($_POST['Runs']['teams_idteam']);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t{\n\t\t\t\t\tif ($_POST['Runs']['idrun'][$i]){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$runs=Runs::model()->findByPk($_POST['Runs']['idrun'][$i]); // = Statshitting::findByPK();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$runs=new Runs;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Load innings from POST\n\t\t\t\t\t//for($i=1;$i<10;$i++){\n\t\t\t\t\t\t//$runs->inning.$i = $_POST['Runs']['inning'.$i][$i];\n\t\t\t\t\t\t$runs->inning1 = $_POST['Runs']['inning1'][$i];\n\t\t\t\t\t\t$runs->inning2 = $_POST['Runs']['inning2'][$i];\n\t\t\t\t\t\t$runs->inning3 = $_POST['Runs']['inning3'][$i];\n\t\t\t\t\t\t$runs->inning4 = $_POST['Runs']['inning4'][$i];\n\t\t\t\t\t\t$runs->inning5 = $_POST['Runs']['inning5'][$i];\n\t\t\t\t\t\t$runs->inning6 = $_POST['Runs']['inning6'][$i];\n\t\t\t\t\t\t$runs->inning7 = $_POST['Runs']['inning7'][$i];\n\t\t\t\t\t\t$runs->inning8 = $_POST['Runs']['inning8'][$i];\n\t\t\t\t\t\t$runs->inning9 = $_POST['Runs']['inning9'][$i];\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\t$runs->R = $_POST['Runs']['R'][$i];\n\t\t\t\t\t$runs->H = $_POST['Runs']['H'][$i];\n\t\t\t\t\t$runs->E = $_POST['Runs']['E'][$i];\n\t\t\t\t\t$runs->teams_idteam = $_POST['Runs']['teams_idteam'][$i];\n\t\t\t\t\t$runs->games_idgame= $_POST['Runs']['games_idgame'][$i];\n\t\t\t\t\t$runs->save();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t//Yii::app()->user->setState('batterNumber', $model->Batter+1); \t\n\t\t\t\n\t\t\t//if($model->save())\n\t\t\t\techo Yii::trace(CVarDumper::dumpAsString(Yii::app()->user->getState('batterNumber')),'varSavecount');//$this->redirect(array('view','id'=>$model->idevents));\n\n\t\t\t//Increment batter\n\n\t\t\t//Change team\n\t\t\t//3 outs change team\n\t\t\t\t\n\t\t\t\n\t\t}\n\n\t\t//echo \"<script> alert(\".$_POST['link'].\")</script>\";\n\t\t\n\t \tif (!empty($_POST['link'])) {\n\t\t\t$this->redirect(array($_POST['link']));\n\t\t}\n\t\t\t\t\t\t\n\t\tif ($ajax && $idevents) {\n\t\t\techo json_encode($idevents);\n\t\t} else {\n\t\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t));\n\t\t\t//$this->redirect(array());\n\t\t}\n\t\t\n\t\t\n\n\t}", "public function actionCreate()\n {\n $model = new Qrxq2017Enroll();\n $model->loadDefaultValues();\n\n $model->id = JdhnCommonHelper::createGuid();\n $model->created_at = time();\n $model->modified_at = $model->created_at;\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\t{\n\t\theader('Content-Type: text/html; charset=utf-8');\n\t\t$arr=json_decode($_POST['Form'], true);\n\t\t$student_id=$arr['学号'];\n\t\t$event=$arr['event'];\n\t\t$name=$arr['姓名'];\n\t\tif(!isset($this->nameId[$name]) || $this->nameId[$name]!=$student_id) {\n\t\t\techo '提交失败!学号与姓名不匹配!';\n\t\t\treturn ;\n\t\t}\n\t\t$model=Form::model()->findByAttributes(array('student_id'=>$student_id,'event'=>$event));\n\t\tif( $model == null) {\n\t\t\t$model=new Form;\n\t\t}\n\t\t$model->student_id=$student_id;\n\t\t$model->value=$_POST['Form'];\n\t\t$model->event=$event;\n\t\tif(!$model->save()){\n\t\t\t//var_dump($model->getErrors()) ;\n\t\t\techo \"提交失败!\";\n\t\t}\n\t\techo \"提交成功!\";\n\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Entry;\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['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function store()\n\t{\n $validator = Eventadd::validate(Input::all());\n\n if($validator->passes()){\n $date = Input::get('date');\n $date = date(\"Y-m-d\", strtotime($date));\n $event = new Eventadd;\n $event->event = Input::get('event');\n $event->venue = Input::get('venue');\n $event->address = Input::get('address');\n $event->zip = Input::get('zipcode');\n $event->date = $date;\n $event->save();\n }\n return Redirect::home();\n\t}", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public function create()\n {\n // $categories = EventInterested::get();\n $cities = JobCities::get();\n\n return view('admin.events.create', compact('categories', 'cities'));\n }", "public function actionCreate()\n {\n $model = new Employe();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee created successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new StandartOne();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Video;\n\n $this->performAjaxValidation($model, 'video-form');\n\n\t\tif(isset($_POST['Video']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Video'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}" ]
[ "0.8578604", "0.84373766", "0.82750595", "0.8127694", "0.7517022", "0.7287367", "0.7137557", "0.711212", "0.7088466", "0.70688343", "0.70607364", "0.703428", "0.7027968", "0.7027968", "0.70162916", "0.6993274", "0.6986412", "0.69775426", "0.6966218", "0.6966218", "0.6966218", "0.6966218", "0.6926895", "0.6922728", "0.69137347", "0.69126785", "0.68960184", "0.68960184", "0.68960184", "0.68960184", "0.6884006", "0.6884006", "0.6884006", "0.6884006", "0.6884006", "0.6884006", "0.68597215", "0.68527997", "0.6850613", "0.6837434", "0.6832316", "0.68312633", "0.6824689", "0.6823672", "0.67914283", "0.6771972", "0.6765834", "0.6761221", "0.6724178", "0.66990316", "0.6690115", "0.66804945", "0.66529256", "0.66518533", "0.66442436", "0.66357106", "0.6634261", "0.66306806", "0.66115063", "0.659359", "0.6580552", "0.65776813", "0.65714395", "0.654108", "0.65022635", "0.6493371", "0.64867187", "0.64807934", "0.6478401", "0.6475982", "0.64738786", "0.6462256", "0.64515996", "0.64349186", "0.64349186", "0.64347625", "0.64315164", "0.6409174", "0.6405301", "0.6397405", "0.63891786", "0.6387233", "0.6386023", "0.6383187", "0.6371478", "0.637099", "0.6370208", "0.6367879", "0.6364755", "0.63627553", "0.636131", "0.6353531", "0.6352624", "0.63524187", "0.63512826", "0.6342304", "0.6325461", "0.631715", "0.6293346", "0.629197" ]
0.6411049
77
Updates an existing Event model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); if (Yii::$app->user->can('admin') || (Yii::$app->user->id != $model->user_id)) { throw new ForbiddenHttpException('You are not allowed to perform this action.'); } /*if ($model->user_id !== Yii::$app->user->id) { return $this->redirect(['view', 'id' => $id]); }*/ $query = SocialMedia::find()->where(['event_id' => $id])->orderBy('id'); $socialMediaModels = $query->all(); $model->max_num_socialMedia = 20; $model->num_socialMedia = intval($query->count()); for ($i = 0; $i < $model->max_num_socialMedia - $model->num_socialMedia; $i++) { $socialMediaModels[] = new SocialMedia(); } $postData = Yii::$app->request->post(); $old_image = $model->image; if ($model->load($postData) && $model->validate() && Model::loadMultiple($socialMediaModels, $postData) && Model::validateMultiple($socialMediaModels)) { // image $image = $model->uploadImage(); if ($image == null) { $model->image = $old_image; } if ($model->update() != false) { if ($image != null) { // delete old and overwrite $model->deleteImage($old_image); $image->saveAs($model->getImagePath()); } } foreach ($socialMediaModels as $socialMediaModel) { if ($socialMediaModel->url == '') { $socialMediaModel->delete(); } else { $socialMediaModel->event_id = $model->id; try { $socialMediaModel->save(); } catch (IntegrityException $e) { throw new \InvalidArgumentException('Url/Hashtag already exists'); } } } // delete cache of this event and create new cache Yii::$app->cache->delete('socialmedia' . $id); $socialMediaModels = SocialMedia::find()->where(['event_id' => $id])->orderBy('id')->all(); $this->findSocialMedia($id, $socialMediaModels); return $this->redirect(['view', 'id' => $model->id]); } else { if (strtotime($model->start_date) != 0) { $model->start_date = date('d.m.Y G:i', strtotime($model->start_date)); } if (strtotime($model->end_date) != 0) { $model->end_date = date('d.m.Y G:i', strtotime($model->end_date)); } } return $this->render('update', ['model' => $model, 'socialMediaModels' => $socialMediaModels]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->event_id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Events']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Events'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->idevents));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n if(Yii::app()->getRequest()->getIsAjaxRequest()) {\n echo CActiveForm::validate( array( $model));\n Yii::app()->end();\n }\n if(isset($_POST['EventMain']))\n {\n $model->attributes=$_POST['EventMain'];\n if($model->save())\n $this->redirect(array('eventsRegistration/view','id'=>$model->id));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Event']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\t$model->modified_on = new CDbExpression('NOW()');\n\t\t\t$model->modified_by=Yii::app()->user->id;\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function action_update()\n {\n\t $this->template = View::forge('template-admin');\n\n\t\t$get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"update\"] = Model_Event::find_by('id',$id);\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント更新\";\n\t\t$this->template->content = View::forge('event/update', $data);\n }", "function update_event($eventID)\r\n {\r\n $data = array(\r\n 'eventID' => $eventID,\r\n 'name' => $this->input->post('name'),\r\n 'description' => $this->input->post('description'),\r\n 'venue' => $this->input->post('venue'),\r\n 'date' => $this->input->post('date'),\r\n 'time' => $this->input->post('time'));\r\n\r\n //model function\r\n $this->load->model('event_model');\r\n $this->event_model->update_specific_event($eventID, $data);\r\n\r\n $this->session->set_flashdata('msg', 'Event has been Updated!');\r\n redirect('event','refresh');\r\n }", "public function action_edit()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t\tthrow new HTTP_Exception_404;\r\n\t\t\r\n\t\t// Can user edit this event's details?\r\n\t\tif ( ! $this->user->can('event_edit', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.edit.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Valid csrf, etc.\r\n\t\tif ($this->valid_post())\r\n\t\t{\r\n\t\t\t// Get event data from $_POST\r\n\t\t\t$event_post = Arr::get($this->request->post(), 'event', array());\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// Save data to event object\r\n\t\t\t\t$event->edit_event($event_post);\r\n\t\t\t\t\r\n\t\t\t\tNotices::success('event.edit.success');\r\n\t\t\t\t\r\n\t\t\t\t// Display edited event\r\n\t\t\t\t$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t}\r\n\t\t\tcatch(ORM_Validation_Exception $e)\r\n\t\t\t{\r\n\t\t\t\t$this->view->errors = $e->errors('event');\r\n\t\t\t\t$this->view->values = $event_post;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->view->values = $event->as_array();\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event object to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t\t\r\n\t}", "public function update(EventRequest $request, Event $event)\n {\n $event->update($request->all());\n\n return redirect('events');\n }", "public function actionUpdate($id)\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n \n\t\t$model=$this->loadModel($id);\n\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\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['Event']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t));\n\t}", "public function update(Request $request, Event $event)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'content' => 'required',\n 'location' => 'required',\n 'date' => 'required'\n ]);\n\n $event = Event::findOrFail($event->id);\n $event->update([\n 'title' => $request->input('title'),\n 'slug' => Str::slug($request->input('title'), '-'),\n 'content' => $request->input('content'),\n 'location' => $request->input('location'),\n 'date' => $request->input('date')\n ]);\n\n if ($event) {\n //redirect dengan pesan sukses\n return redirect()->route('admin.event.index')->with(['success' => 'Data Berhasil Diupdate!']);\n } else {\n //redirect dengan pesan error\n return redirect()->route('admin.event.index')->with(['error' => 'Data Gagal Diupdate!']);\n }\n }", "public function change_event()\r\n\t{\r\n\t\t// get post data\r\n\t\t$data['post'] = $this->input->post();\r\n\t\t// update db\r\n\t\t$this->caifmodel->edit_event($data['post']);\t\r\n\t\t// redirect\r\n\t\tredirect(base_url().'events','location');\r\n\t}", "public function update(Request $request,Event $event)\n {\n $title= $request->title;\n $description = $request->description;\n //$event = Event::firstOrFail($event);\n $event->update([\n 'title' => $title,\n 'description' => $description,\n ]);\n Flashy::message('Evenement modifier avec succes');\n \n\n return redirect(route('event.show',$event->slug));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->staffevent_ref]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($event_id, $category_id)\n {\n $model = $this->findModel($event_id, $category_id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'event_id' => $model->event_id, 'category_id' => $model->category_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update() {\n //event id\n $id = $this->uri->segment(4);\n\n //if save button was clicked, get the data sent via post\n if ($this->input->server('REQUEST_METHOD') === 'POST') {\n\n //form validation\n $this->form_validation->set_rules('titleFR', 'titleFR', 'trim|required');\n $this->form_validation->set_rules('titleNL', 'titleNL', 'trim');\n $this->form_validation->set_rules('titleEN', 'titleEN', 'trim');\n $this->form_validation->set_rules('descriptionFR', 'descriptionFR', 'trim');\n $this->form_validation->set_rules('descriptionNL', 'descriptionNL', 'trim');\n $this->form_validation->set_rules('descriptionEN', 'descriptionEN', 'trim');\n $this->form_validation->set_rules('date', 'date', '');\n $this->form_validation->set_rules('categorie', 'categorie', '');\n $this->form_validation->set_rules('city', 'city', 'trim');\n $this->form_validation->set_rules('cityCode', 'cityCode', 'trim');\n $this->form_validation->set_rules('address', 'address', 'trim');\n $this->form_validation->set_rules('addressInfos', 'addressInfos', 'trim');\n $this->form_validation->set_rules('price', 'price', 'trim');\n $this->form_validation->set_rules('reservation', 'reservation', 'trim');\n $this->form_validation->set_rules('users', 'users', '');\n $this->form_validation->set_error_delimiters('<div class=\"alert alert-error\"><a class=\"close\" data-dismiss=\"alert\">×</a><strong>', '</strong></div>');\n //if the form has passed through the validation\n if ($this->form_validation->run()) {\n\n $this->input->post('titleFR') != \"\" ? $titleFR = $this->input->post('titleFR') : $titleFR = null;\n $this->input->post('titleNL') != \"\" ? $titleNL = $this->input->post('titleNL') : $titleNL = null;\n $this->input->post('titleEN') != \"\" ? $titleEN = $this->input->post('titleEN') : $titleEN = null;\n\n $this->input->post('descriptionFR') != \"\" ? $descriptionFR = $this->input->post('descriptionFR') : $descriptionFR = null;\n $this->input->post('descriptionNL') != \"\" ? $descriptionNL = $this->input->post('descriptionNL') : $descriptionNL = null;\n $this->input->post('descriptionEN') != \"\" ? $descriptionEN = $this->input->post('descriptionEN') : $descriptionEN = null;\n\n $event = $this->events_model->getEventByID($id);\n $titleID = $event['title'];\n $descriptionID = $event['description'];\n\n $this->labels_model->editLabel($titleID, $titleFR, $titleNL, $titleEN);\n $this->labels_model->editLabel($descriptionID, $descriptionFR, $descriptionNL, $descriptionEN);\n\n $fullDate = explode(' ', $this->input->post('date'));\n $dateArray = explode('/', $fullDate[0]);\n $heureArray = explode(':', $fullDate[1]);\n $jour = $dateArray[0];\n $mois = $dateArray[1];\n $annee = $dateArray[2];\n $heure = $heureArray[0];\n $minute = $heureArray[1];\n $seconde = \"00\";\n $finalDate = $annee.'-'.$mois.'-'.$jour.' '.$heure.':'.$minute.':'.$seconde;\n\n $this->input->post('reservation') != \"\" ? $reservation = $this->input->post('reservation') : $reservation = \"http://www.bpho.be/concerts/\";\n\n $data_to_store = array(\n 'title' => $titleID,\n 'description' => $descriptionID,\n 'startDate' => $finalDate,\n 'endDate' => $finalDate,\n 'city' => $this->input->post('city'),\n 'cityCode' => $this->input->post('cityCode'),\n 'addressInfos' => $this->input->post('addressInfos'),\n 'price' => $this->input->post('price'),\n 'reservation' => $reservation,\n 'address' => $this->input->post('address')\n );\n\n //if the insert has returned true then we show the flash message\n if($this->events_model->updateEvent($id, $data_to_store) == TRUE){\n $this->session->set_flashdata('flash_message', 'updated');\n } else {\n $this->session->set_flashdata('flash_message', 'not_updated');\n }\n\n if(isset($_FILES['image']) && $_FILES['image']['tmp_name'] != \"\") {\n $this->events_model->uploadImage(\"../images/\", \"e\".$id, $_FILES);\n }\n\n $this->events_model->addCategory($id, $this->input->post(\"categorie\"));\n\n $oldCat = $this->input->post(\"oldCategory\");\n $newCat = $this->input->post(\"categorie\");\n\n if($oldCat == 1 && $newCat == 2) {\n $this->events_model->deleteLinkRepet($id);\n } elseif($oldCat == 1 && $newCat == 1) {\n $this->events_model->deleteLinkRepet($id);\n if($this->input->post(\"categorie\") == 1 && $this->input->post(\"concert\") > 0) {\n $this->events_model->addLinkConcert($id, $this->input->post(\"concert\"));\n }\n } elseif($oldCat == 2 && $newCat == 1) {\n $this->events_model->deleteLinkConcert($id);\n if($this->input->post(\"categorie\") == 1 && $this->input->post(\"concert\") > 0) {\n $this->events_model->addLinkConcert($id, $this->input->post(\"concert\"));\n }\n }\n\n if (isset($_POST['users'][0])) {\n $musiciens = $_POST['users'];\n $this->events_model->deleteEventUsers($id);\n foreach ($musiciens as $musicien) {\n $this->events_model->addEventUser($id, $musicien);\n }\n } else {\n $this->events_model->deleteEventUsers($id);\n }\n\n redirect('admin/events/update/'.$id.'');\n\n }\n\n }\n\n $event = $this->events_model->getEventByID($id);\n $fullDate2 = explode(\" \", $event['startDate']);\n $date = explode(\"-\", $fullDate2[0]);\n $annee = $date[0];\n $mois = $date[1];\n $jour = $date[2];\n $time = explode(\":\", $fullDate2[1]);\n $dateFinal = $jour.\"/\".$mois.\"/\".$annee.\" \".$time[0].\":\".$time[1];\n $event['startDate'] = $dateFinal;\n\n $data['event'] = $event;\n\n $title = $this->labels_model->getFullLabelByID($event['title']);\n $data['event']['titleFR'] = $title['fr'];\n $data['event']['titleNL'] = $title['nl'];\n $data['event']['titleEN'] = $title['en'];\n\n $description = $this->labels_model->getFullLabelByID($event['description']);\n $data['event']['descriptionFR'] = $description['fr'];\n $data['event']['descriptionNL'] = $description['nl'];\n $data['event']['descriptionEN'] = $description['en'];\n\n $data['event']['categorie'] = $this->events_model->getEventCategory($id);\n $data['categories'] = $this->events_model->getCategories();\n $concerts = $this->events_model->getConcert();\n $data['concerts'] = $concerts;\n\n if($data['event']['categorie'] == 1) {\n $data['event']['concert'] = $this->events_model->getEventConcert($id);\n } else {\n $data['event']['concert'] = 0;\n }\n\n $users = $this->users_model->getUsersOrderByFirstName();\n foreach($users as &$user) {\n if($this->users_model->hasInstrument($user['id'])) {\n $instruments = $this->instruments_model->getInstrumentsByUser($user['id']);\n $user['instruments'] = $instruments;\n } else {\n $user['instruments'] = \"\";\n }\n }\n $data['users'] = $users;\n\n $data['event']['users'] = $this->events_model->getEventUsers($id);\n\n //load the view\n $data['main_content'] = 'admin/events/edit';\n $this->load->view('includes/template', $data);\n\n }", "public function update($id)\n {\n $newsUpdate = $this->request->all();\n $news=NewEvent::find($id);\n $news->update($newsUpdate);\n return redirect('news');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n //var_dump(Yii::$app->request->post());\n //exit();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', '事件<'. $model->title .'>更新成功! ');\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n }", "public function action_updatedo()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n\t\t$id = $post[\"id\"];\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n if($entry){\n\t\t\t$entry[\"venue\"] = $post[\"venue\"];\n\t\t\t$entry[\"post\"] = $post[\"post\"];\n\t\t\t$entry[\"dating\"] = $post[\"dating\"];\n\t\t\t$entry[\"content\"] = $post[\"content\"];\n\t\t\t$entry[\"name\"] = $post[\"name\"];\n\t\t\t$entry[\"man_num\"] = $post[\"man_num\"];\n\t\t\t$entry[\"woman_num\"] = $post[\"woman_num\"];\n\t\t\t$entry[\"visitors_num\"] = $post[\"visitors_num\"];\n\t\t\tif(!$entry->save()){\n\t\t\t\t$data[\"msg\"] = \"更新に失敗しました。\";\n\t\t\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n }\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}", "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, Event $event)\n {\n// $event->name = $request->input('name');\n// $event->description = $request->input('description');\n// $event->save();\n// dd($request->only(['name','description']));\n $event->update($request->only(['name','description']));\n\n Session::flash('status', 'Edited ok!');\n return Redirect::to('/events/edit/' . $event->id);\n }", "public function actionUpdate($id)\n {\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['Events']))\n {\n $model->attributes=$_POST['Events'];\n\n $file_image = CUploadedFile::getInstance($model,'image');\n\n if ( (is_object($file_flyer) && get_class($file_flyer)==='CUploadedFile'))\n $model->flyer = $file_flyer;\n\n if($model->save())\n {\n if (is_object($file_flyer))\n $model->flyer->saveAs(Yii::app()->basePath.'/../files/flyers/'.$model->flyer);\n\n\n //$this->redirect(array('update','id'=>$model->id));\n\n }\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $EventsID)\n {\n $this->validate($request, [\n 'eventname'=>'required',\n 'venue' =>'required',\n 'sdate' =>'required',\n 'edate'=>'required',\n 'description'=>'required',\n 'eimage'=>'nullable'\n ]);\n\n $event = Event::where('EventsID', $EventsID)->first();\n $event->EventName=$request->eventname;\n $event->Description=$request->description;\n $event->Venue=$request->venue;\n $event->Startdate=$request->sdate;\n $event->Enddate=$request->edate;\n $event->Image=$request->eimage;\n $event->save();\n\n return redirect(route('event_list'))->with('success', 'Event Updated');\n }", "public function update(Request $request)\n\t{\n\t\t$evento=Evento::find($request->id);\n\t\t$evento->nombre_evento = $request->nombre_evento;\n\t\t$evento->tipo_evento = $request->tipo_evento;\n\t\t$evento->fecha_evento = $request->fecha_evento;\n\t\t$evento->hora_inicio_evento = $request->hora_inicio_evento;\n\t\t$evento->hora_fin_evento = $request->hora_fin_evento;\n\t\t$evento->lugar_evento = $request->lugar_evento;\n\t\t$evento->descripcion_evento = $request->descripcion_evento;\n\t\t$evento->estado_evento = $request->estado_evento;\n\t\t$evento->responsable = $request->responsable;\n\t\t$evento->save();\n\t\treturn redirect('evento');\n\t}", "public function update(Request $request, $id)\n { \n $request->validate([\n 'name' => 'required',\n ]);\n $event= \\App\\event::find($id);\n $event->update($request->all());\n \n return redirect()->route('event.index')\n ->with('success','event updated successfully');\n }", "public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }", "public function actionUpdate() {\n $data = $this->data;\n $model = $this->findModel($data['employee_id']);\n if ($model) {\n $model->employee_code = $data['employee_code'];\n $model->employee_name = $data['employee_name'];\n $model->employee_email = $data['employee_email'];\n $model->status = $data['status'];\n $model->department_id = $data['department_id'];\n\n $errors = $this->EmpDetailsvalidate($data['address']);\n if ($model->validate() && empty($errors)) {\n $model->save();\n $this->InsertUpdateEmpAddress($model->id, $data['address']);\n echo $this->messageReturn(\"success\", 200);\n exit;\n } else {\n $error = $model->getErrors();\n echo $this->messageReturn(\"error\", 404, \"\", $error);\n exit;\n }\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Please sent correct parameter\");\n exit;\n }\n }", "public function update(Request $request, Event $event)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'start_at' => 'required'\n ]);\n $requestData = $request->all();\n $event->update($requestData);\n\n if ($request->wantsJson()) {\n return response()->json([\n 'message' => __('Data edited successfully')\n ]);\n }\n\n return redirect(route('events.index'))->with('message', __('Data edited successfully'));\n }", "public function editEvent() {\n\n /* Searching the event */\n $event = EventDCI::find(Input::get('id'));\n\n if(is_null($event)) {\n Mail::send('errors.editevent',\n array(\n 'error' => 'No existe el evento especificado',\n 'user' => json_encode(Auth::user()),\n 'event' => json_encode(Input::all()),\n ),\n function($message) {\n $message->to('[email protected]')->subject('Error al editar evento - DCI');\n $message->to('[email protected]')->subject('Error al editar evento - DCI');\n }\n\n );\n\n return Redirect::to('dashboard')\n ->with('alert', 'No existe el evento especificado')\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Validating that the event belongs to the user login user */\n if($event->user_id != Auth::user()->id) {\n return Redirect::to('dashboard')\n ->with('alert', 'Usted no tiene permisos para modificar el evento especificado')\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Verifying that event has a correct and valid data */\n $validation = $this->validateEvent();\n\n if(!$validation['isValid']) {\n return Redirect::to('dashboard')\n ->with('alert', $validation['message'])\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Updating the event */\n $event->name = Input::get('name');\n $event->start_day = Input::get('start_day');\n $event->end_day = Input::get('end_day');\n $event->time = Input::get('time');\n $event->place = Input::get('place');\n $event->link = Input::get('link');\n $event->directed_to = Input::get('directed_to');\n $event->has_cost = !Input::has('has_cost');\n $event->description = Input::get('description');\n $event->save();\n\n $now = new DateTime();\n\n /* Getting old services, resources sources and witeness to the event */\n $old_services = $event->services()->get();\n $old_resources_sources = $event->resources_sources()->get();\n $old_witnesses = $event->witnesses()->get();\n $old_pdi_programs = $event->pdi_programs()->get();\n\n /* Deactivating old services */\n foreach ($old_services as $old_service) {\n $event->services()->updateExistingPivot($old_service->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old resources sources */\n foreach ($old_resources_sources as $old_resource_source) {\n $event->resources_sources()->updateExistingPivot($old_resource_source->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old resources sources */\n foreach ($old_witnesses as $old_witness) {\n $event->witnesses()->updateExistingPivot($old_witness->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old PDI programs */\n foreach ($old_pdi_programs as $old_pdi_program) {\n $event->pdi_programs()->updateExistingPivot($old_pdi_program->id, array('deleted_at' => $now));\n }\n\n /* Getting information about diffusion */\n if(Input::has('services')) {\n\n /* Getting new services to the event */\n $new_services = Input::get('services');\n\n /* Updating old services and adding new services */\n foreach ($new_services as $new_service) {\n if($this->validateArrayElement($new_service, 'string')) {\n $service_exist = false;\n foreach ($old_services as $old_service) {\n if($old_service['original']['pivot_service_id'] == $new_service) {\n $service_exist = true;\n $event->services()->updateExistingPivot($old_service->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$service_exist) {\n $data_services = array(\n 'start_service' => Input::get('start_day'),\n 'end_service' => Input::get('end_day'),\n );\n\n $event->services()->attach($new_service, $data_services);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los servicios actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n /* Sending email to all boss that have relation with the services */\n $departments_sended_mail = array();\n foreach ($event->services()->wherePivot('deleted_at', '=', NULL)->get() as $service) {\n /* Getting the departments associated to the services */\n $department = $service->department()->first();\n\n if(!in_array($department->id, $departments_sended_mail)) {\n /* Getting the users associated to a department that they are bosses */\n $bosses = $department->users()->where('user_type_id', '=', 3)->where('status', '=', 1)->get();\n\n if($bosses->isEmpty()) {\n /* Getting the admin users */\n $admins = User::where('user_type_id', '=', 4)->where('status', '=', 1)->get();\n\n /* Sending email to admins */\n foreach ($admins as $admin) {\n Mail::send('emails.notification.editeventnoboss',\n array(\n 'event' => $event->name,\n 'department' => $department->name,\n ),\n function($message) use($admin) {\n $message->to($admin->email)->subject('Evento editado (Revisar detalle) - DCI');\n }\n\n );\n }\n }\n else {\n /* Sending email to bosses */\n foreach ($bosses as $boss) {\n Mail::send('emails.notification.editevent',\n array(\n 'event' => $event->name,\n ),\n function($message) use($boss) {\n $message->to($boss->email)->subject('Evento editado - DCI');\n }\n\n );\n }\n }\n\n array_push($departments_sended_mail, $department->id);\n }\n }\n\n /* Updating support material to the event */\n $support_materials_aux = Input::get('support_materials');\n $new_support_materials = empty($support_materials_aux) ? array() : Input::get('support_materials');\n $old_support_materials = $event->support_materials()->get();\n\n /* Soft deleting to files deleted by user */\n foreach ($old_support_materials as $old_support_material) {\n if(!in_array($old_support_material->file, $new_support_materials)) {\n $old_support_material->delete();\n }\n }\n\n /* Inserting new files added by user */\n if(Input::hasFile('files')) {\n $files = Input::file('files');\n\n foreach ($files as $file) {\n $new_name = str_random(20).'.'.$file->getClientOriginalExtension();\n $file->move('./support_materials', $new_name);\n\n $support_material_data = array(\n 'original_name' => $file->getClientOriginalName(),\n 'file' => 'support_materials/'.$new_name,\n );\n\n $support_material = new SupportMaterial($support_material_data);\n $event->support_materials()->save($support_material);\n }\n }\n\n }\n\n if(Input::has('resources_sources')) {\n\n /* Getting new resources sources to the event */\n $new_resources_sources = Input::get('resources_sources');\n\n /* Updating old resources sources and adding new resources sources */\n foreach ($new_resources_sources as $new_resource_source) {\n if($this->validateArrayElement($new_resource_source, 'string')) {\n $resource_source_exist = false;\n foreach ($old_resources_sources as $old_resource_source) {\n if($old_resource_source['original']['pivot_resource_source_id'] == $new_resource_source) {\n $resource_source_exist = true;\n $event->resources_sources()->updateExistingPivot($old_resource_source->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$resource_source_exist) {\n $event->resources_sources()->attach($new_resource_source);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Las fuentes de recursos actualizadas no son válidas')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n }\n\n if(Input::has('witnesses')) {\n\n /* Getting new resources sources to the event */\n $new_witnesses = Input::get('witnesses');\n\n /* Updating old resources sources and adding new resources sources */\n foreach ($new_witnesses as $new_witness) {\n if($this->validateArrayElement($new_witness, 'string')) {\n $witnesses_exist = false;\n foreach ($old_witnesses as $old_witness) {\n if($old_witness['original']['pivot_witness_id'] == $new_witness) {\n $witnesses_exist = true;\n $event->witnesses()->updateExistingPivot($old_witness->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$witnesses_exist) {\n $event->witnesses()->attach($new_witness);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los testigos actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n }\n\n if(Input::has('pdi_programs')) {\n\n /*Getting new PDI programs to the event*/\n $new_pdi_programs = Input::get('pdi_programs');\n\n /* Updating old PDI programs and adding new PDI programs */\n foreach ($new_pdi_programs as $new_pdi_program) {\n if($this->validateArrayElement($new_pdi_program, 'string')) {\n $pdi_programs_exist = false;\n foreach ($old_pdi_programs as $old_pdi_program) {\n if($old_pdi_program['original']['pivot_pdi_program_id'] == $new_pdi_program) {\n $pdi_programs_exist = true;\n $event->pdi_programs()->updateExistingPivot($old_pdi_program->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$pdi_programs_exist) {\n $event->pdi_programs()->attach($new_pdi_program);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los testigos actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n }\n\n return Redirect::to('dashboard')->with('alert', 'Evento editado exitosamente ' . $event->id_dci);\n\n }", "public function update($id)\n\t{\n\t\t\n $event = CalendarEvent::find($id);\n $directory = 'img/uploads/';\n $image = Input::file('img');\n \n $event->title = Input::get('title');\n $event->description = Input::get('description');\n $event->date = Input::get('date');\n $event->price = Input::get('price');\n $event->start_time = Input::get('start_time');\n if (!empty(Input::get('end_time'))) {\n $event->end_time = Input::get('end_time');\n } else {\n $event->end_time = null;\n }\n\n $event->location = Input::get('location');\n $event->address = Input::get('address');\n $event->city = Input::get('city');\n $event->state = Input::get('state');\n $event->zip = Input::get('zip');\n $event->user_id = 1;\n if (Input::hasFile('img')) {\n $event->img = $image->move($directory);\n }\n $event->save();\n\n Session::flash('successMessage', 'You updated ' . $event->title . ' event successfully');\n return Redirect::action('EventsController@index');\n\t}", "public function update(Request $request,$id)\n {\n // $events->update($request->all());\n // $events->save();\n // return redirect(route('events.index'));\n $event=Event::find($id);\n $data = $request->validate([\n 'eventsname' => 'string|required',\n 'eventstype' => 'string|required',\n 'description' => 'string|required',\n 'eventsdate' => 'date|required',\n 'eventsvenue' => 'string|required',\n 'eventsimage' => 'string|required',\n 'videolink' => 'string',\n ]);\n $event->update($data);\n $event->save();\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->elearningExamId));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "public function update(Request $request, $id)\n {\n $event = Event::find($id);\n $event->nomEvenement = $request->input('TitleEventCE');\n $event->descriptionEvent = $request->input('DescriptionEventCE');\n $event->nbMaxInscrits = $request->input('maxinscCE');\n $event->dateDeb = $request->input('dateDebEventCE');\n $event->dateFin = $request->input('dateFinEventCE');\n $event->EvenementPayant = $request->input('eventpayantCE');\n $event->lienSitePayment= $request ->input('sitepaiementCE');\n\n $event->save();\n\n return redirect()->back();\n\n }", "public function update(Request $request, $id)\n {\n $events = Event::findOrFail($id);\n $events->type = $request->type;\n $events->title = $request->title;\n $events->description = $request->description;\n $save = $events->save();\n if ($save) {\n return redirect()->back()->with('success', 'Event has been updated successfully');\n } else {\n return redirect()->back()->with('error', 'Something went wrong!');\n }\n }", "public function edit(Event $event)\n { \n // $event = Event::findOrFail($id);\n return view('events.edit',compact('event'));\n }", "public function update(Request $request, $id) {\n // validate the data\n $this->validate($request, array(\n 'date' => 'required|date|date_format:\"Y-m-d H:i:s',\n 'title' => 'required|max:255',\n 'category' => 'required'\n ));\n\n // store in the database\n $event = Event::find($id);\n if ($event && $event->status && $event->user_id == Auth::id()) { // check if event belgongs to this user\n $event->date = $request->date;\n $event->title = $request->title;\n if ($request->description != '') {\n $event->description = $request->description;\n }\n if (Auth::check()) { // check if logged in\n $event->user_id = Auth::id(); // assing user id\n }\n $event->slug = ($request->title != '' ? str_slug($request->title) : time()); // slug from title or timestamp\n if ($request->category > 0) {\n $event->category_id = $request->category;\n }\n $event->timezone = $request->timezone;\n if ($request->private == 'on') {\n $event->is_private = true;\n }\n // redirect to the specified resource if event is saved\n if ($event->save()) {\n Session::flash('success', 'Edited!');\n return redirect(route('events.edit', $event->id)); // redirect to user events\n }\n }\n return redirect(route('profile.events')); // redirect to user events\n }", "public function update(EventRequest $request, Event $event)\n {\n $this->authorize('update', $event);\n $event = $this->eventRepo->update($request->all(), $event->id);\n return Response::success(new EventResource($event));\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}", "public function update(Request $request, $id)\n {\n //\n\n $this->validate($request,[\n 'event_type' => 'required',\n 'event_description' => 'required',\n 'date'=>'required']);\n \n $event = Event::find($id);\n $event->event_type = $request->get('event_type');\n $event->event_description = $request->get('event_description');\n $event->date = $request->get('date');\n $event->save();\n\n // DB:: update('update events set event_type=?,event_description=?,date=? where event_id=? ',[$event_type,$event_description,$event_date,$id]);\n\n return redirect('postLoginEventView')->with('success','Event Updated');\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }", "function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}", "public function actionUpdate($id)\n {\n \t\n $model = $this->findModel($id);\n $model->start_date = date ( \"d-m-Y H:i\", $model->start_date );\n if($model->end_date!=''){\n $model->end_date = date ( \"d-m-Y H:i\", $model->end_date );\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \t\n \tif (Yii::$app->request->isAjax) {\n \t\treturn 1;\n \t\texit();\n \t}else{\n return $this->redirect(['view', 'id' => $model->id]);\n \t}\n } \n if (Yii::$app->request->isAjax) {\n \treturn $this->renderAjax ( 'update', [\n \t\t\t'model' => $model,\n \t] );\n }else{\n \n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function editEve($u_event_title,$u_event_date,$u_event_detail,$event_id){\n //check if it is same event or not\n // $check_sql=\"SELECT * FROM `events` WHERE `event_name`='$u_event_title'\";\n // $result_check=$this->conn->query($check_sql);\n\n // if($result_check->num_rows>0){\n // echo \"<div class='alert alert-danger text-center'>The event is already in the table.</div>\";\n\n // }else{\n // update the data\n $sql=\"UPDATE `events` SET `event_title`='$u_event_title',`event_detail`='$u_event_detail',`event_date`='$u_event_date' WHERE `event_id`='$event_id'\";\n $result=$this->conn->query($sql);\n\n if($result==true){\n header(\"location:edit_event.php?event_id=$event_id&success=1&message=The event was successfully modified\");\n\n }else{\n header(\"location:edit_event.php?event_id=$event_id&success=0&message=Error occurd.Try it again.\");\n\n }\n // }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()) {\n Yii::$app->session->setFlash('success', \"Employee update successfully.\");\n } else {\n Yii::$app->session->setFlash('error', \"Employee not saved.\");\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\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 //$id=getOrganisationID();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Requests\\StoreCalendarEvent $request, CalendarEvent $calendar_event)\n {\n $this->saveCalendarEvent($request, $calendar_event);\n\n return redirect()->route('calendar_events.index')->with('message', 'Item updated successfully.');\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 update(Request $request, $id)\n {\n $events = Events::findOrFail($id);\n $events->Event_start = $request->Event_start;\n $events->Event_end = $request->Event_end;\n $events->Color = $request->Color;\n \n $events->save();\n\n Session::flash('flash_message', 'ข้อมูลถูกแก้ไขเแล้ว!');\n return redirect()->back();\n\n }", "public function updateEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n if ($this->input->post('start') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array(\n 'start' => $this->input->post('start'),\n 'id' => $id,\n 'updated_by' => $this->session->get('username'),\n 'course_desc' => $this->input->post('courseDesc'),\n 'certified_by' => $this->input->post('certifiedBy'),\n 'all_day_event' => (int)$this->input->post('allday'),\n 'end' => $this->input->post('end'),\n );\n\n $updated = $this->model->updateEvent($reqData);\n if ($updated === true) {\n $response = array(\"status\" => true, \"message\" => 'Event updated.');\n $this->send(200, $response);\n } else {\n $response = array(\"status\" => false, \"message\" => 'Event not updated.');\n $this->send(500, $response);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\tif(isset($_POST['buttonCancel']))\n {\n $this->redirect(Yii::app()->homeUrl);\n }\n\t\t\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Organisation']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Organisation'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->orgId));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function update(Request $request, Event $event)\n {\n //\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}", "public function update(UpdateEventsRequest $request, $id)\n {\n if (! Gate::allows('event_edit')) {\n return abort(401);\n }\n $event = Event::findOrFail($id);\n $event->title = $request->input('title');\n $event->description = $request->input('description');\n $event->start_time = $request->input('start_time');\n $event->venue = $request->input('venue');\n $event->category_id = $request->input('category_id');\n $event->subcategory_id = $request->input('subcategory_id');\n // edited\n if($request->hasfile('photo'))\n { \n $image = $request->file('photo');\n $name=time(). '.' .$image->getClientOriginalName();\n $image->move(public_path().'/images/events/', $name);\n $oldPhoto = $event->photo;\n $event->photo = $name;\n $image_path = public_path().'/images/events/'.$oldPhoto;\n // dd($image_path);\n File::delete($image_path);\n $event->save();\n }\n // $event->update($request->all());\n\n\n\n\n return redirect()->route('admin.events.index');\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('up-date', [\r\n 'model' => $model,\r\n ]);\r\n }\r\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 actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function edit(Event $event)\n {\n //dd($events);\n // return view('events.edit',['events'=>$event]);\n \n }", "public function update($id)\n\t{\n $data \t\t=\t$this->inputAll();\n $event = \t$this->events->findOrFail($id);\n $rules\t\t= $this->events->getUpdateRules();\n unset($data['storage_events_id'], $data['properties_id']);\n\n $validator = $this->validator->make($data, $rules);\n if ($validator->fails())\n {\n return $this->redirect->back()->withErrors($validator)->withInput();\n }\n\n $data['is_arifmetic'] = (isset($data['is_arifmetic'])) ? (int) $data['is_arifmetic'] : 0;\n\n if($data['is_arifmetic'] == 0)\n $data['char'] = \"\";\n\n $event->update($data);\n\n return $this->redirect('events.index');\n\t}", "public function updateEmployee()\n {\n // if we have POST data to create a new employee entry\n if (isset($_POST[\"submit_update_employee\"])) {\n // do updateEmployee() from model/model.php\n $this->model->updateEmployee($_POST[\"firstname\"], $_POST[\"surname\"], $_POST[\"email\"], $_POST[\"phone\"], $_POST[\"category\"], $_POST[\"started\"], $_POST[\"left\"],$_POST['employee_id']);\n }\n\n // where to go after employee has been added\n header('location: ' . URL . 'employees/index');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->start_date = date('d M Y', strtotime($model->start_date));\n if ($model->load(Yii::$app->request->post()) ) {\n\n if ($model->updateUser() ) {\n Yii::$app->session->setFlash('success', \"Investor has been updated\");\n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n //var_dump($model->errors);die();\n Yii::$app->session->setFlash('error', \"Failed to update Investor\");\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n Yii::$app->session->setFlash('error', \"UserName/Email has already been taken\");\n return $this->render('create', [\n 'model' => $model,\n ]);\n\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\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 actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(EventRequest $request, $resourceId, $eventId)\n {\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n $event = $this->event->update($request, $eventId);\n\n if ($event) {\n $message = 'Successfully updated event.';\n\n return redirect()->route($this->routes['show'], [$eventable->id, $event->id])->withSuccess($message);\n } else {\n $message = 'There was an issue updating this event. Please try again.';\n\n return redirect()->route($this->routes['edit'], [$eventable->id])->withErrors($message);\n }\n }", "public function update(Request $request, Event $event)\n {\n $this->validate($request,[\n 'title'=>'required',\n 'signup_start'=>'required|date|after:today',\n 'signup_end'=>'required|date|after:today',\n 'prize_date'=>'required|date|after:today',\n 'signup_num'=>'required',\n ],[\n 'start_time.after'=>'起始日期必须是今天之后!'\n ]);\n// dd($request->start_time);\n $event->update([\n 'title'=>$request->title,\n 'content'=>$request->contents??0,\n 'signup_start'=>strtotime($request->signup_start),\n 'signup_end'=>strtotime($request->signup_end),\n 'prize_date'=>$request->prize_date,\n 'signup_num'=>$request->signup_num,\n 'is_prize'=>intval($request->is_prize),\n ]);\n return redirect('event')->with('success','修改成功!');\n }", "public function editEvent(Request $request, $evID)\n {\n $this->validator($request->all())->validate();\n \n $event = Event::find($evID);\n if ($event == null) {\n return view('cms.error', ['message' => 'Event not found!']);\n }\n\n $event = $this->edit($request->all(), $event);\n \n return redirect('/cms/events');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->U_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, $id)\n {\n /*$this->validate($request, [\n 'name' => 'required',\n 'email' => 'required|unique:users,email,'. $id .'|max:255',\n ]);*/\n\n $event = Event::find($id);\n $event->name = $request->input('name');\n $event->description = $request->input('description');\n $event->date = $request->input('date');\n $event->hour = $request->input('hour');\n $event->minimum_quorum = $request->input('minimum_quorum');\n $event->max_capacity = $request->input('max_capacity'); \n //$event->user_id = $request->input('user_id');\n //tipo_evento_id\n //user_id\n //publico_id \n $event->save();\n return redirect()->action('EventController@index');\n }", "public function update(Event $event){\r\n $stmt = $this->db->prepare(\"UPDATE event set type=?, name=?, moment=?, date=?, guests=?, children=?, \r\n sweet_table=?, observations=?, restaurant=?, phone=?, price=? WHERE id_event=?\");\r\n $stmt->execute(array($event->getType(), $event->getName(), $event->getMoment(), $event->getDate(), $event->getGuests(), $event->getChildren(),\r\n $event->getSweetTable(), $event->getObservations(), $event->getRestaurant(), $event->getPhone(),$event->getPrice(),$event->getIdEvent()));\r\n\r\n }", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function actionUpdate($id)\n {\n if($this->isAuthenticate())\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['index','type' => $model->IdEntityType]);\n } else \n {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }", "function edit($venueID)\n { \n // check if the venue exists before trying to edit it\n $data['venue'] = $this->Venue_model->get_venue($venueID);\n \n if(isset($data['venue']['venueID']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('venueCode','VenueCode','required|max_length[10]');\n\t\t\t$this->form_validation->set_rules('venueName','VenueName','required|max_length[100]');\n\t\t\t$this->form_validation->set_rules('venueType','VenueType','required|max_length[50]');\n\t\t\t$this->form_validation->set_rules('status','Status','required|max_length[15]');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'venueType' => $this->input->post('venueType'),\n\t\t\t\t\t'venueCode' => $this->input->post('venueCode'),\n\t\t\t\t\t'venueName' => $this->input->post('venueName'),\n\t\t\t\t\t'status' => $this->input->post('status'),\n );\n\n $this->Venue_model->update_venue($venueID,$params); \n $idnum = $this->session->userdata('userIDNo');\n $paramsaudit = array(\n 'userIDNo' => $idnum,\n 'auditDesc' => 'Successfully edited an existing venue',\n ); \n redirect('venue/index');\n }\n else\n {\n $data['_view'] = 'venue/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The venue you are trying to edit does not exist.');\n }", "public function edit($id)\n {\n $evento = evento::find($id);\n // Redirect to evento list if updating evento wasn't existed\n if ($evento == null || count($evento) == 0) {\n return redirect()->intended('/system-management/evento');\n }\n\n return view('system-mgmt/evento/edit', ['evento' => $evento]);\n }", "public function update(Request $request, Event $event)\n\t\t{\n\t\t\t // if (! $user = JWTAuth::parseToken()->authenticate()) {\n\t\t\t\t// return response()->json(['msg' => 'User not found'], 404);\n\t\t\t // }\n\n\t\t\t$input = $request->all();\n\n\t\t\t\t$validator = Validator::make($input, [\n\t\t\t'name'=> 'required',\n\t\t\t'date'=> 'required',\n\t\t\t'time'=> 'required',\n\t\t\t'price'=> 'required',\n\t\t\t\t'address'=> 'required',\n\t\t\t\t'city'=> 'required',\n\t\t\t\t'country'=> 'required',\t\t\t\n\t\t]);\n\n\t\t\tif($validator->fails()){\n\t\t\t\treturn $this->sendError('Validation Error.', $validator->errors());\n\t\t\t}\n\n\t\t\t\t$event->name = $input['name'];\n\t\t\t\t$event->date = $input['date'];\n\t\t\t\t$event->time = $input['time'];\n\t\t\t\t$event->price = $input['price'];\n\t\t\t\t\n\t\t\t\t$event->address = $input['address'];\n\t\t\t\t$event->city = $input['city'];\n\t\t\t\t$event->country = $input['country'];\n\t\t\t\t\n\t\t\t\t$event->imageUrl = $input['imageUrl'];\n\t\t\t\t$event->onlineUrl = $input['onlineUrl'];\n\n\t\t\t $event->save();\n\n\t\t\t return $event;\n\n\t\t\t// return $this->sendResponse($event->toArray(), 'Event mis a jour avec succes.');\n\t\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t$this->layout='//layouts/modalIframe';\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['Providers']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Providers'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('response', 'id'=>$model->id, 'action'=>'updated'));\n\t\t}\n\n\t\t$this->renderFormAjax($model);\n\n\t\t\n\t}", "public function update(Request $request, $id)\n {\n $event = EventCalendar::find($id);\n $event->title = $request->title;\n $starting_date = strtotime($request->starting_date);\n $event->starting_date = date('Y-m-d',$starting_date).' 00:00:01';\n $ending_date = strtotime($request->ending_date);\n $event->ending_date = date('Y-m-d', $ending_date).' 23:59:59';\n $event->school_id = school_id();\n $event->session = get_schools();\n if($event->save()) {\n flash(translate('event_has_been_updated_successfully'))->success();\n }\n \n return redirect()->back();\n }", "public function update(EventRequest $request, $id)\n {\n $event = Event::find($id);\n $event->event = $request->event;\n $event->organizer = $request->organizer;\n $event->description = $request->description;\n $event->start_date = Carbon::parse($request->start_date);\n $event->end_date = Carbon::parse($request->end_date);\n $week = Carbon::parse($request->start_date)->dayOfWeekIso;\n $color_array = ['#f39c12', '#e84393', '#27ae60', '#d35400', '#2980b9', '#8e44ad', '#c0392b'];\n $event->color = $color_array[$week-1];\n $event->user_id = $request->author;\n $event->slug = slug_th($request->event);\n $event->save();\n return back()->with([\n 'alert' => 'alert-success',\n 'message' => 'บันทึกข้อมูลเรียบร้อย!',\n ]);\n }", "public function actionUpdate($id)\n { \n $model = $this->findModel($id);\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('update', [\n 'model' => $model,\n ]);\n }\n }", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "public function actionUpdate($id)\n\n {\n \n $model = new Main();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n \n \n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Post']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Post'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $this -> layout = 'blankLayout';\n\n $model = $this->findModel($id);\n\n $model->updated_date = date('Y-m-d H:i:s');\n $model->updated_by = Yii::$app->user->getId(); \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', \"Saved successful\");\n return $this->redirect(Yii::$app->request->referrer);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n var_dump($model->errors); die;\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\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['Entry']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Entry'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->fulldesc = strip_tags($model->fulldesc);\n $user_id = $model->user_id;\n $model->datetime = User::getMyDatetime($model->datetime);\n if(isset($model->datetime_to))\n $model->datetime_to = User::getMyDatetime($model->datetime_to);\n $event_category = EventCategory::findOne(['id_event' => $id]);\n $event_categories = [];\n for($i=0; $i<3; $i++)\n $event_categories[] = new EventCategory();\n $pictures = $model->getPicturesForUpload(5);\n if(empty($event_category))\n $event_category = new EventCategory();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n print_r(Yii::$app->request->post());\n $model->datetime = User::convertMyDatetime($model->datetime);\n $model->datetime_to = User::convertMyDatetime($model->datetime_to);\n $model->user_id = $user_id;\n $model->save();\n\n $event_category->attributes = EventCategory::findLastPost();\n $event_category->id_event = $model->id;\n $event_category->save();\n\n for($i=0; $i<count($pictures); $i++) {\n $pictures[$i]->imageFile = UploadedFile::getInstance($pictures[$i], \"[$i]imageFile\");\n if(isset($pictures[$i])&& isset($pictures[$i]->imageFile)) {\n $pictures[$i]->upload();\n $picture_event = new PictureEvent();\n $picture_event->id_picture = $pictures[$i]->id;\n $picture_event->id_event = $model->id;\n $picture_event->save();\n }\n }\n $model->sendUpdateMessage();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'pictures' => $pictures,\n 'event_category' => $event_categories\n ]);\n }\n }", "public function update(EventRequest $request, $eventId)\n {\n\n return $this->response->noContent();\n }", "public function edit($id)\n\t{\n\t\t$evento = Evento::find($id);\n\t\treturn \\View::make('Evento/update_evento',compact('evento'));\n\t}", "public function updateEvent(Event $event)\n {\n /*\n * Set Details\n */\n $event->apiObject->setSummary($event->title);\n\n $event->apiObject->setDescription($event->description);\n\n $event->apiObject->setLocation($event->location);\n\n /*\n * Set Start Date\n */\n $start = $this->createDateTime($event->start, $event->timeZone, $event->allDay);\n $event->apiObject->setStart($start);\n\n /*\n * Set End Date\n */\n $end = $this->createDateTime($event->end, $event->timeZone, $event->allDay);\n $event->apiObject->setEnd($end);\n\n /*\n * Set Recurrence Rule, make sure it's not empty\n */\n if ($event->rrule) {\n $event->apiObject->setRecurrence([$event->rrule]);\n }\n\n /*\n * Create the event\n */\n $updatedEvent = $this->service->events->update($this->calendarId, $event->apiObject->getId(), $event->apiObject);\n\n // Return the updated Event object\n return $this->createEventObject($updatedEvent);\n }", "public function update(Request $request, $id)\n {\n $calendar_event = CalendarEvent::findOrFail($id);\n\n $calendar_event->title = $request->input(\"title\");\n $calendar_event->start = $request->input(\"start\");\n $calendar_event->end = $request->input(\"end\");\n $calendar_event->is_all_day = $request->input(\"is_all_day\");\n $calendar_event->background_color = $request->input(\"background_color\");\n\n $calendar_event->save();\n\n return redirect()->route('calendar_events.index')->with('message', 'Item updated successfully.');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n $this->layout=\"main\";\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }" ]
[ "0.7461516", "0.7337306", "0.72270215", "0.71775776", "0.71349293", "0.6980152", "0.6952172", "0.6871746", "0.6838319", "0.65652776", "0.65471834", "0.65352964", "0.65216005", "0.64700586", "0.63878757", "0.63759995", "0.63706136", "0.63603544", "0.63419336", "0.6339927", "0.63187575", "0.6301461", "0.6249597", "0.62402934", "0.62342983", "0.62026536", "0.61972547", "0.6155392", "0.6140091", "0.6132218", "0.61168593", "0.6104952", "0.6098833", "0.6086881", "0.60620666", "0.6061115", "0.6051442", "0.60504", "0.60460025", "0.6042104", "0.60274625", "0.60173416", "0.60102206", "0.60063195", "0.60025734", "0.60018694", "0.5996735", "0.59944797", "0.59942555", "0.59894466", "0.59863645", "0.5982935", "0.597676", "0.597676", "0.597676", "0.597676", "0.597676", "0.597676", "0.597676", "0.59689", "0.5966275", "0.59491134", "0.593151", "0.59301144", "0.5926364", "0.59211284", "0.5911549", "0.59112877", "0.5908554", "0.59038633", "0.5899436", "0.58977914", "0.58973926", "0.5894134", "0.588488", "0.5883654", "0.58822227", "0.5871785", "0.5866188", "0.586389", "0.5861818", "0.5860452", "0.585607", "0.5854618", "0.58478546", "0.5842004", "0.5836225", "0.5835999", "0.5832789", "0.5832572", "0.58309746", "0.58279747", "0.5826656", "0.5825168", "0.5824211", "0.5822415", "0.5821807", "0.5819384", "0.5818346", "0.58172446", "0.581695" ]
0.0
-1
Creates a new Social Media Link. If creation is successful, the browser will be redirected to the 'view' page.
public function actionLink($id) { $model = $this->findModel($id); if (Yii::$app->user->id == $model->user_id) { return $this->redirect(['update', 'id' => $id]); } $socialMediaModels = SocialMedia::find()->where(['event_id' => $id])->orderBy('id')->all(); // make "linked" link for hashtags foreach ($socialMediaModels as $socialMediaModel) { if ($socialMediaModel->site_name == 'twitter') { $url_regex = '/(http|https)?:?(\/\/)?(w*\.)?twitter\.com\/hashtag\/[a-zA-Z0-9\_\-]*\?src=hash/'; if (!preg_match($url_regex, $socialMediaModel->url)) { $socialMediaModel->url = preg_replace( '/#?(\w+)/i', 'https://twitter.com/hashtag/$1?src=hash', $socialMediaModel->url); } } } $linkModel = new SocialMedia(); $postData = Yii::$app->request->post(); if ($linkModel->load($postData) && $linkModel->validate()) { if ($linkModel->url == '') { $linkModel->delete(); } else { $linkModel->event_id = $model->id; try { $linkModel->save(); } catch (IntegrityException $e) { throw new \InvalidArgumentException('Url/Hashtag already exists'); } } // delete cache of this event and create new cache Yii::$app->cache->delete('socialmedia' . $id); $socialMediaModels = SocialMedia::find()->where(['event_id' => $id])->orderBy('id')->all(); $this->findSocialMedia($id, $socialMediaModels); return $this->redirect(['view', 'id' => $model->id]); } return $this->render('link', ['model' => $model, 'linkModel' => $linkModel, 'socialMediaModels' => $socialMediaModels]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('backend.pages.social_links.create');\n }", "public function create(){\n $dataReceiveFromPost = array(\n 'socialMedia' => $this->input->post(\"socialMedia\"),\n 'url' => $this->input->post(\"url\"),\n );\n $resultSocialCreate = $this->Social_Model->create($dataReceiveFromPost);\n echo json_encode($resultSocialCreate);\n }", "public function create()\n { \n //加载添加页面 \n return view('admin.links.create',['title'=>'友情链接添加']);\n }", "public function create()\n {\n //\n return view(\"Admin.link.create\");\n }", "public function create()\n {\n //显示添加链接界面\n return view('admin.links.add');\n }", "public function create()\n {\n //加载添加友情链接\n \n return view(\"admin.link.create\");\n }", "public function create()\n {\n return view('backend.website.social.add');\n }", "public function create()\n {\n //\n return view('admins.links.add');\n }", "public function create()\n {\n return view(\"/backend/link/create\");\n }", "public function create()\n {\n return view('mediasocial.create');\n }", "public function create()\n {\n if(no_permission('createLink')){\n return view(config('program.no_permission_to_view'));\n }\n return view('admin.link.add');\n }", "public function createAction()\n {\n $request = $this->getRequest();\n $em = $this->getDoctrine()->getManager();\n\n $form = $this->createForm(new LinkType(), new Link());\n $formHandler = new LinkHandler($form, $request, new Link(), $em);\n if ($formHandler->process()) {\n return $this->redirect($this->generateUrl('_blog_backend_link'));\n }\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('admin.socials.add');\n }", "public function create()\n {\n //\n return view('socials.add-new-social');\n }", "public function actionCreate()\n {\n $model = new ShareUser();\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 return view('backend.link.create');\n }", "public function insert(){\n\t\t$facebook = $_POST['facebook'];\n $linkedin = $_POST['linkedin'];\n $twitter = $_POST['twitter'];\n $youtube = $_POST['youtube'];\n\t\t$sql= $this->link->query(\"INSERT INTO social(facebook,linkedin,twitter,youtube)VALUES('$facebook','$linkedin','$twitter','$youtube')\");\n if($sql){\n\t\techo \"<script>alert('link created')</script>\";\n\t\techo \"<script>window.location.href = './social.php'</script>\";\n exit;\n\t }\n\t}", "public function create()\n {\n return view('admin.social.create');\n }", "public function create()\n {\n\n return view('admin.friendlinks.add',['title'=>'友情链接的添加页面']);\n }", "public function create()\n {\n\n //显示创建资源表单页\n return view('/home/friend/create',['title'=>'添加友情链接']);\n }", "public function create()\n {\n // 创建一个友情链接\n return view('admin.config.linkAdd');\n }", "public function create()\n {\n return view('links.create');\n }", "public function create()\n {\n return view('links.create');\n }", "public function actionCreate()\n {\n $model = new Url();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'idurl' => $model->idurl]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function newAction()\n {\n $entity = new Links();\n $form = $this->createForm(new LinksType(), $entity);\n return $this->render('SiteAdminBundle:Links:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function actionCreate()\n {\n $model = new MusrenbangSkpdMedia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Kd_Musrenbang_Kecamatan' => $model->Kd_Musrenbang_Kecamatan, 'Kd_Media' => $model->Kd_Media]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.pages.socialCreate');\n }", "public function createAction()\n {\n if( !$this->_helper->requireUser()->isValid() ) return;\n if( !$this->_helper->requireSubject('group')->isValid() ) return;\n \n $group = Engine_Api::_()->core()->getSubject('group');\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if(!$group->isOwner($viewer)&&!$group->isParentGroupOwner($viewer)) {\n $this->renderScript('/_error.tpl');\n return;\n }\n \n $this->view->form = $form = new Advgroup_Form_Link_Create();\n\n if( !$this->getRequest()->isPost() ) {\n return;\n }\n $post = $this->getRequest()->getPost();\n if(!$form->isValid($post)) return;\n $values = $form->getValues();\n $table = Engine_Api::_()->getItemTable('advgroup_link');\n $db = $table->getAdapter();\n $db->beginTransaction();\n try {\n $link = $table->createRow();\n $link->group_id = $group->group_id;\n $link->owner_id = $group->user_id;\n $link->title = $values['title'];\n $link->description = $values['description'];\n $link->link_content = $values['url'];\n $link->creation_date = date('Y-m-d H:i:s');\n $link->save();\n $db->commit();\n }\n catch (Exception $e){\n $db->rollBack();\n throw $e;\n }\n return $this->_helper->redirector->gotoRoute(array('id'=> $group->group_id,'action' => 'manage'), 'group_link', true);\n}", "public function create()\n {\n $link = new Link();\n\n return view('link.create', compact('link'));\n }", "public function actionCreate()\n\t{\n\t\t$model = new Banner('create');\n\t\t$media = new Media('create');\n\n\t\tif (isset($_POST['Banner'])) {\n\t\t\t$model->attributes=$_POST['Banner'];\n\n $media->attributes = $_POST['Media'];\n $media->file = CUploadedFile::getInstance($media,'file');\n\n if ($media->save()) {\n $model->media_id = $media->media_id;\n\n if ($model->save()) {\n Yii::app()->user->setFlash(\n 'success',\n Yii::t('admin', 'The banner {title} has been created!', array('{title}' => $media->title))\n );\n $this->redirect(array('index'));\n }\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model' => $model,\n 'media' => $media,\n\t\t));\n\t}", "public function store(LinkRequest $request)\n {\n $links = new link;\n\n $links -> name = $request -> input('name','');\n $links -> url = $request -> input('url','');\n\n if($links -> save()){\n return redirect('/admin/link') -> with('success','添加成功');\n }else{\n return back() -> with('error','添加失败');\n }\n }", "public function store(LinkInsertRequest $request)\n {\n // //自动验证\n // $this->validate($request,[\n // 'links_name'=>'required|regex:/[\\W\\w]{2,6}/|unique:links',\n // 'links_url'=>'required|active_url'//active_url验证路径是否有效\n // ],[\n // 'links_name.required' => '站点名称必填',\n // 'links_name.unique' => '站点名称已存在',\n // 'links_name.regex' => '站点名称不正确',\n // 'links_url.required' => 'URL地址必填',\n // 'links_url.active_url' => 'URL地址无效',\n // ]);\n //接受数据 处理数据\n $link = new Link;\n $link -> links_name = $request -> input('links_name','');\n $link -> links_url = $request -> input('links_url','');\n $link -> links_status = $request -> input('links_status','');\n $res = $link -> save();\n //判断是否添加成功\n if($res){\n //成功\n return redirect('/admin/links')->with('success','添加成功');\n }else{\n return back()->with('error','添加失败');\n }\n }", "public function create()\n {\n $data = [];\n return view('admin.links.create', $data);\n\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('admin')) {\n throw new ForbiddenHttpException('You are not allowed to perform this action.');\n }\n\n $model = new Event();\n\n $socialMediaModels = [];\n\n $model->max_num_socialMedia = 20;\n $model->num_socialMedia = 1;\n\n for ($i = 0; $i < $model->max_num_socialMedia; $i++) {\n $socialMediaModels[] = new SocialMedia();\n }\n\n $postData = Yii::$app->request->post();\n\n if ($model->load($postData) && $model->validate() && Model::loadMultiple($socialMediaModels, $postData) && Model::validateMultiple($socialMediaModels)) {\n $model->user_id = Yii::$app->user->id;\n\n $model->clicks = 0;\n\n // image\n $image = $model->uploadImage();\n if ($model->save()) {\n if ($image != null) {\n $image->saveAs($model->getImagePath());\n }\n\n foreach ($socialMediaModels as $socialMediaModel) {\n if ($socialMediaModel->url == '') {\n $socialMediaModel->delete();\n } else {\n $socialMediaModel->event_id = $model->id;\n try {\n $socialMediaModel->save();\n } catch (IntegrityException $e) {\n throw new \\InvalidArgumentException('Url/Hashtag already exists');\n }\n }\n }\n\n // delete cache of this event and create new cache\n Yii::$app->cache->delete('socialmedia' . $model->id);\n $socialMediaModels = SocialMedia::find()->where(['event_id' => $model->id])->orderBy('id')->all();\n $this->findSocialMedia($model->id, $socialMediaModels);\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n if (strtotime($model->start_date) != 0) {\n $model->start_date = date('d.m.Y G:i', strtotime($model->start_date));\n }\n if (strtotime($model->end_date) != 0) {\n $model->end_date = date('d.m.Y G:i', strtotime($model->end_date));\n }\n }\n return $this->render('create', ['model' => $model, 'socialMediaModels' => $socialMediaModels]);\n }", "public function actionCreate()\n {\n $model = new RedirectEntity();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->from_url_hash = md5($model->from_url);\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->from_url_hash]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store(LinkRequest $request)\n {\n if(no_permission('createLink')){\n return view(config('program.no_permission_to_view'));\n }\n $link = new Link();\n $link->name = $request->name;\n $link->title = $request->title;\n $link->url = $request->url;\n $link->orders = $request->orders;\n $link->status = $request->status;\n if($link->save()){\n $message = [\n 'code' => 1,\n 'message' => '推荐网址添加成功'\n ];\n }else{\n $message = [\n 'code' => 1,\n 'message' => '推荐网址添加失败,请稍后重试'\n ];\n }\n return response()->json($message);\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n 'link' => 'required',\n 'icon' => 'required',\n 'color'=> 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n else{\n $social = New SocialMedia();\n $social->name = $request->name;\n $social->link = $request->link;\n $social->icon = $request->icon;\n $social->color = $request->color;\n $social->status = 1;\n\n $social->save();\n\n $notification = array(\n 'message' => 'Social Media Add Successfully!',\n 'alert-type' => 'success'\n );\n\n return redirect()->route('social.index')->with($notification);\n\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n ]);\n $file = new Mediasocial;\n $file->name = $request->name;\n $file->link = $request->link;\n $file->save();\n\n return redirect('social');\n }", "public function create()\n {\n if (!Auth::check()) {\n return redirect()->back();\n }\n $media_formats = MediaFormat::all();\n $media_types = MediaType::all();\n $categories = Category::all();\n $access_types = AccessType::all();\n $tags = Tag::all();\n return view('pages.media.add')\n ->with(\"categories\", $categories)\n ->with(\"media_formats\", $media_formats)\n ->with(\"media_types\", $media_types)\n ->with(\"access_types\", $access_types)\n ->with(\"tags\", $tags);\n }", "public function newAction()\n {\n $form = $this->createForm(new LinkType(), new Link());\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $websites = Website::all();\n $link = new Link();\n\n return view('dashboard.link.create')->withWebsites($websites)->withLink($link);\n }", "public function create(CreateLinkRequest $request): RedirectResponse\n {\n $link = $this->links->create($request->input('location'));\n\n return redirect()->route('links.meta', $link->key);\n }", "public function store(LinkPost $request)\n {\n $link = new Link();\n $link->name = $request->name;\n $link->active = $request->active;\n $link->parent_id = $request->parent_id;\n $link->save();\n\n return redirect()->route(\"admin.links.index\")\n ->with(Messages::SUCCESS, Messages::LINK[Messages::CREATED]);\n }", "public function create()\n {\n $this->data('model', new Share());\n \n $this->data('page_title', trans('labels.share_creating'));\n \n $this->breadcrumbs(trans('labels.share_creating'));\n \n $this->_fillAdditionalTemplateData();\n \n return $this->render('views.'.$this->module.'.create');\n }", "public function create()\n {\n \n return view('admanager.admedia.create');\n \n }", "public function actionCreate() {\r\n\t\t$model = new Follow ();\r\n\t\t\r\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\r\n\t\t\treturn $this->redirect ( [ \r\n\t\t\t\t\t'view',\r\n\t\t\t\t\t'id' => $model->followID \r\n\t\t\t] );\r\n\t\t} else {\r\n\t\t\treturn $this->render ( 'create', [ \r\n\t\t\t\t\t'model' => $model \r\n\t\t\t] );\r\n\t\t}\r\n\t}", "public function actionCreate()\n\t{\n\t\t$model = new Post;\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save())\n\t\t{\n\t\t\treturn $this->redirect(['site/index']);\n\t\t}\n\t\t\n\t\techo $this->render('create', array(\n\t\t\t'model' => $model\n\t\t));\n\t}", "public function create()\n {\n $resources = Material::all();\n return view('admin.links.create',compact('resources'));\n }", "public\n function actionCreate()\n {\n $model = new Phforum();\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 created(Link $link)\n {\n $link->slug = Generate::slug($link->id);\n $link->name = $link->name ?? $link->slug;\n $link->domain = $link->domain ?? env('DEFAULT_SHORT_DOMAIN', 'ur.bn');\n $link->link_type_id = $link->link_type_id ?? 10;\n $link->save();\n }", "public function create()\n {\n return view(\"admin.links.create\")->with(\"links\", Link::getPotentialParents());\n }", "public function store(Request $request)\n {\n $data = $request->except(\"_token\");\n if(empty($data['link_name']) || empty($data['link_url'])){\n dd(\"不能为空\");\n }\n $res = LinkModel::create($data);\n if($res){\n return redirect(\"/link/index\");\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 actionCreate()\n\t{\n if (($id = Yii::$app->request->get('id')) == null) {\n\t\t\tthrow new \\yii\\web\\ForbiddenHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n\n $model = new LinkTree([\n 'creation_id' => $id,\n ]);\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', 'Linktree success created.'));\n if (Yii::$app->request->isAjax) {\n return $this->redirect(Yii::$app->request->referrer ?: ['manage', 'creation' => $model->creation_id]);\n }\n return $this->redirect(['manage', 'creation' => $model->creation_id]);\n //return $this->redirect(['view', 'id' => $model->banner_id]);\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\n\t\t$this->view->title = Yii::t('app', 'Create Linktree');\n\t\t$this->view->description = '';\n\t\t$this->view->keywords = '';\n\t\treturn $this->oRender('admin_create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t}", "public function store(CreateRequest $request): RedirectResponse\n {\n $link = Link::create($request->validated());\n return redirect()->route('links.show', $link);\n }", "protected function add(){\n\t\tif(!isset($_SESSION['is_logged_in'])){\n\t\t\theader('Location: '.ROOT_URL. 'pages/1');\n\t\t}\n\t\t$viewmodel = new ShareModel();\n\n\t\t$this->returnView($viewmodel->add(), true);\n\t}", "public function createAction(Request $request)\n {\n $entity = new Links();\n $entity->setActive(true);\n $form = $this->createForm(new LinksType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('links_show', array('id' => $entity->getId())));\n }\n\n return $this->render('SiteAdminBundle:Links:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function store(Request $request)\n { \n $request->validate([\n 'url' => 'required|unique:links,url,NULL,id,deleted_at,NULL',\n 'title' => ['required', 'max:255', new MinimalWords(2)],\n 'body' => ['required', new MinimalWords(5)],\n 'tags' => 'required',\n ]);\n\n $user = Auth::user(); \n \n $link = $user->links()->create([\n 'title' => $request->title,\n 'url' => cleanUrl($request->url),\n 'slug' => generateSlug($request->title, new Link),\n 'body' => $request->body,\n 'tags' => $request->tags,\n 'media' => $request->media,\n 'owner' => $request->owner,\n 'thumbnail' => $request->thumbnail,\n 'draft' => Auth::user()->isAdmin() ? false : true, //if admin auto publish\n 'original_published_at' => $request->original_published_at ?? Carbon::now(),\n ]); \n\n //change session token\n $request->session()->regenerateToken();\n return redirect('/link/' . $link->slug)->with('success', 'Link berhasil disubmit. Akan kami review');\n }", "public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n if(\\Yii::$app->user->isGuest) {\n \treturn $this->redirect(Yii::$app->params['default']);\n }\n\t\t\n\t\tif(\\Yii::$app->user->identity->jabatan !== \"Administrator\")\t {\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\t\n\t\t}\n\t\t\n $model = new Pengumuman();\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \t\\Yii::$app->getSession()->setFlash('success', \"Announcement is successfully created.\");\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.media.create');\n }", "public function actionCreate()\n {\n $model = new WebinarCreateRequest();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $model->status = Status::STATUS_NEW;\n $model->created_at = gmdate('Y-m-d H:i:s');\n $model->updated_at = gmdate('Y-m-d H:i:s');\n $model->created_by = $model->author_name;\n $model->updated_by = $model->author_name;\n $user = $model->author_name;\n $model->save();\n\n if($this->sendActivationLink($model->id, $model->email, $user)) {\n return $this->render('create', [\n 'model' => $model, \n 'status' => 'success', 'id' => $model->id]);\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 create()\n {\n $data['category'] = Category::all();\n return view('media.add', $data);\n }", "public function create()\n {\n if (!Auth::check()) {\n return redirect()->back();\n }\n\n return view('pages.media_format.add');\n }", "public function create()\n {\n $cond = ['status'=>1];\n\n if(isset($_REQUEST['category_id']) && !empty($_REQUEST['category_id']))\n {\n $cond['category_id'] = $_REQUEST['category_id'];\n }\n\n $this->data[\"files\"] = \\DB::table('media')->where($cond)->orderby('id', 'DESC')->get();\n return view('backend.pages.media.new')->with($this->data);\n }", "function Links_Add(){\n\t\t\n\t\t\n\t\tif(isset($_POST['linkadd'])){\n\t\t\t\n\t\t\n\t\t\n\t\t$values = \"'\".$_POST['fb'].\"','\".$_POST['tw'].\"','\".$_POST['lk'].\"','\".$_POST['insta'].\"','\".$_POST['com'].\"','\".$_POST['doctor'].\"'\";\n\t\t\t\n\t\t\t$this->Add('links',$values,'Social-Links?List&m');\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name'=>['required', 'string'],\n 'url'=>['required', 'url']\n ]);\n\n $user = Auth::user();\n\n $link = new Link([\n 'name'=> $request->input('name'),\n 'url'=>$request->input('url'),\n 'user_id'=>$user->id,\n ]);\n\n $link->save();\n\n return redirect()->route('links.index')->with('status', 'Link Added Correctly!');\n }", "public function actionCreate()\n {\n $model = new Action();\n if (Yii::$app->request->isPost) {\n $postActionFields = Yii::$app->request->post('ActionFields', []);\n $actionFieldsModels = [];\n for ($i = 0; $i < count($postActionFields); $i++) {\n $actionFieldsModels[] = new ActionFields();\n }\n if ($model->load(Yii::$app->request->post()) && Model::loadMultiple($actionFieldsModels, ['ActionFields' => $postActionFields])) {\n if (($model->validate() && Model::validateMultiple($actionFieldsModels))) {\n if ($model->save(false)) {\n foreach ($actionFieldsModels as $actionField) {\n $actionField->action_id = $model->id;\n $actionField->save(false);\n }\n //share op socialMedia\n $this->socialMediaPost($model);\n //redirect to view\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n } else {\n $actionFieldsModels = $model->actionFields;\n }\n return $this->render('create', ['model' => $model, 'actionFields' => $actionFieldsModels]);\n\n }", "public function postLink(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n// $path,$desc,$tag\r\n $blogItem = new BlogItemModel();\r\n $path=$_POST['path'];\r\n $desc=$_POST['title'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addLink($path,$desc,$tag);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function store(SocialRequest $request)\n {\n\n $social = new Social();\n\n $social->icon = $request->icon;\n\n $social->href = $request->link;\n\n $social->save();\n\n return redirect('/socials');\n\n }", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "public function store(CreateRequest $request)\n {\n $request->request->add(['murl' => $this->dispatchNow(new MinifyUrl())]);\n Link::create($request->all());\n\n return redirect()->route('link.index')->with('success', 'Link created successfully');\n }", "public function createpage(){\n\n if($this->check() == true){\n if(isset($_POST['submit']))\n {\n $link = $_POST['link'];\n $header = htmlentities($_POST['header'], ENT_QUOTES);\n $this->admindb->insert(\"pages\", array(\n \"linkname\" => $link,\n \"header\" => $header\n ))->get();\n }\n $this->view(\"admin/pagecreate\");\n }\n\n }", "public function create()\n {\n if (!Auth::check()) {\n return redirect()->back();\n }\n\n return view('pages.media_type.add');\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\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(Request $request)\n {\n //validation\n $validateData = $request->validate([\n 'icon_class' => 'required',\n 'name' => 'required',\n 'link' => 'required|url'\n ]);\n \n //saving data on database\n $sociallink = new Social_link();\n $sociallink->icon_class = $request->icon_class;\n $sociallink->name = $request->name;\n $sociallink->link = $request->link;\n $sociallink->save();\n toastr()->success('Social link successfully added!');\n return redirect()->back();\n }", "public function create()\n {\n return view('video::admin.media.create');\n }", "public function create()\n {\n $links = Link::all();\n return view('userCreate', compact('links'));\n }", "public function newAction()\n {\n $entity = new link();\n\n if (false === $this->get('security.context')->isGranted('CREATE', $entity)) {\n throw new AccessDeniedException('Unauthorized access!');\n }\n \n $form = $this->createCreateForm($entity);\n\n return $this->render('MesdHelpWikiBundle:Link:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'menu' => new Menu(),\n ));\n }", "public function create()\n { \n //لجلب وعرض صفحة إنشاء منشور جديد\n return view('post_views/new_post');\n }", "public function actionCreate()\n {\n $model = new Post();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->alias = Inflector::slug($model->title);\n $model->created_date = time();\n $model->publish_date = time();\n if($model->save()) {\n \\Yii::$app->session->setFlash('success', Module::t('general', 'Create post successfull'));\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new News();\n $author = Yii::$app->user->identity->username;\n\n if ($model->load(Yii::$app->request->post())){\n $model->setAuthor($author);\n if($model->save()){\n return $this->redirect('index');\n }\n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Comment;\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['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Content;\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['Content']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Content'];\n\t\t\t$model->lastmod=date('Y-m-d H:i:s',time());\n\t\t\tif($model->save()){\n\t\t\t\t\n\t\t\t\tYii::app()->user->setFlash('success', 'A változtatások mentésre kerültek.');\n\t\t\t\t$this->redirect($this->createAbsoluteUrl($this->uniqueid));\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tYii::app()->user->setFlash('error', 'Hibásan kitöltött űrlap.');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->module_info['item'] = \"Új \" . $this->module_info['new'] . \" hozzáadása\";\n\t\t\n\t\t$this->render($this->llink.'create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'url'=>'required'\n ]);\n\n $material = Material::findOrFail($request->get(\"resource\"));\n $link = new Link($request->only('url'));\n $link->material()->associate($material);\n $link->save();\n return redirect()->route('link')->with('message','Record Created !!!!');\n }", "public function actionCreate(){\n $model = new stdClass();\n $model->publisher = new Publisher;\n $model->picture = new Picture;\n \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\tif(!empty(Yii::app()->request->getPost('publisherForm'))){\n $form = Yii::app()->request->getPost('publisherForm');\n $model->itemPicture = $form['pictures'];\n $model->publisher->attributes = $form;\n if($model->publisher->validate()){\n try {\n $transaction = $model->publisher->dbConnection->beginTransaction();\n $model->publisher->save();\n $publisherId = Yii::app()->db->getLastInsertID();\n //$authorId = 6;\n $picArr = PictureConvertor::pictureTransfer($form['pictures']);\n $model->itemPicture = json_encode($picArr);\n $idArr = array();\n $idArr = $model->picture->insertAllPictures($picArr);\n $itemPic = new ItemPicture;\n $itemPic->insertDependencies($publisherId, $idArr, $model->publisher->tableName());\n $transaction->commit();\n //$transaction->rollback();\n $this->redirect(array('view','id'=>$publisherId));\n } catch (Exception $e) {\n $transaction->rollback();\n PictureConvertor::rollback($picArr);\n }\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('admin.media.create');\n }", "public function store(Request $request)\n {\n \t$this->validate($request, [\n 'link' => 'required|unique:short_links,link|url',\n ],[\n 'link.url'=>'Please Enter Proper URL Like http://www.example.com OR https://www.example.com'\n\n ]);\n\n \n $input['link'] = $request->link;\n $input['code'] = Str::random(5);\n\n\n \n ShortLink::create($input);\n \n return redirect('/')\n ->with('success', 'Shorten Link Generated Successfully!');\n }", "public function create()\n {\n //\n\n return view('admin.blog_add_new');\n }", "public function actionCreate()\n {\n $model = new Post();\n if (\\Yii::$app->user->can('createPost'))\n {\n if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->savePost()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n else\n {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else\n {\n throw new ForbiddenHttpException('Доступ Закрыт');\n }\n }", "public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }", "public function store(Request $request) {\n if($request->evenement_id == null) {\n return view('admin.link.create', ['evenementen' => Evenement::pluck('naam', 'id'),\n 'error' => 'No evenement selected']);\n }\n $link = new Link;\n $link->naam = $request->naam;\n $link->evenement_id = $request->evenement_id;\n $link->link = $request->link;\n $link->save();\n return view('admin.link.create', ['evenementen' => Evenement::pluck('naam', 'id'),\n 'message' => 'Link added to the database']);\n }", "public function actionCreate()\n {\n $model = new Article();\n if(!empty($_GET['kind'])) $model->kind=$_GET['kind'];\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 static function addnew(Link $link)\n {\n $ID=$user->ID;\n $PhysicalAddress=$Link->PhysicalAddress;\n $FriendlyAddress=$Link->FriendlyAddress;\n date_default_timezone_set(\"Africa/Cairo\");\n $today = date(\"Y-m-d H:i:s\");\n DB::add(\"links\",\"PhysicalAddress,FriendlyAddress,CreatedDateTime,LastUpdatedDateTime,IsDeleted\",\"'$PhysicalAddress','$FriendlyAddress','$today','$today',0\");\n \n \n // $conn->close();\n //header(\"Location:AddLink.php\");\n }", "public function create()\n\t{\n\t\treturn view('backend.blog.create');\n\t}", "public function actionCreate()\n {\n\t\tif (!\\Yii::$app->user->can('cmsCommentHistoriesCreate')) {\n\t\t\tthrow new ForbiddenHttpException('You do not have privileges to view this content.');\n\t\t}\n\t\t\n $model = new CommentHistory();\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 $this->layout = 'headbar';\n $model = new ContactOne();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $dataProvider = new ActiveDataProvider([\n 'query' => ContactOne::find(),\n 'pagination' => [\n 'pageSize' => 20,\n ],\n ]);\n //return $this->redirect(['view', 'id' => $model->id]);\n\n return $this->render('view',[\n 'dataProvider' => $dataProvider,\n ]);\n\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }" ]
[ "0.7152225", "0.7032875", "0.6740546", "0.6729699", "0.66965824", "0.6678348", "0.6600189", "0.6565194", "0.65465164", "0.6517087", "0.6516304", "0.64939463", "0.646906", "0.64464754", "0.6410109", "0.6380649", "0.637872", "0.6358425", "0.6327149", "0.6298797", "0.6222172", "0.6207043", "0.6207043", "0.618939", "0.6168166", "0.6151995", "0.612244", "0.6101966", "0.60990673", "0.6068322", "0.606292", "0.60391474", "0.6015714", "0.6009002", "0.6006105", "0.60050994", "0.5965416", "0.59581405", "0.59406793", "0.5938573", "0.5936137", "0.5928356", "0.5924244", "0.58754617", "0.5838944", "0.5826403", "0.58118886", "0.5806729", "0.5792511", "0.57787955", "0.57780516", "0.57580507", "0.5754672", "0.574203", "0.5741031", "0.57398975", "0.5739348", "0.57372767", "0.5734818", "0.5714454", "0.57106", "0.5705736", "0.5685051", "0.5684323", "0.56838423", "0.56810087", "0.5680192", "0.5676805", "0.5671758", "0.5649627", "0.56455815", "0.56437093", "0.56382436", "0.5637882", "0.5624379", "0.5621582", "0.56170565", "0.56087285", "0.5600893", "0.5579218", "0.5575728", "0.5570731", "0.55655295", "0.555734", "0.55563325", "0.5550765", "0.5543038", "0.5533378", "0.5522218", "0.5512106", "0.55030096", "0.5497845", "0.54945713", "0.54928255", "0.54811674", "0.54808515", "0.5480377", "0.54696447", "0.54658896", "0.5464619" ]
0.61585116
25
Deletes an existing Event model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $model = $this->findModel($id); if (!Yii::$app->user->can('admin') && Yii::$app->user->id != $model->user_id) { throw new ForbiddenHttpException('You are not allowed to perform this action.'); } $model->deleteImage($model->image); $model->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\n $id = $this->uri->segment(4);\n $this->events_model->delete_event($id);\n redirect('admin/events');\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 action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "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 }", "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 destroy(Event $event)\n {\n //$event = Event::findOrFail($id);\n $event->delete($event);\n flash('Evenement supprimer avec succes','danger');\n return redirect(route('home'));\n }", "public function destroy(Event $event)\n {\n $event->delete();\n return redirect('events');\n }", "public function destroy(Event $event)\n {\n $data = Event::findOrFail($event->id)->delete();\n if ($data) {\n return redirect()->route('event.index')\n ->with('success', 'Мероприятие удалено');\n }\n }", "public function actionDelete($id)\n {\n $event_ref = $this->findModel($id)->event_ref;\n $this->findModel($id)->delete();\n \n return $this->redirect(['nurse-staffevent/create','event_ref' => $event_ref]);\n// return $this->redirect(['index']);\n }", "public function action_remove()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\t\r\n\t\t// Can user remove this event?\r\n\t\tif ( ! $this->user->can('event_remove', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.remove.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Cancel the event (will be hidden from view)\r\n\t\t$event->cancel_event();\r\n\t\t\r\n\t\tNotices::success('event.remove.success');\r\n\t\t\r\n\t\t// Show event list\r\n\t\t$this->request->redirect(Route::url('event'));\r\n\t}", "public function delete($evID)\n {\n $event = Event::find($evID);\n if ($event == null) {\n return view('cms.error', ['message' => 'Event not found!']);\n }\n \n // delete main photo\n if ($event->article->image != null) {\n Storage::delete('public/images/'.$event->article->image);\n }\n\n // delete entry in events and article table\n $artID = $event->artID;\n Event::destroy($evID);\n \n // delete all article content\n // delete directory\n Storage::deleteDirectory('public/images/articles/'.$artID);\n \n Article::destroy($artID);\n return redirect('/cms/events');\n }", "public function deleteAction(Request $request, Event $event)\n {\n $this->enforceOwnerSecurity($event);\n $form = $this->createDeleteForm($event);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($event);\n $em->flush();\n }\n\n return $this->redirectToRoute('event_index');\n }", "public function destroy(Event $event)\n {\n $event->delete();\n Session::flash('status', 'Event was deleted successful!');\n// return $event;\n return Redirect::to('/events');\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 delete($eventID)\n {\n $this->request->allowMethod('post', 'delete');\n // Request\n $e = $this->Events->find()->where(['id' => $eventID]);\n // If not result found\n if ($e->isEmpty()) {\n $this->Flash->error('Une erreur est survenue lors de la tentative de suppression. L\\'événement n\\'existe pas');\n return $this->redirect(['action' => 'index']);\n }\n // Get the first record as element\n $event = $e->first();\n // Check if current user is author's event\n if ($this->isCurrentAuthor($event->user_id)) {\n if ($this->Events->delete($event)) {\n $this->Flash->success('L\\'événement a bien été supprimé');\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error('Suppression de l\\'événement impossible');\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error('Vous n\\'êtes pas autorisé à effectuer cette action');\n $this->redirect(['action' => 'view', $eventID]);\n }", "public function destroy(Event $event)\n {\n $event->delete();\n Session::flash('success_message', 'Event Deleted');\n return redirect()->back();\n }", "public function destroy($id)\n {\n $event = Event::find($id);\n $event->delete();\n return redirect('admin/eventos');\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 massDeleteAction()\r\n\t{\r\n\t\tif($eventIds = $this->getRequest()->getParam('event_ids')){\r\n\t\t\ttry{\r\n\t\t\t\tforeach ($eventIds as $eventId) {\r\n\t\t\t\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\t\t\t\t\t$eventModel->delete();\r\n\t\t\t\t}\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your events(%d) have been deleted\", count($eventIds)));\r\n\t\t\t} catch(Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t}\r\n\t\t} else{\r\n\t\t\tMage::getSingleton('adminhtml/session')->addError('select some events');\r\n\t\t}\r\n\t\t$this->_redirect('*/*/index');\r\n\t}", "public function actionDelete()\n\t{\n\t\t$id = intval($_GET['iId']);\n\t\t$this->loadModel($id)->delete();\n\t\t$this->redirect('/app/DayPush/index');\n\t}", "public function destroy($id)\n {\n $event = \\App\\event::find($id);\n $event->delete();\n \n return redirect()->route('event.index')\n ->with('success','event deleted successfully');\n }", "public function destroy($id)\n {\n //\n //DB::delete('delete from events where event_id = ?',[$id]);\n $event = Event::find($id);\n $event->delete();\n return redirect('postLoginEventView')->with('success','Event Deleted');\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 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 destroy($id)\n\t{\n\t\t$evento=Evento::find($id);\n\t\t$evento->delete();\n\t\treturn redirect()->back();\n\t}", "public function destroy($id)\n {\n $event=Event::find($id);\n $event->delete();\n // $event->delete();\n // return redirect(route('events.index'));\n }", "public function action_delete() {\n $elect_id = $this->request->query('elect_id');\n $res = Model::factory('Elect')->delete($elect_id);\n if(!$res) exit('error action_delete');\n $this->redirect('/'); \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 destroy($id)\n {\n $event = Event::findOrFail($id);\n $event->delete();\n return redirect()\n ->route('event.index')\n ->with('success', 'L\\'article a bien été supprimé.');\n }", "public function destroy($id)\n {\n\n $event= Event::find($id)->delete();\n\n return redirect()->back();\n }", "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 destroy($id)\n\t{\n try\n {\n StorageEvents::destroy($id);\n return $this->redirect('events.index');\n }\n catch(ModelNotFoundException $e)\n {\n return $this->redirectNotFound();\n }\n\t}", "public function destroy($id)\n {\n evento::where('id', $id)->delete();\n return redirect()->intended('system-management/evento');\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function destroy($id) {\n\n Event::findOrFail($id)->delete();\n\n return redirect('/dashboard')->with('msg', 'Evento excluído com sucesso!');\n\n }", "public function destroy($id)\n {\n $event = Event::findOrFail($id);\n $event->delete();\n return redirect('/event/');\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}", "function admin_delete($id=null) {\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash('Invalid ID for Event.');\n\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t}\n\t\tif ($this->Event->del($id)) {\n\t\t\t$this->Session->setFlash('Event id #'.$id.' deleted.');\n\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t}\n\t}", "public function destroy($id)\n {\n NewEvent::find($id)->delete();\n return redirect('news');\n }", "public function deleteAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (true === $this->employee->setAction('delete'))\n\t\t{\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t}", "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 destroy($id)\n {\n $event = \\App\\Models\\Event::find($id);\n if ($event) {\n $event->delete();\n return redirect()->route('events.index')->with('status', 'success');\n }\n return redirect()->back()->with('status', 'error');\n }", "public function delete(Event $event){\r\n $stmt = $this->db->prepare(\"DELETE FROM event WHERE id_event = ?\");\r\n $stmt->execute(array($event->getIdEvent()));\r\n }", "public function 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 actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\t$id = intval( Yii::app()->getRequest()->getParam('id') );\n\n\t\tif (!Yii::app()->getRequest()->getIsAjaxRequest() || empty($id))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model = MainRoom::model()->findByPk($id);\n\t\tif (is_null($model))\n\t\t\tthrow new CHttpException(404);\n\n\t\t$model->status = MainRoom::STATUS_DELETED;\n\t\t$model->save(false);\n\t\tdie ( CJSON::encode( array('success'=>true) ) );\n\n\t}", "public function destroy($id)\n {\n // TODO : Delete function needs to delete all records with this event_id in other tables.\n $event = Event::find($id);\n\n $event->delete();\n\n Session::flash('success', 'Succesfully deleted');\n\n return redirect()->route('events.list');\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\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\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function destroy(Event $evento)\n {\n if ($evento->delete()) {\n return redirect()->route('evento.index')->with(\n [\n 'aviso' => 'Evento deletado.',\n 'type' => 'info'\n ]\n );\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 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}", "public function destroy($id)\n {\n $event = Event::findOrFail($id);\n $event->delete();\n\n return redirect()->route('event.index')->with('message', 'Evento removido com sucesso!');\n }", "public function destroy($id)\n {\n $event = Event::find($id);\n $event->delete();\n return redirect('/dashboard')\n ->with('success', 'Event Deleted Successfully');\n }", "public function destroy($id)\n {\n $event = Event::find($id);\n\n $event->delete();\n\n Session::flash('deleted', 'The event was succesfully deleted');\n\n return redirect()->route('events.index');\n }", "public function destroy($id)\n {\n Events::destroy($id);\n\n return redirect('admin/events')->with('flash_message', 'Event deleted!');\n }", "public function destroy($id)\n {\n $event = Event::find($id);\n $event->delete();\n\n return redirect()->route('event.index')->withFlashSuccess('Event deleted successfully');\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function destroy($id)\n {\n $event = Event::find($id);\n $event->delete();\n return redirect('events')->with('success', 'Données supprimées');\n }", "public function destroy($id)\n {\n if (! Gate::allows('event_delete')) {\n return abort(401);\n }\n $event = Event::findOrFail($id);\n $event->delete();\n\n return redirect()->route('admin.events.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 delete() {\n $flg = $this->Seatmodel->delete();\n\n if (!empty($flg)) {\n $this->session->set_flashdata('successmessage', 'Data deleted successfully');\n } else {\n $this->session->set_flashdata('errormessage', 'Oops! Something went wrong');\n }\n\n redirect(base_url('admin-seat-list'));\n }", "public function actionDelete($event_id, $category_id)\n {\n $this->findModel($event_id, $category_id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\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()->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{\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()->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 destroy($id)\n {\n Eventos::find($id)->delete();\n return redirect()->route('evento.index')\n ->with('success','Eventos deleted successfully');\n }", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function destroy($id)\r\n {\r\n // delete\r\n $event = Evento::findOrFail($id);\r\n $event->delete();\r\n\r\n // redirect\r\n Session::flash('success', 'Evento eliminado con éxito!');\r\n return redirect('events');\r\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 }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "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->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "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 function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function destroy(Request $request)\n {\n $this->authorize('delete', new Evento());\n $evento = Evento::findOrFail($request->id);\n $evento->delete();\n toast('Evento eliminado correctamente', 'success');\n return redirect()->route('evento.index');\n }", "protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "public function destroy($id)\n {\n $event = Event::find($id);\n $event->delete();\n return redirect('/event')->with('success', 'Data event Berhasil Dihapus');\n }", "public function actionDelete() {\n $data = $this->data;\n if (isset($data['employee_id']) && !empty($data['employee_id'])) {\n $model = $this->findModel($data['employee_id']);\n if ($model) {\n $this->findModel($data['employee_id'])->delete();\n EmployeeAddress::deleteAll(['employee_id' => $data['employee_id']]);\n echo $this->messageReturn(\"success\", 200);\n exit;\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Employee id not found\");\n exit;\n }\n } else {\n echo $this->messageReturn(\"failed\", 201, \"\", \"Please sent correct parameter\");\n exit;\n }\n }", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "public function actionDelete()\n {\n return $this->findModel(Yii::$app->request->post('id'))->delete(false);\n }", "public function destroy($id)\n {\n Event::destroy($id);\n return redirect('events');\n }", "public function deleteDance(){\n $data = [\n 'status' => ''\n ];\n if(isset($_GET['id'])) {\n $id = $_GET['id'];\n\n if (isset($_POST['confirm'])) {\n if ($_POST['confirm'] == 'Yes') {\n $this->adminModel->deleteDance($id);\n $data['status'] = 'Event has been deleted';\n $this->view('admins/homepage', $data);\n } else if ($_POST['confirm'] == 'No') {\n $data['status'] = 'Event could not be deleted please contact the administrator';\n $this->view('admins/homepage', $data);\n }\n }\n }\n $this->view('admins/deleteDance' , $data);\n\n }", "public function actionDelete()\n {\n if (Yii::app()->request->isPostRequest)\n {\n // we only allow deletion via POST request\n $this->loadModel()->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(array('index'));\n }\n else\n throw new CHttpException(400, 'Invalid request. Please do not repeat this request again.');\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre &eacute;cole n\\'a pas été supprimé.';\n\n\t\t$school = School::find( (int) $this->getRequest()->post('id') );\n\t\t$deleted = $school->delete();\n\n\t\tif ( $deleted ) {\n\t\t\t$message = 'Votre &eacute; a correctement été supprimé.';\n\t\t}\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'status' => $deleted,\n\t\t\t'message' => $message,\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}" ]
[ "0.7811307", "0.75612575", "0.7403664", "0.730768", "0.71056336", "0.7098973", "0.708466", "0.70354104", "0.6990566", "0.6836926", "0.68230855", "0.68192375", "0.67750746", "0.6712019", "0.6699232", "0.6695821", "0.66951805", "0.66598684", "0.6617327", "0.6560723", "0.6555088", "0.6528945", "0.6512477", "0.6504479", "0.6486566", "0.64787173", "0.64694786", "0.6456576", "0.64473456", "0.64272165", "0.6426165", "0.64187664", "0.640563", "0.6393283", "0.6387383", "0.63726526", "0.6370076", "0.6365104", "0.6362738", "0.6348867", "0.6339357", "0.6336006", "0.63352627", "0.63343483", "0.6332177", "0.63255626", "0.6321864", "0.63178587", "0.63162994", "0.63066787", "0.63066787", "0.6305157", "0.63020027", "0.6291908", "0.62898976", "0.6287953", "0.6285031", "0.6277276", "0.6275923", "0.6273891", "0.6273545", "0.62675524", "0.6260688", "0.6260014", "0.6260014", "0.62559545", "0.6255705", "0.62556744", "0.62556744", "0.62541527", "0.62487084", "0.6247238", "0.62399703", "0.6229078", "0.62170184", "0.62170184", "0.6214775", "0.6214775", "0.6210867", "0.6210867", "0.6210867", "0.6210867", "0.62078965", "0.62036437", "0.62036437", "0.6199416", "0.6195524", "0.61935204", "0.61921394", "0.61853516", "0.61797154", "0.616611", "0.616275", "0.61623764", "0.61591876", "0.615802", "0.61509603", "0.6150672", "0.61503625", "0.61503625", "0.6141369" ]
0.0
-1
Is called by the cron job, checks if a cronjob is running and reloads all social media content.
public function actionCron() { if (!Yii::$app->cache->get('cron')) { Yii::$app->cache->set('cron', true); try { $eventModels = Event::find()->all(); foreach ($eventModels as $eventModel) { $socialMediaModels = SocialMedia::find()->where(['event_id' => $eventModel->id])->orderBy('id')->all(); Yii::$app->cache->delete('socialmedia' . $eventModel->id); $this->findSocialMedia($eventModel->id, $socialMediaModels); } } catch (Exception $e) { Yii::$app->cache->delete('cron'); return $e; } Yii::$app->cache->delete('cron'); return 'Cron-job successful.'; } else { return 'Cron-job already running.'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cron()\n\t{\n\t\tglobal $wpdb,\n\t\t\t\t\t $wgobd_importer_helper,\n\t\t\t\t\t $wgobd_events_helper,\n\t\t\t\t\t $wgobd_settings_controller;\n\n\t\t// ====================\n\t\t// = Select all feeds =\n\t\t// ====================\n\t\t$table_name = $wpdb->prefix . 'wgobd_event_feeds';\n\t\t$sql = \"SELECT * FROM {$table_name}\";\n\t\t$feeds = $wpdb->get_results( $sql );\n\n\t\t// ===============================\n\t\t// = go over each iCalendar feed =\n\t\t// ===============================\n\t\tforeach( $feeds as $feed ) {\n\t\t // flush the feed\n\t\t $wgobd_settings_controller->flush_ics_feed( false, $feed->feed_url );\n\t\t // import the feed\n\t\t\t$wgobd_importer_helper->parse_ics_feed( $feed );\n\t\t}\n\t}", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "public function schedule_cron() {\n\t\twp_schedule_event( time(), 'daily', 'download_iracing_members_files' );\n\t\twp_schedule_event( time(), 'daily', 'convert_iracing_members_file_to_json' );\n\t}", "public function cron(){\n\t\t$schedule_list = $this->db->select('analytics.*, account.username, account.password, account.proxy, account.default_proxy, account.id as account_id')\n\t\t->from($this->tb_analytics.\" as analytics\")\n\t\t->join($this->tb_accounts.\" as account\", \"analytics.account = account.id\")\n\t\t->where(\"account.status = 1 AND analytics.next_action <= '\".NOW.\"'\")->limit(10,0)->get()->result();\n\t\t\n\t\tif(!empty($schedule_list)){\n\t\t\tforeach ($schedule_list as $key => $schedule) {\n\t\t\t\tif(!permission(\"instagram/post\", $schedule->uid)){\n\t\t\t\t\t$this->db->delete($this->tb_posts, array(\"uid\" => $schedule->uid, \"time_post >=\" => NOW));\n\t\t\t\t}\n\n\t\t\t\t$proxy_data = get_proxy($this->tb_accounts, $schedule->proxy, $schedule);\n\t\t\t\ttry {\n\t\t\t\t\t$ig = new InstagramAPI($schedule->username, $schedule->password, $proxy_data->use);\n\t\t\t\t\t$result = $ig->analytics->process();\n\t\t\t\t\t\n\t\t\t\t\t$user_timezone = get_timezone_user(NOW, false, $schedule->uid);\n\t\t\t\t\t$user_day = date(\"Y-m-d\", strtotime($user_timezone));\n\n\t\t\t\t\t$check_stats_exist = $this->model->get(\"id\", $this->tb_analytics_stats, \" account = '\".$schedule->account_id.\"' AND uid = '\".$schedule->uid.\"' AND date = '\".$user_day.\"'\");\n\t\t\t\t\tif(empty($check_stats_exist)){\n\n\t\t\t\t\t\t//Save data\n\t\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t\t\"media_count\" => $result->userinfo->media_count,\n\t\t\t\t\t\t\t\"follower_count\" => $result->userinfo->follower_count,\n\t\t\t\t\t\t\t\"following_count\" => $result->userinfo->following_count,\n\t\t\t\t\t\t\t\"engagement\" => $result->engagement\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\"ids\" => ids(),\n\t\t\t\t\t\t\t\"uid\" => $schedule->uid,\n\t\t\t\t\t\t\t\"account\" => $schedule->account_id,\n\t\t\t\t\t\t\t\"data\" => json_encode($user_data),\n\t\t\t\t\t\t\t\"date\" => date(\"Y-m-d\", strtotime($user_timezone))\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$this->db->insert($this->tb_analytics_stats, $data);\n\n\t\t\t\t\t\t$save_info = array(\n\t\t\t\t\t\t\t\"engagement\" => $result->engagement,\n\t\t\t\t\t\t\t\"average_likes\" => $result->average_likes,\n\t\t\t\t\t\t\t\"average_comments\" => $result->average_comments,\n\t\t\t\t\t\t\t\"top_hashtags\" => $result->top_hashtags,\n\t\t\t\t\t\t\t\"top_mentions\" => $result->top_mentions,\n\t\t\t\t\t\t\t\"feeds\" => $result->feeds,\n\t\t\t\t\t\t\t\"userinfo\" => $result->userinfo,\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Next Action\n\t\t\t\t\t\t$now = date('Y-m-d 00:00:00', strtotime($user_timezone));\n\t\t\t\t\t\t$next_day = date('Y-m-d 00:00:00', strtotime($now) + 86400);\n\t\t\t\t\t\t$data_next_action = array(\n\t\t\t\t\t\t\t\"data\" => json_encode($save_info),\n\t\t\t\t\t\t\t\"next_action\" => get_timezone_system($next_day, false, $schedule->uid)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->db->update($this->tb_analytics, $data_next_action, \"account = '\".$schedule->account_id.\"'\");\n\t\t\t\t\t}\n\n\t\t\t\t\techo lang(\"successfully\");\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\techo $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\techo lang(\"no_activity\");\n\t\t}\n\t}", "public function refresh_all_sites()\n\t{\n\t\t$sites = get_sites( array( 'number' => 99999));\n\t\t\n\t\tforeach( $sites as &$site )\n\t\t{\n\t\t\t$this->refresh_site( $site->blog_id );\n\t\t}\n\t\t$this->model->update_option( 'sites-refresh-time', date('Y-m-d H:i:s') );\n\t}", "static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}", "function do_cron() {\n global $config;\n ct_log(\"Cron-Job started.\", 2, -1, 'cron');\n \n $btns = churchcore_getModulesSorted(false, false);\n foreach ($btns as $key) {\n include_once (constant(strtoupper($key)) . \"/$key.php\");\n if (function_exists($key . \"_cron\") && getConf($key . \"_name\")) {\n $arr = call_user_func($key . \"_cron\");\n }\n }\n ct_sendPendingNotifications();\n ct_log(\"Cron-Job finished.\", 2, -1, 'cron');\n}", "function wp_doing_cron()\n {\n }", "static function jobs() {\n\t\tif(self::doCron()):\n\t\t\n\t\twhile(!Db::lock());\n\n\t\tReminder::cron();\n\t\t\n\t\t$ctrl = new Cronjob();\n\t\t$ctrl->checkBookings();\n\t\t$ctrl->cancelPending();\n\t\t$ctrl->unattended();\n\t\t\n\t\twhile(!Db::unlock());\n\t\t\n\t\tPreferences::set('lastCron', date(\"H:i:s\"));\n\t\t_debug(\"CRON JOBS DONE!\");\n\t\tendif;\n\t}", "protected function crawlUrls()\n\t{\n\t\t// only execute if a cURL request is not running\n\t\tif (!$this->running) {\n\t\t\t$this->execute();\n\t\t}\n\t}", "function simulateCron() {\n\t\tglobal $publishthis;\n\n\t\t// Return here is we want to pause polling.\n\t\tif ( $publishthis->get_option ( 'pause_polling' ) ) {\n\t\t\tif ( ! get_option ( 'publishthis_paused_on' ) ) {\n\t\t\t\tupdate_option ( 'publishthis_paused_on', time() );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tignore_user_abort( true );\n\n\t\t//modifying the logic here a bit and going with options, instead of\n\t\t//transients, because those were sometimes disappearing from\n\t\t//the wp cache. don't want to disrupt the clients site\n\n\t\t//basic algorithm\n\t\t/*\n 1 - see if we are doing the cron all ready, if so, don't do anything\n 2 - if not doing cron, get the last timestamp of when we did this cron\n -- we only want to check every XX minutes\n 3 - if no time is set yet, we do the check\n 4 - if the time is set, and we have not yet passed our XX minutes, we do not do anything\n 5 - if we are doing the check, update that we are doing the cron\n 6 - do the cron action\n 7 - once completed, set\n - the timestamp we completed at, for future checks\n - remove the doing cron value\n */\n\t\t$doingSimulatedCron = get_option ( 'pt_simulated_cron' );\n\n\t\t//create lock flag if not exists and set it to 0 (false)\n\t\tif ( false === $doingSimulatedCron ) {\n\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t}\n\t\t$doingSimulatedCron = intval($doingSimulatedCron);\n\t\t//cron is not running\n\t\tif ( 0 === $doingSimulatedCron ) {\n\t\t\t//check the time\n\t\t\t$secondsExpiration = 60 * 2; //roughly 2 minutes. should be based on publishing action set poll times, but that would be too much to query;\n\n\t\t\t$timestamp = get_option ( 'pt_simulated_cron_ts' );\n\n\t\t\t$currentTimestamp = ( time() ) * 1000;\n\n\t\t\tif ( !$timestamp ) {\n\t\t\t\t//this has never been set before, so, we can just assume we need to do the cron\n\t\t\t\t$timestamp = $currentTimestamp;\n\t\t\t\t\n\t\t\t\t//set the timestamp the first time\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $timestamp );\n\t\t\t}\n\t\t\t//see if we need to do the cron\n\t\t\t$diffTimestamp = $currentTimestamp - $timestamp;\n\t\t\t\n\t\t\t$diffTimeSeconds = ( $diffTimestamp / 1000 );\n\t\n\t\t\tif ( $diffTimeSeconds >= $secondsExpiration ) {\n\t\t\t\t//ok, we need to do the cron action\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 1 );\n\n\t\t\t\ttry {\n\t\t\t\t\t//if we are here, that means we need to do the cron action\n\t\t\t\t\t//get only active Publishing Actions\n\t\t\t\t\t$actions = $publishthis->publish->get_publishing_actions();\n\n\t\t\t\t\t$publishthis->log->addWithLevel ( array(\n\t\t\t\t\t\t\t'message' => 'Checking on simulated cron events',\n\t\t\t\t\t\t\t'status' => 'info',\n\t\t\t\t\t\t\t'details' => \"Found \" . count( $actions ) . \" publishing events to check\" ), \"2\" );\n\t\t\t\t\t\n\t\t\t\t\t// do import\n\t\t\t\t\t$publishthis->publish->run_import();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t//set simulate cron options on failure\n\t\t\t\t\t//leaving duplicated lines, because php4 doesn't have finally block\n\t\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//now that we are done, set the old timestamp\n\t\t\t\tupdate_option( \"pt_simulated_cron_ts\", $currentTimestamp );\n\t\t\t\tupdate_option( \"pt_simulated_cron\", 0 );\n\t\t\t}\t\n\t\t}\t\t\n\t}", "function cron() {\n\t\tglobal $wpdb, $table_prefix;\n\t\t$sql = \"DELETE\n\t\t\t\t FROM {$table_prefix}postmeta\n\t\t\t\t WHERE meta_key LIKE '_oembed_%'\";\n\t\t$results = $wpdb->get_results( $sql );\n\t}", "public function run() {\n\t\t$this->cronStarts = time() - 1;\n\t\tif (!$this->isOtherCronRunning()) {\n\t\t\t$config = new UnzerCw_SettingApi();\n\t\t\tUnzerCw_MutableConstantApi::setConstant(self::CRON_MUTEX_NAME, 0);\n\t\t}\n\t\t$cronProcessor = new Customweb_Cron_Processor(UnzerCw_Util::getContainer());\n\t\t$cronProcessor->run();\n\t}", "function asu_isearch_cron() {\n\n // Cache data from configuration\n _asu_isearch_cache_dept_feed();\n\n // Cache dept tree and employee types data\n _asu_isearch_cache_dept_tree_data();\n\n // Begin profile migrations\n _asu_isearch_begin_migrate(FALSE);\n\n // Cleanup the profiles which are no longer associated with\n // unit depts in iSearch. Only run once per day.\n $last_clean = variable_get('last_profile_cleanup', NULL);\n\n if ($last_clean != date('ymd', time())) {\n _asu_isearch_cleanup();\n variable_set('last_profile_cleanup', date('ymd', time()));\n }\n}", "public function background_update() {\n\t\tadd_action( 'wp_update_plugins', [ $this, 'get_meta_plugins' ] );\n\t\tadd_action( 'wp_update_themes', [ $this, 'get_meta_themes' ] );\n\t\tadd_action( 'gu_get_remote_plugin', [ $this, 'run_cron_batch' ], 10, 1 );\n\t\tadd_action( 'gu_get_remote_theme', [ $this, 'run_cron_batch' ], 10, 1 );\n\t}", "public function cron() {\n include('programming_cron.php');\n }", "function run()\n\t{\n\t\tif ((get_param('keep_lang',NULL)===NULL) || (get_param('keep_theme',NULL)===NULL))\n\t\t{\n\t\t\t// We need to run this for each language and for each theme\n\t\t\t$langs=find_all_langs();\n\t\t\trequire_code('themes2');\n\t\t\t$themes=find_all_themes();\n\t\t\tforeach (array_keys($langs) as $lang)\n\t\t\t{\n\t\t\t\tforeach (array_keys($themes) as $theme)\n\t\t\t\t{\n\t\t\t\t\tif (($theme=='default') || (has_category_access(get_member(),'theme',$theme)))\n\t\t\t\t\t{\n\t\t\t\t\t\t$where=array('c_theme'=>$theme,'c_lang'=>$lang);\n\t\t\t\t\t\t$count=$GLOBALS['SITE_DB']->query_value('cron_caching_requests','COUNT(*)',$where);\n\t\t\t\t\t\tif ($count>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$url=get_base_url().'/data/cron_bridge.php?limit_hook=block_caching&keep_lang='.urlencode($lang).'&keep_theme='.urlencode($theme);\n\t\t\t\t\t\t\thttp_download_file($url,NULL,false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Force re-loading of values that we use to mark progress (as above calls probably resulted in changes happening)\n\t\t\tglobal $VALUES;\n\t\t\t$VALUES=$GLOBALS['SITE_DB']->query_select('values',array('*'));\n\t\t\t$VALUES=list_to_map('the_name',$VALUES);\n\n\t\t\treturn;\n\t\t}\n\n\t\t$where=array('c_theme'=>$GLOBALS['FORUM_DRIVER']->get_theme(),'c_lang'=>user_lang());\n\t\t$requests=$GLOBALS['SITE_DB']->query_select('cron_caching_requests',array('id','c_codename','c_map','c_timezone','c_is_bot','c_in_panel','c_interlock','c_store_as_tempcode'),$where);\n\t\tforeach ($requests as $request)\n\t\t{\n\t\t\t$GLOBALS['NO_QUERY_LIMIT']=true;\n\n\t\t\t$codename=$request['c_codename'];\n\t\t\t$map=unserialize($request['c_map']);\n\n\t\t\t$object=do_block_hunt_file($codename,$map);\n\t\t\tif (is_object($object))\n\t\t\t{\n\t\t\t\tglobal $LANGS_REQUESTED,$JAVASCRIPTS,$CSSS,$LANGS_REQUESTED,$DO_NOT_CACHE_THIS,$TIMEZONE_MEMBER_CACHE;\n\n\t\t\t\t$backup_langs_requested=$LANGS_REQUESTED;\n\t\t\t\t$backup_javascripts=$JAVASCRIPTS;\n\t\t\t\t$backup_csss=$CSSS;\n\t\t\t\tget_users_timezone();\n\t\t\t\t$backup_timezone=$TIMEZONE_MEMBER_CACHE[get_member()];\n\t\t\t\t$LANGS_REQUESTED=array();\n\t\t\t\t$JAVASCRIPTS=array('javascript'=>1,'javascript_thumbnails'=>1);\n\t\t\t\t$CSSS=array('no_cache'=>1,'global'=>1);\n\t\t\t\t$cache=$object->run($map);\n\t\t\t\t$TIMEZONE_MEMBER_CACHE[get_member()]=$backup_timezone;\n\t\t\t\t$cache->handle_symbol_preprocessing();\n\t\t\t\tif (!$DO_NOT_CACHE_THIS)\n\t\t\t\t{\n\t\t\t\t\tif (method_exists($object,'cacheing_environment'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=$object->cacheing_environment();\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$info=array();\n\t\t\t\t\t\t$info['cache_on']='array($map,$GLOBALS[\\'FORUM_DRIVER\\']->get_members_groups(get_member()))';\n\t\t\t\t\t\t$info['ttl']=60*24;\n\t\t\t\t\t}\n\t\t\t\t\t$ttl=$info['ttl'];\n\n\t\t\t\t\t$_cache_identifier=array();\n\t\t\t\t\t$cache_on=$info['cache_on'];\n\t\t\t\t\tif (is_array($cache_on))\n\t\t\t\t\t{\n\t\t\t\t\t\t$_cache_identifier=call_user_func($cache_on[0],$map);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($cache_on!='') && (!defined('HIPHOP_PHP')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_cache_on=eval('return '.$cache_on.';'); // NB: This uses $map, as $map is referenced inside $cache_on\n\t\t\t\t\t\t\tif (is_null($_cache_on)) return NULL;\n\t\t\t\t\t\t\tforeach ($_cache_on as $on)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_cache_identifier[]=$on;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif (defined('HIPHOP_PHP')) return NULL;\n\t\t\t\t\t}\n\t\t\t\t\t$_cache_identifier[]=$request['c_timezone'];\n\t\t\t\t\t$_cache_identifier[]=$request['c_is_bot']==0;\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_in_panel']);\n\t\t\t\t\t$_cache_identifier[]=strval($request['c_interlock']);\n\t\t\t\t\t$cache_identifier=serialize($_cache_identifier);\n\n\t\t\t\t\trequire_code('caches2');\n\t\t\t\t\tif ($request['c_store_as_tempcode']==1) $cache=make_string_tempcode($cache->evaluate());\n\t\t\t\t\tput_into_cache($codename,$ttl,$cache_identifier,$cache,array_keys($LANGS_REQUESTED),array_keys($JAVASCRIPTS),array_keys($CSSS),true);\n\t\t\t\t}\n\t\t\t\t$LANGS_REQUESTED+=$backup_langs_requested;\n\t\t\t\t$JAVASCRIPTS+=$backup_javascripts;\n\t\t\t\t$CSSS+=$backup_csss;\n\t\t\t}\n\n\t\t\t$GLOBALS['SITE_DB']->query_delete('cron_caching_requests',$request);\n\t\t}\n\t}", "function runAfterInit() {\n \t$this->subscriptions = new StudentSubscriptions();\n \t//$this->groups = new StudentGroups();\n \t//Custom actions\n \tadd_action('refreshCoursesMeta', array(&$this->subscriptions, 'refreshCoursesMeta'));\n \tadd_action('refreshAssignments', array(&$this->subscriptions, 'refreshAssignments'));\n \tadd_action('refreshClassmates', array(&$this->subscriptions, 'refreshClassmates'));\n\n \t//Ajax load awaiting count triggers and hooks\n \tadd_filter('query_vars', array(&$this, 'awaiting_add_trigger'));\n\t\tadd_action('template_redirect', array(&$this,'awaiting_trigger_check'));\n\t\t\n\t\t//Comment content filter on home page\n\t\tadd_filter('get_comment_text', array(&$this, 'filterCommentText'), 10, 2);\n\t\t\n \t//Load cron after adding custom actions\n \t$this->cron = new LePressCron();\n\n \t//Add LePress pseudo-cron calls\n \tif(!$this->cron->get_next_scheduled('refreshCoursesMeta')) {\n \t\t$ms = $this->get_option('courseRefreshTime') * 60;\n \t\tif($ms > 0) {\n\t\t\t\t$this->cron->add_schedule('refreshCoursesMeta', time()+$ms);\n \t\t}\n\t\t}\n\t\tif(!$this->cron->get_next_scheduled('refreshAssignments')) {\n\t\t\t$ms = $this->get_option('assignmentsRefreshTime') * 60;\n \t\tif($ms > 0) {\n\t\t\t\t$this->cron->add_schedule('refreshAssignments', time()+$ms);\n \t\t}\n\t\t}\n\t\tif(!$this->cron->get_next_scheduled('refreshClassmates')) {\n\t\t\t$ms = $this->get_option('classmatesRefreshTime') * 60;\n \t\tif($ms > 0) {\n\t\t\t\t$this->cron->add_schedule('refreshClassmates', time()+$ms);\n \t\t}\n\t\t}\n }", "public function expire_posts() {\n\n\t\t$expire_urls = array_unique($this->expire_urls);\n\n\t\tforeach($expire_urls as $url) {\n\n\t\t\t$this->expire($url);\n\t\t}\n \n\t\tif (!empty($expire_urls)) {\n \n\t\t\t// Clear the homepage too to take in to account updated posts\n\t\t\t$this->expire(home_url());\n\n\t\t\t// If content has changed we should really update /sitemap.xml to keep the search engines happy\n\t\t\t$this->expire(site_url() . '/sitemap.xml');\n\n\t\t} \n\n\t}", "public function cron_action() {\n\t\t$active = $this->get_option('active', false);\n\t\tif (empty($active)) {\n\t\t\treturn;\n\t\t}\n\t\t$cron = $this->get_option('cron', false);\n\t\tif (empty($cron)) {\n\t\t\t$this->cron_toggle(false);\n\t\t\treturn;\n\t\t}\n\t\t$res = null;\n\t\t$cron_direct = $this->get_option('cron_direct', false);\n\t\t// execute in the action\n\t\tif (empty($cron_direct)) {\n\t\t\tif (!class_exists('WP_Zoho_Cron')) {\n\t\t\t\t@include_once(dirname(__FILE__).'/class-wp-zoho-cron.php');\n\t\t\t}\n\t\t\t$res = new WP_Zoho_Cron();\n\t\t}\n\t\t// execute by calling the file\n\t\telse {\n\t\t\t$url = plugin_dir_url(__FILE__).'class-wp-zoho-cron.php';\n\t\t\tif (function_exists('curl_init')) {\n $c = @curl_init();\n // try 'correct' way\n curl_setopt($c, CURLOPT_URL, $url);\n curl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($c, CURLOPT_MAXREDIRS, 10);\n $res = curl_exec($c);\n // try 'insecure' way\n if (empty($res)) {\n curl_setopt($c, CURLOPT_URL, $url);\n curl_setopt($c, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\t\t\t$user_agent = $this->plugin_title;\n\t\t\t\t\tif (isset($_SERVER[\"HTTP_USER_AGENT\"]) && !empty($_SERVER[\"HTTP_USER_AGENT\"])) {\n\t\t\t\t\t\t$user_agent = $_SERVER[\"HTTP_USER_AGENT\"];\n\t\t\t\t\t}\n curl_setopt($c, CURLOPT_USERAGENT, $user_agent);\n $res = curl_exec($c);\n }\n curl_close($c);\n\t\t\t}\n\t\t\tif (empty($res)) {\n\t\t\t\t$cmd = 'wget -v '.$url.' >/dev/null 2>&1';\n\t\t\t\t@exec($cmd, $res);\n\t\t\t}\n\t\t}\n\t}", "static public function activate()\n {\n do_action( \"sc_wpfmp_enable_wp_cron\" ); // Go enable cron\n }", "public function cron_action()\n\t{\n\n\t\t// process any recently updated inventory\n\t\t$this->inventory_batch();\n\t\t\n\t\t// process any recently shipped orders\n\t\t$this->shipping_batch();\n\n\t\t// process any recently processing orders\n\t\t$this->processing_batch();\n\n\t\t// process any product updates\n\t\t$this->product_batch(); \n\n\t\t// clean up any old records from the queues\n\t\t$this->cleanup();\n\t\texit('done');\n\n\t}", "public function cronRun() {\n @ignore_user_abort(TRUE);\n\n // Try to allocate enough time to run all the hook_cron implementations.\n drupal_set_time_limit(240);\n return $this->processQueues();\n }", "public function run()\n {\n foreach(DB::table('content_kinds')->get() as $d){\n \tDB::table('content_kinds')->where('id', $d->id)->update([\n \t\t'url' => str_slug($d->name)\n \t]);\n }\n }", "function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}", "public function cron()\n\t{\n\t\t$objNews = $this->Database->prepare(\"SELECT * FROM tl_news WHERE newsalert=? AND na_sent=? AND date<=?\")\n\t\t\t\t\t\t\t\t ->execute(1, '', time());\n\t\t\t\t\t\t\t\t \n\t\tif ($objNews->numRows)\n\t\t{\n\t\t\twhile( $objNews->next() )\n\t\t\t{\n\t\t\t\t$this->send($objNews->id, true);\n\t\t\t}\n\t\t}\n\t}", "public function cronprocess(){\n \t\n\t $query = $this->distributiondata->getbyattribute('status',0);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\tforeach ($query->result() as $row){\n\t\t\t\t\t if ($this->process($row->list_id)===true){\n\t\t\t\t\t \t $darray = array('status'=>1);\n\t\t\t\t\t \t $this->distributiondata->update($row->list_id,$darray);\n\t\t\t\t\t \t echo \"Processed: \".$row->title.\" files<br>\";\n\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\techo \"No pending distribution list\";\n\t\t\t}\n\t\t\n\t\t\n\t}", "function questionnaire_cron () {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n return questionnaire_cleanup();\n}", "function contactmod_cron () {\n return true;\n}", "function goodrds_schedule_cron() {\n\t if ( !wp_next_scheduled( 'goodrds_cronjob' ) )\n\t wp_schedule_event(time(), 'daily', 'goodrds_cronjob');\n\t}", "public function run() {\n \n // Require the base class\n $this->load->file(APPPATH . '/base/main.php');\n\n // List all user's apps\n foreach (glob(APPPATH . 'base/user/apps/collection/*', GLOB_ONLYDIR) as $directory) {\n\n // Get the directory's name\n $app = trim(basename($directory) . PHP_EOL);\n\n // Verify if the app is enabled\n if (!get_option('app_' . $app . '_enable')) {\n continue;\n }\n\n // Create an array\n $array = array(\n 'MidrubBase',\n 'User',\n 'Apps',\n 'Collection',\n ucfirst($app),\n 'Main'\n );\n\n // Implode the array above\n $cl = implode('\\\\', $array);\n\n // Run cron job commands\n (new $cl())->cron_jobs();\n }\n \n // Prepare allowed files\n $allowed_files = array(\n 'cron.php',\n 'index.php',\n 'ipn-listener.php',\n 'update.php'\n );\n \n // List all files\n foreach (glob(FCPATH . '/*.php') as $filename) {\n \n $name = str_replace(FCPATH . '/', '', $filename);\n\n if ( !in_array($name, $allowed_files) ) {\n \n $msg = 'Was detected and deleted the file ' . $filename . '. Please contact support if you don\\'t know this file.';\n \n $this->send_warning_message($msg);\n unlink($filename);\n \n } else {\n \n if ( $this->check_for_malware($filename) ) {\n \n $msg = 'Was detected malware in the file ' . $filename . ' and was deleted.';\n\n $this->send_warning_message($msg);\n unlink($filename);\n \n }\n \n }\n \n }\n \n $extensions = array(\n '.php3',\n '.php4',\n '.php5',\n '.php7',\n '.phtml',\n '.pht'\n );\n\n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH, $ext); \n }\n \n $extensions[] = '.php';\n \n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH . 'assets', $ext); \n }\n \n $this->check_for_non_midrub_files(FCPATH . 'assets');\n \n }", "public function importer_cron()\n\t{\n\t\tDBTP_Utils::log('Importer started');\n\n\t\t$importManager = new DBTP_Import_Manager();\n\t\t$schedule = $importManager->schedule_imports();\n\n\t\tif (is_wp_error($schedule)) {\n\t\t\tDBTP_Utils::log('Importer error: '. $schedule->get_error_message());\n\t\t} else {\n\t\t\tDBTP_Utils::log('Imported has been scheduled');\n\t\t}\n\t}", "public function shopifyCronJob(){\n $this->load->model('Projects_model');\n $projects = $this->db->select('*')->from('projects')->where_in('connection_type',[1,3])->get()->result_array();\n $this->updateArticleInShopify();\n if(!empty($projects)){\n foreach ($projects as $p_key => $p_value) {\n $projectId = $p_value['id'];\n if($this->Projects_model->getValue('cms', $projectId)!='shopify')\n continue;\n $enabled = $this->Projects_model->getValue('enabled', $projectId);\n // check if the last execution time is satisfy the time checking.\n if($enabled == '1'){\n if($p_value['erp_system'] == 'exactonline') {\n $this->importArticleFromExact($projectId);\n $this->importCustomerFromExact($projectId);\n }\n }\n }\n } \n }", "public static function scheduleUpdate()\n {\n $next_refresh = wp_next_scheduled('amwscpf_update_feeds_hook');\n if (!$next_refresh)\n wp_schedule_event(time(), 'refresh_interval', 'amwscpf_update_feeds_hook');\n }", "public static function handle_tasks()\n {\n\t $granularity = (int)get_site_preference('pseudocron_granularity',60);\n\t $last_check = get_site_preference('pseudocron_lastrun',0);\n\t if( (time() - $granularity * 60) >= $last_check )\n\t\t {\n\t\t\t // 1. Get Task objects.\n\t\t\t self::get_tasks();\n\t\n\t\t\t // 2. Evaluate Tasks\n\t\t\t self::execute();\n\t\n\t\t\t // 3. Cleanup to minimize memory usage\n\t\t\t self::cleanup();\n\n\t\t\t // 4. Say we've done a check\n\t\t\t set_site_preference('pseudocron_lastrun',time());\n\t\t }\n }", "function view_check_cron() {\n\t}", "public function set_cron_check() {\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 - dismiss cron check.', 'wpcd' ) ) );\n\t\t}\n\n\t\t/* Permissions passed - set transient. */\n\t\tset_transient( 'wpcd_cron_check', 1, 12 * HOUR_IN_SECONDS );\n\t\twp_die();\n\n\t}", "function update_tweet_count_cron($link_id, $interval = 900 /* defaults to 15 minutes */)\n {\n global $prli_link_meta;\n \n static $already_updated_tweet_count;\n \n if( !isset($already_updated_tweet_count) or\n empty($already_updated_tweet_count) or\n !$already_updated_tweet_count )\n {\n $last_update = $prli_link_meta->get_link_meta($link_id,'pretty-link-tweet-last-update',true);\n $now = time();\n \n if($last_update)\n {\n $time_lapse = $now - $last_update;\n if($time_lapse >= $interval)\n {\n $this->update_link_tweets($link_id);\n $prli_link_meta->update_link_meta($link_id,'pretty-link-tweet-last-update',$now);\n $already_updated_tweet_count = true;\n }\n }\n else\n {\n $this->update_link_tweets($link_id);\n $prli_link_meta->update_link_meta($link_id,'pretty-link-tweet-last-update',$now);\n $already_updated_tweet_count = true;\n }\n }\n }", "private function _updateCronStats()\n\t{\n\t $this->load->model('tasks');\n\t $this->tasks->updateCronStats();\n\t}", "function metarefresh_hook_cron(&$croninfo) {\n\tassert('is_array($croninfo)');\n\tassert('array_key_exists(\"summary\", $croninfo)');\n\tassert('array_key_exists(\"tag\", $croninfo)');\n\n\tSimpleSAML\\Logger::info('cron [metarefresh]: Running cron in cron tag [' . $croninfo['tag'] . '] ');\n\n\ttry {\n\t\t$config = SimpleSAML_Configuration::getInstance();\n\t\t$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');\n\n\t\t$sets = $mconfig->getConfigList('sets', array());\n\t\t$stateFile = $config->getPathValue('datadir', 'data/') . 'metarefresh-state.php';\n\n\t\tforeach ($sets AS $setkey => $set) {\n\t\t\t// Only process sets where cron matches the current cron tag\n\t\t\t$cronTags = $set->getArray('cron');\n\t\t\tif (!in_array($croninfo['tag'], $cronTags, true)) continue;\n\n\t\t\tSimpleSAML\\Logger::info('cron [metarefresh]: Executing set [' . $setkey . ']');\n\n\t\t\t$expireAfter = $set->getInteger('expireAfter', NULL);\n\t\t\tif ($expireAfter !== NULL) {\n\t\t\t\t$expire = time() + $expireAfter;\n\t\t\t} else {\n\t\t\t\t$expire = NULL;\n\t\t\t}\n\n\t\t\t$outputDir = $set->getString('outputDir');\n\t\t\t$outputDir = $config->resolvePath($outputDir);\n\t\t\t$outputFormat = $set->getValueValidate('outputFormat', array('flatfile', 'serialize'), 'flatfile');\n\n\t\t\t$oldMetadataSrc = SimpleSAML_Metadata_MetaDataStorageSource::getSource(array(\n\t\t\t\t'type' => $outputFormat,\n\t\t\t\t'directory' => $outputDir,\n\t\t\t));\n\n\t\t\t$metaloader = new sspmod_metarefresh_MetaLoader($expire, $stateFile, $oldMetadataSrc);\n\n\t\t\t# Get global blacklist, whitelist and caching info\n\t\t\t$blacklist = $mconfig->getArray('blacklist', array());\n\t\t\t$whitelist = $mconfig->getArray('whitelist', array());\n\t\t\t$conditionalGET = $mconfig->getBoolean('conditionalGET', FALSE);\n\n\t\t\t// get global type filters\n\t\t\t$available_types = array(\n\t\t\t\t'saml20-idp-remote',\n\t\t\t\t'saml20-sp-remote',\n\t\t\t\t'shib13-idp-remote',\n\t\t\t\t'shib13-sp-remote',\n\t\t\t\t'attributeauthority-remote'\n\t\t\t);\n\t\t\t$set_types = $set->getArrayize('types', $available_types);\n\n\t\t\tforeach($set->getArray('sources') AS $source) {\n\n\t\t\t\t// filter metadata by type of entity\n\t\t\t\tif (isset($source['types'])) {\n\t\t\t\t\t$metaloader->setTypes($source['types']);\n\t\t\t\t} else {\n\t\t\t\t\t$metaloader->setTypes($set_types);\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific blacklists\n\t\t\t\tif(isset($source['blacklist'])) {\n\t\t\t\t\t$source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['blacklist'] = $blacklist;\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific whitelists\n\t\t\t\tif(isset($source['whitelist'])) {\n\t\t\t\t\t$source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['whitelist'] = $whitelist;\n\t\t\t\t}\n\n\t\t\t\t# Let src specific conditionalGET override global one\n\t\t\t\tif(!isset($source['conditionalGET'])) {\n\t\t\t\t\t$source['conditionalGET'] = $conditionalGET;\n\t\t\t\t}\n\n\t\t\t\tSimpleSAML\\Logger::debug('cron [metarefresh]: In set [' . $setkey . '] loading source [' . $source['src'] . ']');\n\t\t\t\t$metaloader->loadSource($source);\n\t\t\t}\n\n\t\t\t// Write state information back to disk\n\t\t\t$metaloader->writeState();\n\n\t\t\tswitch ($outputFormat) {\n\t\t\t\tcase 'flatfile':\n\t\t\t\t\t$metaloader->writeMetadataFiles($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'serialize':\n\t\t\t\t\t$metaloader->writeMetadataSerialize($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ($set->hasValue('arp')) {\n\t\t\t\t$arpconfig = SimpleSAML_Configuration::loadFromArray($set->getValue('arp'));\n\t\t\t\t$metaloader->writeARPfile($arpconfig);\n\t\t\t}\n\t\t}\n\n\t} catch (Exception $e) {\n\t\t$croninfo['summary'][] = 'Error during metarefresh: ' . $e->getMessage();\n\t}\n}", "function bigbluebuttonbn_cron () {\n return true;\n}", "public function cronAction()\n {\n $force = Mage::app()->getRequest()->getParam('force', false);\n $generator = Mage::getModel('smartassistant/generator');\n $generator->scheduleRun($force);\n }", "public function refreshTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\t$ids = Request::getArray('cid', array());\n\t\t\\Hubzero\\Utility\\Arr::toInteger($ids, array());\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$model = Extension::oneOrFail($id);\n\n\t\t\tif (!$model->refreshManifestCache())\n\t\t\t{\n\t\t\t\tNotify::error($model->getError());\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t$this->cancelTask();\n\t}", "public function firstAction() {\n\t\tif (!FreshRSS_Auth::hasAccess()) {\n\t\t\t// Token is useful in the case that anonymous refresh is forbidden\n\t\t\t// and CRON task cannot be used with php command so the user can\n\t\t\t// set a CRON task to refresh his feeds by using token inside url\n\t\t\t$token = FreshRSS_Context::$user_conf->token;\n\t\t\t$token_param = Minz_Request::param('token', '');\n\t\t\t$token_is_ok = ($token != '' && $token == $token_param);\n\t\t\t$action = Minz_Request::actionName();\n\t\t\t$allow_anonymous_refresh = FreshRSS_Context::$system_conf->allow_anonymous_refresh;\n\t\t\tif ($action !== 'actualize' ||\n\t\t\t\t\t!($allow_anonymous_refresh || $token_is_ok)) {\n\t\t\t\tMinz_Error::error(403);\n\t\t\t}\n\t\t}\n\t}", "public function masterRedmineCronJob()\r\n {\r\n //GET All trackers \r\n $allTracker = $this->client->api('tracker')->all(array('limit'=>1000));\r\n foreach ($allTracker['trackers'] as $key=>$tracker)\r\n {\t\r\n $this->addTracker($tracker);\r\n }\r\n //GET All user roles \r\n $allRole = $this->client->api('role')->all(array('limit' => 1000)); \r\n foreach ($allRole['roles'] as $key=>$role)\r\n {\r\n $this->addUserRole($role);\r\n }\r\n //GET All issue status \r\n $allStatus = $this->client->api('issue_status')->all(array('limit' => 1000));\r\n foreach($allStatus['issue_statuses'] as $key=>$status)\r\n {\r\n $this->addStatus($status);\r\n }\r\n }", "public function runInCron(): void\n {\n $result = $this->run();\n\n if ($result->getStatus() !== true) {\n do_action(Hooks::ADVANCED_CHECK_ALERT, $this, $result);\n }\n }", "function process_feed_urls_actions() {\n\t\t\tglobal $movies;\n\t\t\t\n\t\t\tif ( ( isset( $_POST['movies-feed-urls-action'] ) ) && ( $_POST['movies-feed-urls-action'] == 'feed-urls-update' ) ) {\n\t\t\t\t\t\n\t\t\t\tif ( wp_verify_nonce( $_POST['movies-feed-urls-update-wpnonce'], 'movies-feed-urls-update' ) ) {\n\t\t\t\t\t\n\t\t\t\t\tif ( (isset( $_POST['movies-feeds-purge'] ) ) && ( $_POST['movies-feeds-purge'] == 'yes' ) ) {\n\t\t\t\t\t\t$movies_feeds_purge = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$movies_feeds_purge = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$movies->movies_xml_processor->process_all_feeds( true, $movies_feeds_purge );\n\t\t\t\t\t\t\n\t\t\t\t\t?><div id=\"movies-feed-urls-processed\" class=\"updated below-h2\"><p><?php _e('XML Feeds Processed', 'movies'); ?></p></div><?php\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function gather_ua_jobs_url_refresh_feeds() {\n\tif ( isset( $_GET[ 'refresh-job-feeds' ] ) && $_GET[ 'refresh-job-feeds' ] ) {\n\n\t\t// This will refresh the faculty jobs feed\n\t\tfetch_ua_faculty_jobs_feed( true );\n\n\t\t// Go back to the main page\n\t\twp_redirect( add_query_arg( array( 'page' => 'gather-ua-jobs', 'faculty-jobs-refreshed' => 1 ), admin_url( 'tools.php' ) ) );\n\t\texit;\n\n\t// Only update the faculty jobs feed\n\t} else if ( isset( $_GET[ 'refresh-faculty-jobs-feed' ] ) && $_GET[ 'refresh-faculty-jobs-feed' ] ) {\n\n\t\t// This will refresh the faculty jobs feed\n\t\tfetch_ua_faculty_jobs_feed( true );\n\n\t\t// Go back to the main page\n wp_redirect( add_query_arg( array( 'page' => 'gather-ua-jobs', 'faculty-jobs-refreshed' => 1 ), admin_url( 'tools.php' ) ) );\n\t\texit;\n\n\t}\n\n}", "public function execute() {\n global $CFG;\n\n require_once($CFG->dirroot . '/course/lib.php');\n\n // Specific list of plugins that need to be refreshed. If not set, then all mod plugins will be refreshed.\n $pluginstorefresh = null;\n if (isset($this->get_custom_data()->plugins)) {\n $pluginstorefresh = $this->get_custom_data()->plugins;\n }\n\n // Is course id set?\n if (isset($this->get_custom_data()->courseid)) {\n $courseid = $this->get_custom_data()->courseid;\n } else {\n $courseid = 0;\n }\n\n $pluginmanager = core_plugin_manager::instance();\n $modplugins = $pluginmanager->get_plugins_of_type('mod');\n foreach ($modplugins as $plugin) {\n // Check if a specific list of plugins is defined and check if it contains the plugin that is currently being evaluated.\n if (!empty($pluginstorefresh) && !in_array($plugin->name, $pluginstorefresh)) {\n // This plugin is not in the list, move on to the next one.\n continue;\n }\n // Refresh events.\n mtrace('Refreshing events for ' . $plugin->name);\n course_module_bulk_update_calendar_events($plugin->name, $courseid);\n }\n }", "function wp_get_ready_cron_jobs()\n {\n }", "public function cron()\n {\n wp_schedule_event(time(), 'hourly', array($this, 'generate'));\n }", "function cicleinscription_cron () {\n return true;\n}", "public function cron() {\n settings()->cron = json_decode(db()->where('`key`', 'cron')->getValue('settings', '`value`'));\n\n $this->process();\n }", "public static function cronDaily() {\n\t\t$rel_folder='plugins/aTVremote/resources/images/';\n\t\t$abs_folder=dirname(__FILE__).'/../../../../'.$rel_folder;\n\t\texec(\"find \".$abs_folder.\"*.png -mtime +7 -exec rm {} \\;\");\n\t}", "public static function init_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::init_sync_cron_jobs();\n\t}", "function roshine_cron () {\n return true;\n}", "function content_function(){ load_schedule(); }", "public function refreshManifestCache()\n\t{\n\n\t}", "function schedule_backup_cron() {\n\n global $CFG;\n \n $status = true;\n\n $emailpending = false;\n\n //Check for required functions...\n if(!function_exists('utf8_encode')) {\n mtrace(\" ERROR: You need to add XML support to your PHP installation!\");\n return true;\n }\n\n //Get now\n $now = time();\n\n //First of all, we have to see if the scheduled is active and detect\n //that there isn't another cron running\n mtrace(\" Checking backup status\",'...');\n $backup_config = backup_get_config();\n if(!isset($backup_config->backup_sche_active) || !$backup_config->backup_sche_active) {\n mtrace(\"INACTIVE\");\n return true;\n } else if (isset($backup_config->backup_sche_running) && $backup_config->backup_sche_running) {\n mtrace(\"RUNNING\");\n //Now check if it's a really running task or something very old looking \n //for info in backup_logs to unlock status as necessary\n $timetosee = 1800; //Half an hour looking for activity\n $timeafter = time() - $timetosee;\n $numofrec = count_records_select (\"backup_log\",\"time > $timeafter\");\n if (!$numofrec) {\n $timetoseemin = $timetosee/60;\n mtrace(\" No activity in last \".$timetoseemin.\" minutes. Unlocking status\");\n } else {\n mtrace(\" Scheduled backup seems to be running. Execution delayed\");\n return true;\n }\n } else {\n mtrace(\"OK\");\n //Mark backup_sche_running\n backup_set_config(\"backup_sche_running\",\"1\");\n }\n\n //Now we get the main admin user (we'll use his timezone, mail...)\n mtrace(\" Getting admin info\");\n $admin = get_admin();\n if (!$admin) {\n $status = false;\n }\n\n //Delete old_entries from backup tables\n if ($status) {\n mtrace(\" Deleting old data\");\n $status = backup_delete_old_data();\n }\n\n //Now we get a list of courses in the server\n if ($status) {\n mtrace(\" Checking courses\");\n //First of all, we delete everything from backup tables related to deleted courses\n mtrace(\" Skipping deleted courses\");\n $skipped = 0;\n if ($bckcourses = get_records('backup_courses')) {\n foreach($bckcourses as $bckcourse) {\n //Search if it exists\n if (!$exists = get_record('course', 'id', \"$bckcourse->courseid\")) {\n //Doesn't exist, so delete from backup tables\n delete_records('backup_courses', 'courseid', \"$bckcourse->courseid\");\n delete_records('backup_log', 'courseid', \"$bckcourse->courseid\");\n $skipped++;\n }\n }\n }\n mtrace(\" $skipped courses\");\n //Now process existing courses\n $courses = get_records(\"course\");\n //For each course, we check (insert, update) the backup_course table\n //with needed data\n foreach ($courses as $course) {\n if ($status) {\n mtrace(\" $course->fullname\");\n //We check if the course exists in backup_course\n $backup_course = get_record(\"backup_courses\",\"courseid\",$course->id);\n //If it doesn't exist, create\n if (!$backup_course) {\n $temp_backup_course->courseid = $course->id;\n $newid = insert_record(\"backup_courses\",$temp_backup_course);\n //And get it from db\n $backup_course = get_record(\"backup_courses\",\"id\",$newid);\n }\n //If it doesn't exist now, error\n if (!$backup_course) {\n mtrace(\" ERROR (in backup_courses detection)\");\n $status = false;\n continue;\n }\n // Skip backup of unavailable courses that have remained unmodified in a month\n $skipped = false;\n if (!$course->visible && ($now - $course->timemodified) > 31*24*60*60) { //Hidden + unmodified last month\n mtrace(\" SKIPPING - hidden+unmodified\");\n set_field(\"backup_courses\",\"laststatus\",\"3\",\"courseid\",$backup_course->courseid);\n $skipped = true;\n } \n //Now we backup every non skipped course with nextstarttime < now\n if (!$skipped && $backup_course->nextstarttime > 0 && $backup_course->nextstarttime < $now) {\n //We have to send a email because we have included at least one backup\n $emailpending = true;\n //Only make the backup if laststatus isn't 2-UNFINISHED (uncontrolled error)\n if ($backup_course->laststatus != 2) {\n //Set laststarttime\n $starttime = time();\n set_field(\"backup_courses\",\"laststarttime\",$starttime,\"courseid\",$backup_course->courseid);\n //Set course status to unfinished, the process will reset it\n set_field(\"backup_courses\",\"laststatus\",\"2\",\"courseid\",$backup_course->courseid);\n //Launch backup\n $course_status = schedule_backup_launch_backup($course,$starttime);\n //Set lastendtime\n set_field(\"backup_courses\",\"lastendtime\",time(),\"courseid\",$backup_course->courseid);\n //Set laststatus\n if ($course_status) {\n set_field(\"backup_courses\",\"laststatus\",\"1\",\"courseid\",$backup_course->courseid);\n } else {\n set_field(\"backup_courses\",\"laststatus\",\"0\",\"courseid\",$backup_course->courseid);\n }\n }\n }\n\n //Now, calculate next execution of the course\n $nextstarttime = schedule_backup_next_execution ($backup_course,$backup_config,$now,$admin->timezone);\n //Save it to db\n set_field(\"backup_courses\",\"nextstarttime\",$nextstarttime,\"courseid\",$backup_course->courseid);\n //Print it to screen as necessary\n $showtime = \"undefined\";\n if ($nextstarttime > 0) {\n $showtime = userdate($nextstarttime,\"\",$admin->timezone);\n }\n mtrace(\" Next execution: $showtime\");\n }\n }\n }\n\n //Delete old logs\n if (!empty($CFG->loglifetime)) {\n mtrace(\" Deleting old logs\");\n $loglifetime = $now - ($CFG->loglifetime * 86400);\n delete_records_select(\"backup_log\", \"laststarttime < '$loglifetime'\");\n }\n\n //Send email to admin if necessary\n if ($emailpending) {\n mtrace(\" Sending email to admin\");\n $message = \"\";\n\n //Get info about the status of courses\n $count_all = count_records('backup_courses');\n $count_ok = count_records('backup_courses','laststatus','1');\n $count_error = count_records('backup_courses','laststatus','0');\n $count_unfinished = count_records('backup_courses','laststatus','2');\n $count_skipped = count_records('backup_courses','laststatus','3');\n\n //Build the message text\n //Summary\n $message .= get_string('summary').\"\\n\";\n $message .= \"==================================================\\n\";\n $message .= \" \".get_string('courses').\": \".$count_all.\"\\n\";\n $message .= \" \".get_string('ok').\": \".$count_ok.\"\\n\";\n $message .= \" \".get_string('skipped').\": \".$count_skipped.\"\\n\";\n $message .= \" \".get_string('error').\": \".$count_error.\"\\n\";\n $message .= \" \".get_string('unfinished').\": \".$count_unfinished.\"\\n\\n\";\n\n //Reference\n if ($count_error != 0 || $count_unfinished != 0) {\n $message .= \" \".get_string('backupfailed').\"\\n\\n\";\n $dest_url = \"$CFG->wwwroot/$CFG->admin/report/backups/index.php\";\n $message .= \" \".get_string('backuptakealook','',$dest_url).\"\\n\\n\";\n //Set message priority\n $admin->priority = 1;\n //Reset unfinished to error\n set_field('backup_courses','laststatus','0','laststatus','2');\n } else {\n $message .= \" \".get_string('backupfinished').\"\\n\";\n }\n\n //Build the message subject\n $site = get_site();\n $prefix = $site->shortname.\": \";\n if ($count_error != 0 || $count_unfinished != 0) {\n $prefix .= \"[\".strtoupper(get_string('error')).\"] \";\n }\n $subject = $prefix.get_string(\"scheduledbackupstatus\");\n\n //Send the message\n email_to_user($admin,$admin,$subject,$message);\n }\n \n\n //Everything is finished stop backup_sche_running\n backup_set_config(\"backup_sche_running\",\"0\");\n\n return $status;\n}", "function mt_flickr_activate() {\n wp_schedule_event(time(), 'hourly', 'mt_flickr');\n}", "function subsite_manager_remove_cron_cache($site_guid = 0){\n\n $site_guid = sanitize_int($site_guid, false);\n\n if(empty($site_guid)){\n $site_guid = elgg_get_site_entity()->getGUID();\n }\n\n if(($site = elgg_get_site_entity($site_guid)) && elgg_instanceof($site, \"site\", Subsite::SUBTYPE, \"Subsite\")){\n $file_path = get_config(\"dataroot\") . \"subsite_manager/\" . $site->getGUID() . \"/cron_cache.json\";\n\n if(file_exists($file_path)){\n unlink($file_path);\n }\n }\n }", "function schedule_expiry() {\n\t\tif ( ! wp_next_scheduled( 'github_embed_cron' ) ) {\n\t\t\t$frequency = apply_filters( 'github_embed_cache_frequency', 'daily' );\n\t\t\twp_schedule_event( time(), $frequency, 'github_embed_cron' );\n\t\t}\n\t}", "function updateWebstats(){\n\t\tglobal $skipUpdateWebstats;\n\t\tif($skipUpdateWebstats or $this->miscconfig['enablewebstats']=='') {\n\t\t\t# if you put webstats.sh in crontab\n\t\t\techo \"\\nSkipping \".__FUNCTION__.\" because of config directive (\\$skipUpdateWebstats) or enablewebstats is not checked in options.\\n\";\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireCommandLine(__FUNCTION__);\n\t\t$res=$this->query(\"select domainname,homedir from domains where status='$this->status_active' and homedir<>''\");\n\t\t$str='';\n\t\tforeach($res as $dom){\n\t\t\tif ($this->miscconfig['enablecommonwebstats']=='') {\n\t\t\t\tpassthru2(\"mkdir -p \".$dom['homedir'].\"/httpdocs/webstats/\");\n\t\t\t\t$str.=\"webalizer -q -p -n www.\".$dom['domainname'].\" -o \".$dom['homedir'].\"/httpdocs/webstats \".$dom['homedir'].\"/logs/access_log -R 100 TopReferrers -r \".$dom['domainname'].\" HideReferrer \\n\";\n\t\t\t}else {\n\t\t\t\tpassthru2(\"mkdir -p \" .$this->miscconfig[\"commonwebstatsdir\"] .\"/\".$dom['domainname']);\n\t\t\t\t$str.=\"webalizer -q -p -n www.\".$dom['domainname']\n\t\t\t\t\t. \" -o \"\n\t\t\t\t\t. $this->miscconfig['commonwebstatsdir']\n\t\t\t\t\t. \"/\"\n\t\t\t\t\t. $dom['domainname']\n\t\t\t\t\t. \" \"\n\t\t\t\t\t. $dom['homedir']\n\t\t\t\t\t. \"/logs/access_log -R 100 TopReferrers -r \"\n\t\t\t\t\t. $dom['domainname'].\" HideReferrer \\n\";\n\n\t\t\t}\n\n\n\t\t}\n\t\techo $str;\n\n\t\twriteoutput2(\"/etc/ehcp/webstats.sh\",$str,\"w\");\n\t\tpassthru2(\"chmod a+x /etc/ehcp/webstats.sh\");\n\t#\tpassthru2(\"/etc/ehcp/webstats.sh\");\n\t\techo \"\\nwrite webstats file to /etc/ehcp/webstats.sh complete... need to put this in crontab or run automatically.. \\n\";\n\n\t}", "public function schedule_cron($rate = 'md5_hash_weekly') {\n if ( !wp_next_scheduled( 'md5_hasher_check_dir' ) ) {\n wp_schedule_event( time(), $rate, 'md5_hasher_check_dir');\n }\n }", "public function initialteRedmineCronJob()\r\n { \r\n \r\n //GET All projects \r\n $allProjects = $this->client->api('project')->all(array('limit' => 100,'offset' => 0));\r\n foreach ($allProjects['projects'] as $project)\r\n { \r\n \t$this->addProject($project);\r\n }\r\n //GET All issues \r\n $allIssue=$this->client->api('issue')->all();\r\n if($allIssue['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allIssue['total_count'] ; $offset+=$allIssue['limit']) \r\n { \r\n \r\n $issueList=$this->client->api('issue')->all(array(\r\n 'limit' => $allIssue['limit'],\r\n 'offset' =>$offset)); \r\n foreach ($issueList['issues'] as $singleIssue)\r\n {\r\n $this->addIssue($singleIssue);\r\n }\r\n }\r\n }\r\n \r\n \r\n // //Get All Timelog Entries \r\n $allTimeEntry=$this->client->api('time_entry')->all();\r\n if($allTimeEntry['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allTimeEntry['total_count'] ; $offset+=$allTimeEntry['limit']) \r\n { \r\n \r\n $timeEntryList=$this->client->api('time_entry')->all(array('limit' => $allTimeEntry['limit'],'offset' =>$offset)); \r\n foreach ($timeEntryList['time_entries'] as $singleTimeLog)\r\n {\r\n $this->addTimeEntry($singleTimeLog);\r\n }\r\n }\r\n }\r\n\r\n \r\n }", "function local_campusconnect_cron() {\n $ecslist = ecssettings::list_ecs();\n foreach ($ecslist as $ecsid => $name) {\n $ecssettings = new ecssettings($ecsid);\n\n if ($ecssettings->time_for_cron()) {\n mtrace(\"Checking for updates on ECS server '\".$ecssettings->get_name().\"'\");\n $connect = new connect($ecssettings);\n $queue = new receivequeue();\n\n try {\n $queue->update_from_ecs($connect);\n $queue->process_queue($ecssettings);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n mtrace(\"Sending updates to ECS server '\".$ecssettings->get_name().\"'\");\n try {\n export::update_ecs($connect);\n course_url::update_ecs($connect);\n enrolment::update_ecs($connect);\n } catch (connect_exception $e) {\n local_campusconnect_ecs_error_notification($ecssettings, $e->getMessage());\n }\n\n $cms = participantsettings::get_cms_participant();\n if ($cms && $cms->get_ecs_id() == $ecssettings->get_id()) {\n // If we are updating from the ECS with the CMS attached, then check the directory mappings (and sort order).\n directorytree::check_all_mappings();\n }\n\n mtrace(\"Emailing any necessary notifications for '\".$ecssettings->get_name().\"'\");\n notification::send_notifications($ecssettings);\n\n $ecssettings->update_last_cron();\n }\n }\n}", "public function wp_cron_scheduled_check()\n {\n }", "protected function checkScheduledJobs() {\n global $database;\n // first get all active cronjobs\n $SQL = sprintf(\"SELECT * FROM %smod_kit_cj_cronjob WHERE `cronjob_status`='ACTIVE'\", TABLE_PREFIX);\n if (null ===($result = $database->query($SQL))) {\n $this->setError(sprintf('[%s _ %s] %s', __METHOD__, __LINE__, $database->get_error()));\n exit($this->getError());\n }\n $cronjobs = array();\n while (false !== ($job = $result->fetchRow(MYSQL_ASSOC))) {\n $cronjobs[$job['cronjob_id']] = $job;\n }\n foreach ($cronjobs as $cronjob) {\n $this->log[self::CRONJOB_ID] = $cronjob['cronjob_id'];\n $this->log[self::CRONJOB_NAME] = $cronjob['cronjob_name'];\n if ($cronjob['cronjob_next_run'] == '0000-00-00 00:00:00') {\n // this cronjob was never executed...\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $cronjob['cronjob_last_status'] = 'First call, calculate the next regular run of this cronjob.';\n $cronjob['cronjob_last_run'] = date('Y-m-d H:i:s');\n $this->updateCronjob($cronjob);\n $this->log[self::LOG_MESSAGE] = 'First call, calculate the next regular run of this cronjob.';\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = $cronjob['cronjob_last_run'];\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n }\n if (strtotime($cronjob['cronjob_next_run']) < time()) {\n // execute this cronjob\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_URL)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_URL));\n }\n if (false !== strpos($cronjob['cronjob_command'], LEPTON_PATH)) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], strlen(LEPTON_PATH));\n }\n if (strpos($cronjob['cronjob_command'], DIRECTORY_SEPARATOR) == 0) {\n $cronjob['cronjob_command'] = substr($cronjob['cronjob_command'], 1);\n }\n $execute = LEPTON_PATH.DIRECTORY_SEPARATOR.$cronjob['cronjob_command'];\n if (!file_exists($execute)) {\n // write the error to the log but continue with the next cronjob.\n $this->setError(sprintf('The relative path %s does not exists, please check the settings for this cronjob!', $cronjob['cronjob_command']));\n continue;\n }\n if (false === ($result = exec(sprintf(\"%s %s\", $this->php_exec, $execute)))) {\n // error executing - write log and continue\n $this->setError(sprintf('Error executing %s - no more informations available.', $cronjob['cronjob_command']));\n continue;\n }\n $this->log[self::LOG_MESSAGE] = $result;\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::CRONJOB_RUN] = date('Y-m-d H:i:s');\n $this->log[self::CRONJOB_STATUS] = 'OK';\n $this->writeLog();\n $cronjob['cronjob_last_run'] = $this->log[self::CRONJOB_RUN];\n $cronjob['cronjob_last_status'] = $result;\n $cronjob['cronjob_next_run'] = $this->calculateNextRun($cronjob);\n $this->updateCronjob($cronjob);\n $this->cronjob_executed = true;\n }\n }\n }", "public static function action_wp() {\n $enable_reminders = self::send_domain_reminders();\n $schedule = wp_get_schedule( self::$scheduled_event_hook );\n $next_occurence = wp_next_scheduled( self::$scheduled_event_hook );\n if( !$schedule && !$next_occurence && $enable_reminders ) {\n wp_schedule_event( time(), 'weekly', self::$scheduled_event_hook );\n return;\n \t}\n \tif( $schedule !== false && !$enable_reminders ) {\n \twp_unschedule_event( $next_occurence, self::$scheduled_event_hook );\n \treturn;\n \t}\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command(RefreshLandingPageChecks::class)->cron('15 1 * * *');\n }", "static public function deactive()\n {\n do_action( \"sc_wpfmp_disable_wp_cron\" ); // Go disable cron\n }", "function subsite_manager_make_cron_cache(){\n\n if(subsite_manager_on_subsite()){\n $site = elgg_get_site_entity();\n $file_path = get_config(\"dataroot\") . \"subsite_manager/\";\n\n // make correct file structure\n if(!is_dir($file_path)){\n mkdir($file_path);\n }\n\n $file_path .= $site->getGUID() . \"/\";\n\n if(!is_dir($file_path)){\n mkdir($file_path);\n }\n\n // cache file\n $file_path .= \"cron_cache.json\";\n\n if(!file_exists($file_path)){\n $crons = array();\n\n $hooks = get_config(\"hooks\");\n\n if(!empty($hooks[\"cron\"])){\n foreach($hooks[\"cron\"] as $interval => $functions){\n if(($interval != \"all\") && !empty($functions)){\n $crons[] = $interval;\n }\n }\n }\n\n file_put_contents($file_path, json_encode($crons));\n }\n }\n }", "public function synchronize()\n {\n // Synchronize users-comments-images\n $query = $this->_db->getQuery(true)\n ->delete('c USING '._JOOM_TABLE_COMMENTS.' AS c')\n ->leftJoin(_JOOM_TABLE_IMAGES.' AS i ON c.cmtpic = i.id')\n ->where('i.id IS NULL');\n $this->_db->setQuery($query);\n\n if(!$this->_db->query())\n {\n // Redirect to maintenance manager because this task is usually launched there\n $this->setRedirect($this->_ambit->getRedirectUrl('maintenance&tab=comments'), $this->_db->getErrorMsg(), 'error');\n\n return;\n }\n\n $this->_db->getQuery(true)\n ->update(_JOOM_TABLE_COMMENTS.' AS c')\n ->leftJoin('#__users AS u ON c.userid = u.id')\n ->set('c.userid = 0')\n ->where('u.id IS NULL');\n $this->_db->setQuery($query);\n\n if(!$this->_db->query())\n {\n // Redirect to maintenance manager because this task is usually launched there\n $this->setRedirect($this->_ambit->getRedirectUrl('maintenance&tab=comments'), $this->_db->getErrorMsg(), 'error');\n\n return;\n }\n\n // Redirect to maintenance manager because this task is usually launched there\n $this->setRedirect($this->_ambit->getRedirectUrl('maintenance&tab=comments'), JText::_('COM_JOOMGALLERY_MAIMAN_CM_MSG_COMMENTS_SYNCHRONIZED'));\n }", "public function actionCronHourly()\n {\n switch (date('H')) {\n default: echo \"Nothing to run\\n\";\n }\n echo \"Done!\\n\";\n }", "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }", "function om13_wait_for_going_live() {\n\tif (time() < 1365447600 && !is_user_logged_in()) {\n\t\twp_die('Die Website der #om13 ist demnächst verfügbar. Bei Fragen kannst du gern den Twitteraccount <a href=\"https://twitter.com/openmindkonf\">@openmindkonf</a> kontaktieren. Wir freuen uns auf dich!'); // TODO: __\n\t}\n}", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "public function runSubscriptionsCron()\n {\n $billingActive = $this->scopeConfig->getValue(\n 'subscriptions/general/billing_active',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n\n if ($billingActive == 1) {\n $this->runSubscriptions();\n }\n }", "public static function clear_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::clear_sync_cron_jobs();\n\t}", "public function run(): void\n {\n foreach (Social::getSocials() as $social) {\n $model = Social::firstOrNew($social);\n $model->save();\n }\n }", "function run_all_tasks() {\n\n foreach ($this->task_records as $record) {\n //if the task cache has not been updated since we began, execute\n if (!\\core\\task\\manager::static_caches_cleared_since($this->timestart)) {\n $task = $this->fetch_task_from_record($record);\n if ($task) {\n $this->run_task($task);\n }//end of if task\n }//end of if static caches\n }//end of foreach\n }", "public function runCron(){\n// $q = 'SELECT * FROM `Intermediair`';\n $q = 'SELECT * FROM `Intermediair` WHERE userid = 11529';\n $res = $this->cmsmanager->customSelectQuery($q)[0];\n $this->generateEmail($res);\n \n// if(count($res) > 0){\n// foreach($res as $intermediair){\n// $this->generateEmail($intermediair);\n// }\n// }\n }", "public function run()\n\t{\n if($this->_config()->isLogEnabled()) {\n $this->_config()->dbLog(\"Cron [Triggered]\");\n }\n\n /**\n * This doesn't exist in 1.3.2!\n */\n $indexProcess = new Mage_Index_Model_Process();\n $indexProcess->setId(self::LOCK_INDEX_ID);\n if ($indexProcess->isLocked()) {\n // Check how old the lock is - unlock after 1hr\n if ($this->_lockIsOld(self::LOCK_INDEX_ID)) {\n $indexProcess->unlock();\n } else {\n $this->_config()->log('MAILUP: cron already running or locked');\n return false;\n }\n }\n $indexProcess->lockAndBlock();\n\n try {\n require_once dirname(__FILE__) . '/../Helper/Data.php';\n $db_read = Mage::getSingleton('core/resource')->getConnection('core_read');\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $syncTableName = Mage::getSingleton('core/resource')->getTableName('mailup/sync');\n $jobsTableName = Mage::getSingleton('core/resource')->getTableName('mailup/job');\n $lastsync = gmdate(\"Y-m-d H:i:s\");\n // reading customers (jobid == 0, their updates)\n $customer_entity_table_name = Mage::getSingleton('core/resource')->getTableName('customer_entity');\n\n /**\n * Now Handle Jobs we need to Sync, and all customers attached to each job\n */\n foreach(Mage::getModel('mailup/job')->fetchQueuedOrStartedJobsCollection() as $jobModel) {\n /* @var $jobModel MailUp_MailUpSync_Model_Job */\n $job = $jobModel->getData();\n\n $storeId = isset($job['store_id']) ? $job['store_id'] : NULL;\n\n // If job is auto-sync and cron is not enabled for the job's site, skip the job\n if ($jobModel->isAutoSync() && ! $this->_config()->isCronExportEnabled($storeId)) {\n $this->_config()->dbLog(\"Auto-Task skipped as auto-sync disabled for site\", $job[\"id\"], $storeId);\n continue;\n }\n\n $stmt = $db_write->query(\n \"UPDATE {$jobsTableName}\n SET status='started', start_datetime='\" . gmdate(\"Y-m-d H:i:s\") . \"'\n WHERE id={$job[\"id\"]}\"\n );\n $customers = array();\n $job['mailupNewGroup'] = 0;\n $job['mailupIdList'] = Mage::getStoreConfig('mailup_newsletter/mailup/list', $storeId);\n $job[\"mailupGroupId\"] = $job[\"mailupgroupid\"];\n $job[\"send_optin_email_to_new_subscribers\"] = $job[\"send_optin\"];\n\n // If group is 0 and there is a default group, set group to this group\n $defaultGroupId = Mage::getStoreConfig('mailup_newsletter/mailup/default_group');\n if ($job[\"mailupGroupId\"] == 0 && $defaultGroupId !== null) {\n $job[\"mailupGroupId\"] = $defaultGroupId;\n }\n\n $tmp = Mage::getSingleton('mailup/source_lists');\n $tmp = $tmp->toOptionArray($storeId); // pass store id!\n foreach ($tmp as $t) {\n if ($t[\"value\"] == $job['mailupIdList']) {\n $job['mailupListGUID'] = $t[\"guid\"];\n $job[\"groups\"] = $t[\"groups\"];\n break;\n }\n }\n unset($tmp);\n unset($t);\n $stmt = $db_read->query(\"\n SELECT ms.*, ce.email\n FROM {$syncTableName} ms\n JOIN $customer_entity_table_name ce\n ON (ms.customer_id = ce.entity_id)\n WHERE ms.needs_sync=1\n AND ms.entity='customer'\n AND job_id={$job[\"id\"]}\"\n );\n while ($row = $stmt->fetch()) {\n $customers[] = $row[\"customer_id\"];\n }\n /**\n * Send the Data!\n */\n $returnCode = MailUp_MailUpSync_Helper_Data::generateAndSendCustomers($customers, $job, $storeId);\n /**\n * Check return OK\n */\n if($returnCode === 0) {\n $customerCount = count($customers);\n $db_write->query(\"\n UPDATE {$syncTableName} SET needs_sync=0, last_sync='$lastsync'\n WHERE job_id = {$job[\"id\"]}\n AND entity='customer'\"\n );\n $this->_config()->dbLog(\"Job Task [update] [Synced] [customer count:{$customerCount}]\", $job[\"id\"], $storeId);\n // finishing the job also\n $db_write->query(\"\n UPDATE {$jobsTableName} SET status='finished', finish_datetime='\" . gmdate(\"Y-m-d H:i:s\") . \"'\n WHERE id={$job[\"id\"]}\"\n );\n $this->_config()->dbLog(\"Jobs [Update] [Complete] [{$job[\"id\"]}]\", $job[\"id\"], $storeId);\n }\n /**\n * Only successfull if we get 0 back. False is also a fail.\n */\n else {\n $stmt = $db_write->query(\n \"UPDATE {$jobsTableName} SET status='queued' WHERE id={$job[\"id\"]}\"\n );\n if($this->_config()->isLogEnabled()) {\n $this->_config()->dbLog(sprintf(\"generateAndSendCustomers [ReturnCode] [ERROR] [%d]\", $returnCode), $job[\"id\"], $storeId);\n }\n }\n }\n } catch (Exception $e) {\n // In case of otherwise uncaught error, unlock and re-throw\n $indexProcess->unlock();\n throw $e;\n }\n\n $indexProcess->unlock();\n \n if ($this->_config()->isLogEnabled()) {\n $this->_config()->dbLog(\"Cron [Completed]\");\n }\n\t}", "public function run()\n {\n if (!GOOGLE_APPENGINE) { // GAE has its own external task queue\n require_code('tasks');\n\n $task_rows = $GLOBALS['SITE_DB']->query_select('task_queue', array('*'), array('t_locked' => 0));\n foreach ($task_rows as $task_row) {\n $GLOBALS['SITE_DB']->query_update('task_queue', array(\n 't_locked' => 1,\n ), array(\n 'id' => $task_row['id'],\n ), '', 1);\n\n require_code('files');\n //$url = find_script('tasks') . '?id=' . strval($task_row['id']) . '&secure_ref=' . urlencode($task_row['t_secure_ref']);\n //http_download_file($url);\n execute_task_background($task_row);\n }\n }\n }", "public function domainRefresh() {\n try {\n $response = $this->httpClient->post(self::CM_DOMAIN_REFRESH_URL, [\n 'args' => [\\Drupal::request()->getSchemeAndHttpHost(), ['force' => TRUE]],\n ]);\n } catch (\\Exception $exception) {\n $this->logger->critical(\"Clearing Shareaholic domain cache in Content Manager failed. Connection failed.\");\n return;\n }\n\n $statusCode = $response->getStatusCode();\n if ($statusCode !== 200) {\n $this->logger->critical(\"Clearing Shareaholic domain cache in Content Manager failed. Status code returned: $statusCode.\");\n }\n }", "function my_task_function() {\r\n\twrite_log('CRON: Called and Actioned');\r\n\tset_up_feeds();\r\n\tprune_posts();\r\n\r\n\t// wp_mail( '[email protected]', 'Automatic email', 'Automatic scheduled 5 mine from WordPress.');\r\n}", "function aggregator_refresh($feed) {\n global $channel, $image, $db;\n\n // Generate conditional GET headers.\n $headers = array();\n if ($feed->etag) {\n $headers['If-None-Match'] = $feed->etag;\n }\n if ($feed->modified) {\n $headers['If-Modified-Since'] = gmdate('D, d M Y H:i:s', $feed->modified) .' GMT';\n }\n\n // Request feed.\n $result = http_request($feed->category_feed, $headers);\n\n // Process HTTP response code.\n switch ($result->code) {\n case 304:\n // No new syndicated content from site\n $db->query('UPDATE feed_data SET checked = ' . time() . ' WHERE id = '. $feed->id);\n break;\n case 301:\n // Updated URL for feed\n $feed->category_feed = $result->redirect_url;\n $db->query(\"UPDATE feed_data SET category_feed='\" . $feed->category_feed . \"' WHERE category_id=\" . $feed->id);\n break;\n\n case 200:\n case 302:\n case 307:\n // Filter the input data:\n if (aggregator_parse_feed($result->data, $feed)) {\n\n if ($result->headers['Last-Modified']) {\n $modified = strtotime($result->headers['Last-Modified']);\n }\n\n /*\n ** Prepare the channel data:\n */\n\n foreach ($channel as $key => $value) {\n $channel[$key] = trim(strip_tags($value));\n }\n\n /*\n ** Prepare the image data (if any):\n */\n\n foreach ($image as $key => $value) {\n $image[$key] = trim($value);\n }\n\n if ($image['LINK'] && $image['URL'] && $image['TITLE']) {\n $image = '<a href=\"'. $image['LINK'] .'\"><img src=\"'. $image['URL'] .'\" alt=\"'. $image['TITLE'] .'\" /></a>';\n }\n else {\n $image = NULL;\n }\n\n /*\n ** Update the feed data:\n */\n\n $db->query(\"UPDATE feed_data SET checked = \". time() .\", link = '\". $channel['LINK'] .\"', description = '\". $channel['DESCRIPTION'] .\"', image = '\". $image .\"', etag = '\". $result->headers['ETag'] .\"', modified = '\". $modified .\"' WHERE id = \". $feed->id);\n\n }\n break;\n default:\n echo 'Failed to parse RSS feed ' . $feed->category_name . ' : ' . $result->code .' '. $result->error . \"\\n\";\n }\n}", "public function run()\n {\n Job::create(['url'=> 'https://proxify.io']);\n\n Job::create(['url'=> 'https://reddit.com']);\n\n Job::factory(1000)->create();\n }", "static function doCron() {\n\t\t$lc = new DateTime(Preferences::value(\"lastCron\"));\n\t\t$now = new DateTime();\n\t\t\n\t\t$diff = $now->diff($lc, true);\n\t\tif($diff->i >= 1) return true;\n\t\treturn false;\n\t}", "function install_cron(){\n wp_schedule_event(\n time(),\n 'cuentadigital_interval',\n 'cuentadigital_cron_hook'\n );\n }", "public function cronCleanup() {\n if (variable_get('cron_semaphore', FALSE)) {\n watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);\n\n // Release cron semaphore.\n variable_del('cron_semaphore');\n }\n }", "function sensei_cust_remove_content_drip_emails() { \nremove_all_actions( 'woo_scd_daily_cron_hook' );\n}", "public function maybeSchedule() {\n\t\t$scheduledTimestamp = wp_next_scheduled(static::$cronHook);\n\t\tif( !$scheduledTimestamp ) {\n\t\t\t$this->schedule();\n\t\t\treturn;\n\t\t}\n\n\t\t$cronJobs = _get_cron_array();\n\t\t$job = $cronJobs[$scheduledTimestamp][static::$cronHook];\n\n\t\t//If the schedule doesn't match, reschedule\n\t\tif( $job['schedule'] !== $this->get_option('schedule') ) {\n\t\t\t$this->unschedule();\n\t\t\t$this->schedule();\n\t\t}\n\t}", "public function autoSync()\n {\n // Only run Auto Sync Jobs\n $job = Mage::getModel('mailup/job');\n /* @var $job MailUp_MailUpSync_Model_Job */\n \n foreach($job->fetchAutoSyncQueuedJobsCollection() as $job) {\n \n }\n }", "public function crawl(){\n\t\t\t$this->collectUrls();\n\t\t}", "private function initCurrentlyBeingDone() {\n global $wpdb;\n $tableUrls = Factory::databaseService()->getDbTableUrlsName();\n\n // URLs currently being crawled\n $resultsBeingCrawled = $wpdb->get_results(\"SELECT * FROM {$tableUrls}\n WHERE is_locked = TRUE\n AND saved_at IS NULL\n AND saved_post_id IS NULL\n AND recrawled_at IS NULL\n ORDER BY created_at ASC\n \");\n\n $this->urlsCurrentlyBeingCrawled = $this->addSiteDataToUrlTuples($resultsBeingCrawled);\n\n // Posts currently being recrawled\n $resultsBeingRecrawled = $wpdb->get_results(\"SELECT * FROM {$tableUrls}\n WHERE is_locked = TRUE\n AND saved_at IS NOT NULL\n AND saved_post_id IS NOT NULL\n ORDER BY updated_at ASC\n \");\n\n $this->postsCurrentlyBeingSaved = $this->getPostsFromUrlTuples($resultsBeingRecrawled);\n }", "public function run()\n {\n DB::table('cron_master_lists')->insert([\n \t\t 'description' => 'Advertising Performance',\n \t\t 'route' => 'UpdateCampaignAdvertising',\n \t\t 'sequence' => 10\n \t\t]);\n }", "protected function processQueues() {\n $original_session_saving = drupal_save_session();\n drupal_save_session(FALSE);\n\n // Force the current user to anonymous to ensure consistent permissions on\n $original_user = $GLOBALS['user'];\n $GLOBALS['user'] = drupal_anonymous_user();\n\n $return = FALSE;\n\n // Try to acquire cron lock.\n if (!lock_acquire('cron', 240.0)) {\n // Cron is still running normally.\n return watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING);\n }\n\n //Grab the defined cron queues.\n $queues = $this->infoQueues;\n //$queues = module_invoke_all('cron_queue_info');\n drupal_alter('cron_queue_info', $queues);\n\n // Make sure every queue exists. There is no harm in trying to recreate an existing queue.\n foreach ($queues as $queue_name => $info) {\n DrupalQueue::get($queue_name)->createQueue();\n }\n // Iterate through the modules calling their cron handlers (if any):\n foreach (module_implements('cron') as $module) {\n // Do not let an exception thrown by one module disturb another.\n try {\n module_invoke($module, 'cron');\n }\n catch (Exception $e) {\n watchdog_exception('cron', $e);\n }\n }\n\n // Record cron time.\n variable_set('cron_last', REQUEST_TIME);\n watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);\n // Release cron lock.\n lock_release('cron');\n // Return TRUE so other functions can check if it did run successfully\n $return = TRUE;\n\n foreach ($queues as $queue_name => $info) {\n if (!empty($info['skip on cron'])) {\n // Do not run if queue wants to skip.\n continue;\n }\n\n $callback = $info['worker callback'];\n $end = time() + (isset($info['time']) ? $info['time'] : 15);\n $queue = DrupalQueue::get($queue_name);\n\n while (time() < $end && ($item = $queue->claimItem())) {\n try {\n call_user_func($callback, $item->data);\n $queue->deleteItem($item);\n }\n catch (Exception $e) {\n // In case of exception log it and leave the item in the queue to be processed again later.\n watchdog_exception('cron', $e);\n }\n }\n }\n\n // Restore the user.\n $GLOBALS['user'] = $original_user;\n drupal_save_session($original_session_saving);\n\n return $return;\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('make:rss')->hourly();\n\n }", "public function maybe_flush_permalinks()\n {\n }" ]
[ "0.62960064", "0.6002295", "0.59985125", "0.59789884", "0.5807026", "0.57494456", "0.5748267", "0.5744877", "0.5737135", "0.57294106", "0.5722282", "0.5692741", "0.5669009", "0.5638065", "0.559893", "0.5586244", "0.55589575", "0.54940087", "0.54729044", "0.5446612", "0.5439381", "0.54242206", "0.54220766", "0.54214317", "0.54173225", "0.541693", "0.5413149", "0.54058903", "0.54026127", "0.5400979", "0.5375802", "0.5371255", "0.5361735", "0.53505", "0.5340114", "0.53296345", "0.5328164", "0.5326172", "0.5325227", "0.53192955", "0.53131485", "0.531141", "0.530968", "0.52936566", "0.52836484", "0.5278024", "0.5276243", "0.52690786", "0.5265602", "0.52596265", "0.52540153", "0.5244382", "0.5239486", "0.52340406", "0.5231707", "0.52281064", "0.5225626", "0.5220716", "0.5200643", "0.51882577", "0.51872706", "0.5184113", "0.5167245", "0.51502025", "0.51464146", "0.51379716", "0.51312125", "0.512916", "0.5127607", "0.51257867", "0.5123952", "0.5118691", "0.5112246", "0.5111974", "0.5111445", "0.5110291", "0.51094985", "0.5109168", "0.5099809", "0.5098393", "0.508495", "0.5083866", "0.50819325", "0.50803614", "0.5070257", "0.50698435", "0.50693655", "0.5066667", "0.5066274", "0.5066161", "0.50653344", "0.5064774", "0.5046786", "0.50281817", "0.501928", "0.50185466", "0.5009265", "0.5005808", "0.5001756", "0.49936512" ]
0.6509287
0
Finds the Event model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Event::findOne($id)) != null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\r\n {\r\n if (($model = Events::findOne($id)) !== null) {\r\n return $model;\r\n }\r\n\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }", "protected function findModel($id)\n {\n if (($model = EventType::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 = Event::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 = Event::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 = Event::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 = WorkloadEvent2::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);", "public function loadModel($id)\n\t{\n\t\t$model=Events::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 = Patentevents::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\t{\n\t\t$model=Event::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 loadModel($id)\n\t{\n\t\t$model=Event::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 loadModel($id)\n {\n $model=EventMain::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}", "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 }", "public function loadModel($id)\n\t{\n\t\t$model=Events::model()->with('customerid')->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 loadModel($id)\n\t{\n\t\t$model=Evento::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 = 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 }", "protected function findModel($id)\n {\n if (($model = Calendar::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 = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SaleEventHeader::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function findById() {\n // TODO: Implement findById() method.\n }", "protected function findModel($id)\n {\n if (($model = NurseStaffevent::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 = Schedule::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function getOne($id){\n $repo = $this->om->getRepository(Event::class);\n return $repo->find($id);\n }", "public function testFindOneById(): void\n {\n // given\n $event = $this->simpleEvent();\n $expectedId = $event->getId();\n\n // when\n $result = $this->eventService->findOneById($expectedId);\n\n // then\n $this->assertEquals($expectedId, $result->getId());\n }", "public function findModel($id)\n {\n if (($model = Schedule::findOne($id)) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public function find($model, $id);", "public static function getById($eventId) {\n return Event::find()->select(['id', 'name'])->where(['id' => $eventId])->one();\n }", "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}", "protected function findModel($id)\n {\n if (($model = Schedule::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\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 }", "protected function findModel($id) {\n\t\tif(($model = Alert::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\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 findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "public function find($id) {\n $sql = \"select * from eventtype where num_ET=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new \\Exception(\"No type matching id \" . $id);\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "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 = 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 }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Module::t('The requested page does not exist.'));\n }\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 }", "protected function findModel($id)\n {\n if (($model = Agenda::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 = Monitoring::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 = Employee::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($code)\n {\n if (($model = Offer::findOne(['code' => $code])) !== 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 = Appointment::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}", "protected function findModel($id)\n {\n if (($model = Qrxq2017Enroll::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "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) {\n if (($model = RealEstateMaster::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 = Document::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('Страница не существует.');\n }", "protected function findModel($id)\n {\n if (($model = Timetable::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 = Document::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 = Escaparate::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 = Inventorier::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "public function loadModel($id) {\n $model = Workdays::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public static function find($id, $key = 'id');", "public function findById(string $modelId): ?Model;", "public function loadModel($id) {\n $model = Task::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('app', 'Http.404'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Employe::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\r\n {\r\n if (($model = Log::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 = Documento::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "protected function findModel($id) {\n if (($model = TimeBooks::findOne($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;", "protected function findModel($id)\n {\n if (($model = Dict::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function _findModel($id)\n {\n $modelClass = $this->_getModelClass();\n\n if (($model = $modelClass::findOne($id)) === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $model;\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id) {\n if (($model = Energies::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 /** @var \\lispa\\amos\\core\\record\\Record $model */\n $model = null;\n $modelObj = $this->getModelObj();\n\n $modelObj->id = $id;\n $modelObj->trigger(self::BEFORE_FINDMODEL_EVENT);\n if (($model = $modelObj->findOne($id)) === null) {\n throw new NotFoundHttpException(BaseAmosModule::t('amoscore', 'The requested page does not exist.'));\n }\n $this->setModelObj($model);\n $model->trigger(self::AFTER_FINDMODEL_EVENT);\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = Announce::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\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)\n\t{\n\t\tif (($model = Route::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = Usertable::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\t\tif (($model = Notification::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}", "protected function findModel($id)\n {\n if (($model = Tblalarm::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 return StepEvent::find()->where([StepEvent::tableName() . '.id' => $id])->checkAccess(Yii::$app->user->id)->one();\n }", "public function getModelByPrimaryKey($action = null, $keyValue = null)\n {\n $keyName = $this->model->getKeyName();\n\n if ($keyValue == '_') {\n if ($this->request()->has(\"data.primaryKey.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.primaryKey.{$keyName}\");\n } elseif ($this->request()->has(\"data.old.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.old.{$keyName}\");\n } elseif ($this->request()->has('data.items')) {\n $items = $this->request()->input('data.items');\n if (Arr::has($items, $keyName)) {\n $keyValue = Arr::get($items, $keyName);\n } else {\n $first = Arr::first($items);\n if (Arr::has($first, $keyName)) {\n $keyValue = Arr::get($first, $keyName);\n }\n }\n }\n }\n\n $data = [$keyName => $keyValue];\n\n $r = $this->validateData($data, null, 'primaryKey', $action, [$keyName => ['includeUniqueRules' => false]]);\n if ($r !== true) {\n return $r;\n }\n\n $modelClass = get_class($this->model);\n if ($model = $modelClass::find($data[$keyName])) {\n return $model;\n }\n\n return CrudJsonResponse::error(CrudHttpErrors::TARGET_DATA_MODEL_NOT_FOUND, null, [\n 'action' => 'primaryKey',\n 'parent_action' => $action,\n 'target' => $data,\n ]);\n }", "public function returnFindByPK($id);", "protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::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 }", "public function getForEmployerByEvent( int $employerId, string $eventName ) : IEmployerIncentive\n {\n foreach( $this->getForEmployer( $employerId ) as $rec )\n {\n if ( $rec->getIncentive()->getName() == $eventName )\n return $rec;\n }\n \n throw new RecordNotFoundException();\n }", "protected function findModel($id)\n {\n if (($model = Apple::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 = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n {\n if (($model = Reviews::model()->findByPk($id)) === null) {\n throw new CHttpException(\n 404,\n Yii::t($this->aliasModule, 'Requested page was not found!')\n );\n }\n \n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=AppDayPush::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 = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\r\n $model = ProductStockEntries::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }", "public function findById ($id);", "protected function findModel($id)\n {\n if (($model = CatalogDocument::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('catalog', 'The requested page does not exist.'));\n }", "protected function findModel($id)\n {\n if (($model = Email::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 = CallData::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\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}", "protected function findModel($id)\n {\n if (($model = OpeningHours::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.6909712", "0.6859031", "0.6736683", "0.6736683", "0.6736683", "0.67142", "0.6704311", "0.6654512", "0.6620141", "0.6618055", "0.6618055", "0.65298706", "0.65207946", "0.64376724", "0.6415396", "0.6344483", "0.6304588", "0.6302471", "0.6189635", "0.61583847", "0.61404026", "0.6103954", "0.60629904", "0.60289675", "0.6017274", "0.6008375", "0.6005934", "0.59739053", "0.5967217", "0.59481394", "0.5945005", "0.5932808", "0.5914856", "0.59084964", "0.590435", "0.5895915", "0.58950764", "0.5872592", "0.58691376", "0.5857874", "0.5847795", "0.58421624", "0.5837753", "0.58222747", "0.58137435", "0.5813407", "0.5807722", "0.5804914", "0.58043337", "0.57979965", "0.5789456", "0.5787901", "0.5785388", "0.57799846", "0.57796264", "0.5777303", "0.5776721", "0.57736355", "0.5769534", "0.5768349", "0.57679343", "0.57534325", "0.5753398", "0.5749323", "0.5748785", "0.57481354", "0.57468265", "0.5744308", "0.5743987", "0.5743987", "0.5742567", "0.5741879", "0.5740887", "0.5740507", "0.5738819", "0.5738808", "0.5737771", "0.5735112", "0.57346535", "0.57288706", "0.5727644", "0.572082", "0.5720562", "0.57186604", "0.5716691", "0.5714874", "0.5712265", "0.57119524", "0.5710671", "0.570934", "0.5708679", "0.5706063", "0.5703282", "0.5702745", "0.5700594", "0.5698744", "0.56927854", "0.56894916", "0.56880176", "0.568655" ]
0.673747
2
Checks if socialmedia is in the cache, else loads social media content.
public function findSocialMedia($id, $socialMediaModels) { //todo als Cron-Job oder ähnliches //Yii::$app->cache->gc(true); if (!Yii::$app->cache->get('socialmedia' . $id)) { $socialMediaApi = new SocialMediaApi(); foreach ($socialMediaModels as $key => $socialMediaModel) { $socialMediaApi->loadSocialMedia($socialMediaModels[$key]); } Yii::$app->cache->set('socialmedia' . $id, $socialMediaApi->getSocialMedia()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function inCache()\n\t{\n\t\t$content = $this->_cache->retrieve($this->redditid); //faster if we have it in cache already\n\t\treturn $content;\n\t}", "public function isCached() {}", "public function isCached(): bool;", "function have_social_media(){\n\t$social_media = get_social_media();\n\treturn !empty($social_media) && is_array($social_media);\n}", "protected function _loadCache()\n {\n return false;\n }", "private function get_posts_from_cache() : bool {\n\t\tif ($this->use_cache && file_exists($this->cache_path)) {\n\t\t\t$this->posts = json_decode(utf8_encode(file_get_contents($this->cache_path)));\n\n\t\t\tif (!$this->posts) {\n\t\t\t\tthrow new Exception('Error on loading posts from cache (no posts?).');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->posts = (array) $this->posts;\n\t\t\t$this->count_posts = count($this->posts);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function loadFromCache() {}", "public function wasCached();", "private function do_caching() {\n if ($this->is_logged_in) {\n return false;\n }\n //Dont cache the request if it's either POST or PUT\n else if (preg_match(\"/^(?:POST|PUT)$/i\", $_SERVER[\"REQUEST_METHOD\"])) {\n return false;\n }\n if (preg_match(\"#register#\", $_SERVER[\"REQUEST_URI\"])) {\n return false;\n }\n if (preg_match(\"#login#\", $_SERVER[\"REQUEST_URI\"])) {\n return false;\n }\n if (is_array($_COOKIE) && !empty($_COOKIE)) {\n foreach ($_COOKIE as $k => $v) {\n if (preg_match('#session#', $k) && strlen($v))\n return false;\n if (preg_match(\"#fbs_#\", $k) && strlen($v))\n return false;\n }\n }\n return true;\n }", "private function decide(): bool\n {\n if ($this->cloudflare && isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {\n $this->cache = false;\n $this->addMessage('request from cloudflare');\n }\n // don't cache if user is logged in\n if (strpos('test ' . implode(' ', array_keys($_COOKIE)), 'wordpress_logged_in')) {\n $this->cache = false;\n $this->loggedin = true;\n $this->addMessage('Loggedin user');\n }\n // don't cache post requests\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $this->cache = false;\n $this->addMessage('Post request');\n }\n // don't cache requests to wordpress php files\n if (preg_match('%(/wp-admin|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)%',\n $this->path)) {\n $this->cache = false;\n $this->addMessage('This is a WordPress file ');\n }\n\n // don't cache if url has a query string\n // TODO verify that this is reasonable\n if (parse_url($this->url, PHP_URL_QUERY)) {\n $this->cache = false;\n $this->addMessage('Not caching query strings');\n }\n\n return $this->cache;\n }", "public function is_already_cached( string $url, bool $is_mobile = false ) {\n\t\tstatic $https;\n\n\t\tif ( ! isset( $https ) ) {\n\t\t\t$https = is_ssl() && $this->options->get( 'cache_ssl' ) ? '-https' : '';\n\t\t}\n\n\t\t$url = get_rocket_parse_url( $url );\n\n\t\t/** This filter is documented in inc/functions/htaccess.php */\n\t\tif ( apply_filters( 'rocket_url_no_dots', false ) ) {\n\t\t\t$url['host'] = str_replace( '.', '_', $url['host'] );\n\t\t}\n\n\t\t$url['path'] = trailingslashit( $url['path'] );\n\n\t\tif ( '' !== $url['query'] ) {\n\t\t\t$url['query'] = '#' . $url['query'] . '/';\n\t\t}\n\n\t\t$mobile = $is_mobile ? '-mobile' : '';\n\n\t\t$file_cache_path = rocket_get_constant( 'WP_ROCKET_CACHE_PATH' ) . $url['host'] . strtolower( $url['path'] . $url['query'] ) . 'index' . $mobile . $https . '.html';\n\n\t\tif ( ! $this->options->get( 'cache_webp', false ) ) {\n\t\t\treturn $this->filesystem->exists( $file_cache_path );\n\t\t}\n\n\t\t$webp_path = rocket_get_constant( 'WP_ROCKET_CACHE_PATH' ) . $url['host'] . strtolower( $url['path'] . $url['query'] ) . 'index' . $mobile . $https . '-webp.html';\n\t\t$no_webp_path = rocket_get_constant( 'WP_ROCKET_CACHE_PATH' ) . $url['host'] . strtolower( $url['path'] . $url['query'] ) . '.no-webp';\n\n\t\treturn $this->filesystem->exists( $webp_path ) || ( $this->filesystem->exists( $no_webp_path ) && $this->filesystem->exists( $file_cache_path ) );\n\t}", "public static function hasDefaultCache();", "private static function getCache()\n\t{\n\t\t// Initialiase variables.\n\t\t$file = JPATH_CACHE . '/twitter';\n\n\t\tif (JFile::exists($file))\n\t\t{\n\t\t\treturn unserialize(JFile::read($file));\n\t\t}\n\n\t\treturn false;\n\t}", "protected function load_cache(){\r\n\t\tstatic $cached = null;\r\n\t\t\r\n\t\tif(!$cached){\r\n\t\t\t\r\n\t\t\tif($this->_cfg->get('sfversion') == 'auto'){\r\n\t\t\t\t// get version from sourceforge/cache\r\n\t\t\t\tif (!$this->is_cached()) $this->update_cache();\r\n\t\t\t\t$cached = (object)include($this->get_cache());\r\n\t\t\t}else{\r\n\t\t\t\t// use predefined version from config\r\n\t\t\t\t$cached = (object)$this->_cfg->get('sfversion');\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $cached;\r\n\t}", "private function loadCache()\r\n {\r\n if (file_exists(WEMO_CACHE)) {\r\n $fp = fopen(WEMO_CACHE, 'r');\r\n $json = fread($fp, filesize(WEMO_CACHE));\r\n fclose($fp);\r\n return json_decode($json);\r\n } else {\r\n return false;\r\n }\r\n }", "protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function clearFacebookCache()\n {\n $owner = $this->owner;\n if (!$owner->hasMethod('AbsoluteLink')) {\n return false;\n }\n $anonymousUser = Member::create();\n if ($owner->can('View', $anonymousUser)) {\n $curlRequest = curl_init();\n curl_setopt_array(\n $curlRequest,\n array(\n CURLOPT_URL => 'https://graph.facebook.com/v1.0/?id='. urlencode($owner->AbsoluteLink()). '&scrape=1',\n CURLOPT_POST => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_SSL_VERIFYPEER => false,\n )\n );\n $response = curl_exec($curlRequest);\n $headers = curl_getinfo($curlRequest);\n if(!$response || $headers['http_code'] !== 200) {\n return false;\n }\n return $response;\n }\n }", "private function _check_socials_access() {\n\n return Access_token::inst()->check_socials_access($this->c_user->id);\n\n }", "public function isCachable() {\n\n // The error page should not be cached\n if($this->isErrorPage()) {\n return false;\n }\n\n $lang = ($this->site->defaultLanguage())? $this->site->defaultLanguage()->code : null;\n foreach($this->kirby->option('cache.ignore') as $pattern) {\n if(fnmatch($pattern, $this->uri($lang)) === true) {\n return false;\n }\n }\n\n return true;\n\n }", "public function realPageCacheContent() {}", "function wprss_do_not_cache_feeds( &$feed ) {\n $feed->enable_cache( false );\n }", "public function isStaticCacheble() {}", "public function maybe_run_ajax_cache() {\n\t\t$post = get_post();\n\n\t\tif ( ! $post || empty( $_GET['message'] ) )\n\t\t\treturn;\n\n?>\n<script type=\"text/javascript\">\n\tjQuery(document).ready(function($){\n\t\t$.get(\"<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>\");\n\t});\n</script>\n<?php\n\t}", "function mpcth_social_cache_callback() {\r\n\tglobal $post;\r\n\r\n\t$share_counts = get_transient('mpcth_scc_' . $post->ID);\r\n\t\r\n\tif($share_counts === false) {\r\n\t\tif(!empty($_POST['data']) && !empty($_POST['id'])) {\r\n\t\t\t$share_counts = $_POST['data'];\r\n\t\t\t\r\n\t\t\tset_transient('mpcth_scc_' . $_POST['id'], $share_counts, 300);\r\n\t\t} else {\r\n\t\t\t$share_counts = array('errors' => 'error');\r\n\t\t}\r\n\t}\r\n\t\r\n\tdie();\r\n}", "private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }", "protected function useCache() {\n\t\tif (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (isset($_GET['nc']) && $_GET['nc'] == 1) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function hasCache(): bool\n {\n return isset($this->contents);\n }", "function oceanwp_cached_rss_widget( $widget_id, $callback ) {\n\t\t\t$loading = '<p class=\"widget-loading hide-if-no-js\">' . __( 'Loading&#8230;' ) . '</p><div class=\"hide-if-js notice notice-error inline\"><p>' . __( 'This widget requires JavaScript.', 'ocean-extra' ) . '</p></div>';\n\t\t\t$check_urls = self::$feed;\n\n\t\t\t$locale = get_user_locale();\n\t\t\t$cache_key = 'owp_feed_data_' . md5( $widget_id . '_' . $locale );\n\t\t\tif ( false !== ( $output = get_transient( $cache_key ) ) ) {\n\t\t\t\techo $output;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ( empty( $check_urls ) ) {\n\t\t\t\techo $loading;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( $callback && is_callable( $callback ) ) {\n\t\t\t\t$args = array_slice( func_get_args(), 3 );\n\t\t\t\tarray_unshift( $args, $widget_id, $check_urls );\n\t\t\t\tob_start();\n\t\t\t\tcall_user_func_array( $callback, $args );\n\t\t\t\tset_transient( $cache_key, ob_get_flush(), 12 * HOUR_IN_SECONDS ); // Default lifetime in cache of 12 hours (same as the feeds)\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function safe_scrape_cached($url){\n\n\t\t$cache = cache::factory();\n\n\t\t$cached = $cache->get($url);\n\t\tif (isset($cached) && $cached !== false) {\n\t\t\treturn $cached;\n\t\t}else{\n\t\t\t$page = safe_scrape($url);\n\t\t $cache->set($url, $page, \"safe_scrape\");\t\n\t\t\treturn $page;\n\t\t}\n\t\t\n\t}", "function social_total_count( $url, $option_cachetimer, $facebook_enabled, $twitter_enabled, $googleplus_enabled, $linkedin_enabled, $pinterest_enabled ) {\n\t$key = 'social_total_count_' . $option_cachetimer . '_' . md5( $url );\n\t$keyindividual = 'social_individual_count_' . $option_cachetimer . '_' . md5( $url );\n\t$counted_date_key = 'counted_date_' . $option_cachetimer . '_' . md5( $url );\n\t$total_shares = wp_cache_get( $key,'social_total_count' );\n\t$individual_shares = wp_cache_get( $keyindividual, 'social_individual_count' );\n\t$counted_date = wp_cache_get( $counted_date_key, 'counted_date' );\n\n\tif ( false === $total_shares ) {\n\t//if no cache, run the other functions, which also are cached if hosts supports Wordpress Object Cache\n\t\t//http://codex.wordpress.org/Class_Reference/WP_Object_Cache\n\t\tif ( $facebook_enabled ) {\n\t\t\t$fbshares = get_facebook_count( $url );\n\t\t\t$fbshares = '-Facebook-' . $fbshares . '-';\n\t\t}\n\t\tif ( $twitter_enabled ) {\n\t\t\t$tweets = get_tweet_count( $url );\n\t\t\t$tweets = 'Twitter-' . $tweets;\n\t\t}\n\t\tif ( $googleplus_enabled ) {\n\t\t\t$gshares = get_googleplus_count( $url, $option_cachetimer );\n\t\t\t$gshares = 'GooglePlus-' . $gshares . '-';\n\t\t}\n\t\tif ( $linkedin_enabled ) {\n\t\t\t$lnshares = get_linkedin_count( $url );\n\t\t\t$lnshares = 'LinkedIn-' . $lnshares . '-';\n\t\t}\n\t\tif ( $pinterest_enabled ) {\n\t\t\t$pins = get_pinterest_count( $url );\n\t\t\t$pins = 'Pinterest-' . $pins;\n\t\t}\n\t\t//See individual count in source (data-tag/comment)\n\t\t$individual_shares = $tweets . $fbshares . $gshares . $lnshares . $pins;\n\t\t//Format total for balloon\n\t\t$total_shares = $tweets + $fbshares + $gshares + $lnshares + $pins;\n\t\t$total_shares = nice_number( $total_shares );\n\t\t//information about when it was cached last\n\t\t$thismoment = current_time( 'Y-m-d H:i:s' );\n\t\twp_cache_set( $key, $total_shares, 'social_total_count', $option_cachetimer );\n\t\twp_cache_set( $keyindividual, $individual_shares, 'social_individual_count', $option_cachetimer );\n\t\twp_cache_set( $counted_date_key, $thismoment, 'counted_date', $option_cachetimer );\n\n\t\t$latest_share_count = '<!-- ' . __( 'Last share count by Fast Social Count just this minute. Result not cached.', 'fast-social-count' ) . ' -->';\n\t} else {\n\t\t$formatcachetime = sprintf( '%02d hours and %02d minutes', ($option_cachetimer / 3600), ($option_cachetimer / 60 % 60) );\n\t\t$latest_share_count = '<!-- ' . __( 'Last share count by Fast Social Count on', 'fast-social-count' ) . ' ' . $counted_date . __( 'Cache set to', 'fast-social-count' ) . ' ' . $formatcachetime . ' -->';\n\t}\n\treturn array( $total_shares, $individual_shares, $latest_share_count );\n}", "public function isLoadedFromCache()\n {\n return $this->loadedFromCache;\n }", "private function isCached()\n {\n return Cache::has($this->cacheKey());\n }", "protected function _cached_exists()\n {\n return file_exists($this->cached_file);\n }", "public static function hasCache() {\n\t\treturn false;\n\t}", "function _can_cache() {\n\t\treturn true;\n\t}", "public function isCached()\n\t{\n\t\treturn is_file($this->getCacheFile());\n\t}", "public function refreshCommentCache(modxTalksPost & $comment, modxTalksConversation & $conversation) {\n if ($this->mtCache === true) {\n if (!$this->cacheComment($comment)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks::refreshCommentCache] Error cache the comment with ID ' . $comment->id);\n }\n\n if (!$this->cacheConversation($conversation)) {\n $this->modx->log(xPDO::LOG_LEVEL_ERROR, '[modxTalks::refreshCommentCache] Error cache the conversation with ID ' . $conversation->id);\n }\n }\n\n return true;\n }", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "public function getBbCodeMediaSitesForCache()\n\t{\n\t\t$sites = $this->getAllBbCodeMediaSites();\n\t\t$cache = array();\n\t\tforeach ($sites AS &$site)\n\t\t{\n\t\t\t$cache[$site['media_site_id']] = array(\n\t\t\t\t'embed_html' => $site['embed_html']\n\t\t\t);\n\t\t}\n\n\t\treturn $cache;\n\t}", "public function _check_if_need_to_cache()\n {\n // Fast implementation of disabling output caching for the current page\n if (conf('no_output_cache')) {\n $this->NO_NEED_TO_CACHE = true;\n return false;\n }\n if (main()->NO_GRAPHICS && ! conf('output_cache_force')) {\n $this->NO_NEED_TO_CACHE = true;\n return false;\n }\n if ($_SESSION['user_group'] > 1 || $_COOKIE['member_id']) {\n $this->NO_NEED_TO_CACHE = true;\n return false;\n }\n // Special for the 'share on facebook' feature\n if (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit')) {\n $this->NO_NEED_TO_CACHE = true;\n return false;\n }\n // Check 'white' list first\n $w = $this->WHITE_LIST_PATTERN;\n if ( ! empty($w)) {\n // Array like: 'search' => array(), 'static_pages' => array('show')\n if (is_array($w)) {\n if ( ! isset($w[$_GET['object']])) {\n $this->NO_NEED_TO_CACHE = true;\n return $this->NO_NEED_TO_CACHE;\n } elseif ( ! empty($w[$_GET['object']]) && ! in_array($_GET['action'], (array) $w[$_GET['object']])) {\n $this->NO_NEED_TO_CACHE = true;\n return $this->NO_NEED_TO_CACHE;\n }\n } else {\n if ( ! preg_match('/' . $w . '/i', $_SERVER['QUERY_STRING'])) {\n $this->NO_NEED_TO_CACHE = true;\n return $this->NO_NEED_TO_CACHE;\n }\n }\n return false;\n }\n // Try to search current query string in the stop list\n foreach ((array) $this->_OC_STOP_LIST as $pattern) {\n if (preg_match('/' . $pattern . '/i', $_SERVER['QUERY_STRING'])) {\n $this->NO_NEED_TO_CACHE = true;\n return $this->NO_NEED_TO_CACHE;\n }\n }\n return false; // Default return value\n }", "public function load($entity) \n {\n if ($this->cacheKnow($entity)) {\n $where = $this->cacheWhereIs($entity);\n return (bool) @include_once $where;\n }\n return false;\n }", "public function isCacheEnabled(){\n return(true);\n }", "public function isCacheEnabled(){\n return(true);\n }", "private function initializeSocialMedia()\n {\n $this->ch->addSection($this->slug . '_social_media', 'Social Media', 130);\n foreach ($this->social as $media => $label) {\n $this->ch->addControl(\"social_{$media}\", $this->slug . '_social_media', $label);\n }\n }", "public function set_do_not_cache_flag_for_gated_content() {\r\n\t\t\r\n\t\t// Check if we are to try preventing caching of gated content\r\n\t\t\r\n\t\tif ( get_option( 'patreon-prevent-caching-gated-content', 'yes' ) != 'yes' ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tglobal $post;\r\n\r\n\t\t// Bail out if no post object present\r\n\t\tif ( !$post ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t// Bail out if not a singular page/post\r\n\t\tif ( !is_singular() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// We are here, it means that this is singular content. Check if it is meant to be gated\r\n\t\t\r\n\t\t$gate_content = false;\r\n\t\t\r\n\t\t$lock_or_not = Patreon_Wordpress::lock_or_not( $post->ID );\r\n\t\t\t\r\n\t\tif ( isset( $lock_or_not['lock'] ) ) {\r\n\t\t\t$gate_content = $lock_or_not['lock'];\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif ( $gate_content ) {\r\n\t\t\t\r\n\t\t\t// General caching plugin define - Prevents caching of non cached pages\r\n\t\t\tdefine( 'DONOTCACHEPAGE', true );\r\n\t\t\t\r\n\t\t\t// WP Super Cache - disables cache for already cached pages\r\n\t\t\tdefine( 'WPSC_SERVE_DISABLED', true );\r\n\t\t\t\r\n\t\t\t// W3 Total Cache - do not minify JS in gated page\r\n\t\t\tdefine( 'DONOTMINIFY', true );\r\n\t\t\t\r\n\t\t\t// W3 Total Caache - Do not serve gated page from CDN\r\n\t\t\tdefine( 'DONOTCDN', true );\r\n\t\t\t\r\n\t\t\t// W3 Total Cache - Do not use object cache for gated page\r\n\t\t\tdefine( 'DONOTCACHCEOBJECT', true );\r\n\t\t\t\r\n\t\t\t// Litespeed Cache - Equal to DONOTCACHEPAGE flag\r\n\t\t\tdefine('LSCACHE_NO_CACHE', true);\r\n\t\t\t\r\n\t\t\t// WP Fastest Cache compatibility - prevents page from being served from cache.\r\n\t\t\t\r\n\t\t\tif ( $this->check_if_plugin_active( 'wp-fastest-cache/wpFastestCache.php' ) AND function_exists( 'wpfc_exclude_current_page' ) ) {\r\n\t\t\t\twpfc_exclude_current_page();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function wp_ajax_oembed_cache()\n {\n }", "public function isCacheEnabled() {\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n // If cache disabled by SocialEngine\n if (APPLICATION_ENV != 'production')\n return;\n\n // In case, if don't want cache\n if (isset($_REQUEST['disableCache']) && !empty($_REQUEST['disableCache']))\n return;\n\n // In case of pagination, cache will not work\n if (isset($_REQUEST['page']) && !empty($_REQUEST['page']) && ($_REQUEST['page'] > 1))\n return;\n\n // In case of advanced activity feed pagination, cache will not work\n if (isset($_REQUEST['maxid']) && !empty($_REQUEST['maxid']))\n return;\n\n if (isset($_REQUEST['action_id']))\n return;\n //request method is put or post\n if ($request->isPost() || $request->isPut()) {\n return;\n }\n\n // Only file based caching allowed.\n $getDefaultCache = $this->_readDefaultCache();\n if (!isset($getDefaultCache['backend']['File']))\n return;\n \n $backendOptions = $getDefaultCache['backend']['File']['cache_dir'];\n if (!is_dir($backendOptions)) {\n return;\n }\n\n// $Data = $_REQUEST;\n// $keys = array_keys($Data);\n//\n// $matched = preg_grep('/_id$/', $keys);\n// if ($matched) {\n// return;\n// }\n\n return true;\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "function isCached() {\r\n if ($this->_cachingEnabled) {\r\n $isCached = $this->_templateObject->isCached($this->_viewId);\r\n }\r\n else $isCached = false;\r\n return $isCached;\r\n }", "public function getFromCache() {}", "private function cacheEnabled()\n {\n foreach ($this->cacheManager->getStatus() as $cache => $status) {\n if ($cache == 'full_page') {\n return $status;\n }\n }\n return false;\n }", "private function _loadCacheObj()\n {\n $cache = new mime_type_cache();\n self::$_mime_type_obj = $cache->getCache();\n\t\treturn;\n }", "public function isProvidersCached(): bool;", "protected function _cached_required()\n {\n $image_info = getimagesize($this->source_file);\n\n if (($this->url_params['w'] == $image_info[0]) AND ($this->url_params['h'] == $image_info[1]))\n {\n $this->serve_default = TRUE;\n return FALSE;\n }\n\n return TRUE;\n }", "public function is_cached()\n\t\t{\n\t\t\treturn $this->cached;\n\t\t}", "function markup_from_cache();", "private function setCacheHeadersForRssFeed() : void {\n $feedSlugRegex = '#^/feed/?$#';\n if (preg_match($feedSlugRegex, $_SERVER['REQUEST_URI']) === 1) {\n $this->disableCache();\n }\n }", "function getCache() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT cached_result FROM $this->cacheTable WHERE post_id = '\" . $this->db->escape( $this->postID ) . \"'\";\n\t\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( !$results[0] )\n\t\t\treturn false;\n\t\t\t\n\t\treturn $results[0]->cached_result;\n\t}", "private function isCached()\n\t{\n\t\t$q = 'SELECT UNIX_TIMESTAMP(lastResult) as lastUpdated FROM twitterSearch WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\t$r = mysql_query($q, CONN) or die('could not query the database for caching check');\n\t\t$arr = mysql_fetch_array($r);\n\t\t\n\t\t$now \t= time();\n\t\t$diff \t= $now - $arr[0];\n\t\t\n\t\tif ($this->_testMode) {\n\t\t\t\n\t\t\tprint \"is cached? results --------------------\";\n\t\t\tprint \"<pre>\";\n\t\t\t\tprint_r($arr);\n\t\t\tprint \"</pre><br />\";\n\t\t\t\n\t\t\tprint \"array count = \" .count($arr) .'<br />';\n\n\t\t\tprint \"is cached? q = \" .$q .\"<br>\";\n\t\t\tprint \"is cached? last modified = \" .$arr[0] .\"<br>\";\n\t\t\tprint \"is cached? now = \" .$now .\"<br>\";\n\t\t\tprint \"is cached? diff = \" .$diff .\"<br>\";\n\t\t}\n\t\t\n\t\tif (!isset($arr['lastUpdated'])) {\n\t\t\tdie('the search term has not been setup properly');\n\t\t}\n\t\t\n\t\tif($diff > $this->_cacheFileTime){\n\t\t\tif ($this->_testMode) {print \"is cached? returning false<br>\";}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif ($this->_testMode) {print \"is cached? returning true<br>\";}\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t\n\t\tif ($this->_testMode) {print \"is cached? returning true<br>\";}\n\t\treturn true;\n\t}", "function fetch_rss ($url, $cache_age) {\n \t// initialize constants\n \tinit();\n \n \tif ( !isset($url) ) {\n \t\t// error(\"fetch_rss called without a url\");\n \t\treturn false;\n \t}\n \n \t// if cache is disabled\n \tif ( !MAGPIE_CACHE_ON ) {\n \t\t// fetch file, and parse it\n \t\t$resp = _fetch_remote_file( $url );\n \t\tif ( is_success( $resp->status ) ) {\n \t\t\treturn _response_to_rss( $resp );\n \t\t}\n \t\telse {\n \t\t\t// error(\"Failed to fetch $url and cache is off\");\n \t\t\treturn false;\n \t\t}\n \t}\n \t// else cache is ON\n \telse {\n \t\t// Flow\n \t\t// 1. check cache\n \t\t// 2. if there is a hit, make sure its fresh\n \t\t// 3. if cached obj fails freshness check, fetch remote\n \t\t// 4. if remote fails, return stale object, or error\n \n $cache_age = isset($cache_age) ? $cache_age : MAGPIE_CACHE_AGE;\n \n \t\t$cache = new RSSCache( MAGPIE_CACHE_DIR, $cache_age);\n \n \t\tif (MAGPIE_DEBUG and $cache->ERROR) {\n \t\t\tdebug($cache->ERROR, E_USER_WARNING);\n \t\t}\n \n \t\t$cache_status \t = 0;\t\t// response of check_cache\n \t\t$request_headers = array(); // HTTP headers to send with fetch\n \t\t$rss \t\t\t = 0;\t\t// parsed RSS object\n \t\t$errormsg\t\t = 0;\t\t// errors, if any\n \n \t\tif (!$cache->ERROR) {\n \t\t\t// return cache HIT, MISS, or STALE\n \t\t\t$cache_status = $cache->check_cache( $url );\n \t\t}\n \n \t\t// if object cached, and cache is fresh, return cached obj\n \t\tif ( $cache_status == 'HIT' ) {\n \t\t\t$rss = $cache->get( $url );\n \t\t\t\n \t\t\tif ( isset($rss) and $rss ) {\n \t\t\t\n $rss->from_cache = 1;\n \t\t\t\tif ( MAGPIE_DEBUG > 1) {\n \t\t\t\t debug(\"MagpieRSS: Cache HIT\", E_USER_NOTICE);\n }\n \n \t\t\t\treturn $rss;\n \t\t\t}\n \t\t}\n\n \t\t// else attempt a conditional get\n \n \t\t// setup headers\n \t\tif ( $cache_status == 'STALE' ) {\n \t\t\t$rss = $cache->get( $url );\n \t\t\tif ( $rss->etag and $rss->last_modified ) {\n \t\t\t\t$request_headers['If-None-Match'] = $rss->etag;\n \t\t\t\t$request_headers['If-Last-Modified'] = $rss->last_modified;\n \t\t\t}\n \t\t}\n \t\t\n\n \n \t\t$resp = _fetch_remote_file( $url, $request_headers );\n \n \t\tif (isset($resp) and $resp) {\n \t\t\tif ($resp->status == '304' ) {\n \t\t\t\t// we have the most current copy\n \t\t\t\tif ( MAGPIE_DEBUG > 1) {\n \t\t\t\t\tdebug(\"Got 304 for $url\");\n \t\t\t\t}\n \t\t\t\t// reset cache on 304 (at minutillo insistent prodding)\n \t\t\t\t$cache->set($url, $rss);\n \t\t\t\treturn $rss;\n \t\t\t}\n \t\t\telseif ( is_success( $resp->status ) ) {\n \t\t\t\t$rss = _response_to_rss( $resp );\n \t\t\t\tif ( $rss ) {\n \t\t\t\t\tif (MAGPIE_DEBUG > 1) {\n \t\t\t\t\t\tdebug(\"Fetch successful\");\n \t\t\t\t\t}\n \t\t\t\t\t// add object to cache\n \t\t\t\t\t$cache->set( $url, $rss );\n \t\t\t\t\treturn $rss;\n \t\t\t\t}\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$errormsg = \"Failed to fetch $url. \";\n \t\t\t\tif ( $resp->error ) {\n \t\t\t\t\t# compensate for Snoopy's annoying habbit to tacking\n \t\t\t\t\t# on '\\n'\n \t\t\t\t\t$http_error = substr($resp->error, 0, -2);\n \t\t\t\t\t$errormsg .= \"(HTTP Error: $http_error)\";\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\t$errormsg .= \"(HTTP Response: \" . $resp->response_code .')';\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\telse {\n \t\t\t$errormsg = \"Unable to retrieve RSS file for unknown reasons.\";\n \t\t}\n \n \t\t// else fetch failed\n \n \t\t// attempt to return cached object\n \t\tif ($rss) {\n \t\t\tif ( MAGPIE_DEBUG ) {\n \t\t\t\tdebug(\"Returning STALE object for $url\");\n \t\t\t}\n \t\t\treturn $rss;\n \t\t}\n \n \t\t// else we totally failed\n \t\t// error( $errormsg );\n \n \t\treturn false;\n \n \t} // end if ( !MAGPIE_CACHE_ON ) {\n }", "private function _cache_get_content_encoded($cache_id, $cache_group = 'global', $time = false)\n {\n $use_apc = false;\n if ($cache_group === null) {\n\n $cache_group = 'global';\n }\n\n if ($cache_id === null) {\n\n return false;\n }\n\n $cache_id = trim($cache_id);\n\n $cache_group = $cache_group . DS;\n\n $cache_group = reduce_double_slashes($cache_group);\n if ($use_apc == false) {\n $mem = $this->_cache_get_content_from_memory($cache_id, $cache_group);\n //d($mem);\n if ($mem != false) {\n //d($cache_id);\n // exit();\n return $mem;\n }\n }\n\n $cache_file = $this->_cache_get_file_path($cache_id, $cache_group);\n $cache_file = normalize_path($cache_file, false);\n $get_file = $cache_file;\n\n\n $cache = false;\n try {\n if ($get_file != false) {\n if (isset($get_file) == true and is_file($get_file)) {\n $t = intval($time);\n if ($time != false and $t > 0) {\n if (time() - $t > filemtime($get_file)) {\n /// cache is expired\n return false;\n }\n }\n $cache = @file_get_contents($cache_file);\n } else {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, false);\n return false;\n }\n }\n } catch (Exception $e) {\n $cache = false;\n }\n\n if (isset($cache) and strval($cache) != '') {\n $search = MW_CACHE_CONTENT_PREPEND;\n $replace = '';\n $count = 1;\n $cache = str_replace($search, $replace, $cache, $count);\n }\n\n if (isset($cache) and $cache != false and ($cache) != '') {\n $this->_cache_get_content_from_memory($cache_id, $cache_group, $cache);\n return $cache;\n }\n return false;\n }", "private function cached()\n {\n if (isset(self::$_cached)) {\n $this->_config = self::$_cached;\n return true;\n } else {\n return false;\n }\n }", "protected function extractDataFromCache()\n\t{\n\t\treturn false;\n\t}", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "private function _cache_get_content($cache_id, $cache_group = 'global', $time = false)\n {\n\n $mem_var = $this->mw_cache_mem;\n if (isset($mem_var[$cache_group])) {\n if (isset($mem_var[$cache_group][$cache_id]) and $mem_var[$cache_group][$cache_id] != false) {\n //\t\t print $mem_var[$cache_group][$cache_id];\n return $mem_var[$cache_group][$cache_id];\n }\n\n }\n\n $mode = 2;\n\n if (!strstr($cache_group, 'global')) {\n $mode = 1;\n }\n\n $cache = $this->_cache_get_content_encoded($cache_id, $cache_group, $time);\n\n if ($cache == false or $cache == '' or $cache == '---empty---' or $cache == '---false---' or (is_array($cache) and empty($cache))) {\n $this->mw_cache_mem[$cache_group][$cache_id] = false;\n return false;\n } else {\n // $cache = base64_decode($cache);\n $cache = @unserialize($cache);\n $this->mw_cache_mem[$cache_group][$cache_id] = $cache;\n return $cache;\n }\n }", "public function isCacheUsed()\n\t{\n\t\treturn $this->__isMainTree() and $this->use_cache;\n\t}", "function get_the_content_cached( $more_link_text = null, $strip_teaser = false ) {\n\n $post_id = get_the_ID();\n if ( false === $post_id /* Not possible to tie content to post ID. */\n || ! ( null === $more_link_text && false === $strip_teaser ) /* TODO Pull requests are welcome! */\n || tiny_cache_skip_cache()\n ) {\n return get_the_content( $more_link_text, $strip_teaser );\n }\n\n $found = false;\n $cached = wp_cache_get( $post_id, 'get_the_content', false, $found );\n\n // Cache hit.\n if ( $found ) {\n /** @var string $cached */\n return $cached;\n }\n\n // Cache miss.\n $save_to_cache = false;\n $post = get_post( $post_id );\n if ( is_object( $post ) ) {\n // Cache only public posts.\n if ( 'publish' === $post->post_status && empty( $post->post_password ) ) {\n $save_to_cache = true;\n }\n }\n\n $content = get_the_content( $more_link_text, $strip_teaser );\n if ( $save_to_cache ) {\n $message_tpl = '<!-- Cached content generated by Tiny cache on %s -->';\n $timestamp = gmdate( 'c' );\n $message = sprintf( $message_tpl, esc_html( $timestamp ) );\n wp_cache_add( $post_id, $content . $message, 'get_the_content', DAY_IN_SECONDS );\n }\n\n return $content;\n}", "public function maybe_run_ajax_cache()\n {\n }", "public function loadFromCache() {\n parent::loadFromCache();\n $this->historyLinks = $this->data;\n }", "public function hasACacheableContentType()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n foreach ($this->headersList() as $_key => $_header) {\n if (mb_stripos($_header, 'content-type:') === 0) {\n $content_type = $_header;\n } // Use last content-type header.\n } // unset($_key, $_header); // Housekeeping.\n\n if (isset($content_type[0]) && mb_stripos($content_type, 'html') === false\n && mb_stripos($content_type, 'xml') === false && mb_stripos($content_type, GLOBAL_NS) === false) {\n return $is = false; // Do NOT cache data sent by scripts serving other MIME types.\n }\n return $is = true;\n }", "function rbge_repo_embed_get_data($uri, &$data){\n $data = get_post_meta(get_the_ID(), $uri, true);\n \n // fixme - remove for live;\n $data = false;\n \n if($data){\n \n // we stamp it with when we got it out the cache\n $data['wordpress_cached_retrieved_time'] = time();\n \n // if the data is older than a day set up a task to refresh it.\n if ($data['wordpress_cached_time'] + (24 * 60 * 60) < time()){\n $data['wordpress_cache_update_request_time'] = time();\n wp_schedule_single_event(time(), 'exec_rbge_repo_embed_cache_data', array($uri, get_the_ID()));\n }\n \n // we have data - even though it is old so return it\n // they can get new next time\n return true;\n \n }else{\n // no choice but to wait for data this time\n // will cause it to be cached\n $response = rbge_repo_embed_cache_data($uri, get_the_ID());\n if($response){\n $data = $response;\n return true;\n }else{\n $data = \"We had trouble retrieving the data for $uri\";\n return false;\n }\n \n }\n \n}", "public function hasCacheStore(): bool;", "public function _AllowCache()\n {\n // caching not possible because we randomize the images\n $bCachingAllowed = true;\n if ($this->bPickRandomImage) {\n $bCachingAllowed = false;\n }\n\n return $bCachingAllowed;\n }", "function medigroup_mikado_load_blog_assets() {\n return medigroup_mikado_is_ajax_enabled() || medigroup_mikado_is_blog_template() || is_home() || is_single() || medigroup_mikado_has_blog_shortcode() || is_archive() || is_search() || medigroup_mikado_has_blog_widget();\n }", "function clearCacheIfSet()\t{\n\t\tif ($this->conf['clearCacheOfPages'])\t{\n\t\t\t$cc_pidList = $GLOBALS['TYPO3_DB']->cleanIntList($this->conf['clearCacheOfPages']);\n\t\t\t$GLOBALS['TSFE']->clearPageCacheContent_pidList($cc_pidList);\n\t\t}\n\t}", "protected function initializeCache() {}", "function storefront_footer_social_media()\n {\n include('footer_social_media.php');\n }", "public function cache_oembed($post_id)\n {\n }", "protected function initializeCache() {}", "public function isCacheEnabled(){\n return(false);\n }", "public function clearPageCacheContent() {}", "public function isCacheClearEnabled(): bool;", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$steamIds)) {\n self::$steamIds[$this->steamId64] = $this;\n if(!empty($this->customUrl) &&\n !array_key_exists($this->customUrl, self::$steamIds)) {\n self::$steamIds[$this->customUrl] = $this;\n }\n }\n }", "function wpcom_vip_wp_oembed_get( $url, $args = array() ) {\n\t$cache_key = md5( $url . '|' . serialize( $args ) );\n\n\tif ( false === $html = wp_cache_get( $cache_key, 'wpcom_vip_wp_oembed_get' ) ) {\n\t\t$html = wp_oembed_get( $url, $args );\n\n\t\twp_cache_set( $cache_key, $html, 'wpcom_vip_wp_oembed_get' );\n\t}\n\n\treturn $html;\n}", "public function configurationIsCached();", "function exists() {\n \n return !empty($this->cache);\n \n }", "public function getSocialRecordFromCache($gid);", "protected function productListsHTMLCanBeCached(): bool\n {\n //todo: FIX!\n return ! (bool) EcommerceConfig::inst()->OnlyShowProductsThatCanBePurchased;\n }", "public function hasCachedData(): bool\n {\n return !empty(static::$cachedData);\n }", "function jptweak_remove_share() {\n remove_filter( 'the_content', 'sharing_display',19 );\n remove_filter( 'the_excerpt', 'sharing_display',19 );\n if ( class_exists( 'Jetpack_Likes' ) ) {\n remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );\n }\n}", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "function _loadData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$query='SELECT * FROM #__joomleague_playground WHERE id='.(int) $this->_id;\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_data=$this->_db->loadObject();\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}", "public function loadHeaders()\n\t{\t\t\n\t\tif ($this->_isPageCacheable())\n\t\t{\n\t\t\t$ttl = is_numeric($this->settings['standardTtl']) ? $this->settings['standardTtl'] : 86400;\n\t\t\t$expiry = time() + $ttl;\n\n\t\t\theader('Cache-Control: max-age=' . $ttl);\n\t\t\theader('Pragma: cache');\n\t\t\theader('Expires: ' . date('D, d M Y H:i:s', $expiry) . ' GMT');\n\t\t}\n\t}", "public function isUseCache()\n {\n return $this->use_cache;\n }", "public function _AllowCache()\n {\n return true;\n }", "function voyage_mikado_load_blog_assets() {\n return voyage_mikado_is_ajax_enabled() || voyage_mikado_is_blog_template() || is_home() || is_single() || voyage_mikado_has_blog_shortcode() || is_archive() || is_search() || voyage_mikado_has_blog_widget();\n }", "function load_theme_image_cache($db, $site, $true_theme, $true_lang)\n{\n global $THEME_IMAGES_CACHE, $THEME_IMAGES_SMART_CACHE_LOAD, $SMART_CACHE;\n\n if ($THEME_IMAGES_SMART_CACHE_LOAD == 0) {\n $THEME_IMAGES_CACHE[$site] = $SMART_CACHE->get('theme_images_' . $true_theme . '_' . $true_lang);\n if (is_null($THEME_IMAGES_CACHE[$site])) {\n $THEME_IMAGES_CACHE[$site] = array();\n }\n } elseif ($THEME_IMAGES_SMART_CACHE_LOAD == 1) {\n $test = $db->query_select('theme_images', array('id', 'path'), array('theme' => $true_theme, 'lang' => $true_lang));\n $THEME_IMAGES_CACHE[$site] = collapse_2d_complexity('id', 'path', $test);\n }\n\n $THEME_IMAGES_SMART_CACHE_LOAD++;\n}", "function is_update_necessary( $related_post )\r\n\t{\r\n\t\tglobal $blog_id;\r\n\t\t\r\n\t\tif( $blog_id != $related_post->annotation->wp_blog_id )\r\n\t\t{\r\n\t\t\tswitch_to_blog( $related_post->annotation->wp_blog_id );\r\n\t\t} \r\n\t\t$yolink_config = get_option('yolink_config');\r\n\t\t$cached = get_post_meta( $related_post->annotation->wp_post_id, 'yolink_related_posts', true);\r\n\r\n\t\t// If no cached found or cache is expired, then skip\r\n\t\tif( $cached == false || !isset( $cached ) || $cached->timestamp < 0 )\r\n\t\t{\r\n\t\t\tif( is_multisite() )\r\n\t\t\t{\r\n\t\t\t\trestore_current_blog();\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\r\n\t\t// If same blog, return true;\r\n\t\tif( $blog_id == $related_post->annotation->wp_blog_id )\r\n\t\t{\t\r\n\t\t\tif( is_multisite() )\r\n\t\t\t{\r\n\t\t\t\trestore_current_blog();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// Ensure the show relate post is enabled on the foreign blog\r\n\t\tif( !isset($yolink_config['wp_show_related_posts']) || $yolink_config['wp_show_related_posts'] != 'true' )\r\n\t\t{\r\n\t\t\tif( is_multisite() )\r\n\t\t\t{\r\n\t\t\t\trestore_current_blog();\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// If not same blog, ensure foreign blog is configured to include the current post\r\n\t\t$included_blogs = $yolink_config['included_blogs'];\r\n\t\tif( isset( $included_blogs ) )\r\n\t\t{\r\n\t\t\tforeach( $included_blogs as $b )\r\n\t\t {\r\n\t\t\t \tif( !empty($b) )\r\n \t\t\t{\r\n\t\t\t\t\tif( $blog_id == $b )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif( is_multisite() )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trestore_current_blog();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t \t}\r\n \t}\r\n\t\t}\r\n\t\tif( is_multisite() )\r\n\t\t{\r\n\t\t\trestore_current_blog();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function has()\n\t{\n\t\t$name = $this->name();\n\n\t\tif(($has = Cache::has($name)) && $this->forget)\n\t\t{\n\t\t\tCache::forget($name);\n\n\t\t\t// We don't want to return the cached assets because we cleared\n\t\t\t// the cache and we want a new fresh copy of the assets returned.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $has;\n\t}" ]
[ "0.60945153", "0.60057694", "0.58437186", "0.5834118", "0.580944", "0.5786", "0.5685354", "0.56390876", "0.56099904", "0.55999047", "0.55372965", "0.5497684", "0.5483717", "0.54763114", "0.5426461", "0.5413291", "0.5395933", "0.5383037", "0.5381986", "0.5359928", "0.53350496", "0.53317326", "0.53211653", "0.53018004", "0.5301064", "0.52983147", "0.52791387", "0.52770466", "0.5268923", "0.52679837", "0.52093863", "0.5199752", "0.5198236", "0.5186084", "0.5179808", "0.51507837", "0.5138532", "0.5110776", "0.51046175", "0.50910705", "0.5080908", "0.5079713", "0.5079713", "0.50758374", "0.50740314", "0.5072507", "0.506664", "0.5043743", "0.5042566", "0.5038044", "0.50184816", "0.50180244", "0.5017007", "0.50131875", "0.5004162", "0.50017715", "0.49984598", "0.49840185", "0.49804863", "0.49698243", "0.49548736", "0.49503797", "0.49461818", "0.49452797", "0.49327397", "0.4932265", "0.4931936", "0.49313954", "0.49255908", "0.49241218", "0.49107563", "0.4908351", "0.4890636", "0.48877195", "0.4883826", "0.48814002", "0.48786485", "0.48765457", "0.48760033", "0.48752615", "0.48744392", "0.48713428", "0.48579103", "0.4856344", "0.484954", "0.4847177", "0.48466963", "0.48409906", "0.48392615", "0.4834035", "0.48297843", "0.48247796", "0.48149112", "0.48139948", "0.48113188", "0.48086673", "0.4808389", "0.47958416", "0.47951627", "0.479178" ]
0.5042607
48
Sort date from eventList
private function sortEventList($eventList){ $anz = count($eventList); $temp=""; for ($a = 0; $a < $anz; $a++) { for ($b = 0; $b < $anz -2; $b++) { if ($eventList[$b +1]->start_date < $eventList[$b]->start_date) { $temp = $eventList[$b]; $eventList[$b] = $eventList[$b +1]; $eventList[$b +1] = $temp; } } } return $eventList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_sort_event_list()\n\t{\n\t$temp = $this->get_event_list();\n\tif (!empty($temp))\n\t{\n\t\tusort($temp, [&$this, \"ical_dtstart_compare\"]);\n\t\treturn $temp;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t}", "public function sort_projects_by_date ()\n {\n\n }", "public function getSortedEvents() {\n\t\tif ($events = $this->getEvents()) {\n\t\t\tusort(\n\t\t\t\t$events, function ($a, $b) {\n\t\t\t\t\treturn $a['DTSTART'] > $b['DTSTART'];\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn $events;\n\t\t}\n\t\treturn array();\n\t}", "function sortFunction( $a, $b ) {\n\t\t\t\treturn strtotime($a[\"event_start_date_time\"]) - strtotime($b[\"event_start_date_time\"]);\n\t\t\t}", "private function update_data_filter_and_sort()\n {\n\n $array = get_data_from_API();\n //create a new array for only the data we want\n $filteredEvents = array();\n\n //loop through the array with all event data. \n foreach ($array as $events) {\n //Pull the data we want. \n $eName = $events['event']['name'];\n $eDate = $events['event']['end_date'];\n $eDate = str_replace('-', '/', $eDate);\n //grab the event's end date and save it as a datetime object for comparison\n $eDateTime = strtotime($eDate);\n $sDate = $events['event']['start_date'];\n $sDate = str_replace('-', '/', $sDate);\n $eLink = \"placeholder.com\";\n\n //Save it into an array called $singleEvent\n $singleEvent = array(\n 'name' => $eName,\n 'start_date' => $sDate,\n 'end_date' => $eDate,\n 'event_link' => $eLink\n );\n\n\n //checks to see if the $singleEvent is relevant or not (older than today's date)\n $date_now = getDatetimeNow();\n\n $date_now = strtotime($date_now);\n\n //if today's date is less than the stored date, add it\n //(i.e. the event hasn't happened yet, it is an upcoming event)\n if ($eDateTime > $date_now && $eDateTime != null) {\n array_push($filteredEvents, $singleEvent);\n } else {\n //do nothing\n }\n }\n\n //sort the array ascending by dates (most recent event first)\n foreach ($filteredEvents as $key => $value) {\n $sort_data[$key] = $value['end_date'];\n }\n array_multisort($sort_data, SORT_ASC, $filteredEvents);\n\n return $filteredEvents;\n }", "function sortDateAscending($thisFiles) {\n \tusort($thisFiles, \"cmpDA\");\n \treturn $thisFiles;\n }", "public function sortArrayByDate($array) {\n //so they can be displayed in the correct order regardless of when they were entered\n for($i = 1; $i < count($array); $i++) {\n //Storing current entry\n $entry = $array[$i];\n \n //Storing date of current entry\n $date = $array[$i]->{'Datum'};\n \n //Storing $i in separate variable $j for manipulation\n $j = $i;\n \n //As long as $j is greater than zero (index of the first entry) and the date of the entry in the previous iteration\n //is less than that of the current entry\n while($j > 0 && $array[$j - 1]->{'Datum'} < $date) {\n \n //The entry at the index of the current iteration is assigned the value of the previous iteration\n $array[$j] = $array[$j - 1];\n \n //$j is decremented in order to move \"left\" in the array\n $j -= 1;\n }\n \n //When there are no longer any entries with earlier dates,\n //place the stored entry at the position we are currently in\n $array[$j] = $entry;\n }\n \n return $array;\n \n }", "public function sort_events_by_date( $elem1, $elem2 ) {\r\n\t\treturn strtotime( $elem2['date'] ) - strtotime( $elem1['date'] );\r\n\t}", "function sort_events( $vars ) {\n\n\t\t// Check if we're viewing the 'event' post type.\n\t\tif ( isset( $vars['post_type'] ) && 'event' == $vars['post_type'] ) {\n\n\t\t\t// Check if 'orderby' is set to 'recurring'.\n\t\t\tif ( isset( $vars['orderby'] ) && 'recurring' == $vars['orderby'] ) {\n\n\t\t\t\t// Merge the query vars with our custom variables.\n\t\t\t\t$vars = array_merge(\n\t\t\t\t\t$vars,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'meta_key' => 'be_recurring_event',\n\t\t\t\t\t\t'orderby' => 'meta_value_num',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}", "function sortEvents($x,$y)\n\t\t{\n\t\t\tinclude \"convertTime.php\";\n\t\t\t\n\t\t\t// Converts all times to 24 hour time\n\t\t\t$xStart = convertTime($x[1],$x[2],$x[3]);\n\t\t\t$yStart = convertTime($y[1],$y[2],$y[3]);\n\t\t\t$xEnd = convertTime($x[4],$x[5],$x[6]);\n\t\t\t$yEnd = convertTime($y[4],$y[5],$y[6]);\n\t\t\t\n\t\t\t// Checks which event starts first\n\t\t\tif($xStart==$yStart)\n\t\t\t{\n\t\t\t\t// If the start times are equal then it checks end times\n\t\t\t\tif($xEnd==$yEnd)\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\telse if($xEnd>$yEnd)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($xStart>$yStart)\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}", "public function sortBy(){\n global $SnickerPlugin;\n\n if($SnickerPlugin->getValue(\"frontend_order\") === \"date_asc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] > $b[\"date\"];\n });\n } else if($SnickerPlugin->getValue(\"frontend_order\") === \"date_desc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] < $b[\"date\"];\n });\n }\n return true;\n }", "function _datesort($a,$b){\n $da = $this->_meta($a,'cdate');\n $db = $this->_meta($b,'cdate');\n if($da < $db) return -1;\n if($da > $db) return 1;\n return strcmp($a['file'],$b['file']);\n }", "function SortArticlesByDate( $a, $b ){\n return strtotime($a['date']) < strtotime( $b['date'] );\n}", "function sortByDate( $a, $b ) {\n return strtotime($b[\"date\"]) - strtotime($a[\"date\"]);\n}", "function logSorter_sort($list) {\n uasort($list, 'logSorter_cmpFiles');\n return $list;\n}", "function sortDateDescending($thisFiles) {\n \tusort($thisFiles, \"cmpDD\");\n \treturn $thisFiles;\n }", "public function sortAppointmentsList($a, $b) {\nif ((strtotime($a['title']) !== false) && (strtotime($b['title']) !== false)) { // sort by time, if they're times\n\t$a = strtotime($a['title']);\n\t$b = strtotime($b['title']);\n} else { // if not, sort as text\n\t$a=preg_replace('~[^a-z0-9]~', '', strtolower($a['title']));\n\t$b=preg_replace('~[^a-z0-9]~', '', strtolower($b['title']));\n}\nreturn $a==$b ? 0 : ($a<$b) ? -1 : 1;\n}", "function sortFunction( $a, $b ) {\n return strtotime($a['date']) - strtotime($b[\"date\"]);\n}", "function sortFunction( $a, $b ) {\n return strtotime($b[\"date\"]) - strtotime($a[\"date\"]);\n}", "public static function _sortEventsByTime($a, $b)\n\t{\n\t\t//if ($a->publish_up() == $b->publish_up()) return 0;\n\n\t\tlist($adate, $atime) = explode(' ', $a->publish_up());\n\t\tlist($bdate, $btime) = explode(' ', $b->publish_up());\n\n\t\t// if allday event, sort by title first on day\n\t\tif ($a->alldayevent())\n\t\t\t$atime = '00:00' . $a->title();\n\t\tif ($b->alldayevent())\n\t\t\t$btime = '00:00' . $b->title();\n\n\t\treturn strcmp($atime, $btime);\n\n\t}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "public function getSortOrderByDate() \n {\n return $this->_fields['SortOrderByDate']['FieldValue'];\n }", "public function asort() {}", "function sortByDate(array $a, array $b): int {\n return strtotime($b['publishDate']) - strtotime($a['publishDate']);\n}", "function extSortUpcoming($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "private function sortEvents(\\Illuminate\\Support\\Collection $events, DateTimeZone $timezone)\n {\n return $this->option('next')\n ? $events->sortBy(fn ($event) => $this->getNextDueDateForEvent($event, $timezone))\n : $events;\n }", "function sortFunction( $a, $b ) {\n return strtotime($a[0]) - strtotime($b[0]);\n }", "public function date_get_eventlist($date, $gid = 0)\n {\n if (is_array($date)) {\n $from = $this->esc($date[0]);\n $to = $this->esc($date[1]);\n } else {\n $date = $from = $to = $this->esc($date);\n }\n // Support for filtering out events from groups not included in result set according to query type\n $eventListFilter = $this->getQueryTypeFilter($gid);\n $gidFilter = $this->getGroupAndShareFilter($gid);\n\n $return = array();\n $query = 'SELECT DISTINCT e.`id` '\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`starts`, \"%T\")) ), UNIX_TIMESTAMP(e.`starts`) ) as start'\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`ends`, \"%T\")) ), UNIX_TIMESTAMP(e.`ends`) ) as end'\n .',e.`starts`, e.`ends`, e.`location`, e.`title`, e.`description`, e.`type`, e.`status`, e.`opaque`, rp.`type` `repeat_type`, rp.`until` `repeat_until`'\n .',IF(fs.`val` IS NULL, \"\", fs.`val`) `colour`'\n .', (SELECT `mode` FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `eid`=e.`id` AND `ref`=\"evt\" LIMIT 1) `warn_mode`'\n .' FROM '.$this->Tbl['cal_repetition'].' rp, '.$this->Tbl['cal_event'].' e'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=e.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=e.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .$eventListFilter[0]\n .' WHERE rp.`eid`=e.`id` AND rp.`ref`=\"evt\" AND ('.$gidFilter.')'.$eventListFilter[1]\n .' AND IF (rp.`type`!=\"-\", DATE_FORMAT(e.`starts`, \"%Y%m%d\") <= DATE_FORMAT(\"'.$from.'\", \"%Y%m%d\"), 1)'\n .' AND IF (rp.`type`!=\"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until`>\"'.$to.'\",1) AND ('\n // Begins or ends today\n .'DATE_FORMAT(e.`starts`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR DATE_FORMAT(e.`ends`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR '\n // Begins in the past AND ends in the future\n .'( DATE_FORMAT(e.`starts`, \"%Y%m%d\")<=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") AND DATE_FORMAT(e.`ends`, \"%Y%m%d\")>=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") ) OR '\n // Is an event occuring yearly. Todays date matches the repetition date\n .'(rp.`type`=\"year\" AND (DATE_FORMAT(e.`starts`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%m%d\") OR DATE_FORMAT(e.`ends`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\",\"%m%d\"))) OR '\n // A monthly event, repetition day is today, repetition month is empty or matches\n .'(rp.`type`=\"month\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%e\") AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) ) OR '\n // Monthly event on e.g. the 31st of month with months shorter than 31 days, this is only supported from MySQL 4.1.1 onward\n .'(rp.`type`=\"month\" AND rp.`repeat`=31 AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) AND LAST_DAY(\"'.$date.'\")=DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"))'\n // A weekly event, repetition weekday is today\n .' OR (rp.`type`=\"week\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%w\") AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, \"'.$date.'\")/7, rp.`extra`))=0) ) OR '\n // A \"daily\" event, where the bit pattern should match today's weekday\n .'(rp.`type`=\"day\" AND (rp.`repeat`=\"0\" OR SUBSTRING(LPAD(BIN(rp.`repeat`), 8, 0), IF(DATE_FORMAT(\"'.$date.'\", \"%w\")=0, 8, DATE_FORMAT(\"'.$date.'\", \"%w\")+1), 1) = 1 ) )'\n .') ORDER BY `start` ASC';\n $qh = $this->query($query);\n while ($line = $this->assoc($qh)) {\n if ($line['warn_mode'] == '?') {\n $qid2 = $this->query('SELECT `mode` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$line['id'].' AND `ref`=\"evt\" AND `mode` != \"-\" LIMIT 1');\n list ($rem) = $this->fetchrow($qid2);\n $line['warn_mode'] = $rem ? $rem : '-';\n } elseif ($line['warn_mode'] == '' || is_null($line['warn_mode'])) {\n $line['warn_mode'] = '-';\n }\n $return[] = $line;\n }\n return $return;\n }", "static function default_sort_key(): string { return 'date_till'; }", "function sort_notes($a, $b) {\n return strtotime($b['date']) - strtotime($a['date']);\n }", "public function Sorting_DateUpdate($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.date_update ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "private function sortByDate($a, $b) {\n\n return strcmp($a->tstamp, $b->tstamp);\n }", "public static function sortByWhenOrScheduledWhen(Array $departuresList): Array\n {\n uasort($departuresList, function($a, $b) {\n $dateA = $a->when;\n if($dateA == null) {\n $dateA = $a->scheduledWhen;\n }\n\n $dateB = $b->when;\n if($dateB == null) {\n $dateB = $b->scheduledWhen;\n }\n\n return ($dateA < $dateB) ? -1 : 1;\n });\n\n return $departuresList;\n }", "function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}", "private function sortDates(array $dates)\n\t{\n\t\tusort($dates, function($date1, $date2)\n\t\t{\n\t\t\tif($date1->lt($date2))\n\t\t\t{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\telse if($date1->gt($date2))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t}", "function sortByDate($a, $b) \n{\n $aStats = explode ( \":\", $a );\n\t$bStats = explode ( \":\", $b );\n\t\n return -1 * (strcmp( $aStats[1],$bStats[1] ));\n}", "function printEventsList($args = array()) {\n\t \t$echo = true;\n\t \t$before = $after = '';\n\n\t \t$template = get_option('fse_template_lst');\n\t \t$groupby = get_option('fse_groupby');\n\t \t$groupby_hdr = get_option('fse_groupby_header');\n\n\t \t$pagination = get_option('fse_pagination');\n\n\t \tif (isset($_GET['wpcal-page'])) {\n\t \t\t$args['page'] = intval($_GET['wpcal-page']);\n\t \t} else {\n\t \t\t$args['page'] = 1;\n\t \t}\n\n\t \tforeach($args as $k => $a) {\n\t \t\tswitch($k) {\n\t \t\t\tcase 'echo':\n\t \t\t\t\tif (is_bool($a))\n\t \t\t\t\t$echo = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'before':\n\t \t\t\t\t$before = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'after':\n\t \t\t\t\t$after = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'template':\n\t \t\t\t\t$template = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'groupby':\n\t \t\t\t\tif (in_array($a, array('','d','m','y')))\n\t \t\t\t\t$groupby = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'groupby_header':\n\t \t\t\t\t$groupby_hdr = $a;\n\t \t\t\t\tbreak;\n\t \t\t\tcase 'pagination':\n\t \t\t\t\t$pagination = ($a == true ? true : false); // Allow type cast using == instead of ===$\n\t \t\t\t\tbreak;\n\n\t \t\t}\n\t \t}\n\n\t \t// Sort must be by date, the user can choos, if asc or desc...\n\t \tif (isset($filter['orderby'])) {\n\t \t\tunset($filter['orderby']);\n\t \t}\n\t \t$filter['orderby'] = array('datefrom');\n\n\t \tif (isset($filter['orderdir'])) {\n\t \t\t$dir = $filter['orderdir'];\n\t \t\tif (isset($dir[0]))\n\t \t\t$dir = $dir[0];\n\t \t\telse\n\t \t\t$dir = 'asc';\n\t \t\tunset($filter['orderdir']);\n\t \t} else {\n\t \t\t$dir = 'asc';\n\t \t}\n\t \t$filter['orderdir'] = array($dir);\n\n\t \t$ret = '';\n\n\t \t$evt = $this->getEventsExternal($args);\n\n\n\t \tif ($pagination) {\n\t \t\t$args['count'] = true;\n\t \t\t$count = $this->getEventsExternal($args);\n\n\t \t\t// If no pagination is needed, disabled it\n\t \t\tif (count($evt) == $count) {\n\t \t\t\t$pagination = false;\n\t \t\t}\n\t \t}\n\n\t \tif ($evt !== false) {\n\t \t\t$d = $m = $y = -1;\n\t \t\tforeach($evt as $e) {\n\t \t\t\t$dn = $e->getStart('d');\n\t \t\t\t$mn = $e->getStart('m');\n\t \t\t\t$yn = $e->getStart('y');\n\n\t \t\t\tif (($groupby == 'y' && $yn != $y) ||\n\t \t\t\t($groupby == 'm' && ($yn != $y || $mn != $m)) ||\n\t \t\t\t($groupby == 'd' && ($yn != $y || $mn != $m || $dn != $d))) {\n\n\t \t\t\t\t//echo $yn.'-'.$y.':'.$mn.'-'.$m.'<br />';\n\n\t \t\t\t\tif ($d != -1) {\n\t \t\t\t\t\t$ret .= '</ul></li>';\n\t \t\t\t\t}\n\t \t\t\t\t$ret .= '<li class=\"event_header\">'.$e->getStart($groupby_hdr).'<ul class=\"events\">';\n\t \t\t\t\t$d = $dn;\n\t \t\t\t\t$m = $mn;\n\t \t\t\t\t$y = $yn;\n\t \t\t\t}\n\t \t\t\t$ret .= '<li class=\"event\" id=\"event-'.$e->eventid.'\">';\n\t \t\t\t$ret .= $this->filterContent($template, $e);\n\t \t\t\t$ret .= '</li>';\n\t \t\t}\n\t \t\tif ($d != -1) {\n\t \t\t\t$ret .= '</ul></li>';\n\t \t\t}\n\t \t}\n\n\t \t$pagstr = '';\n\t \tif ($pagination) {\n\t \t\t$pagstr = $this->getEventsPagination($count, $args);\n\t \t}\n\n\t \t$ret = $pagstr.$before.'<ul class=\"groups\">'.$ret.'</ul>'.$after.$pagstr;\n\n\t \tif ($echo == true)\n\t \t\techo $ret;\n\t \telse\n\t \t\treturn $ret;\n\t }", "function getEvents($filter, $sort_string = '', $limit = 0, $start = 0, $count = false) {\n\t \tglobal $wpdb;\n\n\t \tif (empty($sort_string)) {\n\t \t\t$sort_string = 'e.`datefrom` ASC';\n\t \t}\n\t \t\n\t \t// Convert timestamps to mysql date format\n\t \tif (isset($filter['datefrom']) && !empty($filter['datefrom'])) {\n\t \t\t// Neu auch text unterstützen\n\t \t\tif (strpos(strtolower($filter['datefrom']), 'now') !== false) { // Now\n\t \t\t\t$filter['datefrom'] = $this->calculate_dates($filter['datefrom']);\n\t \t\t} else if (strpos(strtolower($filter['datefrom']), 'today') !== false) { // Today\n\t \t\t\t$filter['datefrom'] = $this->calculate_dates($filter['datefrom']);\n\t \t\t} else if (strpos($filter['datefrom'], '-') === false) { // Integer format\n\t \t\t\t$filter['datefrom'] = date('Y-m-d H:i:s', $filter['datefrom']);\n\t \t\t} else {\n\t \t\t\t// Validate!\n\t \t\t\tif (strtotime($filter['datefrom']) == false || strtotime($filter['datefrom']) == -1) {\n\t \t\t\t\t$filter['datefrom'] = $this->calculate_dates('now');\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t \tif (isset($filter['dateto']) && !empty($filter['dateto'])) {\n\t \t\tif (strpos(strtolower($filter['dateto']), 'now') !== false) {\n\t \t\t\t$filter['dateto'] = $this->calculate_dates($filter['dateto']);\n\t \t\t} else if (strpos(strtolower($filter['dateto']), 'today') !== false) {\n\t \t\t\t$filter['dateto'] = $this->calculate_dates($filter['dateto'], true);\n\t \t\t} else if (strpos($filter['dateto'], '-') === false) {\n\t \t\t\t$filter['dateto'] = date('Y-m-d H:i:s', $filter['dateto']);\n\t \t\t} else {\n\t \t\t\t// Validate!\n\t \t\t\tif (strtotime($filter['dateto']) == false || strtotime($filter['dateto']) == -1) {\n\t \t\t\t\tunset($filter['dateto']);\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t \t// If its an allday event, modify any selection time, because allday events allways starts at 00:00\n\t \tif (isset($filter['allday']) && $filter['allday'] == true) {\n\t \t\tif (isset($filter['datefrom'])) {\n\t \t\t\t$df = $filter['datefrom'];\n\t \t\t\t$filter['datefrom'] = date('Y-m-d H:i:s', mktime(0,0,0,mysql2date('m', $df), mysql2date('d', $df), mysql2date('Y', $df)));\n\t \t\t}\n\t \t\tif (isset($filter['dateto'])) {\n\t \t\t\t$df = $filter['dateto'];\n\t \t\t\t$filter['dateto'] = date('Y-m-d H:i:s', mktime(0,0,0,mysql2date('m', $df), mysql2date('d', $df)+1, mysql2date('Y', $df)) - 1);\n\t \t\t}\n\t \t}\n\n\t \t$where = ' WHERE ';\n\t \tif (isset($filter['id_inc']) && is_array($filter['id_inc']))\n\t \t$where .= \" e.`eventid` IN (\".implode(',', $filter['id_inc']).\") AND\";\n\t \tif (isset($filter['id_exc']) && is_array($filter['id_exc']))\n\t \t$where .= \" e.`eventid` NOT IN (\".implode(',', $filter['id_exc']).\") AND\";\n\t \tif (isset($filter['state']) && isset(self::$valid_states[$filter['state']]))\n\t \t$where .= \" e.`state`='{$filter['state']}' AND\";\n\t \tif (isset($filter['author']))\n\t \t$where .= \" e.`author`='{$filter['author']}' AND\";\n\t \tif (isset($filter['allday']))\n\t \t$where .= \" e.`allday`=\".($filter['allday'] === true ? '1' : '0').\" AND\";\n\t \tif (isset($filter['datefrom']) || isset($filter['dateto'])) {\n\n\t \t\tif (!isset($filter['datemode'])) {\n\t \t\t\t$filter['datemode']\t= FSE_DATE_MODE_ALL;\n\t \t\t}\n\n\t \t\t// Make date selection complete\n\t \t\tif (!isset($filter['datefrom']) || empty($filter['datefrom']))\n\t \t\t$filter['datefrom'] = date('Y-m-d H:i:s', 0);\n\t \t\tif (!isset($filter['dateto']) || empty($filter['dateto']))\n\t \t\t$filter['dateto'] = date('Y-m-d H:i:s', mktime(23, 59, 59, 12, 31, 2037));\n\n\t \t\t// Allday events to-stamp is at the beginning of the day!\n\t \t\t$date_to_allday = date('Y-m-d H:i:s', mktime(0, 0, 0, mysql2date('m', $filter['datefrom']), mysql2date('d', $filter['datefrom']), mysql2date('y', $filter['datefrom'])));\n\n\n\t \t\t// Events must always start before the end and\n\t \t\t// must end after start\n\t \t\t$where .= ' (e.`datefrom` <= \"'.$filter['dateto'].'\") AND '.\n \t\t\t\t\t\t' ((e.`dateto` >= \"'.$filter['datefrom'].'\") OR (e.`dateto` >= \"'.$date_to_allday.'\" AND `allday` = 1))'; \n\n\t \t\t//\n\t \t\tif ($filter['datemode'] == FSE_DATE_MODE_START) {\n\t \t\t\t$where .= ' AND (e.`datefrom` >= \"'.$filter['datefrom'].'\")';\n\t \t\t} elseif ($filter['datemode'] == FSE_DATE_MODE_END) {\n\t \t\t\t$where .= ' AND (e.`datefrom` <= \"'.$filter['dateto'].'\")';\n\t \t\t}\n\n\t \t\t$where .= ' AND';\n\t \t}\n\n\t \t// Join for categories\n\t \t$join = '';\n\t \tif (isset($filter['categories'])) {\n\t \t\t$f = $filter['categories'];\n\t \t\tif (!is_array($f))\n\t \t\t$f = array($f);\n\t \t\t$in = '';\n\t \t\tforeach($f as $c) {\n\t \t\t\t$c = intval($c);\n\t \t\t\tif (!empty($c))\n\t \t\t\t$in .= $c.',';\n\t \t\t}\n\n\t \t\tif (!empty($in)) {\n\t \t\t\t$in = substr($in, 0, strlen($in)-1);\n\t \t\t\t$where .= ' c.`catid` IN ('.$in.') AND';\n\t \t\t\t$join = ' LEFT JOIN `'.$wpdb->prefix.'fsevents_cats` AS c ON e.`eventid` = c.`eventid` ';\n\t \t\t}\n\t \t}\n\n\t \tif ($where != ' WHERE ')\n\t \t\t$where = substr($where, 0, strlen($where) - 3);\n\t \telse\n\t \t\t$where = '';\n\n\t \t// Special Case 'Count'!\n\t \tif ($count == true) {\n\t \t\t$sql = 'SELECT DISTINCT count(e.`eventid`) FROM `'.$wpdb->prefix.'fsevents` AS e '.$join.$where.' ORDER BY '.$sort_string;\n\t \t\treturn $wpdb->get_var($sql);\n\t \t} else {\n\t \t\t$sql = 'SELECT DISTINCT e.`eventid` FROM `'.$wpdb->prefix.'fsevents` AS e '.$join.$where.' ORDER BY '.$sort_string;\n\t \t\tif (!empty($limit)) {\n\t \t\t\t$sql .= ' LIMIT '.intval($start).', '.intval($limit);\n\t \t\t}\n\t \t}\n\n\t \tif (defined('FSE_SQL_DEBUG') && FSE_SQL_DEBUG == true && defined('WP_DEBUG') && WP_DEBUG == true) {\n\t \t\techo '<p>'.$sql.'</p>';\n\t \t}\t\n\t \t\n\t \t$res = $wpdb->get_col($sql);\n\n\t \tif ($res === NULL)\n\t \t\treturn false;\n\n\t \treturn $res;\n\t }", "public static function _sortEventsByModificationDate($a, $b)\n\t{\n\n\t\t$adate = $a->modified();\n\t\t$bdate = $b->modified();\n\n\t\t// reverse created date\n\t\treturn -strcmp($adate, $bdate);\n\n\t}", "public function sortPhoneData(){\n usort($this->phoneData, function($a, $b) {\n return $a['activationDate'] <=> $b['activationDate'];\n });\n\n }", "private function _sort_by_date( $current, $next ) {\n\t\t\tif ( (int) $current['content']['date'] === (int) $next['content']['date'] ):\n\t\t\t\treturn 0;\n\t\t\telseif ( (int) $current['content']['date'] < (int) $next['content']['date'] ):\n\t\t\t\treturn - 1;\n\t\t\telse:\n\t\t\t\treturn 1;\n\t\t\tendif;\n\t\t}", "function extSort($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aItem['allday']<$bItem['allday']){\n return 1;\n }elseif($aItem['allday']>$bItem['allday'])\n return -1;\n \n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "public function sort();", "public function sortCheckInDay()\n {\n // Database query\n $this->db->query('SELECT guests.id, guests.room_number, guests.full_name, guests.check_in_date, guests.check_out_date, guests.notes, reservations.status FROM guests INNER JOIN reservations ON guests.id = reservations.guest WHERE DATE_FORMAT(check_in_date, \"%Y-%m-%d\") = CURDATE()');\n // Get records\n $results = $this->db->resultSet();\n\n return $results;\n }", "private function sortListeners($eventName)\n {\n $this->_sorted[$eventName] = array();\n\n if (isset($this->_listeners[$eventName])) {\n krsort($this->_listeners[$eventName]);\n $this->_sorted[$eventName] = call_user_func_array('array_merge', $this->_listeners[$eventName]);\n }\n }", "public function index()\n {\n $seo = new SEOTools();\n\n $seo->setTitle('Home');\n $seo->setCanonical('https://citizenwarfare.com');\n\n\n $sorted = [];\n $pubEvents = Event::where('private', 0)->with('organization')->get();\n\n $events = new EventController();\n $timezonedata = $events->getTimeZone();\n session()->put('timezone', $timezonedata->time_zone->name);\n\n\n //remove outdated public events\n if(!$today = Carbon::now()->setTimezone(session()->get('timezone'))->format('Y-m-d')){\n $today = Carbon::now()->setTimezone(session()->get('timezone'))->format('Y-m-d');\n }\n //dd($this->data['pubEvents']);\n foreach ($pubEvents as $k => $event) {\n $parsed = Carbon::parse($event->start_date)->setTimezone(session()->get('timezone'))->format('Y-m-d');\n if ($parsed < $today) {\n unset($pubEvents[$k]);\n }\n //sort for front page and profile.\n $weekStart = Carbon::getWeekStartsAt();\n $weekEnd = Carbon::getWeekEndsAt();\n\n if(Carbon::parse($event->start_date)->setTimezone(session()->get('timezone'))->format('Y-m-d') < $weekEnd && $event > $weekStart){\n $sorted['thisWeek'][] = $event;\n }elseif(Carbon::parse($event->start_date)->setTimezone(session()->get('timezone'))->format('m') === Carbon::now()->setTimezone(session()->get('timezone'))->format('m')){\n $sorted['thisMonth'][] = $event;\n }elseif(Carbon::parse($event->start_date)->setTimezone(session()->get('timezone'))->format('Y-m-d') === Carbon::now()->setTimezone(session()->get('timezone'))->format('Y-m-d')){\n $sorted['today'][] = $event;\n }\n }\n\n return view('home')->with('sorted', $sorted);\n }", "private function makeDayEventListArray()\n\t{\n\t\t$outevents = array();\n\t\t$n = 0;\n\t\tforeach($this->eventItems as $item) {\n\t\t\tif($item['date'] == $this->curYear.'-'.$this->curMonth.'-'.$this->dayOfMonth) {\t\t\n\t\t\t\t$outevents[$n]['category'] = $item['cat'];\n\t\t\t\t\n\t\t\t\tif($item['stdurl']) {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'].'?id='.$item['id'];\n\t\t\t\t} else {\n\t\t\t\t\t$outevents[$n]['url'] = $item['url'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$outevents[$n]['summary'] = $item['text'];\n\t\t\t\t$outevents[$n]['description'] = $item['desc'];\n\t\t\t\t$outevents[$n]['categorycolor'] = (strlen($item['catcolor']) > 0 ? str_replace('#','',$item['catcolor']) : '#eeeeee');\n\t\t\t}\n\t\t\t$n++;\n\t\t}\n\t\t\n\t\tif(count($outevents)) {\n\t\t\treturn $outevents;\n\t\t}\n\t\treturn false;\n\t}", "function getEvents()\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events ORDER BY Date Desc');\n $request->execute(array());\n $result = $request->fetchAll();\n return $result;\n}", "function _buildContentOrderBy()\n\t{\t\t\t\n\t\t$orderEvents = EventBookingHelper::getConfigValue('order_events');\n\t\tif ($orderEvents == 2) {\n\t\t\t$orderby = ' ORDER BY a.event_date ';\n\t\t} else {\n\t\t\t$orderby = ' ORDER BY a.ordering ';\t\n\t\t}\t\t\t\n\t\treturn $orderby;\n\t}", "public function Sorting_dateStart($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.date_start ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function __construct(vevent $event, $from_date, $to_date)\r\n {\r\n //$this_day = date('d', $from_date);\r\n //$this_month = date('m', $from_date);\r\n //$this_year = date('Y', $from_date);\r\n\r\n //For the list view\r\n $date = getdate();\r\n $date_unixtime = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']);\r\n // TODO: List view needs to start today, not on the last selected date.\r\n// \t$from_date = ($date_unixtime + $to_date) / 2;\r\n \t$this_day = date('d', $from_date);\r\n $this_month = date('m', $from_date);\r\n $this_year = date('Y', $from_date);\r\n// \t$this_day = $date['mday'];\r\n// \t$this_month = $date['mon'];\r\n// \t$this_year = $date['year'];\r\n\r\n $start_month = $date['mon'] - 1;\r\n $start_year = $date['year'];\r\n $end_month = $this_month + 1;\r\n $end_year = $this_year;\r\n\r\n\r\n if ($this_month == 1)\r\n {\r\n $start_month = 12;\r\n $start_year --;\r\n }\r\n if ($this_month == 12)\r\n {\r\n $end_month = 1;\r\n $end_year ++;\r\n }\r\n\r\n $this->event = $event;\r\n $this->view_start = mktime(0, 0, 0, $start_month, 1, $start_year);\r\n $this->view_end = mktime(0, 0, 0, $end_month, 31, $end_year);\r\n\r\n if ($this->debug)\r\n {\r\n echo '<hr />';\r\n echo '<b>ICAL RECURRENCE</b>';\r\n echo '<hr />';\r\n echo '<table class=\"data_table\">';\r\n echo '<thead>';\r\n echo '<tr><th>Variable</td><th>Value</td>';\r\n echo '</thead>';\r\n echo '<tbody>';\r\n echo '<tr><td>Title</td><td>' . $this->event->summary['value'] . '</td>';\r\n echo '<tr><td>View begin</td><td>' . $this->view_start . ' (' . date('r', $this->view_start) . ')</td>';\r\n echo '<tr><td>View end</td><td>' . $this->view_end . ' (' . date('r', $this->view_end) . ')</td>';\r\n // echo '<tr><td>Event</td><td>';\r\n // echo '<pre>';\r\n // echo print_r($this->event, true);\r\n // echo '</pre>';\r\n // echo '</td>';\r\n // echo '</tr>';\r\n echo '</tbody>';\r\n echo '</table>';\r\n }\r\n }", "public function getTimeEventsList(){\n return $this->_get(8);\n }", "public function setSortOrderByDate($value) \n {\n $this->_fields['SortOrderByDate']['FieldValue'] = $value;\n return $this;\n }", "function set_sort (\t$in_keys\t/**<\tThis is the way we control a sort. It is both very powerful, and non-trivial.\n\t\t\t\t\t\t\t\t\t\t\t\tThis is an associative array, and the order of the keys determines sort priority,\n\t\t\t\t\t\t\t\t\t\t\t\twith the first key being the highest priority, and subsequent keys descending in\n\t\t\t\t\t\t\t\t\t\t\t\timportance.\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\tThis sort is far more powerful than the basic one used in the root server. It is designed\n\t\t\t\t\t\t\t\t\t\t\t\tto allow you to be very specific in your sort criteria for your printed list.\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\tThe value of each key determines the direction of the sort. If it is 0, false or null,\n\t\t\t\t\t\t\t\t\t\t\t\tthe sort will be descending (lower to greater). If it is 1 or true, then the sort will\n\t\t\t\t\t\t\t\t\t\t\t\tbe ascending.\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\tThis function executes the sort, so the meeting_data array is sorted after this function.\n\t\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t)\n\t\t\t{\n\t\t\t\tif ( isset ( $in_keys['week_starts'] ) && ($in_keys['week_starts'] > 0) && ($in_keys['week_starts'] < 8) )\t// This little dope fiend move is how we set a non-Sunday week start.\n\t\t\t\t\t{\n\t\t\t\t\tself::$week_starts = $in_keys['week_starts'];\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tself::$sort_order_keys = $in_keys;\n\t\t\t\t$ret = usort ( $this->meeting_data, self::$sort_callback );\n\t\t\t\treturn $ret;\n\t\t\t}", "function wp_list_sort($input_list, $orderby = array(), $order = 'ASC', $preserve_keys = \\false)\n {\n }", "function sortEvt($a,$b) { return strcmp(str_pad($a['sti'],5).$b['adt'], str_pad($b['sti'],5).$a['adt']); }", "private function _sort_by_added($a, $b)\n {\n if(strpos($a['date_scanned'], \":\") !== false) {\n $adate = DateTime::createFromFormat('j M Y H:i', $a['date_scanned']);\n } else {\n $adate = DateTime::createFromFormat('j M Y', $a['date_scanned']);\n }\n\n if(strpos($b['date_scanned'], \":\") !== false) {\n $bdate = DateTime::createFromFormat('j M Y H:i', $b['date_scanned']);\n } else {\n $bdate = DateTime::createFromFormat('j M Y', $b['date_scanned']);\n }\n\n if($bdate == $adate){\n return $this->_sort_by_show($a, $b);\n }\n\n if($this->sorting_order == \"az\")\n {\n return ($adate > $bdate);\n }\n\n return ($adate < $bdate);\n }", "public function getAllSortByDate()\n\t{\n\t\t$table = \"\";\n\t\t$table = $this->getTableName();\n\t\t$db_connection = get_db_connection();\n\t\t$dataArray = array();\n\t\t\n\t\t$query = \"select * from $table order by year_posted, month_posted\";\t\t\n\t\t$result = mysqli_query($db_connection, $query);\n\t\t$dataArray = $this->getData($result, $db_connection);\n\t\tmysqli_close($db_connection);\n\t\t\n\t\treturn $dataArray;\n\t}", "function sort_by_updated ($a, $b) {\n\t\treturn strtotime($b['LASTCHANGEDDATE']) - strtotime($a['LASTCHANGEDDATE']);\n\t}", "function agenda_get_item_list($course_id, $user_id, $user_group_list, $order='DESC')\n\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\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t event.master_event_id\t\t\tAS master_event_id,\n\t\t\t\t rel_event_recipient.user_id\t \tAS user_id,\n\t\t\t\t rel_event_recipient.group_id \tAS group_id,\n\t\t\t\t rel_event_recipient.visibility \tAS visibility\n\t\tFROM \" . $tbl . \"\n\t\tWHERE \t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id = \" . (int) $user_id .\")\n\t\t\tOR\n\t\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\tAND rel_event_recipient.group_id is NULL)\";\n\t\tforeach($user_group_list as $this_group)\n\t\t{\n\t\t\t$sql .=\" OR\n\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\tAND rel_event_recipient.group_id = \". (int) $this_group .\")\";\n\t\t}\n\n\n\t\t$sql .=\"ORDER BY event.start_date \" . ('DESC' == $order?'DESC':'ASC');\n\n\treturn claro_sql_query_fetch_all($sql);\n}", "public function getDateSortie() {\n return $this->dateSortie;\n }", "public function sortProductByCreatedAt()\n {\n $query=new \\yii\\db\\Query();\n return $sort=$query->from('product')->where(['status' => self::ACTIVE_STATUS])->orderBy('created_at DESC')->all();\n }", "function sortArticlesByDate(array $a, array $b) : int {\n return strtotime($b['published_date']) - strtotime($a['published_date']);\n}", "public function index()\n { $eventuser=[];\n $events=Event::all()->sortBy('startDate');\n foreach($events as $event){\n $eventuser[]= ['user'=> $event->user,'event'=>$event ];\n \n }\n return ['data' => $eventuser];\n }", "public function bookingListByDate()\n {\n $dateOptipns = [];\n $bookingMgr = new BookingMgr();\n $bookings = $bookingMgr->getBookings();\n foreach ($bookings->toArray() as $booking) {\n $dateOptipns[] = $booking['reserve_date'];\n }\n $dateOptipns = array_unique($dateOptipns);\n $dateOptipns = array_sort($dateOptipns);\n \n return view('booking/date', [\n 'dateOptipns' => $dateOptipns,\n ]);\n }", "public function findAllOrderedByUpdatedAtDate()\n {\n $query = $this->createQueryBuilder('e')\n ->orderBy('e.updatedAt', 'DESC');\n return $query->getQuery()->getResult();\n }", "public function getItems($params)\n\t{\n\t\t$eventcats = $params->get('eventcats', array());\n\t\t$eventcount = $params->get('eventcount', 5);\n\t\t$order = $params->get('order', 1);\n\t\t$Itemid = BabioonEventRouteHelper::getItemid('events');\n\t\t$db = JFactory::getDBO();\n\t\t$user\t\t= JFactory::getUser();\n\t\t$now = gmdate(\"Y-m-d\");\n\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('MONTHNAME(e.sdate) AS mon')\n\t\t\t\t->select('YEAR(e.sdate) AS year')\n\t\t\t\t->select('e.*')\n\t\t\t\t->select('cc.title AS cctitle')\n\t\t\t\t->from('#__babioonevent_events AS e')\n\t\t\t\t->from('#__categories AS cc')\n\t\t\t\t->where('(e.sdate >= \"' . $now . '\" OR e.edate >= \"' . $now . '\")')\n\t\t\t\t->where('e.catid = cc.id')\n\t\t\t\t->where('e.enabled = 1')\n\t\t\t\t->where('cc.published = 1')\n\t\t\t\t->order('e.sdate, cc.title');\n\n\t\tif (!empty($eventcats) && trim($eventcats[0]) != \"\")\n\t\t{\n\t\t\t$catfilter = 'catid in (' . implode(',', $eventcats) . ') ';\n\t\t\t$query->where($catfilter);\n\t\t}\n\n\t\t// Implement View Level Access\n\t\tif (!$user->authorise('core.admin'))\n\t\t{\n\t\t\t$groups = implode(',', $user->getAuthorisedViewLevels());\n\t\t\t$query->where('cc.access IN (' . $groups . ')');\n\t\t}\n\n\t\t$db->setQuery($query, 0, $eventcount);\n\n\t\t$c = $db->loadObjectList();\n\t\t$ccount = count($c);\n\t\t$link = 'index.php?option=com_babioonevent&view=event' . '&Itemid=' . $Itemid . '&id=';\n\n\t\t$categorylist = array();\n\t\t$nr = array();\n\n\t\tfor ($i = 0; $i < $ccount; $i ++)\n\t\t{\n\t\t\t$obj = new stdClass;\n\t\t\t$crow = $c [$i];\n\t\t\t$obj = $crow;\n\t\t\t$obj->link = $link . $crow->babioonevent_event_id;\n\t\t\t$nr [] = $obj;\n\t\t\t$categorylist [$obj->catid] = $obj->cctitle;\n\t\t}\n\n\t\tif ($order == 2)\n\t\t{\n\t\t\t$result = array();\n\n\t\t\tif (!empty($eventcats))\n\t\t\t{\n\t\t\t\tforeach (explode(',', $eventcats) as $elm)\n\t\t\t\t{\n\t\t\t\t\tforeach ($nr as $r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($elm == $r->catid)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$result [] = $r;\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\telse\n\t\t\t{\n\t\t\t\tif (asort($categorylist, SORT_LOCALE_STRING) === true)\n\t\t\t\t{\n\t\t\t\t\tforeach ($categorylist as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($nr as $r)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($key == $r->catid)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$result [] = $r;\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\t$result = $nr;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $nr;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function asort()\n {\n }", "private function beautifyEvents(array $events): array\n {\n foreach ($events as $event) {\n $event->dtstart = $this->formatDate($event->dtstart);\n $event->dtend = $this->formatDate($event->dtend);\n $event->dtstamp = $this->formatDate($event->dtstamp);\n $event->created = ($event->created !== null)? $this->formatDate($event->created) : null;\n $event->lastmodified = ($event->lastmodified !== null)? $this->formatDate($event->lastmodified) : null;\n $event->start = $event->dtstart;\n $event->end = $event->dtstart;\n }\n return $events;\n }", "private function _sort_by_added($a, $b)\n {\n if(strpos($a['date_scanned'], \":\") !== false) {\n $adate = DateTime::createFromFormat('j M Y H:i', $a['date_scanned']);\n } else {\n $adate = DateTime::createFromFormat('j M Y', $a['date_scanned']);\n }\n\n if(strpos($b['date_scanned'], \":\") !== false) {\n $bdate = DateTime::createFromFormat('j M Y H:i', $b['date_scanned']);\n } else {\n $bdate = DateTime::createFromFormat('j M Y', $b['date_scanned']);\n }\n\n if($this->sorting_order == \"az\")\n {\n return ($adate > $bdate);\n }\n\n return ($adate < $bdate);\n }", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "function sort ($block,$field,$dir = \"\") {\n\t\t$sort = [];\n\n\t\tforeach ($this->data as $event) {\n\t\t\t$sortval = $event->get($block,$field);\n\n\t\t\tif (is_array ($sortval))\n\t\t\t\t$sortval = $sortval[0];\n\n\t\t\t$sort[$sortval] = $event;\n\t\t}\n\n\t\t# choose sort direction\n\t\tif (strtoupper($dir) == \"DESC\")\n\t\t\tkrsort ($sort);\n\t\telse\n\t\t\tksort($sort);\n\n\t\t$this->data = $sort;\n\t}", "public function archive()\n\t{\n\t\t// --------------------------------------\n\t\t// Prep no_results to avoid conflicts\n\t\t// --------------------------------------\n\n\t\t$this->_prep_no_results();\n\n\t\t// --------------------------------------\n\t\t// Get the events\n\t\t// --------------------------------------\n\n\t\tif ( ! ($events = $this->_get_event_entries()))\n\t\t{\n\t\t\t$this->_log('No events found, returning no results');\n\t\t\treturn $this->EE->TMPL->no_results();\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Loop through events and add them to the months array\n\t\t// --------------------------------------\n\n\t\t$months = array();\n\n\t\tforeach ($events AS $event)\n\t\t{\n\t\t\t// Create Low Date objects from each date\n\t\t\t$start = new Low_date($event['start_date']);\n\t\t\t$end = new Low_date($event['end_date']);\n\n\t\t\t// Set both dates to the first of the month\n\t\t\t// and return the month url: YYYY-MM\n\t\t\t$start_month = $start->first_of_month()->month_url();\n\t\t\t$end_month = $end->first_of_month()->month_url();\n\n\t\t\t// If event starts and ends in the same month,\n\t\t\t// simply add it to the months array\n\t\t\tif ($start_month == $end_month)\n\t\t\t{\n\t\t\t\t$months[$start_month][] = $event['entry_id'];\n\t\t\t}\n\t\t\t// Or else add each spanning month to the months array\n\t\t\telse\n\t\t\t{\n\t\t\t\t// To do this, increase the start date by a month\n\t\t\t\t// until it exceeds the end month\n\t\t\t\twhile ($start->month_url() <= $end_month)\n\t\t\t\t{\n\t\t\t\t\t$months[$start->month_url()][] = $event['entry_id'];\n\t\t\t\t\t$start->add('month');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Sort the array by month\n\t\t// --------------------------------------\n\n\t\tif ($this->EE->TMPL->fetch_param('sort', 'asc') == 'asc')\n\t\t{\n\t\t\tksort($months);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tkrsort($months);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Create data array based on month\n\t\t// --------------------------------------\n\n\t\t$data = array();\n\n\t\tforeach ($months AS $month => $rows)\n\t\t{\n\t\t\t// Initiate new row for data\n\t\t\t$row = array(\n\t\t\t\t'month_url' => $month,\n\t\t\t\t'events_in_month' => count($rows)\n\t\t\t);\n\n\t\t\t// Create new date for this month\n\t\t\t$date = new Low_Date($month);\n\n\t\t\t// Add each possible format to this row\n\t\t\tforeach ($this->formats AS $fmt => $key)\n\t\t\t{\n\t\t\t\t$row[$key] = $date->ee_format($fmt);\n\t\t\t}\n\n\t\t\t// Then add the row to the data array\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\treturn $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $data);\n\n\t}", "public function get_timeline_events() {\r\n\t\t$contents[] = $this->get_content_posts();\r\n\t\t$contents[] = $this->get_content_tweets();\r\n\t\t$contents[] = $this->get_content_stories();\r\n\t\t\r\n\t\t$events = array();\r\n\t\t\r\n\t\t// Process each of the contents we have attempted to grab and combine them as events by year.\r\n\t\tforeach( $contents as $content ) {\r\n\t\t\tif( is_array ( $content ) ) {\r\n\t\t\t\tforeach ( $content as $date_group => $values ) {\r\n\t\t\t\t\tif( empty( $events[$date_group] ) || !isset( $events[$date_group] ) ) {\r\n\t\t\t\t\t\t$events[$date_group] = $values;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$events[$date_group] = array_merge( $events[$date_group], $values);\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\tforeach( $events as $year=>&$event ) {\r\n\t\t\tusort( $event, array( &$this, 'sort_events_by_date' ) );\r\n\t\t}\r\n\t\t\r\n\t\tuksort( &$events, array( &$this, 'sort_date_groups' ) );\r\n\r\n\t\treturn $events;\r\n\t}", "public function test_it_returns_trainings_sorted_by_date()\n {\n Exercice::factory()\n ->has(\n Training::factory()->count(2)->sequence(\n ['created_at' => now()->subDay(), 'value' => 2],\n ['created_at' => now(), 'value' => 3],\n ))->create([\n 'name' => 'Abdos',\n ]);\n\n Exercice::factory()\n ->has(\n Training::factory()->count(2)->sequence(\n ['created_at' => now()->subDay(), 'value' => 15],\n ['created_at' => now(), 'value' => 20],\n ))->create([\n 'name' => 'Pompes',\n ]);\n\n // When sorting them using the sort by date action\n $trainings = Training::with('exercice:id,name')\n ->betweenDates()\n ->get();\n\n $trainings = (new SortTrainingsByDate())->handle($trainings);\n\n // Then it should have the date as array keys\n $this->assertEquals(now()->format('Y-m-d'), $trainings->keys()[0]);\n $this->assertEquals(now()->subDay()->format('Y-m-d'), $trainings->keys()[1]);\n\n // and then each should have the exercise name as key\n foreach ($trainings as $training)\n {\n $this->assertEquals('abdos', $training->keys()[0]);\n $this->assertEquals('pompes', $training->keys()[1]);\n }\n }", "function obj_do_cx_events_list( $events ) {\n\tif (is_array($events) ) {\n echo '<div class=\"event-list-grid\">';\n foreach ($events as $event ) {\n obj_do_cx_event_item_output($event);\n }\n echo '</div>';\n }\n}", "function listEventTitle($e_id) {\n\t\t$e_id = mysql_real_escape_string($e_id);\n\t\t$this->eid = $e_id;\n\t\t$query = \"SELECT e_title, v.name, start_datetime, end_datetime \n\t\tFROM yam14.F_event e, yam14.F_venue v \n\t\tWHERE e.venue_id = v.v_id\n\t\tAND e_id = $this->eid;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\n\t\t\t$this->title = $row['e_title'];\n\t\t\t$this->venue = $row['name'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t\n\t\t\techo \"<div>\";\n\t\t\techo \"<h3>$this->title</h3>\";\n\t\t\techo \"<h4>$this->venue</h4>\";\n\t\t\techo \"<h4>From $this->startdate $this->starttime </h4><h4>To $this->enddate $this->endtime </h4>\";\n\t\t\techo \"<hr />\";\n\t\t\techo \"</div>\";\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t}", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "public function Sorting_DateCreate($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.date_create ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function getEvents($date = '') {\r\n //Include db configuration file\r\n include 'dbConfig.php';\r\n $eventListHTML = '';\r\n $date = $date ? $date : date(\"Y-m-d\");\r\n //Get events based on the current date\r\n $result = $db->query(\"SELECT title FROM floralbookings WHERE date = '\" . $date . \"' AND status = 1\");\r\n if ($result->num_rows > 0) {\r\n $eventListHTML = '<h2>Events on ' . date(\"l, d M Y\", strtotime($date)) . '</h2>';\r\n $eventListHTML .= '<ul>';\r\n while ($row = $result->fetch_assoc()) {\r\n $eventListHTML .= '<li>' . $row['title'] . '</li>';\r\n }\r\n $eventListHTML .= '</ul>';\r\n }\r\n echo $eventListHTML;\r\n}", "private static function sortByAsc($a, $b)\n {\n return strcmp($a->comment_date, $b->comment_date);\n }", "private function getEventsOnADate($date)\n {\n # Load EventLinks\n $eventlinks = $this->eventlinks;\n\n # Convert Date to currently displayed month\n $dayDate = $this->getDayDate($date);\n\n # get all events on a day\n $events = array_first($eventlinks, function ($eventDate, $url) use ($dayDate) {\n return $eventDate == $dayDate;\n }, false);\n\n return $events ;\n }", "function date_compare($a, $b) {\n //var_dump($a);\n $t1 = strtotime($a);\n $t2 = strtotime($b);\n // The negative in front the result sorts by the most recent entry\n return -($t1 - $t2);\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "public function setEvents($events, $format = false)\n {\n $this->_events = $events;\n if ($format !== false)\n $this->_format = $format;\n ksort($this->_events);\n }", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "public function time_sort($timeslots) \n {\n usort($timeslots, function ($t1,$t2) \n {\n if ($t1->get_start()==$t2->get_start()) \n return 0;\n \n return ($t1->get_start()<$t1->get_start())?-1:1;\n });\n }", "function getFilterDate($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('egt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date asc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "public function getSorting();", "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}", "protected function sortDataArray() {}", "public function buildDayList($date){\n\t\t$events = $this->getDayEvents($date);\n\t\t$count = 0;\n\t\t\n\t\tob_start();\n\t\tif(count($events) > 0){\n\t\t\tforeach($events as $key => $event){\t\t\t\n\t\t\t\t$recurringDays = $event->getRecurringDays();\n\t\t\t\t\t\t\n\t\t\t\t$dayOfWeek = date_create($date);\n\t\t\t\t$dayOfWeek = strtolower(date_format($dayOfWeek, \"l\"));\n\t\t\t\t//echo $dayOfWeek;\n\n\t\t\t\tif(count($recurringDays)){\n\t\t\t\t\tif(in_array($dayOfWeek, $recurringDays)){\n\t\t\t\t\t\techo '<h4>Events for ' . $this->getDate($date) . '</h4>';\n\t\t\t\t\t\techo $event->toHtml('listing');\n\t\t\t\t\t\techo '<hr />';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo '<h4>Events for ' . $this->getDate($date) . '</h4>';\n\t\t\t\t\techo $event->toHtml('listing');\n\t\t\t\t\techo '<hr />';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\treturn ob_get_clean();\n\t}", "function cmpUIDs($a, $b)\n\t\t{\n\t\t\tif ($a['uid'] == $b['uid']) {\n\t\t\t\tif ($a['startdate'] == $b['startdate'])\n\t\t\t\t\treturn 0;\n\t\t\t\telse if ($a['startdate'] < $b['startdate'])\n\t\t\t\t\treturn -1;\n\t\t\t\telse\n\t\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn ($a['uid'] < $b['uid']) ? -1 : 1;\n\t\t}", "public function sortDaysByDateAndTime(array $days)\n {\n if (count($days)) {\n $eventDate = array();\n $eventTime = array();\n foreach ($days as $key => $day) {\n $eventDate[$key] = $day['eventDate']; // integer\n $eventTime[$key] = $day['EventTime']; // string\n }\n array_multisort($eventDate, SORT_ASC, SORT_NUMERIC, $eventTime, SORT_ASC, SORT_STRING, $days);\n }\n\n return $days;\n }", "public function get_event_list()\n\t{\n\treturn $this->cal['VEVENT'];\n\t}", "function publisher_getOrderBy($sort)\r\n{\r\n if ($sort == \"datesub\") {\r\n return \"DESC\";\r\n } else if ($sort == \"counter\") {\r\n return \"DESC\";\r\n } else if ($sort == \"weight\") {\r\n return \"ASC\";\r\n }\r\n}", "public static function sortIndex($a,$b) {\n\t\t$a_time = strtotime($a['date']);\n\t\t$b_time = strtotime($b['date']);\n\t\tif ($a_time == $b_time) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn ($a_time < $b_time) ? 1 : -1;\n\t}", "public function findAllDates()\n {\n $workflowList = $this->entityManager\n ->getRepository('SiowebDummyBundle:Test')\n ->findBy(array(), array('date' => 'DESC'));\n #$workflowList = $this->entityManager->getRepository('SiowebDummyBundle:Test')->findAll();\n\n return $workflowList;\n }", "function formatEvent($time, $date, $firstInList=false)\n{\n\t$str = \"\";\n\t$event = $time->get(\"-event:time\");\n\t$organisers = array();\n\tgetOrganisers($organisers, $event);\n\t$places = array();\n\tgetPlaces($places, $event);\n\n\t$sid = sid($time);\n\n\tglobal $eventcounter;\n\tglobal $eventdate;\n\t$eventcounter++;\n\tif($eventcounter <= 10 || $eventdate == $date) { $featured = \"featured \"; } else { $featured = \"\"; }\n\tif($eventcounter <= 10) { $eventdate = $date; }\n\t$starts = \"\";\n\tif( $time->has( \"tl:start\" ) && substr($time->getString(\"tl:start\"), 0, 10) == $date )\n\t{\n\t\t$starts = \" <span class='date'>(\".formatTime($time->getString( \"tl:start\" ), $date).\")</span>\";\n\t}\n\t$str .= \"<div class='event $featured\".($firstInList?\"first-event \":\"\").implode(\" \", array_keys($organisers)).\" \".implode(\" \", array_keys($places)).\"' itemscope itemtype='http://data-vocabulary.org/Event'>\\n\";\n\t$str .= \"\\t<h3 itemprop='summary'><img class='small-chevron' src='img/chevron_small_right.png' alt='' />\".htmlspecialchars($event->label()).\"$starts</h3><div class='event-links'><a href='#' class='expand-link'>Read more</a>\";\n\tif( $event->has( \"foaf:homepage\" ) )\n\t{\n\t\t$str .= \" | <a href='\".htmlspecialchars($event->get( \"foaf:homepage\" )).\"' itemprop='url' target='_blank'>View event</a>\";\n\t}\n\t$str .= \"</div>\\n\";\n\t$str .= \"\\t<div class='event-more' id='\".$sid.\"'>\\n\";\n\t$str .= \"\\t\\t<div class='event-info'>\\n\";\n\tif( $time->has( \"tl:start\" ) && substr($time->getString(\"tl:start\"), 0, 10) == $date )\n\t{\n\t\t$str .= \"\\t\\t\\t<div>\";\n\t\t$str .= formatTime($time->getString( \"tl:start\" ), $date);\n\t\tif( $time->has( \"tl:end\" ) )\n\t\t{\n\t\t\t$str .= \" - \".formatTime($time->getString( \"tl:end\" ), $date);\n\t\t}\n\t\t$str .= \"</div>\\n\";\n\t\t$str .= \"<span style='display:none' itemprop='startDate'>\".$time->getString( \"tl:start\" ).\"</span>\";\n\t\tif( $time->has( \"tl:end\" ) )\n\t\t{\n\t\t\t$str .= \"<span style='display:none' itemprop='endDate'>\".$time->getString( \"tl:end\" ).\"</span>\";\n\t\t}\n\t}\n\t$str .= getEventPlaces($event, \"Place\");\n\t$str .= getEventPlaces($event, \"Additional Place Info\");\n\t$organisers = getEventAgents($event, \"Organiser\");\n\tif(count($organisers) > 0)\n\t{\n\t\tsort($organisers);\n\t\t$str .= \"\\t\\t\\t<div class='organisers'>Organised by: \";\n\t\tforeach($organisers as $organiser)\n\t\t{\n\t\t\t$str .= $organiser.\" \";\n\t\t}\n\t\t$str .= \"</div>\\n\";\n\t}\n\t$str .= \"\\t\\t</div>\\n\";\n\t//$str .= \"\\t<div style='clear:left'></div>\\n\";\n\t$speakers = getEventAgents($event, \"Speaker\");\n\tif(count($speakers) > 0)\n\t{\n\t\t$str .= \"\\t\\t<div class='speakers'>Speaker\".((count($speakers) > 1) ? \"s\" : \"\").\": \";\n\t\tforeach($speakers as $speaker)\n\t\t{\n\t\t\t$str .= $speaker.\" \";\n\t\t}\n\t\t$str .= \"</div>\\n\";\n\t}\n\tif( $event->has( \"dct:description\" ) )\n\t{\n\t\t$str .= \"\\t\\t<div class='description' itemprop='description'>\".$event->getString( \"dct:description\" ).\"</div>\\n\";\n\t}\n\t$str .= \"\\t\\t<div style='clear:both'></div>\\n\";\n\t$str .= \"\\t</div>\\n\";\n\t$str .= \"</div>\\n\";\n\treturn $str;\n}" ]
[ "0.74938416", "0.65839666", "0.6485", "0.6463082", "0.63868636", "0.6334563", "0.6244892", "0.6176524", "0.6129585", "0.60245866", "0.60062766", "0.6005522", "0.5977371", "0.5972849", "0.5971844", "0.59616023", "0.5933118", "0.59314245", "0.59272987", "0.5795483", "0.5784241", "0.5784241", "0.5766477", "0.5679141", "0.5659537", "0.5657179", "0.5646759", "0.56326336", "0.56293774", "0.5627386", "0.56249404", "0.5598749", "0.5596622", "0.5583604", "0.5581983", "0.55622816", "0.55436", "0.553978", "0.5531959", "0.55301386", "0.55276036", "0.5519433", "0.5501687", "0.5500175", "0.5474605", "0.54445136", "0.54417163", "0.54399204", "0.5434579", "0.54334444", "0.54276526", "0.5415815", "0.54131025", "0.53981185", "0.53954", "0.5380438", "0.53607404", "0.5339649", "0.5338637", "0.5334655", "0.5320833", "0.53142786", "0.53059775", "0.52959293", "0.5261456", "0.5261263", "0.5256696", "0.52565205", "0.52538055", "0.5253529", "0.5251934", "0.5251412", "0.52482486", "0.5247768", "0.5247176", "0.5244642", "0.5241597", "0.5237982", "0.52366596", "0.5235475", "0.523159", "0.5214386", "0.5197168", "0.5194301", "0.51880616", "0.51820207", "0.517539", "0.51670116", "0.5162335", "0.51623327", "0.5159417", "0.51344913", "0.5133451", "0.5131482", "0.5131051", "0.5126211", "0.51035017", "0.5102331", "0.5091453", "0.50890917" ]
0.81565565
0
/ Make sure the caller has rate quota left and use it if needed. This module must be called after the user data has been assigned into the endpoint (ie. after APIAuthModule).
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_user_over_quota()\n {\n }", "public function testRateLimit()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "protected function get_email_rate_limit()\n {\n }", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "private function isRateLimitReached()\n {\n if (!$this->getRateLimit()) {\n throw new InstagramThrottleException('400 Bad Request : You have reached Instagram API Rate Limit', 400);\n }\n }", "function multisite_over_quota_message()\n {\n }", "public function clear_rate_limit()\n {\n }", "public function rateUser()\n {\n\t\t$userSession = \\Utility\\Singleton::getInstance(\"\\Control\\Session\");\n\t\t$userLog = $userSession->get('username');\n\t\t$user = new \\Foundation\\User();\n\t\t$view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t\n\t\t$hasAlreadyRated=$this->hasVoted($username, $userLog);\n\t\t$vote=$view->get('vote');\n\t\t\n if(!$hasAlreadyRated)\n {\t\t\t\n $votation=$user->usersVotation($username, $userLog, $vote);\n $reliabilityVotes = $user->getNumberOfReliabilityVotes($username);\n \n $user2=$user->getByUsername($username);\n $user2->updateReliabilityScore($reliabilityVotes,$vote);\n \n $isUpdated=$user->updateReliabilityScore($username,$user2->getReliability());\n\n return $votation; /** @todo add a return for the else statement*/\n\t\t}\n // else return something\n\t}", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }", "private function validate_user_usage_limit( $user_id = null ) {\n\t\tif ( ! $user_id ) {\n\t\t\t$user_id = get_current_user_id();\n\t\t}\n\t\tif ( $this->usage_limit_per_user > 0 && is_user_logged_in() && $this->id ) {\n\t\t\tglobal $wpdb;\n\t\t\t$usage_count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT( meta_id ) FROM {$wpdb->postmeta} WHERE post_id = %d AND meta_key = '_used_by' AND meta_value = %d;\", $this->id, $user_id ) );\n\n\t\t\tif ( $usage_count >= $this->usage_limit_per_user ) {\n\t\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t\t}\n\t\t}\n\t}", "public function hasQuota(){\n return $this->_has(12);\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "public static function rateLimit(): self\n {\n return self::getInstance('RATE_LIMIT');\n }", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "function _buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$quota=post_param_integer('quota');\n\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t// Stop if we can't afford this much quota\n\t\tif ((($quota*$price)>$pointsleft) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('CANT_AFFORD'));\n\t\t}\n\n\t\t// Mail off the order form\n\t\t$quota_url=get_option('quota_url');\n\t\t$_price=$quota*$price;\n\t\t$encoded_reason=do_lang('TITLE_QUOTA');\n\t\t$message_raw=do_template('POINTSTORE_QUOTA_MAIL',array('_GUID'=>'5a4e0bb5e53e6ccf8e57581c377557f4','ENCODED_REASON'=>$encoded_reason,'QUOTA'=>integer_format($quota),'EMAIL'=>$prefix.$suffix,'QUOTA_URL'=>$quota_url,'PRICE'=>integer_format($_price)));\n\t\trequire_code('notifications');\n\t\tdispatch_notification('pointstore_request_quota','quota_'.uniqid('',true),do_lang('MAIL_REQUEST_QUOTA',NULL,NULL,NULL,get_site_default_lang()),$message_raw->evaluate(get_site_default_lang(),false),NULL,NULL,3,true);\n\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_QUOTA_DONE'));\n\t}", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "function buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$topamount=intval(get_option('max_quota'));\n\n\t\tif ($price==0) $topamount=$pointsleft; else $topamount=intval(round($pointsleft/$price));\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// Screen\n\t\t$submit_name=do_lang_tempcode('TITLE_QUOTA');\n\t\t$post_url=build_url(array('page'=>'_SELF','type'=>'_buyquota','id'=>'pop3'),'_SELF');\n\t\t$text=do_template('POINTSTORE_QUOTA',array('_GUID'=>'1282fae968b4919bcd0ba1e3ca169fe8','POINTS_LEFT'=>integer_format($pointsleft),'PRICE'=>integer_format($price),'TOP_AMOUNT'=>integer_format($topamount),'EMAIL'=>$prefix.$suffix));\n\t\trequire_code('form_templates');\n\t\t$fields=form_input_integer(do_lang_tempcode('QUOTA'),do_lang_tempcode('QUOTA_DESCRIPTION'),'quota',100,true);\n\t\treturn do_template('FORM_SCREEN',array('_GUID'=>'1c82c713beaa03d1e3045e50295c722c','HIDDEN'=>'','URL'=>$post_url,'TITLE'=>$title,'FIELDS'=>$fields,'TEXT'=>$text,'SUBMIT_NAME'=>$submit_name));\n\t}", "public function getQuota()\n {\n return $this->quota;\n }", "public static function reInstateQuotaExceeded()\n {\n //$noticeControl = Notices::getInstance();\n //$notice = $noticeControl->getNoticeByID(self::MSG_QUOTA_REACHED);\n Notices::removeNoticeByID(self::MSG_QUOTA_REACHED);\n //$notice->unDismiss();\n //$noticeControl->update();\n }", "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "public function rateUser(Request $request)\n {\n\n //find ride request \n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::TRIP_ENDED, Ride::COMPLETED])\n ->first();\n\n\n if(!$rideRequest || !$rideRequest->user) {\n return $this->api->json(false, 'INVALID_REQUEST', 'Invalid Request, Try again.');\n }\n\n //validate rating number\n if(!$request->has('rating') || !in_array($request->rating, Ride::RATINGS)) {\n return $this->api->json(false, 'INVALID_RATING', 'You must have give rating within '.implode(',', Ride::RATINGS));\n }\n\n\n /** driver cannot give rating until user payment complete */\n if($rideRequest->payment_status == Ride::NOT_PAID) {\n return $this->api->json(false, 'USER_NOT_PAID', 'Ask user to pay before give rating');\n }\n\n\n //updatig both driver and ride request table\n try {\n\n \\DB::beginTransaction();\n\n //saving ride request rating\n $rideRequest->user_rating = $request->rating;\n $rideRequest->save(); \n\n /** push user rating calculation to job */\n ProcessUserRating::dispatch($rideRequest->user_id);\n\n\n //making availble driver\n $driver = $rideRequest->driver;\n $driver->is_available = 1;\n $driver->save();\n\n\n\n \\DB::commit();\n\n } catch(\\Exception $e) {\n \\DB::rollback();\n \\Log::info('USER_RATING');\n \\Log::info($e->getMessage());\n return $this->api->unknownErrResponse();\n }\n \n\n /** send user that you made the payment message */\n $user = $rideRequest->user;\n $currencySymbol = $this->setting->get('currency_symbol');\n $websiteName = $this->setting->get('website_name');\n $invoice = $rideRequest->invoice;\n if($rideRequest->payment_mode == Ride::CASH) {\n $user->sendSms(\"Thank you!! We hope you enjoyed {$websiteName} service. See you next time.\");\n } \n // else {\n // $user->sendSms(\"We hope you enjoyed {$websiteName} service. Please make the payment of {$currencySymbol}\".$invoice->total);\n // }\n\n\n return $this->api->json(true, 'RATED', 'User rated successfully.');\n\n }", "public function getQuota()\n {\n return $this->_quota;\n }", "function quota_getUploadQuota($quota) {\n\tglobal $_zp_current_admin_obj;\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {\n\t\t$quota = -1;\n\t} else {\n\t\t$quota = $_zp_current_admin_obj->getQuota();\n\t\tif ($quota == NULL) $quota = getOption('quota_default');\n\t}\n\treturn $quota;\n}", "function ratelimit(array $data);", "protected function handleRateLimit(): void\n {\n if (!$this->isRateLimitEnabled() || !$this->requestTimestamp) {\n return;\n }\n\n /** @var DateTime $limitReset */\n $limitReset = $this->getApiCallLimits('reset');\n if (!$limitReset) {\n return;\n }\n\n $limitLeft = $this->getApiCallLimits('left') ?: 1;\n $secondsLeft = $limitReset->getTimestamp() - time();\n $rateLimitCycle = round(($secondsLeft / $limitLeft) * 1000);\n\n // Calculate in milliseconds the duration the API call took\n $duration = round(microtime(true) - $this->requestTimestamp, 3) * 1000;\n $waitTime = $rateLimitCycle - $duration;\n\n if ($waitTime > 0) {\n // Do the sleep for X microseconds (convert from milliseconds)\n usleep($waitTime * 1000);\n }\n }", "private function _checkRateLimit()\n {\n if (empty(self::$_responseHeaders))\n {\n return;\n }\n\n // Default the $limit and $remaining values if not set in the last response header.\n /** @var int $limit */\n $limit = isset(self::$_responseHeaders[self::RATE_LIMIT])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT]\n : self::DEFAULT_RATE_LIMIT;\n\n /** @var int $remaining */\n $remaining = isset(self::$_responseHeaders[self::RATE_LIMIT_REMAINING])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT_REMAINING]\n : self::DEFAULT_RATE_LIMIT;\n\n // If no API calls have been made, no need to delay.\n if ($limit == $remaining)\n {\n return;\n }\n\n // If we are below 5% remaining, sleep for 0.50 seconds.\n if ($remaining / $limit < 0.05)\n {\n usleep(500000);\n return;\n }\n\n // If we are below 10% remaining, sleep for 0.25 seconds.\n if ($remaining / $limit < 0.1)\n {\n usleep(250000);\n }\n }", "public function beforeSave(){\n // Clean out old requests:\n Yii::app()->db->createCommand('DELETE FROM `'.$this->tableName().'`'\n . ' WHERE requested < '.(time()-self::EXPIRE_S))\n ->execute();\n $user = $this->resolveUser();\n if($user instanceof User){\n $this->userId = $user->id;\n }\n return !$this->limitReached && parent::beforeSave();\n }", "protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }", "public function setQuota(): int\n {\n $this->quota = (int) floor(\n ($this->validBallots /\n ($this->election->getWinnersCount() + 1)\n ) // p. 47 (1)\n + 1); // p. 47 (2)\n\n $this->logger->info(sprintf('Quota set at %d based on %d winners and %d valid ballots', $this->quota, $this->election->getWinnersCount(), $this->validBallots));\n\n return $this->quota;\n }", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function setRateLimit($rateLimit){\n if($rateLimit > self::API_RATE_LIMIT) {\n throw new Exception('Specified rateLimit exceeds API rate limit of '.self::API_RATE_LIMIT.' requests per minute.');\n }\n \n\t\t$this->rateLimit = (int)$rateLimit;\n\t}", "public function unRate()\n {\n\n }", "function get_quota() {\n\n\t\t$response = $this->curl_get(skydrive_base_url.\"me/skydrive/quota?access_token=\".$this->access_token);\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\t\t\t\n\n\t\t\treturn $response;\n\n\t\t}\n\n\t}", "public function setQuota($value) {\n $this->_quota = $value;\n }", "public function getXsiTypeName() {\n return \"RateExceededError\";\n }", "public function getQuota(): int\n {\n return $this->quota;\n }", "public function getMyRateLimitInfo () {\n var_dump($this->talkToTwitter('application/rate_limit_status', '?'));\n exit();\n }", "public function run(APIEndpoint $endpoint) {\n\t\tif (!$endpoint->requires_quota()) { return; }\n\n\t\t$quota = $endpoint->get_caller()->get_quota();\n\t\tif ($quota->has_state('api_t_start')) {\n\t\t\t$t = $quota->get_state('api_t_start');\n\t\t\tif (time() - $t >= gtlim('API_RATE_T')) {\n\t\t\t\t// Reset rate quota and time after the cutoff.\n\t\t\t\t$quota->set_state('api_t_start', time());\n\t\t\t\t$quota->set_used('api_rate', 0);\n\t\t\t}\n\t\t} else {\n\t\t\t// Start counting time.\n\t\t\t$quota->set_state('api_t_start', time());\n\t\t}\n\n\t\tif (!$quota->has_quota('api_rate')) {\n\t\t\tthrow new APIException(\n\t\t\t\tAPI_E_RATE,\n\t\t\t\t\"API rate limited.\"\n\t\t\t);\n\t\t} else {\n\t\t\t$quota->use_quota('api_rate');\n\t\t}\n\t\t$endpoint->get_caller()->write();\n\t}", "public function testGetRateLimits()\n {\n }", "function upload_is_user_over_quota($display_message = \\true)\n {\n }", "function getUserBadges($userObj){\n\t if (isset($_SESSION[\"TOKEN\"])) {\n\n\t }\n }", "function quotas() {\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * Display SQL databases quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSqldata will be available in the view.\n\t\t */\n\t\t$this->set('quotasSqldata', $this->Quota->displayTotal('Sqldata'));\n\t\t\n\t\t/**\n\t\t * Display FTP users quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasFtpuser will be available in the view.\n\t\t */\n\t\t$this->set('quotasFtpuser', $this->Quota->displayTotal('Ftpuser'));\n\t\t\n\t\t/**\n\t\t * Display SQL users quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSqluser will be available in the view.\n\t\t */\n\t\t$this->set('quotasSqluser', $this->Quota->displayTotal('Sqluser'));\n\t\t\n\t\t/**\n\t\t * Display mailboxes quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasMailbox will be available in the view.\n\t\t */\n\t\t$this->set('quotasMailbox', $this->Quota->displayTotal('Mailbox'));\n\t\t\n\t\t/**\n\t\t * Display aliases quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasAlias will be available in the view.\n\t\t */\n\t\t$this->set('quotasAlias', $this->Quota->displayTotal('Alias'));\n\t\t\n\t\t/**\n\t\t * Display domains quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasDomain will be available in the view.\n\t\t */\n\t\t$this->set('quotasDomain', $this->Quota->displayTotal('Domain'));\n\t\t\n\t\t/**\n\t\t * Display subdomains quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSubdomain will be available in the view.\n\t\t */\n\t\t$this->set('quotasSubdomain', $this->Quota->displayTotal('Subdomain'));\n\t\t\n\t\t/**\n\t\t * Display cronjobs quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasCron will be available in the view.\n\t\t */\n\t\t$this->set('quotasCron', $this->Quota->displayTotal('Cron'));\n\n\t\t/**\n\t\t * Display disk quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasDisk will be available in the view.\n\t\t */\n\t\t$this->set('quotasDisk', $this->Quota->displayDisk('Quotasprogress'));\n\n\t\t/**\n\t\t * Select all quotas about the offer who belongs to the user.\n\t\t * @var array\n\t\t */\n\t\t$conditionQuota = array('conditions' => array('Quota.offer_id' => $this->Auth->user('offer_id')));\n\n\t\t/**\n\t\t * Display the total of quotas.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasTotal will be available in the view.\n\t\t */\n\t\t$this->set('quotasTotal', $this->User->Offer->Quota->find('all', $conditionQuota));\n\n\t}", "public function getQuota(){\n $option = Paging::normalizeOption($_GET);\n $result = QuotaTable::get($option);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function rateLimit($applicationId, $userId)\n\t{\n\t\t// load limit data, creating initial record if doesnt exist\n\t\tif (!$data = $this->storage->getRateLimitData($applicationId, $userId))\n\t\t{\n\t\t\t$data = $this->createRateLimitData($applicationId, $userId);\n\t\t}\n\n\t\t// check if we can reset short expiration\n\t\tif (time() > with(new Date($data->expires_short))->toUnix())\n\t\t{\n\t\t\t$newShortDate = $this->getNewExpiresDateString('short');\n\t\t\t$this->storage->resetShort($data->id, 0, $newShortDate);\n\t\t}\n\n\t\t// check if we can reset long expiration\n\t\tif (time() > with(new Date($data->expires_long))->toUnix())\n\t\t{\n\t\t\t$newLongDate = $this->getNewExpiresDateString('long');\n\t\t\t$this->storage->resetLong($data->id, 0, $newLongDate);\n\t\t}\n\n\t\t// increment data then refetch\n\t\t$this->storage->incrementRateLimitData($data->id);\n\n\t\t// refetch record after incrementing\n\t\t$data = $this->storage->getRateLimitData($applicationId, $userId);\n\n\t\t// check to see if were over short or long limits\n\t\t$data->exceeded_short = false;\n\t\t$data->exceeded_long = false;\n\t\tif ($data->count_short >= $data->limit_short)\n\t\t{\n\t\t\t$data->exceeded_short = true;\n\t\t}\n\t\tif ($data->count_long >= $data->limit_long)\n\t\t{\n\t\t\t$data->exceeded_long = true;\n\t\t}\n\n\t\t// return data\n\t\treturn $data;\n\t}", "public function getRefreshRate() { return 0; }", "public function getRateLimit($context);", "public function getQuota()\r\n\t{\r\n\t\tif($this->accessToken === null) {\r\n\t\t\tthrow new SkydriveException_InvalidToken();\r\n\t\t}\r\n\t\t$url = self::baseUrl . \"me/skydrive/quota?access_token=\" . $this->accessToken;\r\n\t\t$info = json_decode($this->fetch($url), true);\r\n\t\t$total = (float)$info[\"quota\"];\r\n\t\t$available = (float)$info[\"available\"];\r\n\t\t$used = $total - $available;\r\n\t\t$quota = array(\"total\"=>$total, \"used\"=>$used);\r\n\t\treturn $quota;\r\n\t}", "private function checkApiRequestsLimit()\n {\n $tempTime = time() - $this->startTime;\n if($this->apiRequestsCount >= $this->apiRequestsLimit && $tempTime < $this->apiTimeLimit) {\n usleep(($this->apiTimeLimit - $tempTime)*1000000);\n $this->apiRequestsCount = 1;\n $this->startTime = time();\n } else {\n $this->apiRequestsCount++;\n }\n }", "public function getRateLimit()\n {\n return $this->xRateLimitRemaining;\n }", "private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60);\n });\n }", "public function rateBuyer()\n\t{\n $username = Input::get('username');\n $posting_id = Input::get('posting_id');\n $loggedin_user = Session::get('user');\n\n $posting_info = App::make('User')->getSellerAndFlags($posting_id);\n if(!count($posting_info))\n {\n return Redirect::to('/outputMessage')->with('message', 'Sorry, but that user does not exist.');\n }\n\n //if logged in user is seller and seller_has_rated flag is set, don't rate again!\n //if logged in user isn't seller and buyer_has_rated flag is set, also don't rate\n $seller_or_buyer = 'buyer';\n\n if ($loggedin_user == $posting_info[0]->username) {\n $seller_or_buyer = 'seller';\n }\n\n if((($seller_or_buyer == 'seller') && ($posting_info[0]->seller_has_rated == '1')) ||\n (($seller_or_buyer == 'buyer') && ($posting_info[0]->buyer_has_rated == '1')) ) {\n return Redirect::to('/outputMessage')->with('message', 'You have already rated this transaction!');\n }\n\n if( $posting_info[0]->hide_post == '0') {\n return Redirect::to('/outputMessage')->with('message', 'This transaction must be marked as complete before rating!');\n }\n\n\n if(Input::has('like')){\n App::make('User')->thumbsUp($username, $posting_id, $seller_or_buyer);\n return Redirect::to('/outputMessage')->with('message', 'Thank you for providing feedback. You liked '.$username.'.');\n }\n else if(Input::has('dislike')){\n App::make('User')->thumbsDown($username, $posting_id, $seller_or_buyer);\n return Redirect::to('/outputMessage')->with('message', 'Thank you for providing feedback. You disliked '.$username.'.');\n }\n return Redirect::to('/outputMessage')->with('message', 'Submitted');\n\t}", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function get_limits()\n\t{\n\t\t$profile_start = microtime(true);\n\n\t\t$limitsData = array(\n\t\t\t\t\t'call_limit' =>\tCALL_LIMIT,\n\t\t\t\t\t'duration_limit' =>\tCALL_DURATION_LIMIT,\n\t\t\t\t\t'listing_limit' =>\tLISTING_LIMIT\n\t\t\t\t\t);\n\n\t\t$this->input->do_put($this->config->base_url.\"/api/limit\",[]);\n\n\t\tif(!empty($limitsData))\n\t\t\t$this->display->success($limitsData,'limits');\n\t\telse\n\t\t\t$this->display->error(1502);\n\n\t\t$profile_start = profiler($profile_start,__CLASS__,__FUNCTION__,'openapi');\n\t}", "protected function recordTotalRequest($user) {\n\t\tif($this->totalLimit) {\n\t\t\t$key = $this->getKey($user, $this->totalLimit->getIntervalKey());\n\t\t\t$this->_recordRequest($key, $this->totalLimit->getExpiration());\n\t\t}\n\t}", "public function hasQuotaLock(){\n return $this->_has(11);\n }", "private function validate_usage_limit() {\n\t\tif ( $this->usage_limit > 0 && $this->usage_count >= $this->usage_limit ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t}\n\t}", "protected function resetRateLimit(UserInterface $user, $field)\n {\n $this->login->resetRateLimit($user, $field);\n }", "function quota_getCurrentUse($userobj) {\n\tglobal $_zp_current_admin_obj;\n\tif (is_null($userobj)) {\n\t\t$userobj = $_zp_current_admin_obj;\n\t}\n\t$sql = 'SELECT sum(`filesize`) FROM '.prefix('images').' WHERE `owner`=\"'.$userobj->getUser().'\"';\n\t$result = query_single_row($sql);\n\treturn array_shift($result)/1024;\n}", "public function rate()\n {\n\n }", "function quota_checkQuota($error, $image) {\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {\n\t\treturn UPLOAD_ERR_OK;\n\t}\n\tif (getSuffix($image) == 'zip') {\n\t\treturn UPLOAD_ERR_EXTENSION;\n\t}\n\t$quota = quota_getUploadQuota(0);\n\t$size = round(filesize($image)/1024);\n\tif ($quota > 0) {\n\t\tif (quota_getCurrentUse(NULL) + $size > $quota) {\n\t\t\t$error = UPLOAD_ERR_QUOTA;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn $error;\n}", "function get_credit_limit() {\n cache_randys_credit_values();\n $woo_cust_id = get_current_user_id();\n return get_transient( '_randys_credit_limit_' . $woo_cust_id );\n}", "protected function rateLimitingDisabled()\n {\n return $this->config['limit'] == 0;\n }", "public function isRateLimitEnabled(): bool\n {\n return $this->rateLimitEnabled === true;\n }", "public function use_quota(string $key, int $amount = 1): void {\n\t\tif (!$this->has_quota($key, $amount)) {\n\t\t\tthrow new QuotaException(\"Not enough quota left for $key.\");\n\t\t}\n\t\t$this->used[$key] += $amount;\n\t}", "function __construct(){\nparent::__construct();\n // Configure limits on our controller methods\n // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php\n $this->methods['users_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['users_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['users_delete']['limit'] = 50; // 50 requests per hour per user/key\n $this->load->model('M_main', 'M_main');\n}", "public function isLimitExceeded();", "public function defaultRefPoints()\n {\n \t//If User Signed Up.\n \t//Donate the 10 ref points to them for nearest shop.\n\n }", "public function setRateLimitRemaining($rateLimitRemaining)\n {\n $this->rateLimitRemaining = $rateLimitRemaining;\n }", "private function setRateLimiterKey()\n {\n $this->rateLimiterKey = sha1($this->formRequestClass . request()->ip());\n }", "private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}", "public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\n }", "function check_quota ($quota, $domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['maxquota'] >= 0)\n {\n if ($quota > $limit['maxquota'])\n {\n return false;\n }\n }\n return true;\n}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "protected function limiter(): RateLimiter\n {\n return app(RateLimiter::class);\n }", "public function initUserRates()\n\t{\n\t\t$this->collUserRates = array();\n\t}", "function quota_save_admin($updated, $userobj, $i, $alter) {\n\tif (isset($_POST[$i.'quota']) && $alter) {\n\t\t$oldquota = $userobj->getQuota();\n\t\t$userobj->setQuota(sanitize_numeric($_POST[$i.'quota']));\n\t\t$updated = $oldquota == $userobj->getQuota();\n\t}\n\treturn $updated;\n}", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "public function allowAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') )\n\t\t{\tif( $this->db->allowRefund($this->_getParam('user')) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the number for the past term\n\t\t$term = (date('Y') - 1900) * 10 + floor((date('m') - 1) / 4) * 4 + 1;\n\t\tif( $term % 10 == 1 )\n\t\t{\t$term -= 2;\n\t\t}else\n\t\t{\t$term -= 4;\n\t\t}\n\n\t\t// Add list of people who already have been enabled\n\t\t$this->view->user_allowed = implode( \", \", $this->db->getRefunds('REGULAR', $term));\n\n\t\t// Add list of users who got their refunds last term\n\t\t$this->view->user_options = $this->db->getRefunds('RECEIVED', $term);\n\t}", "private function userUnblock()\n\t{\n\t\t// Make sure the payment is complete\n\t\tif($this->state != 'C') return;\n\t\t\n\t\t// Make sure the subscription is enabled\n\t\tif(!$this->enabled) return;\n\t\t\n\t\t// Paid and enabled subscription; enable the user if he's not already enabled\n\t\t$user = JFactory::getUser($this->user_id);\n\t\tif($user->block) {\n\t\t\t// Check the confirmfree component parameter and subscription level's price\n\t\t\t// If it's a free subscription do not activate the user.\n\t\t\tif(!class_exists('AkeebasubsHelperCparams')) {\n\t\t\t\trequire_once JPATH_ADMINISTRATOR.'/components/com_akeebasubs/helpers/cparams.php';\n\t\t\t}\n\t\t\t$confirmfree = AkeebasubsHelperCparams::getParam('confirmfree', 0);\n\t\t\tif($confirmfree) {\n\t\t\t\t$level = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')\n\t\t\t\t\t->getItem($this->akeebasubs_level_id);\n\t\t\t\tif($level->price < 0.01) {\n\t\t\t\t\t// Do not activate free subscription\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$updates = array(\n\t\t\t\t'block'\t\t\t=> 0,\n\t\t\t\t'activation'\t=> ''\n\t\t\t);\n\t\t\t$user->bind($updates);\n\t\t\t$user->save($updates);\n\t\t}\n\t}", "public function free_quota(string $key, int $amount = 1): void {\n\t\tif ($this->used[$key] > 0) {\n\t\t\t$this->used[$key] -= $amount;\n\t\t}\n\t}", "public function getUsagelimit()\n {\n return $this->usagelimit;\n }", "protected function exceededRateLimit()\n {\n return $this->cache->get($this->config['keys']['requests']) > $this->config['limit'];\n }", "public function setQuota($value)\n {\n $this->_quota = $value;\n return $this;\n }", "public function checkSendQuota()\n {\n try {\n $SesClient = new SesClient([\n 'profile' => $this->profile,\n 'version' => $this->version,\n 'region' => $this->region\n ]);\n $result = $SesClient->getSendQuota([]);\n $send_limit = $result[\"Max24HourSend\"];\n $sent = $result[\"SentLast24Hours\"];\n $available = $send_limit - $sent;\n //print(\"<p>You can send \" . $available . \" more messages in the next 24 hours.</p>\");\n //var_dump($result);\n } catch (AwsException $e) {\n throw new AwsException ($e->getMessage());\n }\n\n return $available;\n }", "public function getRateLimitRemaining()\n {\n return $this->rateLimitRemaining;\n }", "protected function get_request_counts()\n {\n }", "public function I_can_not_create_more_than_hundred_of_percents()\n {\n }", "protected function registerRateLimiting()\n {\n $this->app->singleton('api.limiting', function ($app) {\n return new RateLimitHandler($app, $app['cache'], $this->config('throttling'));\n });\n }", "protected function abortIfApiLimitReached()\n {\n if($this->request_limit_reached_on && date('Y-m-d h:i', strtotime($this->request_limit_reached_on . \" +10 minutes\")) > date('Y-m-d h:i', time())) {\n $this->requestStatus = false;\n return $this;\n //throw new ErplySyncException('API request limit error reached on: ' . $this->request_limit_reached_on, self::API_REQUEST_LIMIT_PER_HOUR_ERR_CODE);\n }\n }", "public function clearUserRates()\n\t{\n\t\t$this->collUserRates = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function areScopesLimitedToGrants()\n {\n return $this->limitScopesToGrants;\n }", "public function createQuotaVersion(){\n switch ($_SESSION['role']) {\n case 0:\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $json = file_get_contents('php://input');\n $quotas = json_decode($json);\n\n if (property_exists($quotas, 'version')) {\n $version = $quotas->version;\n $checkVer = QuotaTable::checkVersionExisted($version);\n if($checkVer) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['version']) . Constant::isExistedText\n ));\n return;\n }\n } else {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['version']) . Constant::isRequiredText\n ));\n return;\n }\n $data = $quotas->data;\n if (!is_array($data) || count($data) == 0) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => Constant::emptyList\n ));\n return;\n }\n\n $errorCount = 0;\n\n $factors = array();\n //Only update factor by version\n $factors['mainFactorStudent'] = (property_exists($quotas, 'mainFactorStudent'))\n ? number_format($quotas->mainFactorStudent, 2, '.', '') : 1;\n $factors['coFactorStudent'] = (property_exists($quotas, 'coFactorStudent'))\n ? number_format($quotas->coFactorStudent, 2, '.', '') : 1;\n $factors['mainFactorResearcher'] = (property_exists($quotas, 'mainFactorResearcher'))\n ? number_format($quotas->mainFactorResearcher, 2, '.', '') : 1;\n $factors['coFactorResearcher'] = (property_exists($quotas, 'coFactorResearcher'))\n ? number_format($quotas->coFactorResearcher, 2, '.', '') : 1;\n $factors['mainFactorGraduated'] = (property_exists($quotas, 'mainFactorGraduated'))\n ? number_format($quotas->mainFactorGraduated, 2, '.', '') : 1;\n $factors['coFactorGraduated'] = (property_exists($quotas, 'coFactorGraduated'))\n ? number_format($quotas->coFactorGraduated, 2, '.', '') : 1;\n\n foreach ($data as $obj) {\n $quota = array();\n $quota['version'] = $version;\n if (property_exists($obj, 'degreeId')) $quota['degreeId'] = $obj->degreeId;\n if (property_exists($obj, 'maxStudent')) $quota['maxStudent'] = $obj->maxStudent;\n if (property_exists($obj, 'maxGraduated')) $quota['maxGraduated'] = $obj->maxGraduated;\n if (property_exists($obj, 'maxResearcher')) $quota['maxResearcher'] = $obj->maxResearcher;\n $quota['isActive'] = 0;\n $quota['mainFactorStudent'] = $factors['mainFactorStudent'];\n $quota['coFactorStudent'] = $factors['coFactorStudent'];\n $quota['mainFactorResearcher'] = $factors['mainFactorResearcher'];\n $quota['coFactorResearcher'] = $factors['coFactorResearcher'];\n $quota['mainFactorGraduated'] = $factors['mainFactorGraduated'];\n $quota['coFactorGraduated'] = $factors['coFactorGraduated'];\n\n $quotaObj = new Quota($quota);\n\n if(!isset($quota['degreeId']) || $quota['degreeId'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['degreeId']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxStudent']) || $quota['maxStudent'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxStudent']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxGraduated']) || $quota['maxGraduated'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxGraduated']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxResearcher']) || $quota['maxResearcher'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxResearcher']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['isActive']) || $quota['isActive'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['isActive']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } else {\n foreach ($quota as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$quotaObj->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n\n $errorCount += 1;\n break;\n }\n \n //Check maximum sum of factors\n if($key == 'mainFactorStudent' || $key == 'coFactorStudent') {\n $sumFactors = $quota['mainFactorStudent'] + $quota['coFactorStudent'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài khóa luận phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorGraduated' || $key == 'coFactorGraduated') {\n $sumFactors = $quota['mainFactorGraduated'] + $quota['coFactorGraduated'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận văn phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorResearcher' || $key == 'coFactorResearcher') {\n $sumFactors = $quota['mainFactorResearcher'] + $quota['coFactorResearcher'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận án phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n }\n\n if($errorCount > 0) { break; }\n }\n\n $degree = DegreeTable::getById($quota['degreeId']);\n if(!$degree){\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::objectNames['degree']) . Constant::notExistedText\n ));\n\n $errorCount += 1;\n break;\n }\n\n //Create new quota for each degreeId\n $result = QuotaTable::addQuota($quotaObj);\n if(!$result) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tạo \" . Constant::objectNames['quotas'] . \" không thành công\"\n ));\n\n $errorCount += 1;\n break;\n }\n }\n\n //Delete version if error occurs\n if($errorCount > 0) {\n //deactive\n //QuotaTable::activeQuotaByVersion($version, 0);\n QuotaTable::deleteByVersion($version);\n } else {\n http_response_code(200);\n echo json_encode(array(\n 'message' => Constant::success\n ));\n }\n }", "public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }" ]
[ "0.7122056", "0.62184715", "0.6156436", "0.61009866", "0.6100634", "0.6031333", "0.59737915", "0.5951008", "0.59188646", "0.5908091", "0.5905105", "0.5887422", "0.5887422", "0.5873192", "0.58711934", "0.5842104", "0.58123475", "0.58123475", "0.58123475", "0.58123475", "0.5811028", "0.57880014", "0.57670164", "0.57593787", "0.57403255", "0.5737663", "0.5713238", "0.57065356", "0.5660173", "0.56504446", "0.563217", "0.5625772", "0.5599472", "0.5585731", "0.55836684", "0.5582017", "0.55762315", "0.55680627", "0.5550598", "0.55430084", "0.5528325", "0.5494632", "0.5484023", "0.54713714", "0.54688376", "0.54565907", "0.5452883", "0.5428428", "0.5415661", "0.54102457", "0.53942573", "0.53756464", "0.53726345", "0.53705573", "0.5366615", "0.5361944", "0.5326545", "0.53261375", "0.532553", "0.5318503", "0.5313394", "0.5304706", "0.5291837", "0.5287092", "0.5285601", "0.5280008", "0.5279447", "0.52772593", "0.52750784", "0.5243408", "0.52244663", "0.520723", "0.5182984", "0.5182767", "0.5180513", "0.51801425", "0.5168802", "0.51685834", "0.5166352", "0.5158885", "0.5152996", "0.5142525", "0.5138621", "0.5137284", "0.5137284", "0.51108426", "0.5109761", "0.5105544", "0.50729215", "0.50722784", "0.5055407", "0.505533", "0.5055302", "0.50311166", "0.5025447", "0.5020306", "0.49976397", "0.49927422", "0.49909195", "0.49908066", "0.49874234" ]
0.0
-1
Use API rate quota if required.
public function run(APIEndpoint $endpoint) { if (!$endpoint->requires_quota()) { return; } $quota = $endpoint->get_caller()->get_quota(); if ($quota->has_state('api_t_start')) { $t = $quota->get_state('api_t_start'); if (time() - $t >= gtlim('API_RATE_T')) { // Reset rate quota and time after the cutoff. $quota->set_state('api_t_start', time()); $quota->set_used('api_rate', 0); } } else { // Start counting time. $quota->set_state('api_t_start', time()); } if (!$quota->has_quota('api_rate')) { throw new APIException( API_E_RATE, "API rate limited." ); } else { $quota->use_quota('api_rate'); } $endpoint->get_caller()->write(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting(): void\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());\n });\n }", "public function is_user_over_quota()\n {\n }", "public function testRateLimit()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "protected function configureRateLimiting()\n {\n RateLimiter::for('api', function (Request $request) {\n return Limit::perMinute(60);\n });\n }", "private function isRateLimitReached()\n {\n if (!$this->getRateLimit()) {\n throw new InstagramThrottleException('400 Bad Request : You have reached Instagram API Rate Limit', 400);\n }\n }", "function ratelimit(array $data);", "protected function get_email_rate_limit()\n {\n }", "public function clear_rate_limit()\n {\n }", "public static function rateLimit(): self\n {\n return self::getInstance('RATE_LIMIT');\n }", "public function setQuota($value) {\n $this->_quota = $value;\n }", "public function setRateLimit($rateLimit){\n if($rateLimit > self::API_RATE_LIMIT) {\n throw new Exception('Specified rateLimit exceeds API rate limit of '.self::API_RATE_LIMIT.' requests per minute.');\n }\n \n\t\t$this->rateLimit = (int)$rateLimit;\n\t}", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "public function getRateLimit($context);", "function multisite_over_quota_message()\n {\n }", "public function getQuota(){\n $option = Paging::normalizeOption($_GET);\n $result = QuotaTable::get($option);\n\n http_response_code(200);\n echo json_encode($result);\n }", "public function hasQuota(){\n return $this->_has(12);\n }", "function get_quota() {\n\n\t\t$response = $this->curl_get(skydrive_base_url.\"me/skydrive/quota?access_token=\".$this->access_token);\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\t\t\t\n\n\t\t\treturn $response;\n\n\t\t}\n\n\t}", "public function getQuota()\n {\n return $this->quota;\n }", "public function isRateLimitEnabled(): bool\n {\n return $this->rateLimitEnabled === true;\n }", "function _buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$quota=post_param_integer('quota');\n\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t// Stop if we can't afford this much quota\n\t\tif ((($quota*$price)>$pointsleft) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('CANT_AFFORD'));\n\t\t}\n\n\t\t// Mail off the order form\n\t\t$quota_url=get_option('quota_url');\n\t\t$_price=$quota*$price;\n\t\t$encoded_reason=do_lang('TITLE_QUOTA');\n\t\t$message_raw=do_template('POINTSTORE_QUOTA_MAIL',array('_GUID'=>'5a4e0bb5e53e6ccf8e57581c377557f4','ENCODED_REASON'=>$encoded_reason,'QUOTA'=>integer_format($quota),'EMAIL'=>$prefix.$suffix,'QUOTA_URL'=>$quota_url,'PRICE'=>integer_format($_price)));\n\t\trequire_code('notifications');\n\t\tdispatch_notification('pointstore_request_quota','quota_'.uniqid('',true),do_lang('MAIL_REQUEST_QUOTA',NULL,NULL,NULL,get_site_default_lang()),$message_raw->evaluate(get_site_default_lang(),false),NULL,NULL,3,true);\n\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_QUOTA_DONE'));\n\t}", "private function checkApiRequestsLimit()\n {\n $tempTime = time() - $this->startTime;\n if($this->apiRequestsCount >= $this->apiRequestsLimit && $tempTime < $this->apiTimeLimit) {\n usleep(($this->apiTimeLimit - $tempTime)*1000000);\n $this->apiRequestsCount = 1;\n $this->startTime = time();\n } else {\n $this->apiRequestsCount++;\n }\n }", "function quotas() {\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * Display SQL databases quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSqldata will be available in the view.\n\t\t */\n\t\t$this->set('quotasSqldata', $this->Quota->displayTotal('Sqldata'));\n\t\t\n\t\t/**\n\t\t * Display FTP users quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasFtpuser will be available in the view.\n\t\t */\n\t\t$this->set('quotasFtpuser', $this->Quota->displayTotal('Ftpuser'));\n\t\t\n\t\t/**\n\t\t * Display SQL users quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSqluser will be available in the view.\n\t\t */\n\t\t$this->set('quotasSqluser', $this->Quota->displayTotal('Sqluser'));\n\t\t\n\t\t/**\n\t\t * Display mailboxes quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasMailbox will be available in the view.\n\t\t */\n\t\t$this->set('quotasMailbox', $this->Quota->displayTotal('Mailbox'));\n\t\t\n\t\t/**\n\t\t * Display aliases quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasAlias will be available in the view.\n\t\t */\n\t\t$this->set('quotasAlias', $this->Quota->displayTotal('Alias'));\n\t\t\n\t\t/**\n\t\t * Display domains quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasDomain will be available in the view.\n\t\t */\n\t\t$this->set('quotasDomain', $this->Quota->displayTotal('Domain'));\n\t\t\n\t\t/**\n\t\t * Display subdomains quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasSubdomain will be available in the view.\n\t\t */\n\t\t$this->set('quotasSubdomain', $this->Quota->displayTotal('Subdomain'));\n\t\t\n\t\t/**\n\t\t * Display cronjobs quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasCron will be available in the view.\n\t\t */\n\t\t$this->set('quotasCron', $this->Quota->displayTotal('Cron'));\n\n\t\t/**\n\t\t * Display disk quota.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasDisk will be available in the view.\n\t\t */\n\t\t$this->set('quotasDisk', $this->Quota->displayDisk('Quotasprogress'));\n\n\t\t/**\n\t\t * Select all quotas about the offer who belongs to the user.\n\t\t * @var array\n\t\t */\n\t\t$conditionQuota = array('conditions' => array('Quota.offer_id' => $this->Auth->user('offer_id')));\n\n\t\t/**\n\t\t * Display the total of quotas.\n\t\t * Call the \"Quota\" component to check.\n\t\t * $quotasTotal will be available in the view.\n\t\t */\n\t\t$this->set('quotasTotal', $this->User->Offer->Quota->find('all', $conditionQuota));\n\n\t}", "public function testGetRateLimits()\n {\n }", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "public function getQuota()\n {\n return $this->_quota;\n }", "function quota_getUploadQuota($quota) {\n\tglobal $_zp_current_admin_obj;\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {\n\t\t$quota = -1;\n\t} else {\n\t\t$quota = $_zp_current_admin_obj->getQuota();\n\t\tif ($quota == NULL) $quota = getOption('quota_default');\n\t}\n\treturn $quota;\n}", "public function get_limits()\n\t{\n\t\t$profile_start = microtime(true);\n\n\t\t$limitsData = array(\n\t\t\t\t\t'call_limit' =>\tCALL_LIMIT,\n\t\t\t\t\t'duration_limit' =>\tCALL_DURATION_LIMIT,\n\t\t\t\t\t'listing_limit' =>\tLISTING_LIMIT\n\t\t\t\t\t);\n\n\t\t$this->input->do_put($this->config->base_url.\"/api/limit\",[]);\n\n\t\tif(!empty($limitsData))\n\t\t\t$this->display->success($limitsData,'limits');\n\t\telse\n\t\t\t$this->display->error(1502);\n\n\t\t$profile_start = profiler($profile_start,__CLASS__,__FUNCTION__,'openapi');\n\t}", "public function setCPUThrottlingRate(ContextInterface $ctx, SetCPUThrottlingRateRequest $request): void;", "protected function limitCallRate()\n {\n if (!$this->callRateLimit) {\n return;\n }\n $now = microtime(true);\n $callIntervalActual = $now - $this->callTimeLast;\n $callIntervalNeeded = 1 / $this->callRateLimit;\n $callDelayNeeded = $callIntervalNeeded - $callIntervalActual;\n if ($callDelayNeeded > 0) {\n usleep($callDelayNeeded * 1000000); // Seconds to microseconds\n }\n $this->callTimeLast = $now;\n }", "public function getQuota(): int\n {\n return $this->quota;\n }", "function buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$topamount=intval(get_option('max_quota'));\n\n\t\tif ($price==0) $topamount=$pointsleft; else $topamount=intval(round($pointsleft/$price));\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// Screen\n\t\t$submit_name=do_lang_tempcode('TITLE_QUOTA');\n\t\t$post_url=build_url(array('page'=>'_SELF','type'=>'_buyquota','id'=>'pop3'),'_SELF');\n\t\t$text=do_template('POINTSTORE_QUOTA',array('_GUID'=>'1282fae968b4919bcd0ba1e3ca169fe8','POINTS_LEFT'=>integer_format($pointsleft),'PRICE'=>integer_format($price),'TOP_AMOUNT'=>integer_format($topamount),'EMAIL'=>$prefix.$suffix));\n\t\trequire_code('form_templates');\n\t\t$fields=form_input_integer(do_lang_tempcode('QUOTA'),do_lang_tempcode('QUOTA_DESCRIPTION'),'quota',100,true);\n\t\treturn do_template('FORM_SCREEN',array('_GUID'=>'1c82c713beaa03d1e3045e50295c722c','HIDDEN'=>'','URL'=>$post_url,'TITLE'=>$title,'FIELDS'=>$fields,'TEXT'=>$text,'SUBMIT_NAME'=>$submit_name));\n\t}", "protected function registerRateLimiting()\n {\n $this->app->singleton('api.limiting', function ($app) {\n return new RateLimitHandler($app, $app['cache'], $this->config('throttling'));\n });\n }", "public function setQuota($value)\n {\n $this->_quota = $value;\n return $this;\n }", "public function getQuota()\r\n\t{\r\n\t\tif($this->accessToken === null) {\r\n\t\t\tthrow new SkydriveException_InvalidToken();\r\n\t\t}\r\n\t\t$url = self::baseUrl . \"me/skydrive/quota?access_token=\" . $this->accessToken;\r\n\t\t$info = json_decode($this->fetch($url), true);\r\n\t\t$total = (float)$info[\"quota\"];\r\n\t\t$available = (float)$info[\"available\"];\r\n\t\t$used = $total - $available;\r\n\t\t$quota = array(\"total\"=>$total, \"used\"=>$used);\r\n\t\treturn $quota;\r\n\t}", "protected function rateLimitingDisabled()\n {\n return $this->config['limit'] == 0;\n }", "public function use_quota(string $key, int $amount = 1): void {\n\t\tif (!$this->has_quota($key, $amount)) {\n\t\t\tthrow new QuotaException(\"Not enough quota left for $key.\");\n\t\t}\n\t\t$this->used[$key] += $amount;\n\t}", "protected function handleRateLimit(): void\n {\n if (!$this->isRateLimitEnabled() || !$this->requestTimestamp) {\n return;\n }\n\n /** @var DateTime $limitReset */\n $limitReset = $this->getApiCallLimits('reset');\n if (!$limitReset) {\n return;\n }\n\n $limitLeft = $this->getApiCallLimits('left') ?: 1;\n $secondsLeft = $limitReset->getTimestamp() - time();\n $rateLimitCycle = round(($secondsLeft / $limitLeft) * 1000);\n\n // Calculate in milliseconds the duration the API call took\n $duration = round(microtime(true) - $this->requestTimestamp, 3) * 1000;\n $waitTime = $rateLimitCycle - $duration;\n\n if ($waitTime > 0) {\n // Do the sleep for X microseconds (convert from milliseconds)\n usleep($waitTime * 1000);\n }\n }", "public function enableRateLimit(): self\n {\n $this->rateLimitEnabled = true;\n\n return $this;\n }", "public function getMyRateLimitInfo () {\n var_dump($this->talkToTwitter('application/rate_limit_status', '?'));\n exit();\n }", "protected function limiter(): RateLimiter\n {\n return app(RateLimiter::class);\n }", "public function free_quota(string $key, int $amount = 1): void {\n\t\tif ($this->used[$key] > 0) {\n\t\t\t$this->used[$key] -= $amount;\n\t\t}\n\t}", "public function getRefreshRate() { return 0; }", "public function getXsiTypeName() {\n return \"RateExceededError\";\n }", "public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\n }", "public function rate()\n {\n\n }", "private function _checkRateLimit()\n {\n if (empty(self::$_responseHeaders))\n {\n return;\n }\n\n // Default the $limit and $remaining values if not set in the last response header.\n /** @var int $limit */\n $limit = isset(self::$_responseHeaders[self::RATE_LIMIT])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT]\n : self::DEFAULT_RATE_LIMIT;\n\n /** @var int $remaining */\n $remaining = isset(self::$_responseHeaders[self::RATE_LIMIT_REMAINING])\n ? (int)self::$_responseHeaders[self::RATE_LIMIT_REMAINING]\n : self::DEFAULT_RATE_LIMIT;\n\n // If no API calls have been made, no need to delay.\n if ($limit == $remaining)\n {\n return;\n }\n\n // If we are below 5% remaining, sleep for 0.50 seconds.\n if ($remaining / $limit < 0.05)\n {\n usleep(500000);\n return;\n }\n\n // If we are below 10% remaining, sleep for 0.25 seconds.\n if ($remaining / $limit < 0.1)\n {\n usleep(250000);\n }\n }", "private function limitShippingCarrier(Quote $quote) : void\n {\n $shippingAddress = $quote->getShippingAddress();\n if ($shippingAddress && $shippingAddress->getShippingMethod()) {\n $shippingRate = $shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod());\n $shippingAddress->setLimitCarrier($shippingRate->getCarrier());\n }\n }", "public function hasQuotaUnlock(){\n return $this->_has(10);\n }", "public function getRateLimitLimit(): int\n {\n return $this->httpClient->getRateLimitLimit();\n }", "public function has_quota(string $key, int $amount = 1): bool {\n\t\treturn ($this->limits[$key]['limit'] - $this->used[$key]) >= $amount;\n\t}", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "function rate_limit($key, $interval, $max, $error = 'Slow down a bit, yo.')\n{\n $unit = round(time() / $interval);\n $key .= '-'.$unit;\n $count = 0;\n\n if (apcu_exists($key)) {\n $count = apcu_fetch($key);\n if ($count >= $max) {\n throw new Exception($error);\n }\n }\n\n $count++;\n apcu_store($key, $count, $interval);\n\n return $count;\n}", "public function setQuota(): int\n {\n $this->quota = (int) floor(\n ($this->validBallots /\n ($this->election->getWinnersCount() + 1)\n ) // p. 47 (1)\n + 1); // p. 47 (2)\n\n $this->logger->info(sprintf('Quota set at %d based on %d winners and %d valid ballots', $this->quota, $this->election->getWinnersCount(), $this->validBallots));\n\n return $this->quota;\n }", "public static function set_usage($api = null)\n\t{\n\t\tif (empty($api)) {\n\t\t\t$api = \\V1\\APIRequest::get('api');\n\t\t}\n\t\t\n\t\t// Default\n\t\t$usage = array();\n\t\t\n\t\t// Grab any current stats\n\t\ttry {\n\t\t\t$usage = \\Cache::get('account.'.\\Session::get('consumer_key').'usage');\n\t\t} catch (\\CacheNotFoundException $e) {}\n\t\t\n\t\t// Every time period starts with this data\n\t\t$reset_array = array(\n\t\t\n\t\t\t'ts'\t=> time(),\n\t\t\t'count'\t=> 1,\n\t\t\t\t\n\t\t);\n\t\t\n\t\t// Excrement the total calls through the system.\n\t\tif (empty($usage['total'])) {\n\t\t\t$usage['total'] = 1;\n\t\t} else {\n\t\t\t$usage['total']++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Increment the API's call counter\n\t\t */\n\t\t\n\t\t// No data exists.\n\t\tif (empty($usage[$api])) {\n\t\t\t\n\t\t\t// Set each time period to the starting data.\n\t\t\t$usage[$api] = array_fill_keys(array('second', 'minute', 'hour', 'day', 'month', 'year'), $reset_array);\n\t\t\t\n\t\t// Data exists in the system.\n\t\t} else {\n\t\t\t\n\t\t\t// Loop through the time period data\n\t\t\tforeach ($usage[$api] as $time_period => $period_data) {\n\t\t\t\t\n\t\t\t\t// If the timestamp is still valid, then increment the counter.\n\t\t\t\tif (\n\t\t\t\t\t\\Utility::subtract_seconds($time_period) <= $period_data['ts'] &&\n\t\t\t\t\t$period_data['ts'] <= time() // DST adjustments\n\t\t\t\t) {\n\t\t\t\t\t$usage[$api][$time_period]['count']++;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// The timestamp was invalid, so we reset the time period.\n\t\t\t\t\t$usage[$api][$time_period] = $reset_array;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// Set it to the new value, and make sure that it doesn't expire.\n\t\t\\Cache::set('account.'.\\Session::get('consumer_key').'usage', $usage, null);\n\t}", "public function setBaseToGlobalRate($rate);", "private function setRateLimiterKey()\n {\n $this->rateLimiterKey = sha1($this->formRequestClass . request()->ip());\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "function quota_checkQuota($error, $image) {\n\tif (zp_loggedin(MANAGE_ALL_ALBUM_RIGHTS)) {\n\t\treturn UPLOAD_ERR_OK;\n\t}\n\tif (getSuffix($image) == 'zip') {\n\t\treturn UPLOAD_ERR_EXTENSION;\n\t}\n\t$quota = quota_getUploadQuota(0);\n\t$size = round(filesize($image)/1024);\n\tif ($quota > 0) {\n\t\tif (quota_getCurrentUse(NULL) + $size > $quota) {\n\t\t\t$error = UPLOAD_ERR_QUOTA;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn $error;\n}", "private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}", "function check_quota ($quota, $domain)\n{\n $limit = get_domain_properties ($domain);\n if ($limit['maxquota'] >= 0)\n {\n if ($quota > $limit['maxquota'])\n {\n return false;\n }\n }\n return true;\n}", "public function getRateLimit()\n {\n return $this->xRateLimitRemaining;\n }", "public function getApiUsageAvailable() {\n return @$this->attributes['api_usage_available'];\n }", "function upload_is_user_over_quota($display_message = \\true)\n {\n }", "private function parseRateLimitAndCache() {\n\n $rateLimited = false;\n $rateLimit = null;\n $rateLimitMultiplier = null;\n $cached = false;\n $cacheTime = null;\n\n foreach ($this->interceptors as $interceptor) {\n $inspector = $this->classInspectorProvider->getClassInspector(get_class($interceptor));\n $annotations = $inspector->getClassAnnotations();\n\n // Derive rate limit config\n $rateLimited = $rateLimited || isset($annotations[\"rateLimited\"]);\n if (!$rateLimit) $rateLimit = isset($annotations[\"rateLimit\"][0]) ? $annotations[\"rateLimit\"][0]->getValue() : null;\n if (!$rateLimitMultiplier) $rateLimitMultiplier = isset($annotations[\"rateLimitMultiplier\"][0]) ? $annotations[\"rateLimitMultiplier\"][0]->getValue() : null;\n\n // Derive cache config\n $cached = $cached || isset($annotations[\"cached\"]);\n if (!$cacheTime) $cacheTime = isset($annotations[\"cacheTime\"][0]) ? $annotations[\"cacheTime\"][0]->getValue() : null;\n\n }\n\n // Only set the cache and ratelimit configs if any exist.\n if ($cached || $cacheTime) $this->contentCacheConfig = new ContentCacheConfig($cacheTime);\n if ($rateLimited || $rateLimit || $rateLimitMultiplier) $this->rateLimiterConfig = new RateLimiterConfig($rateLimit, $rateLimitMultiplier);\n }", "private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "protected function abortIfApiLimitReached()\n {\n if($this->request_limit_reached_on && date('Y-m-d h:i', strtotime($this->request_limit_reached_on . \" +10 minutes\")) > date('Y-m-d h:i', time())) {\n $this->requestStatus = false;\n return $this;\n //throw new ErplySyncException('API request limit error reached on: ' . $this->request_limit_reached_on, self::API_REQUEST_LIMIT_PER_HOUR_ERR_CODE);\n }\n }", "public function setRate($rate) {\n $this->rate = $rate;\n }", "public function unRate()\n {\n\n }", "public function hasQuotaLock(){\n return $this->_has(11);\n }", "public function shouldRaiseExceptionWhenQuotaExceeded(): void\n {\n $station = $this->faker->city;\n\n $this->waqi->shouldReceive('getObservationByStation')\n ->once()\n ->with($station)\n ->andThrow(QuotaExceededException::class);\n\n $this->waqi->getObservationByStation($station);\n }", "function __construct(){\nparent::__construct();\n // Configure limits on our controller methods\n // Ensure you have created the 'limits' table and enabled 'limits' within application/config/rest.php\n $this->methods['users_get']['limit'] = 500; // 500 requests per hour per user/key\n $this->methods['users_post']['limit'] = 100; // 100 requests per hour per user/key\n $this->methods['users_delete']['limit'] = 50; // 50 requests per hour per user/key\n $this->load->model('M_main', 'M_main');\n}", "public function check_rate_limit( $echo = FALSE ){\n\n\t\t\t// check rate-limiting (per IP)\n\t\t\t$raw_response = wp_remote_get( $this->api_urls['ratelimit'], array( 'sslverify' => $this->sslverify ) );\n\n\t\t\tif( is_wp_error( $raw_response ) ){\n\n\t\t\t\t$this->error = TRUE;\n\t\t\t\t$this->set_error(\n\t\t\t\t\t\t'warning',\n\t\t\t\t\t\tsprintf( '%s: %s', __( 'An error occurred while fetching the rate-limit', self::LANG ), $raw_response->get_error_message() )\n\t\t\t\t);\n\n\t\t\t} else {\n\n\t\t\t\t$headers = &$raw_response['headers'];\n\n\t\t\t\tself::$api_calls_remaining = $headers['x-ratelimit-remaining'];\n\t\t\t\tself::$api_calls_ratelimit = $headers['x-ratelimit-limit'];\n\n\t\t\t\tif( 0 >= self::$api_calls_remaining ){\n\n\t\t\t\t\t$this->error = TRUE;\n\t\t\t\t\t$this->set_error( 'warning', sprintf( __( 'Rate limit of %d api-calls is exceeded.', self::LANG ), self::$api_calls_ratelimit ) );\n\t\t\t\t\treturn FALSE;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn ( FALSE !== $echo ) ? sprintf( '%d out of %d api calls remaining.', self::$api_calls_remaining, self::$api_calls_ratelimit ) : TRUE;\n\n\t\t}", "function quota_save_admin($updated, $userobj, $i, $alter) {\n\tif (isset($_POST[$i.'quota']) && $alter) {\n\t\t$oldquota = $userobj->getQuota();\n\t\t$userobj->setQuota(sanitize_numeric($_POST[$i.'quota']));\n\t\t$updated = $oldquota == $userobj->getQuota();\n\t}\n\treturn $updated;\n}", "protected function exceededRateLimit()\n {\n return $this->cache->get($this->config['keys']['requests']) > $this->config['limit'];\n }", "public function setRequest(Mage_Shipping_Model_Rate_Request $request)\n {\n if ($request->getAutoConfig()) {\n return $this->setRequestAutoConfig($request);\n } else {\n return parent::setRequest($request);\n }\n }", "public static function reInstateQuotaExceeded()\n {\n //$noticeControl = Notices::getInstance();\n //$notice = $noticeControl->getNoticeByID(self::MSG_QUOTA_REACHED);\n Notices::removeNoticeByID(self::MSG_QUOTA_REACHED);\n //$notice->unDismiss();\n //$noticeControl->update();\n }", "public function updateQuotaVersion($param){\n $version = $param['version'];\n\n $oldQuota = QuotaTable::getByVersion($version);\n if(!$oldQuota){\n http_response_code(404);\n echo json_encode(array(\n 'message' => Constant::notFoundText . Constant::objectNames['quotas']\n ));\n return;\n }\n\n switch ($_SESSION['role']) {\n case 0:\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $json = file_get_contents('php://input');\n $quotas = json_decode($json);\n $factors = array();\n\n //Only update factor by version\n if(property_exists($quotas, 'mainFactorStudent')){\n $factors['mainFactorStudent'] = number_format($quotas->mainFactorStudent, 2, '.', '');\n }\n if(property_exists($quotas, 'coFactorStudent')){\n $factors['coFactorStudent'] = number_format($quotas->coFactorStudent, 2, '.', '');\n }\n if(property_exists($quotas, 'mainFactorResearcher')){\n $factors['mainFactorResearcher'] = number_format($quotas->mainFactorResearcher, 2, '.', '');\n }\n if(property_exists($quotas, 'coFactorResearcher')){\n $factors['coFactorResearcher'] = number_format($quotas->coFactorResearcher, 2, '.', '');\n }\n if(property_exists($quotas, 'mainFactorGraduated')){\n $factors['mainFactorGraduated'] = number_format($quotas->mainFactorGraduated, 2, '.', '');\n }\n if((property_exists($quotas, 'coFactorGraduated'))){\n $factors['coFactorGraduated'] = number_format($quotas->coFactorGraduated, 2, '.', '');\n }\n\n $data = $quotas->data;\n $errorCount = 0;\n if($data && is_array($data) && count($data) != 0) {\n foreach ($data as $obj) {\n $quota = array();\n if (property_exists($obj, 'id')) {\n $quota['id'] = $obj->id;\n } else {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['id']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n }\n\n if (property_exists($obj, 'maxStudent')) $quota['maxStudent'] = $obj->maxStudent;\n if (property_exists($obj, 'maxGraduated')) $quota['maxGraduated'] = $obj->maxGraduated;\n if (property_exists($obj, 'maxResearcher')) $quota['maxResearcher'] = $obj->maxResearcher;\n foreach($factors as $key => $value){\n $quota[$key] = $value;\n }\n\n $quotaObj = new Quota($quota);\n\n if(isset($quota['maxStudent']) && $quota['maxStudent'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxStudent']) . Constant::notEmptyText\n ));\n $errorCount += 1;\n break;\n } elseif(isset($quota['maxGraduated']) && $quota['maxGraduated'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxGraduated']) . Constant::notEmptyText\n ));\n $errorCount += 1;\n break;\n } elseif(isset($quota['maxResearcher']) && $quota['maxResearcher'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxResearcher']) . Constant::notEmptyText\n ));\n $errorCount += 1;\n break;\n } else {\n foreach ($quota as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$quotaObj->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n\n $errorCount += 1;\n break;\n }\n\n //Check maximum sum of factors\n if($key == 'mainFactorStudent' || $key == 'coFactorStudent') {\n $sumFactors = $quota['mainFactorStudent'] + $quota['coFactorStudent'];\n\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài khóa luận phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorGraduated' || $key == 'coFactorGraduated') {\n $sumFactors = $quota['mainFactorGraduated'] + $quota['coFactorGraduated'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận văn phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorResearcher' || $key == 'coFactorResearcher') {\n $sumFactors = $quota['mainFactorResearcher'] + $quota['coFactorResearcher'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận án phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n }\n if($errorCount > 0) { break; }\n }\n\n //Update a quota by id\n QuotaTable::updateQuotaById($version, $quota);\n }\n } else {\n if(count($factors) > 0){\n echo \"hel\";\n $quotaObj = new Quota($factors);\n foreach ($factors as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$quotaObj->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'id' => $factors['id'],\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n\n $errorCount += 1;\n break;\n }\n }\n\n if($errorCount == 0) {\n QuotaTable::updateQuotaByVersion($version, $factors);\n }\n }\n }\n\n //Delete version if error occurs\n if($errorCount > 0) {\n return;\n } else {\n http_response_code(200);\n echo json_encode(array(\n 'message' => Constant::success\n ));\n }\n }", "private function limitCalls()\n {\n if ($this->lastCallTimestamp > 0) {\n $callsLimit = $this->shopifyClient->callLimit();\n $callsMade = $this->shopifyClient->callsMade();\n $callsLeft = $this->shopifyClient->callsLeft();\n\n Log::debug(\"ShopifyApi.limitCalls: callsLimit=$callsLimit, callsMade=$callsMade, callsLeft=$callsLeft\");\n $currentTimestamp = microtime(true);\n $deltaTimestamp = ($this->lastCallTimestamp > 0) ? $currentTimestamp - $this->lastCallTimestamp : 0;\n Log::debug(\"ShopifyApi.limitCalls: deltaTimestamp=$deltaTimestamp\");\n\n if ($callsLeft < 10) {\n Log::debug(\"ShopifyApi.limitCalls: DELTA < 10: wait 0.5 seconds\");\n usleep(500000);\n }\n } else {\n Log::debug(\"ShopifyApi.limitCalls: first call\");\n }\n $this->lastCallTimestamp = microtime(true);\n }", "public function isLimitExceeded();", "private function validate_usage_limit() {\n\t\tif ( $this->usage_limit > 0 && $this->usage_count >= $this->usage_limit ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_USAGE_LIMIT_REACHED );\n\t\t}\n\t}", "function get_quota($quota) {\n if(ereg('S$', $quota)) {\n $quota = ereg_replace('S$','', $quota);\n $quota = $quota / 1024;\n $quota = $quota / 1024;\n $quota = $quota . 'MB';\n }\n return $quota;\n}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function createQuotaVersion(){\n switch ($_SESSION['role']) {\n case 0:\n break;\n default:\n http_response_code(403);\n echo json_encode(array(\n 'message' => Constant::notPermissionText\n ));\n return;\n }\n\n $json = file_get_contents('php://input');\n $quotas = json_decode($json);\n\n if (property_exists($quotas, 'version')) {\n $version = $quotas->version;\n $checkVer = QuotaTable::checkVersionExisted($version);\n if($checkVer) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['version']) . Constant::isExistedText\n ));\n return;\n }\n } else {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['version']) . Constant::isRequiredText\n ));\n return;\n }\n $data = $quotas->data;\n if (!is_array($data) || count($data) == 0) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => Constant::emptyList\n ));\n return;\n }\n\n $errorCount = 0;\n\n $factors = array();\n //Only update factor by version\n $factors['mainFactorStudent'] = (property_exists($quotas, 'mainFactorStudent'))\n ? number_format($quotas->mainFactorStudent, 2, '.', '') : 1;\n $factors['coFactorStudent'] = (property_exists($quotas, 'coFactorStudent'))\n ? number_format($quotas->coFactorStudent, 2, '.', '') : 1;\n $factors['mainFactorResearcher'] = (property_exists($quotas, 'mainFactorResearcher'))\n ? number_format($quotas->mainFactorResearcher, 2, '.', '') : 1;\n $factors['coFactorResearcher'] = (property_exists($quotas, 'coFactorResearcher'))\n ? number_format($quotas->coFactorResearcher, 2, '.', '') : 1;\n $factors['mainFactorGraduated'] = (property_exists($quotas, 'mainFactorGraduated'))\n ? number_format($quotas->mainFactorGraduated, 2, '.', '') : 1;\n $factors['coFactorGraduated'] = (property_exists($quotas, 'coFactorGraduated'))\n ? number_format($quotas->coFactorGraduated, 2, '.', '') : 1;\n\n foreach ($data as $obj) {\n $quota = array();\n $quota['version'] = $version;\n if (property_exists($obj, 'degreeId')) $quota['degreeId'] = $obj->degreeId;\n if (property_exists($obj, 'maxStudent')) $quota['maxStudent'] = $obj->maxStudent;\n if (property_exists($obj, 'maxGraduated')) $quota['maxGraduated'] = $obj->maxGraduated;\n if (property_exists($obj, 'maxResearcher')) $quota['maxResearcher'] = $obj->maxResearcher;\n $quota['isActive'] = 0;\n $quota['mainFactorStudent'] = $factors['mainFactorStudent'];\n $quota['coFactorStudent'] = $factors['coFactorStudent'];\n $quota['mainFactorResearcher'] = $factors['mainFactorResearcher'];\n $quota['coFactorResearcher'] = $factors['coFactorResearcher'];\n $quota['mainFactorGraduated'] = $factors['mainFactorGraduated'];\n $quota['coFactorGraduated'] = $factors['coFactorGraduated'];\n\n $quotaObj = new Quota($quota);\n\n if(!isset($quota['degreeId']) || $quota['degreeId'] == null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['degreeId']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxStudent']) || $quota['maxStudent'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxStudent']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxGraduated']) || $quota['maxGraduated'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxGraduated']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['maxResearcher']) || $quota['maxResearcher'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['maxResearcher']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } elseif(!isset($quota['isActive']) || $quota['isActive'] === null) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames['isActive']) . Constant::isRequiredText\n ));\n $errorCount += 1;\n break;\n } else {\n foreach ($quota as $key => $value) {\n $action = 'check' . ucfirst($key);\n if (!$quotaObj->$action()) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::columnNames[$key]) . Constant::invalidText\n ));\n\n $errorCount += 1;\n break;\n }\n \n //Check maximum sum of factors\n if($key == 'mainFactorStudent' || $key == 'coFactorStudent') {\n $sumFactors = $quota['mainFactorStudent'] + $quota['coFactorStudent'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài khóa luận phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorGraduated' || $key == 'coFactorGraduated') {\n $sumFactors = $quota['mainFactorGraduated'] + $quota['coFactorGraduated'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận văn phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n\n else if($key == 'mainFactorResearcher' || $key == 'coFactorResearcher') {\n $sumFactors = $quota['mainFactorResearcher'] + $quota['coFactorResearcher'];\n if($sumFactors != 1) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tổng hệ số hướng dẫn cho đề tài luận án phải bằng 1\"\n ));\n $errorCount += 1;\n break;\n }\n }\n }\n\n if($errorCount > 0) { break; }\n }\n\n $degree = DegreeTable::getById($quota['degreeId']);\n if(!$degree){\n http_response_code(400);\n echo json_encode(array(\n 'message' => ucfirst(Constant::objectNames['degree']) . Constant::notExistedText\n ));\n\n $errorCount += 1;\n break;\n }\n\n //Create new quota for each degreeId\n $result = QuotaTable::addQuota($quotaObj);\n if(!$result) {\n http_response_code(400);\n echo json_encode(array(\n 'message' => \"Tạo \" . Constant::objectNames['quotas'] . \" không thành công\"\n ));\n\n $errorCount += 1;\n break;\n }\n }\n\n //Delete version if error occurs\n if($errorCount > 0) {\n //deactive\n //QuotaTable::activeQuotaByVersion($version, 0);\n QuotaTable::deleteByVersion($version);\n } else {\n http_response_code(200);\n echo json_encode(array(\n 'message' => Constant::success\n ));\n }\n }", "public function rateUser(Request $request)\n {\n\n //find ride request \n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::TRIP_ENDED, Ride::COMPLETED])\n ->first();\n\n\n if(!$rideRequest || !$rideRequest->user) {\n return $this->api->json(false, 'INVALID_REQUEST', 'Invalid Request, Try again.');\n }\n\n //validate rating number\n if(!$request->has('rating') || !in_array($request->rating, Ride::RATINGS)) {\n return $this->api->json(false, 'INVALID_RATING', 'You must have give rating within '.implode(',', Ride::RATINGS));\n }\n\n\n /** driver cannot give rating until user payment complete */\n if($rideRequest->payment_status == Ride::NOT_PAID) {\n return $this->api->json(false, 'USER_NOT_PAID', 'Ask user to pay before give rating');\n }\n\n\n //updatig both driver and ride request table\n try {\n\n \\DB::beginTransaction();\n\n //saving ride request rating\n $rideRequest->user_rating = $request->rating;\n $rideRequest->save(); \n\n /** push user rating calculation to job */\n ProcessUserRating::dispatch($rideRequest->user_id);\n\n\n //making availble driver\n $driver = $rideRequest->driver;\n $driver->is_available = 1;\n $driver->save();\n\n\n\n \\DB::commit();\n\n } catch(\\Exception $e) {\n \\DB::rollback();\n \\Log::info('USER_RATING');\n \\Log::info($e->getMessage());\n return $this->api->unknownErrResponse();\n }\n \n\n /** send user that you made the payment message */\n $user = $rideRequest->user;\n $currencySymbol = $this->setting->get('currency_symbol');\n $websiteName = $this->setting->get('website_name');\n $invoice = $rideRequest->invoice;\n if($rideRequest->payment_mode == Ride::CASH) {\n $user->sendSms(\"Thank you!! We hope you enjoyed {$websiteName} service. See you next time.\");\n } \n // else {\n // $user->sendSms(\"We hope you enjoyed {$websiteName} service. Please make the payment of {$currencySymbol}\".$invoice->total);\n // }\n\n\n return $this->api->json(true, 'RATED', 'User rated successfully.');\n\n }", "public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }", "public function rateLimit($applicationId, $userId)\n\t{\n\t\t// load limit data, creating initial record if doesnt exist\n\t\tif (!$data = $this->storage->getRateLimitData($applicationId, $userId))\n\t\t{\n\t\t\t$data = $this->createRateLimitData($applicationId, $userId);\n\t\t}\n\n\t\t// check if we can reset short expiration\n\t\tif (time() > with(new Date($data->expires_short))->toUnix())\n\t\t{\n\t\t\t$newShortDate = $this->getNewExpiresDateString('short');\n\t\t\t$this->storage->resetShort($data->id, 0, $newShortDate);\n\t\t}\n\n\t\t// check if we can reset long expiration\n\t\tif (time() > with(new Date($data->expires_long))->toUnix())\n\t\t{\n\t\t\t$newLongDate = $this->getNewExpiresDateString('long');\n\t\t\t$this->storage->resetLong($data->id, 0, $newLongDate);\n\t\t}\n\n\t\t// increment data then refetch\n\t\t$this->storage->incrementRateLimitData($data->id);\n\n\t\t// refetch record after incrementing\n\t\t$data = $this->storage->getRateLimitData($applicationId, $userId);\n\n\t\t// check to see if were over short or long limits\n\t\t$data->exceeded_short = false;\n\t\t$data->exceeded_long = false;\n\t\tif ($data->count_short >= $data->limit_short)\n\t\t{\n\t\t\t$data->exceeded_short = true;\n\t\t}\n\t\tif ($data->count_long >= $data->limit_long)\n\t\t{\n\t\t\t$data->exceeded_long = true;\n\t\t}\n\n\t\t// return data\n\t\treturn $data;\n\t}", "public function isAPICallLimitErr() {\n // create implementation of this function inside gogoLib for trademe\n // it's easier to hook it there for api call limit checks\n // also if call limit occurs. create log at /var/tragento/apicalllimit.log\n // with dates. than when running new cron process check if date in call is less than 1 hour.\n // actually check if it is in current hour. if current hour than don't execute tragento cron\n // it's nice but requires coding time. don't overcomplicate error handling\n\n // $response->is_ok()\n // $response->error_message()\n // You have exceeded your API call quota for the current hour\n // it's a state for the life of trademe model. when api limit reached it can't be changed to ok later.\n // hovewer in next 5 minutes there will be another call from cron with clear state\n return $this->trademe->isAPICallLimitErr();\n }", "public function syncTaxPercentage() : void\n {\n $subscription = $this->asStripeSubscription();\n $subscription->tax_percent = $this->user->taxPercentage();\n $subscription->save();\n }", "protected function get_request_counts()\n {\n }", "protected function setOfferApplicablePricing ()\n {\n $offerApplicableAccountHeads = $this->getOfferApplicableAccountHeads();\n\n foreach ( $this->request->pricing as $accountHead => $amount ) {\n if ( in_array($accountHead, $offerApplicableAccountHeads) ) {\n $this->offerApplicablePricing[ $accountHead ] = $amount;\n $this->offerApplicableAmount += $amount;\n }\n }\n }", "function testSetUploadQuota()\n {\n $this->deleteLog($this->logfilename);\n $this->login();\n $query = $this->db->query(\"SELECT id FROM project WHERE name = 'EmailProjectExample'\");\n $projectid = $query[0]['id'];\n $content = $this->connect($this->url.'/createProject.php?projectid='.$projectid);\n\n if($content == false)\n {\n return;\n }\n\n // set the upload quota to 1 GB\n $this->setField('uploadQuota','1');\n $this->clickSubmitByName('Update');\n }", "public function getStoreToBaseRate();" ]
[ "0.65724987", "0.65363127", "0.65363127", "0.64696", "0.64696", "0.64696", "0.64696", "0.64502174", "0.6439209", "0.62942404", "0.6243948", "0.6157251", "0.6133878", "0.61255085", "0.6124383", "0.6027495", "0.6019407", "0.5970086", "0.59656316", "0.5936998", "0.590452", "0.58771795", "0.58458096", "0.5845004", "0.5798037", "0.57861024", "0.5784547", "0.57682216", "0.5766684", "0.5753137", "0.5741822", "0.5721995", "0.5715802", "0.57060474", "0.5685828", "0.56819236", "0.56234103", "0.56109375", "0.5593044", "0.5591849", "0.55877125", "0.55834186", "0.557454", "0.5555572", "0.54976755", "0.5495939", "0.5440478", "0.5439583", "0.54204625", "0.53989613", "0.53913265", "0.53902555", "0.5385109", "0.5379508", "0.5353497", "0.53428113", "0.53221935", "0.53221935", "0.5306377", "0.5297902", "0.52978355", "0.5295327", "0.5289464", "0.5280052", "0.52689075", "0.5268003", "0.52537143", "0.52145123", "0.5206484", "0.52032626", "0.52027875", "0.51938033", "0.5190096", "0.51896185", "0.5181705", "0.5177506", "0.5154104", "0.5148177", "0.5138484", "0.5123804", "0.51160514", "0.511129", "0.51035976", "0.50907815", "0.50660527", "0.5045357", "0.5038098", "0.50259954", "0.5022236", "0.5022236", "0.50173557", "0.5016517", "0.5016271", "0.49882862", "0.4978023", "0.4972323", "0.4970678", "0.4956979", "0.4946393", "0.4920918" ]
0.5956218
19
Returns the corresponding parent.
abstract public function parent();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_parent() {\n\t\treturn $this->parent();\n\t}", "public function get_parent();", "protected function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent() {\n return $this->get_mapped_property('parent');\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent()\n {\n return $this->parent;\n }", "public function getParent() {\n\t\treturn $this->parent;\n\t}", "public function getParent() {\n\t\treturn $this->parent;\n\t}", "public function parent(){\n return $this->where('id', $this->parent_id)->first();\n }", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "function get_parent()\r\n {\r\n return $this->parent;\r\n }", "public function getParent() {\n return $this->parent;\n }", "public function getParent() {\n\t\treturn $this->_parent;\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "function getParent () {\r\n\t\treturn $this->_parent;\r\n\t}", "public function getParent() {\r\n\t\tif ($this->pzkParentId) {\r\n\t\t\treturn pzk_store_element($this->pzkParentId);\r\n\t\t}\r\n\t\treturn NULL;\r\n\t}", "public function getParent() {\n\t\t\treturn $this->parent;\n\t\t}", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function getParent();", "public function parent()\r\n\t{\r\n\t\treturn $this->parent;\r\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 parent() {\n return $this->parent;\n }", "final public function getParent()\n\t{\n\t\treturn $this->parent;\n\t}", "public function getParent() {\n return $this->__parent;\n }", "public function getParent()\n {\n if (! $this->parentrecord) {\n list($this->parentrecord, $unused) = self::getParentAndChild($this->flatpath);\n }\n return $this->parentrecord;\n }", "public function getParent()\n {\n return $this->parent;\n\n }", "public function getParent() {\n return $this->mediator_->getContainerForName($this->get('parentName'), $this->getType());\n }", "function getParent();", "public function getParent(){\n return $this->_parent;\n }", "public function parent()\n {\n if ( !$this->loaded )\n $this->reload();\n\n if ($this->is_root())\n return NULL;\n\n if ( ! in_array('parent', $this->_objects) )\n {\n $sql = \"SELECT * FROM $this->_table_name\n WHERE \n $this->primary_column = $this->parent_key\n ORDER BY \". $this->_sorting[0] .\" \". $this->_sorting[1] .\"\n \";\n\n $result = $this->_db->query($sql);\n\n $this->_objects['parent'] = $this->factory_set($result)[0];\n }\n\n return $this->_objects['parent'];\n }", "public function getParentIdentifier()\n {\n return $this->parent;\n }", "public function getParentID()\n {\n return $this->parent_id;\n }", "final public function getParent() {\n\t\treturn $this->_parentNode;\n\t}", "public function parentRecord()\r\n {\r\n return $this->_parent;\r\n }", "public function getParent_id() {\n\t\treturn $this->parent_id;\n\t}", "public function getParent()\n {\n return $this->Root->parentOfSection($this->URLSegment);\n }", "protected function retrieveParent()\n {\n }", "public function getParentId()\n\t{\n\t\treturn $this->parent_id;\n\t}", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function getParentId()\n {\n return $this->parent_id;\n }", "public function parent()\n\t{\n\t\tif( static::$databaseColumnParent !== NULL )\n\t\t{\n\t\t\t$parentColumn = static::$databaseColumnParent;\n\t\t\tif( $this->$parentColumn !== static::$databaseColumnParentRootValue )\n\t\t\t{\n\t\t\t\treturn static::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( isset( static::$parentNodeClass ) )\n\t\t{\n\t\t\t$parentNodeClass = static::$parentNodeClass;\n\t\t\t$parentColumn = static::$parentNodeColumnId;\n\t\t\tif( $this->$parentColumn )\n\t\t\t{\n\t\t\t\treturn $parentNodeClass::load( $this->$parentColumn );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn NULL;\n\t}", "public function getParent()\n {\n }", "public function getParent()\n {\n // TODO: Implement getParent() method.\n }", "public function getParentObject()\n\t{\n\t\treturn $this->parent_obj;\n\t}", "public function getParent(){\n\t\treturn $this->father;\n\t}", "public function parent() { return $this->post->post_parent; }", "public function getParent() {\n\t\tif ($this->path === '/') {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->nodeDataRepository->findOneByPath($this->parentPath, $this->workspace);\n\t}", "public function getParent() {\n return Tracker_FormElementFactory::instance()->getFieldByid($this->parent_id);\n }", "public function getParentId();", "public function getParentId();", "public function getParentId();", "public function getParentItem() {\n return $this->parentItem;\n }", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item)) {\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function getParent()\n\t{\n\t\tif (!is_object($this->_item))\n\t\t{\n\t\t\t$this->getCategory();\n\t\t}\n\n\t\treturn $this->_parent;\n\t}", "public function getParent()\n {\n if (array_key_exists(\"parent\", $this->_propDict)) {\n if (is_a($this->_propDict[\"parent\"], \"\\Beta\\Microsoft\\Graph\\Model\\ParentLabelDetails\") || is_null($this->_propDict[\"parent\"])) {\n return $this->_propDict[\"parent\"];\n } else {\n $this->_propDict[\"parent\"] = new ParentLabelDetails($this->_propDict[\"parent\"]);\n return $this->_propDict[\"parent\"];\n }\n }\n return null;\n }", "function parentID( )\r\n {\r\n return $this->ParentID;\r\n }", "public function parent() {\n\t\treturn $this->hasOne(Forum::getSectionClass(), \"parent_id\");\n\t}", "final protected function parentId() {return $this->r('originalId');}", "public function get_parent_id() {\n\t\treturn $this->post->post_parent;\n\t}", "public function getIdParent()\n {\n return $this->id_parent;\n }", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParentId()\n {\n return $this->parentId;\n }", "public function getParentEntity() {\n\t\treturn get_entity($this->getParentGUID());\n\t}", "public function getParent () {\n\t\treturn ProjectFactory::getProject($this->idParent);\n\t}" ]
[ "0.8761789", "0.8725119", "0.867668", "0.8497202", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.84284776", "0.8410566", "0.8410566", "0.84060216", "0.839747", "0.839747", "0.8388487", "0.8388487", "0.8382035", "0.8381631", "0.83683014", "0.83683014", "0.83665335", "0.8348898", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8347747", "0.8346726", "0.8330295", "0.8330295", "0.8330295", "0.8330295", "0.8330295", "0.8330295", "0.8330295", "0.8327339", "0.8317283", "0.8288882", "0.8283134", "0.8246536", "0.8225851", "0.820646", "0.8200532", "0.81659263", "0.8152861", "0.80658126", "0.8046846", "0.8032449", "0.8002506", "0.80014825", "0.7967166", "0.79336435", "0.79192424", "0.79192424", "0.78988224", "0.7888681", "0.7856701", "0.7826306", "0.7813475", "0.78075373", "0.78050506", "0.780309", "0.77931875", "0.77931875", "0.77931875", "0.77666724", "0.77566314", "0.7755818", "0.7729048", "0.7686248", "0.7682228", "0.76813835", "0.76802135", "0.76669097", "0.76595175", "0.76595175", "0.76458174", "0.7644526" ]
0.0
-1
Use known routes instead of find routes recursively
private function _getFromKnownRoutes($source, $userRole){ // pr($userRole);die; $knownRoutes = [ 'Expert' => [ 'Appointments' => ['Users','Experts'], 'Conversations' => ['Users','Experts'] ], 'User' => [] ]; if(isset($knownRoutes[$userRole][$source])){ return $knownRoutes[$userRole][$source]; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_routes() {\n\n // 1. plugins routes\n foreach($this->context->plugins() as $plugin) {\n \n if(false === $plugin->is_type('IRoutesPlugin')) continue;\n\n foreach($plugin->routes() as $route_value) {\n $this->routes[]= $route_value;\n }\n }\n\n // 2. config.xml routes\n $config_routes= $this->context->config()->routes();\n // XXX: review, maybe Route[] should be returned by configurator?\n foreach( $config_routes as $r ) {\n // xxx. requirements\n $this->routes[]= new Route( \n (string)trim($r['name']), // name\n (string)trim($r['value']), // definition\n $this->context->config()->route_defaults($r) // array with defaults\n );\n }\n\n // Medick::dump($this->routes);\n\n // xxx: throw exception if 0 routes?\n }", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }", "protected function routes()\n {\n if ($this->app->routesAreCached()) {\n return;\n }\n\n\n /**\n * Porteiro; Routes\n */\n $this->loadRoutesForRiCa(__DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'routes');\n }", "private static function traverseRoutes() {\r\n\r\n\r\n\t\t$method = $_SERVER['REQUEST_METHOD'];\r\n\t\t$requested = $_SERVER['REQUEST_URI'];\r\n\t\t$path = $requested; // set our path to our request\r\n\t\t$path = explode('?',$path)[0]; // check for a query string. At zero index\r\n\t\t$path = strlen($path) > 1 ? rtrim($path,'/') : $path; //strip the slash at the end of the string (if its there). rtrim will take care of this automatically\r\n\t\t$parts = explode('/',$path);\r\n\t\t$parameters = array(); // Start traversal process. These are the parameters that we will pass\r\n\t\t$level = &self::$routes[$method]; // same as when we are registering. Grab a reference to our trunk\r\n\t\t\r\n\t\t// traverse the tree and determine if we have a valid route\r\n\t\treset($parts);\r\n\t\twhile(($part = current($parts)) !== false) {\r\n\r\n\t\t\tif(isset($level[$part])) { // found, now we move down one more level\r\n\t\t\t\t$level = &$level[$part];\r\n\t\t\t} elseif(isset($level['@'])) { // didn't find a defined, but we have a wild card. Go down this level\r\n\t\t\t\t$level = &$level['@'];\r\n\t\t\t\t$parameters[$level['name']] = urldecode($part);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new RouteException($requested.' route not found');\r\n\t\t\t}\r\n\r\n\t\t\tnext($parts);\r\n\t\t}\r\n\r\n\t\t// we have reached the final level. Extract the required information and dig in \r\n\t\t$callback = $level['*'];\r\n\t\tif(is_callable($callback)) {\r\n\t\t\t$callback($parameters);\r\n\t\t} else {\r\n\t\t\t$callbackParts = explode('@', $callback);\r\n\t\t\t$class = 'App\\Controllers\\\\'.$callbackParts[0];\r\n\t\t\t$function = $callbackParts[1];\r\n\t\t\t$controller = new $class();\r\n\t\t\treturn $controller->{$function}($parameters);\r\n\t\t}\r\n\r\n\t}", "public function getRoutes() {}", "public static function getRoutes();", "public static function getRoutes();", "public function parseRoutes()\n {\n $this->cacheRoutes();\n\n $request_uri = $this->prepareUrl($_SERVER['REQUEST_URI']);\n\n foreach (static::$routes as $uri => $data) {\n static::$uri = $uri;\n static::$routingType = $data['routingType'];\n\n if ($this->compareMethods($data['methods'], $data['routingType']) === false)\n continue;\n\n if ($this->parseUri($uri, $request_uri) === false)\n if (static::$urlCatcher === false)\n continue;\n\n if ($this->parseMiddleware($data['middleware']) === false)\n break;\n\n $this->parseServices($data['services']);\n\n if ($data['locale'] !== null)\n App::setLocale($data['locale']);\n\n // Execute\n $this->executeRoute($uri, $data);\n\n RouterStatus::increase();\n break;\n }\n\n if (RouterStatus::get() === 0) {\n static::$uri = null;\n abort(404);\n\n return;\n }\n }", "public function getRoutes();", "public function getRoutes();", "protected function _loadRoutes()\n\t{\n\t\t$this->_routes['/^\\/login\\/?$/'] = '/account/login';\n\t}", "protected function loadRoutes()\n\t{\n\t\tglobal $app;\n\t\t$app = $this->app;\n\t\n\t\t$routesPaths = $this->container->locator->findResources('routes://', true, true);\n\n\t\tforeach ($routesPaths as $key => $path) {\n\t\t\t$routeFiles = glob($path . '/*.php');\n\t\t\n\t\t\tforeach ($routeFiles as $file) {\n\t\t\t\trequire_once $file;\n\t\t\t}\n\t\t}\n\t}", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function getSystemRoutes();", "protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function routes(): array\n {\n $language = $this->language;\n $kirby = $language->kirby();\n $routes = $kirby->routes();\n\n // only keep the scoped language routes\n $routes = array_values(array_filter($routes, function ($route) use ($language) {\n\n // no language scope\n if (empty($route['language']) === true) {\n return false;\n }\n\n // wildcard\n if ($route['language'] === '*') {\n return true;\n }\n\n // get all applicable languages\n $languages = Str::split(strtolower($route['language']), '|');\n\n // validate the language\n return in_array($language->code(), $languages) === true;\n }));\n\n // add the page-scope if necessary\n foreach ($routes as $index => $route) {\n if ($pageId = ($route['page'] ?? null)) {\n if ($page = $kirby->page($pageId)) {\n\n // convert string patterns to arrays\n $patterns = A::wrap($route['pattern']);\n\n // prefix all patterns with the page slug\n $patterns = array_map(function ($pattern) use ($page, $language) {\n return $page->uri($language) . '/' . $pattern;\n }, $patterns);\n\n // reinject the pattern and the full page object\n $routes[$index]['pattern'] = $patterns;\n $routes[$index]['page'] = $page;\n } else {\n throw new NotFoundException('The page \"' . $pageId . '\" does not exist');\n }\n }\n }\n\n return $routes;\n }", "protected function prepareRoutes ()\n {\n foreach ($this->routes as $index => $route) {\n $this->registerNamedRoute($route);\n $this->registerRouteMethods($route, $index);\n }\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "public static function routes(): void\n {\n //\n }", "protected function loadRoutes()\n {\n $router = $this->app->make(Router::class);\n\n $router->pattern('url', '.+');\n\n $router->pattern('pageToken', '\\[a-z0-9]+');\n $router->bind('pageToken', function ($token) {\n $repository = $this->app->make(WikiEngine::class)->repository();\n\n $page = $repository->pageByToken($token);\n\n // Throw 404 error if page not found by token\n if ($page === null) {\n abort(404);\n }\n\n return $page;\n });\n\n $router->pattern('userId', '\\d+');\n $router->model('userId', User::class, function () {\n abort(404);\n });\n\n if (!$this->app->make('app')->routesAreCached()) {\n $attributes = [\n 'namespace' => 'ViKon\\\\Wiki\\\\Http\\\\Controller',\n ];\n $router->group($attributes, function () {\n require __DIR__ . '/Http/routes.php';\n });\n }\n }", "private function getRoutes()\r\n\t{\r\n\t\t$this->info('Loading Api routes...');\r\n\r\n\t\tif (config('openapischemas.router') === 'laravel') {\r\n\t\t\treturn Route::getRoutes();\r\n\t\t} else {\r\n\t\t\treturn app('Dingo\\Api\\Routing\\Router')->getRoutes()[config('openapischemas.routes_prefix')];\r\n\t\t}\r\n\t}", "public static function getRoutes()\n {\n $routes = new \\FreeFW\\Router\\RouteCollection();\n $paths = [];\n $paths[] = __DIR__ . '/../resource/routes/restful/routes.php';\n foreach ($paths as $onePath) {\n $apiRoutes = @include($onePath);\n if (is_array($apiRoutes)) {\n foreach ($apiRoutes as $routeId => $apiRoute) {\n $myRoute = new \\FreeFW\\Router\\Route();\n $myRoute\n ->setId($routeId)\n ->setMethod($apiRoute[\\FreeFW\\Router\\Route::ROUTE_METHOD])\n ->setUrl($apiRoute[\\FreeFW\\Router\\Route::ROUTE_URL])\n ->setController($apiRoute[\\FreeFW\\Router\\Route::ROUTE_CONTROLLER])\n ->setFunction($apiRoute[\\FreeFW\\Router\\Route::ROUTE_FUNCTION])\n ;\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_ROLE, $apiRoute)) {\n $myRoute->setRole($apiRoute[\\FreeFW\\Router\\Route::ROUTE_ROLE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_AUTH, $apiRoute)) {\n $myRoute->setAuth($apiRoute[\\FreeFW\\Router\\Route::ROUTE_AUTH]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_INCLUDE, $apiRoute)) {\n $myRoute->setInclude($apiRoute[\\FreeFW\\Router\\Route::ROUTE_INCLUDE]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_MODEL, $apiRoute)) {\n $myRoute->setDefaultModel($apiRoute[\\FreeFW\\Router\\Route::ROUTE_MODEL]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COLLECTION, $apiRoute)) {\n $myRoute->setCollection($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COLLECTION]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_COMMENT, $apiRoute)) {\n $myRoute->setComment($apiRoute[\\FreeFW\\Router\\Route::ROUTE_COMMENT]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_PARAMETERS, $apiRoute)) {\n $myRoute->setParameters($apiRoute[\\FreeFW\\Router\\Route::ROUTE_PARAMETERS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_RESULTS, $apiRoute)) {\n $myRoute->setResponses($apiRoute[\\FreeFW\\Router\\Route::ROUTE_RESULTS]);\n }\n if (array_key_exists(\\FreeFW\\Router\\Route::ROUTE_SCOPE, $apiRoute)) {\n $myRoute->setScope($apiRoute[\\FreeFW\\Router\\Route::ROUTE_SCOPE]);\n }\n $routes->addRoute($myRoute);\n }\n }\n }\n return $routes;\n }", "public function route()\n {\n $path = Url::getPath();\n\n // If no routes exist, set 404\n if (count($this->routes) == 0)\n {\n return;\n }\n\n // Check if exact match (cheap)\n if ((isset($this->routes[$path]))\n && (!$this->routes[$path]['is_regex']))\n {\n $this->dispatch($this->routes[$path]);\n exit;\n }\n\n // Loop through all routes and attempt to find a match. (expensive)\n foreach ($this->routes as $i => $route)\n {\n $matches = null;\n\n // If route found\n if (($route['is_regex'])\n && (preg_match($route['match'], $path, $matches)))\n {\n // Remove full match from array list\n array_shift($matches);\n\n $this->dispatch($route, $matches);\n exit;\n }\n }\n }", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function registerSiteRoutes()\n\t{\n\t\t// NOTE: the second route is used to capture files in subdirectories as well\n\t\treturn array(\n\t\t\t'internal/(?P<id>.\\d*)' => array('action' => 'AssetManagement/Assets/findById'),\n\t\t\t'internal/(?P<directory>.*)/(?P<name>.*)' => array('action' => 'AssetManagement/Assets/findInDirectory')\n\t\t);\n\t}", "public function initRoutes()\r\n {\r\n $route = new Route();\r\n\r\n $routesConf = include __DIR__ . '/../../config/routes.inc.php';\r\n\r\n foreach ($routesConf as $routeConf) {\r\n\r\n $uri = $routeConf['uri'];\r\n\r\n if (preg_match_all('/\\$(.*?(?=\\/)|.*?$)/', $routeConf['uri'], $matches)) {\r\n $uri = preg_replace('/\\$(.*?(?=\\/)|.*?$)/', '.*', $routeConf['uri']);\r\n }\r\n\r\n $route->add($uri, $routeConf, $matches[1], function($params) {\r\n $this->config->route = $params['config'];\r\n\r\n $args = [];\r\n if (isset($params['arguments'])) {\r\n $args = $params['arguments'];\r\n }\r\n\r\n $controller = new $params['config']['controller']($this->config, $this->db, $args);\r\n\r\n $controller->indexAction();\r\n });\r\n }\r\n\r\n $findUrl = $route->submit();\r\n\r\n if (!$findUrl) {\r\n header('HTTP/1.0 404 Not Found');\r\n include_once __DIR__ . '/../../../src/Views/errors/404_de.html';\r\n }\r\n }", "private static function loadRoutes()\n {\n $route_found = false;\n foreach (\n sf_conf('routes') as $path => $route_data\n ) {\n $route_found = true;\n self::$routes[$path] = Route::buildRoute($path, $route_data);\n }\n\n if (! $route_found) {\n trigger_error(\n 'No routes have been configured. Check routes.yaml.',\n E_USER_ERROR\n );\n\n exit;\n }\n }", "protected function mapRoutes()\n {\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/base.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/api/admin.php');\n // $this->loadRoutesFrom(__DIR__.'/../../routes/web.php');\n $this->loadRoutesFrom(__DIR__.'/../../routes/auth.php');\n }", "public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }", "protected function _connectDefaultRoutes(): void\n {\n Router::scope('/', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n }", "private function route(): void\n {\n $url = $this->getUrlAsArray();\n $size = \\sizeof($url);\n $section = $this->section;\n\n for ($i = 0; $i < $size; $i++) {\n if ($i < ($size - 1)) {\n $section = $section->searchInSections($url[$i]);\n if ($section instanceof Section) {\n }\n } else {\n $route = $section->searchInRoutes($url[$i]);\n // TODO: Show view and use models\n if ($route instanceof Route) {\n\n }\n }\n }\n }", "public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function getListRoutes()\r\n {\r\n $result = array();\r\n \r\n if (count( $this->routes ))\r\n {\r\n foreach ( $this->routes as $act )\r\n {\r\n \r\n $route_str = '';\r\n if (isset( $this->default_params['url_prefix'] ) && ! empty( $this->default_params['url_prefix'] ))\r\n {\r\n $route_str = $this->default_params['url_prefix'];\r\n }\r\n \r\n if (is_array( $act['type'] ))\r\n {\r\n $route_str = implode( '|', $act['type'] ) . ' ' . $route_str;\r\n }\r\n else\r\n {\r\n $route_str = $act['type'] . ' ' . $route_str;\r\n }\r\n $route_str .= $act['route'];\r\n \r\n if (isset( $act['params']['ajax'] ) && (bool) ($act['params']['ajax']))\r\n {\r\n $route_str .= ' [ajax]';\r\n }\r\n \r\n $action_str = '';\r\n if (isset( $act['params']['namespace'] ) && ! empty( $act['params']['namespace'] ))\r\n {\r\n $action_str = (string) $act['params']['namespace'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['namespace'] ) && ! empty( $this->default_params['namespace'] ))\r\n {\r\n $action_str = $this->default_params['namespace'];\r\n }\r\n }\r\n $action_str .= '\\\\';\r\n \r\n if (isset( $act['params']['controller'] ))\r\n {\r\n $action_str .= (string) $act['params']['controller'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['controller'] ) && ! empty( $this->default_params['controller'] ))\r\n {\r\n $action_str .= $this->default_params['controller'];\r\n }\r\n }\r\n $action_str .= '->' . (string) $act['params']['action'];\r\n \r\n $kbps = $this->default_params['kbps'];\r\n if( isset( $act['params']['kbps'] ) ){\r\n \t$kbps = $act['params']['kbps'];\r\n }\r\n $ttl = $this->default_params['ttl'];\r\n if( isset( $act['params']['ttl'] ) ){\r\n \t$ttl = $act['params']['ttl'];\r\n }\r\n \r\n $route = new \\stdclass();\r\n $route->pattern = $route_str;\r\n $route->handler = $action_str;\r\n $route->ttl = $ttl;\r\n $route->kbps = $kbps;\r\n $result[] = $route;\r\n }\r\n }\r\n \r\n return $result;\r\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "protected function loadRoutes()\n {\n $this->app->call([$this, 'map']);\n }", "protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\n }", "static public function routes()\n\t{\n\t\tglobal $core;\n\t\tstatic $constructed;\n\n\t\tif (!$constructed)\n\t\t{\n\t\t\t$constructed = true;\n\n\t\t\tself::$routes += $core->configs->fuse('routes', array(__CLASS__, 'routes_constructor'));\n\t\t}\n\n\t\treturn self::$routes;\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapCustomerRoutes();\n\n $this->mapInternalRoutes();\n\n $this->mapVendorRoutes();\n\n $this->mapWhiteGloveRoutes();\n\n $this->mapLocalRoutes();\n }", "public static function all()\n\t{\n\t\treturn Route::$_routes + Kohana::$tree['routes']['external'];\n\t}", "private function searchRoute()\r\n {\r\n $currentUrl = self::cleanUrl(self::getCurentUrl());\r\n $activeMethod = self::getActiveMethod();\r\n\r\n foreach (array_reverse($this->routes) as $route) {\r\n if (preg_match('/^'.$route['regex'].'$/', $currentUrl) && $activeMethod === $route['method']) {\r\n $route['active'] = $currentUrl;\r\n return $route;\r\n }\r\n }\r\n }", "protected function loadRoutes()\n {\n $routeLoader = $this->container->get('routing.loader');\n $routes = $this->routes;\n foreach ($this->bundles as $bundle) {\n if (!$this->loaded[$bundle]) {\n $resource = $this->container->get('kernel')->locateResource(sprintf('@%s/Controller/', $bundle));\n $routes = array_merge($routes, $routeLoader->load($resource)->all());\n }\n }\n\n foreach($routes as $routeName => $route) {\n if (array_key_exists('label', $route->getOptions())) {\n $this->routes[$routeName] = $route;\n }\n }\n }", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "private static function xml_route(){\n\t\t\n\t\t$xml_routes=new Parser();\n\t\t$xml_routes->load_from_file('routes.xml');\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$routes=$xml_routes->getElementsByAttributeValue('method', Request::get_request_type());\n\t\t\n\t\t$str_routes=\"\";\n\t\t$found_route=null;\n\t\tforeach ($routes as $item){\n\t\t\t\n\t\t\tif($item->nodeType==XML_ELEMENT_NODE){\n\t\t\t\tforeach($item->childNodes as $attr){\n\t\t\t\t\t\n\t\t \tif($attr->nodeType==XML_ELEMENT_NODE){\n\t\t \n\t\t \t\tif($attr->tagName==\"request\"){\n\t\t \t\t\tif($item->getAttribute('method')==$_SERVER['REQUEST_METHOD']){\n\t\t \t\t\t\t$match_route=$item->cloneNode(true);\n\t\t \t\t\t\t//print \"{$match_route->getElementsByTagName('request')->item(0)->nodeValue}\\n\";\n\t\t \t\t\t\t\n\t\t \t\t\t\t$controller=$match_route->getElementsByTagName('controller')->item(0)->nodeValue;\n\t\t \t\t\t\t$action=$match_route->getElementsByTagName('action')->item(0)->nodeValue;\n\t\t \t\t\t\t\n\t\t \t\t\t\t$match=str_ireplace('/','\\\\/',$match_route->getElementsByTagName('request')->item(0)->nodeValue);\n\t\t \t\t\t\t//$match.=\"(\\\\/(.*))?\";\n\t\t \t\t\t\t$match='/^'.$match.'$/';\n\t\t \t\t\t\t$replace=\"/$controller/$action\";\n\t\t \t\t\t\tif($match_route->getAttribute('args')==true){\n\t\t \t\t\t\t\t$number_args=($match_route->getAttribute('argsnum')!==null)?$match_route->getAttribute('argsnum'):1;\n\t\t \t\t\t\t\tfor($i=1;$i<=$number_args;$i++)\n\t\t \t\t\t\t\t$replace.=\"/$\".$i;\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(preg_match($match, $request)){\n\t\t \t\t\t\t\t$request=preg_replace($match,$replace,$request);\n\t\t \t\t\t\t\t$found_route=$item->cloneNode(true);\n\t\t \t\t\t\t\t\n\t\t \t\t\t\t\t//print \"Found\\n\";\n\t\t \t\t\t\t\tbreak;\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t}\n\t\t\t\t}\n\t\t }\n\t\t if($found_route!==null){\n\t\t \tbreak;\n\t\t }\n\t\t}\n\t\t\n\t\treturn $request;\n\t}", "protected function add_configured_routes() {\n global $ROOT_DIR;\n \n // we'll need a builder\n $builder = new Controller_Routing_Builder($this);\n \n // start with any legacy routes\n $this->add_legacy_configured_routes($builder);\n \n // load the routes file if we have one\n if (file_exists(\"$ROOT_DIR/config/routes.php\")) {\n $route = $builder;\n include_once(\"routes.php\");\n } else {\n $this->add_legacy_default_routes($builder);\n }\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "protected function loadScannedRoutes()\n {\n $this->app->booted(function () {\n $router = $this->app['Illuminate\\Contracts\\Routing\\Registrar'];\n\n require $this->finder->getScannedRoutesPath();\n });\n }", "public function routes() {\n $storage = $this->entityTypeManager->getStorage('graphql_server');\n /** @var \\Drupal\\graphql\\Entity\\ServerInterface[] $servers */\n $servers = $storage->loadMultiple();\n $routes = [];\n\n // Allow all authentication providers by default.\n $auth = array_keys($this->authenticationCollector->getSortedProviders());\n\n foreach ($servers as $id => $server) {\n $path = $server->get('endpoint');\n\n $routes[\"graphql.query.$id\"] = (new Route($path))\n ->addDefaults([\n 'graphql_server' => $id,\n '_graphql' => TRUE,\n '_controller' => '\\Drupal\\graphql\\Controller\\RequestController::handleRequest',\n '_disable_route_normalizer' => TRUE,\n ])\n ->addRequirements([\n '_graphql_query_access' => 'graphql_server:{graphql_server}',\n '_format' => 'json',\n ])\n ->addOptions([\n '_auth' => $auth,\n 'no_cache' => TRUE,\n 'default_url_options' => ['path_processing' => FALSE],\n 'parameters' => ['graphql_server' => ['type' => 'entity:graphql_server']]\n ]);\n }\n\n return $routes;\n }", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "function add_listing_routes()\n {\n $this->add_route('GET', '/routes', function(){\n print \"<h1>Routes</h1>\";\n foreach($this->routes as $method => $routes) {\n print \"<h3>\".$method.\"</h3>\";\n print \"<ul>\";\n foreach ($routes as $route) {\n print \"<li>\".$route->path.\"</li>\";\n }\n print \"</ul>\";\n }\n });\n }", "private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }", "protected function loadRoute()\n {\n $this->post('/task', 'task.controller:saveAction');\n\n // Url for update task\n $this->put('/task/{id}', 'task.controller:updateAction');\n\n // Url for see one task\n $this->get('/task/{id}', 'task.controller:getAction');\n\n // Url for delete task\n $this->delete('/task/{id}', 'task.controller:deleteAction');\n\n // Url for list of tasks\n $this->get('/task', 'task.controller:listAction');\n\n //Get Tag list\n $this->get('/tags', 'tag.controller:listAction');\n\n //Add tag to task\n $this->post('/addTag', 'tag.controller:setTagAction');\n\n //Add tag to tag list\n $this->post('/tag', 'tag.controller:saveAction');\n\n //Search by tag\n $this->get('/search/tag', 'tag.controller:searchAction'); \n\n // Url for delete tag in tag list\n $this->delete('/tag', 'tag.controller:deleteAction');\n \n // Url for auth github\n $this->post('/github', 'github.controller:authAction'); \n }", "private function loadRoutes() {\n $routesJson = file_get_contents('config/routing.json');\n $routesArray = json_decode($routesJson, true);\n\n foreach ($routesArray as $routeElement) {\n $route = new Route($routeElement['route'], array(\n 'controller' => $routeElement['controller'],\n 'action' => $routeElement['action']\n ));\n $this->routeCollection->add($routeElement['name'], $route);\n }\n }", "private function _loadRoutes()\n\t{\n\t\tif(file_exists(__DIR__.'/routes.php')) {\n\t\t\tinclude __DIR__ . '/routes.php';\n\t\t}\n\t}", "public function testFindAllByRoute()\n {\n $this->markTestIncomplete('WebTestCases are not implemented yet.');\n }", "protected function loadRoutes()\n {\n if (!$this->app->routesAreCached()) {\n $this->routes($this->app->make(Router::class));\n }\n }", "protected function scanRoutes()\n {\n $scans = $this->routeScans();\n\n if (empty($scans)) {\n return;\n }\n\n $scanner = $this->app->make('annotations.route.scanner');\n\n $scanner->setClassesToScan($scans);\n\n file_put_contents(\n $this->finder->getScannedRoutesPath(), '<?php '.$scanner->getRouteDefinitions()\n );\n }", "protected function loadAnnotatedRoutes()\n {\n if ($this->app->environment('local') && $this->scanWhenLocal) {\n $this->scanRoutes();\n }\n\n $scans = $this->routeScans();\n\n if (!empty($scans) && $this->finder->routesAreScanned()) {\n $this->loadScannedRoutes();\n }\n }", "public function all()\n {\n $routes = parent::all();\n\n // sort routes by names - move custom actions at the beginning,\n // default at the end\n uksort($routes, function($route1, $route2) {\n $route1Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route1);\n $route2Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route2);\n\n if ($route1Match && !$route2Match) {\n return 1;\n } elseif (!$route1Match && $route2Match) {\n return -1;\n } else {\n return strcmp($route1, $route2);\n }\n });\n\n return $routes;\n }", "public function generateRoutes()\n {\n $routes = property_exists(app(), 'router')? app()->router->getRoutes() : app()->getRoutes();\n foreach ($routes as $route) {\n array_push($this->routes, [\n 'method' => $route['method'],\n 'uri' => $route['uri'],\n 'name' => $this->getRouteName($route),\n 'action' => $this->getRouteAction($route),\n 'middleware' => $this->getRouteMiddleware($route),\n 'map' => $this->getRouteMapTo($route)\n ]);\n }\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }" ]
[ "0.7215689", "0.7088724", "0.69434935", "0.6906194", "0.6901884", "0.68630147", "0.6826024", "0.6720935", "0.6720935", "0.66849315", "0.66722447", "0.66722447", "0.6663022", "0.6657879", "0.66372544", "0.66244894", "0.6620528", "0.6606545", "0.6603113", "0.6599434", "0.65611035", "0.65490395", "0.6548172", "0.6545328", "0.6465903", "0.6465562", "0.6464131", "0.64635116", "0.6461717", "0.64521027", "0.64513975", "0.6442485", "0.64377964", "0.6413168", "0.63843036", "0.6377725", "0.6330118", "0.63284904", "0.63154274", "0.63024294", "0.63010716", "0.62760884", "0.626469", "0.6258971", "0.6256779", "0.6255375", "0.62506735", "0.6243348", "0.62400997", "0.6238752", "0.62323755", "0.6227239", "0.6227239", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62247527", "0.62230456", "0.6218887", "0.621257", "0.620417", "0.62018293", "0.6184968", "0.6176093", "0.6166565", "0.616459", "0.6163012", "0.6161855", "0.61432475", "0.61411643", "0.61297977", "0.61253756", "0.6125247" ]
0.0
-1
function to ignore the role Access for common apis for both Expert and Customers
private function _ignoreRoleAccess($prefix){ if($prefix){ $commonApis = [ 'api' => [ 'Users' => ['addPhone'], 'UserDeviceTokens' => ['add','edit'], 'SpecializationServices' => ['index'], 'ExpertSpecializationServices' => ['view'] ], 'api/user' => [ 'AppointmentBookings' => ['index','view'], 'AppointmentReviews' => ['add'], 'Users' => ['addCard','deleteCard','listCards','viewCard'] ] ]; return !$this->_checkUnAuthorized($commonApis[$prefix]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rol_conductor_not_access()\n {\n if ($this->rol != 1 && $this->rol != 2) {\n exit($this->httpResponse(\"error\", \"forbbiden\", \"Your role do not have permission\", 403)->json());\n }\n }", "public function rol_conductor_only_access()\n {\n if ($this->rol != 3) {\n exit($this->httpResponse(\"error\", \"forbbiden\", \"Your role do not have permission\", 403)->json());\n }\n }", "public function skipsAuthorization(): bool\n {\n return true;\n }", "protected abstract function onAuthorizeMissingOwner(): Effect|Response;", "public function attestationExcludedCredentials(): array;", "public function veterinaireDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_VETERINAIRE');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_VETERINAIRE', null, 'User tried to access a page without having ROLE_VETERINAIRE');\n}", "public function responsableDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_RESPONSABLE', null, 'User tried to access a page without having ROLE_RESPONSABLE');\n}", "public function adminOnly();", "public function adminOnly();", "public function testShowUnauthicatedAccess(): void { }", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "public function adminDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_ADMINISTRATEUR');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_ADMINISTRATEUR', null, 'User tried to access a page without having ROLE_ADMINISTRATEUR');\n}", "static function denied()\n {\n\n }", "protected function matchHideForNonAdminsCondition() {}", "public function getIsCustomerAccessLimited(): bool;", "function unauthorizedUsersOnly(){\n global $authenticatedUser;\n if(!empty($authenticatedUser)){\n header(\"HTTP/1.1 403 Forbidden\");\n header('Location: https://eso.vse.cz/~frim00/marvelous-movies/');\n exit();\n }\n }", "public function denyAccess(): AccessResultInterface;", "public function livreurDashboard()\n{\n $this->denyAccessUnlessGranted('ROLE_LIVREUR');\n\n // or add an optional message - seen by developers\n $this->denyAccessUnlessGranted('ROLE_LIVREUR', null, 'User tried to access a page without having ROLE_LIVREUR');\n}", "public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }", "function pinimp_remove_capability($capability)\n{\n // this function remove the $capability only from the classic roles\n $check_order = array(\"subscriber\", \"contributor\", \"author\", \"editor\", \"administrator\");\n\n foreach ($check_order as $role) {\n $role = get_role($role);\n $role->remove_cap($capability);\n }\n\n}", "public function testIsAllowedNotMyRole()\n {\n $class = new \\ReflectionClass(get_class($this->mvcKeeper));\n $method = $class->getMethod('isAllowed');\n $method->setAccessible(true);\n\n $authorize = new Authorize([\n 'value' => [\n 'roles' => [\n 'NotMyRole'\n ],\n 'permissions' => [\n 'grant-for-all-users',\n ]\n ]\n ]);\n\n $this->assertFalse($method->invoke($this->mvcKeeper, $authorize));\n }", "public static function removeAccessCapability() {\n foreach (wp_roles()->role_objects as $name => $role) {\n if (in_array($name, static::getAccessibleRoles())) {\n $role->remove_cap('admin_access');\n }\n }\n }", "public function setDefaultPermissions()\n {\n $this->allow('guest', 'default_error');\n $this->allow('guest', 'default_uploader');\n $this->allow('guest', 'default_lang');\n $this->allow('guest', 'people_auth');\n $this->allow('guest', 'api_auth');\n $this->allow('guest', 'api_search');\n $this->allow('guest', 'api_company');\n $this->allow('guest', 'api_entidad');\n $this->allow('guest', 'frontend_index');\n $this->allow('guest', 'frontend_auth');\n $this->allow('guest', 'frontend_account');\n $this->allow('guest', 'frontend_auction');\n $this->allow('guest', 'frontend_search');\n $this->allow('guest', 'frontend_product');\n $this->allow('guest', 'frontend_page');\n /**\n * User Access Level Permissions\n */\n $this->allow('user', 'default_index');\n $this->allow('user', 'default_error');\n $this->allow('user', 'default_uploader');\n $this->allow('user', 'default_lang');\n $this->allow('user', 'people_auth');\n $this->allow('user', 'search_index');\n $this->allow('user', 'frontend_search');\n $this->allow('user', 'frontend_product');\n $this->allow('user', 'frontend_page');\n $this->allow('user', 'people_user', array(\n 'my', // View My Details Page\n 'view', // View User Details Page\n 'changepassword', // Change Password Page\n 'updateavatar', // Update Avatar Lightbox\n 'getavatar', // Get Avatar JSON Call\n 'get-addr-avatar','setavatar', // Set Avatar JSON Call\n 'removeavatar' // Remove Avatar JSON Call\n ));\n\n /* $this->allow('user', 'company_manage', array(\n 'index', // Company List Page\n 'view' // Company View Page\n ));*/\n }", "public function getIgnoreAccess() {\n\t\treturn elgg_get_ignore_access();\n\t}", "public function testIndexDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\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' => 'index',\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "private function userNotPermit(){\n throw new \\Symfony\\Component\\HttpKernel\\Exception\\AccessDeniedHttpException('Bad user',null, 403);\n }", "protected function notAuthorized()\n {\n $this->response = $this->response->withStatus(403);\n $this->jsonBody($this->payload->getInput());\n }", "function vns_subscribe_order_add_access_capabilities() {\n $roles = array( 'administrator','editor' );\n foreach ( $roles as $role ) {\n \n $role = get_role( $role );\n if ( empty( $role ) ) {\n continue;\n }\n \n \n \n \n if(!$role->has_cap( 'vns_subscribe_order_view_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_view_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_add_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_add_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_edit_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_edit_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_delete_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_delete_news' );\n }\n \n \n \n }\n \n $user = wp_get_current_user();\n $user->get_role_caps();\n \n}", "public function forbiddenAction() {\n }", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "public function getAllowSpecific();", "public function testIsApplicableWithNonAuthorizedUser()\n {\n $paymentMethod = $this->createMock(\\Magento\\Payment\\Model\\MethodInterface::class);\n $quote = $this->createPartialMock(\\Magento\\Quote\\Model\\Quote::class, ['getCustomerId']);\n $quote->expects($this->once())->method('getCustomerId')->willReturn(null);\n $this->assertTrue($this->hasCompanyPermission->isApplicable($paymentMethod, $quote));\n }", "public function notAuthorized(ResponseInterface $response);", "public function test_that_unauthroized_user_cannot_view_courses()\n {\n\n }", "public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }", "public function skipsAuthorization(): bool\n {\n return Gate::allows('skips-authorization', $this);\n }", "public function authorize() {\n\t\treturn false;\n }", "abstract public function require_access();", "public function testIndexDenyNotAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\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' => 'logs',\n\t\t\t\t'action' => 'index',\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public static function non_auth_actions() {\n\n\t\t/**\n\t\t * Set which actions <em>do not</em> require authentication.\n\t\t *\n\t\t * Note: must return an array. To set no actions pass an empty array.\n\t\t *\n\t\t * @since 0.1.0\n\t\t *\n\t\t * @param array $actions_to_skip\n\t\t */\n\t\t$actions_to_skip = apply_filters( 'ht_dms_internal_api_skip_authentication', array( 'hourly', 'org_no_members', 'no_org', 'consensus_details' ) );\n\n\t\tif ( ! is_array( $actions_to_skip ) ) {\n\t\t\t$actions_to_skip = array();\n\t\t}\n\n\t\treturn $actions_to_skip;\n\n\t}", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "public function authorize()\r\n {\r\n return false;\r\n }", "public function getAcl() {\n\n //throw new \\Exception(\"something\");\n\n\n\n $acl = new AclList();\n\n $acl->setDefaultAction(Acl::DENY);\n\n //Register roles\n $roles = array(\n 'users' => new Role('Users'),\n 'guests' => new Role('Guests'),\n 'operators' => new Role('Operators')\n );\n foreach ($roles as $role) {\n $acl->addRole($role);\n }\n\n //Private area resources\n $privateResources = array(\n 'report' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'notworking', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2', 'lpreport'),\n 'reportmb' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2'),\n 'operation' => array('index', 'mainstreamsourcenewname', 'getClientInfo', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'slink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup', 'set_country', 'unset_country'),\n 'smlink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup'),\n 'affiliate' => array('index', 'removeAffiliation', 'updatePayout', 'newAffiliation'),\n 'isp' => array('index', 'get_groups', 'get_group', 'create_group', 'create_isp', 'delete_isp'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index', 'gallery', 'updateBannerId', 'insertbanners', 'editbanner', 'searchbanners', 'createBulk', 'editBulk', 'cloneBulk', 'downloadZip', 'tableBulk', 'getNjump', 'getCountry', 'getSources', 'getBulk', 'getBanners', 'downloadXlsx'),\n 'alert' => array('index', 'getSourcesAlerts', 'getClientsAlerts', 'getCountriesAlerts', 'getTablesAlerts', 'newAlert', 'editAlert', 'editTables', 'removeAlert', 'newCountryAlert', 'newAggAlert', 'newSrcAlert', 'getSourceTypeAlerts', 'newSourceTypeAlert'),\n 'invest' => array('index', 'upload', 'report', 'setfilter', 'campaigns', 'getReportExcel', 'totalsRow'),\n 'security' => array('index', 'deletei'),\n 'google' => array('index', 'downloadreport', 'addgooglesource'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'last7Days', 'percentageShift'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'testphalconshit', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'permission' => array('index', 'countries', 'srcagr', 'updatecountry', 'updateAgregators', 'updateSources'),\n 'customreport' => array('index', 'getAttributes', 'savecustomreport', 'createcustom', 'getMyCustomReports', 'echoReport', 'deleteSavedReport', 'downloadReport'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns', 'executetemprestore', 'blockbyname'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'newOfferpack2', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index', 'changeGlobalName', 'getStatistics', 'favoriteNjump', 'getNjumps', 'getnjump', 'newnjump', 'njumpedit', 'njumpclone', 'njumpdelete', 'njumpdeleterow', 'njumpnewrow', 'updatecell', 'njumpsortby', 'indexm', 'njumpeditm', 'mreset', 'getnjumpsbycountry', 'njumpclonemultiplelines', 'njumpdeletemultiplerow'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($privateResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n //operation area resources\n $operationResources = array(\n 'operation' => array('index', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'report' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'reportmb' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'security' => array('index', 'deletei'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'chartinfo', 'reportbyhour', 'percentageShift', 'last7Days', 'getRateThreeMonths'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($operationResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Public area resources\n $publicResources = array(\n 'index' => array('index'),\n 'errors' => array('show404', 'show500'),\n 'session' => array('index', 'register', 'start', 'end'),\n 'offerpack' => array('getzip')\n );\n foreach ($publicResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Grant access to public areas to both users and guests\n foreach ($roles as $role) {\n foreach ($publicResources as $resource => $actions) {\n $acl->allow($role->getName(), $resource, '*');\n }\n }\n\n //Grant acess to private area to role Users\n foreach ($privateResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Users', $resource, $action);\n }\n }\n //Grant acess to operations area to role Operations\n foreach ($operationResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Operators', $resource, $action);\n }\n }\n\n //The acl is stored in session, APC would be useful here too\n $this->persistent->acl = $acl;\n\n\n return $this->persistent->acl;\n }", "function access_denied() {\n\t\tif ( ! php_version_at_least( '4.1.0' ) ) {\n\t\t\tglobal $_SERVER;\n\t\t}\n\n\t\t// Si viene por webservice no necesita estar logueado.\n\t\tif($_POST['code']=='14149989'){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! auth_is_user_authenticated() ) {\n\t\t\t$p_return_page = string_url( $_SERVER['REQUEST_URI'] );\n\t\t\tprint_header_redirect( 'index.php?m=webtracking&a=login_page&return=' . $p_return_page );\n\t\t} else {\n\t\t\tglobal $AppUI;\n\t\t\t$AppUI->redirect(\"m=public&a=access_denied\");\n\t\t\t\n\t\t\t/*\n\t\t\tprint '<center>';\n\t\t\tprint '<p>'.error_string(ERROR_ACCESS_DENIED).'</p>';\n\t\t\tprint_bracket_link( 'index.php?m=webtracking&a=main_page', lang_get( 'proceed' ) );\n\t\t\tprint '</center>';*/\n\t\t}\n\t\texit;\n\t}", "public function isAuthorized($user)\n{\n if (isset($user['role']) && $user['role'] === 'admin') {\n return true;\n }\n\n // Default deny\n return false;\n}", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function authorize()\n {\n return false;\n }", "public function forbidden() :string {\n\t\theader('HTTP/1.0 403 Forbidden');\n\t\tdie('Api overloaded 403 forbidden');\n\t}", "public function testViewDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\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'1'\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function wlabarron_saml_intercept_admin() {\n\tif ( isset( $_GET['access'] ) && $_GET['access']=='denied' ) {\n\t\tyourls_add_notice('Access Denied');\n\t}\n\n\t// Intercept requests for plugin management\n\tif(isset( $_SERVER['REQUEST_URI'] ) &&\n\t preg_match('/\\/admin\\/plugins/', $_SERVER['REQUEST_URI'] ) ) {\n \n if (!wlabarron_saml_is_user_in_config()) {\n yourls_redirect( yourls_admin_url( '?access=denied' ), 302 );\n }\n\t}\n}", "public function getExplicitlyAllowAndDeny() {}", "public function nonApiDoSomethingElse()\n {\n // empty\n }", "public function isAdministrador(){ return false; }", "public function relatorio4(){\n $this->isAdmin();\n }", "function notAllowed( $name ) {\n\t\techo _NOT_AUTH;\n\n\t\treturn null;\n\t}", "public function providerTestAccessForbidden() {\n $data = [];\n // Tests the access method without a field_name.\n $data[] = [NULL, LanguageInterface::LANGCODE_NOT_SPECIFIED];\n // Tests the access method with a non-existent field.\n $data[] = ['not_valid', LanguageInterface::LANGCODE_NOT_SPECIFIED];\n // Tests the access method without a langcode.\n $data[] = ['valid', NULL];\n // Tests the access method with an invalid langcode.\n $data[] = ['valid', 'xx-lolspeak'];\n return $data;\n }", "public function testViewDenyNotAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\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' => 'logs',\n\t\t\t\t'action' => 'view',\n\t\t\t\t'1',\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function testUserListForStandardUser()\n {\n $user = User::factory()->create([\n 'type' => 'user',\n ]);\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(403)\n ->assertJson([\n 'success' => false\n ]);\n }", "public static function denyAccess()\n {\n static::redirect(static::adminPath(), cbTrans('denied_access'));\n }", "public function testEditDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\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'1',\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "private function metodo_privado() {\n }", "public function rest_api_permission() {\n return apply_filters('h5p_rest_api_all_permission', current_user_can('edit_others_h5p_contents'));\n }" ]
[ "0.6486725", "0.63079035", "0.62683296", "0.6145359", "0.6128574", "0.60971445", "0.6065098", "0.6021666", "0.6021666", "0.59413856", "0.59299886", "0.59209114", "0.58816683", "0.58645564", "0.5860146", "0.58368206", "0.58193684", "0.5787158", "0.5736261", "0.57143116", "0.5699498", "0.56950223", "0.5665167", "0.5662193", "0.56586623", "0.5627373", "0.56233734", "0.56201476", "0.5603762", "0.5598182", "0.5598182", "0.55958843", "0.55923027", "0.5586336", "0.5580338", "0.5554877", "0.5551874", "0.5525173", "0.55208373", "0.5518443", "0.55132043", "0.551016", "0.5478801", "0.5468048", "0.54631597", "0.5455261", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439733", "0.5439292", "0.543838", "0.54306626", "0.54254603", "0.54042757", "0.54018074", "0.54009575", "0.5400373", "0.53975147", "0.5380751", "0.53752077", "0.5373512", "0.53696996", "0.5368762", "0.5368037" ]
0.66071016
0
method to check wether current controller & action matches some list of un authorized controllers
private function _checkUnAuthorized($unAuthorizedLocations){ if(isset($unAuthorizedLocations[$this->reqController])){ if($unAuthorizedLocations[$this->reqController][0] == 'all' || in_array($this->reqAction, $unAuthorizedLocations[$this->reqController])){ return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}", "private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }", "public function _checkControllerAccess() \n {\n static $_unprotectedControllersHookDone = false;\n static $_hookCalled = false;\n \n if ($_hookCalled || !$controller = Yii::app()->getController()) {\n return;\n }\n \n $_hookCalled = true;\n $unprotectedControllers = (array)Yii::app()->params->itemAt('unprotectedControllers');\n\n if (!$_unprotectedControllersHookDone) {\n Yii::app()->params->add('unprotectedControllers', $unprotectedControllers);\n $_unprotectedControllersHookDone = true;\n }\n\n if (!in_array($controller->id, $unprotectedControllers) && !Yii::app()->user->getId()) {\n // make sure we set a return url to the previous page that required the user to be logged in.\n Yii::app()->user->setReturnUrl(Yii::app()->request->requestUri);\n // and redirect to the login url.\n $controller->redirect(Yii::app()->user->loginUrl);\n }\n \n // since 1.3.5, user permission to controller action, aka route\n if (!in_array($controller->id, $unprotectedControllers) && Yii::app()->user->getId()) {\n $controller->onBeforeAction = array($this, '_checkRouteAccess');\n }\n \n // check version update right before executing the action!\n $controller->onBeforeAction = array($this, '_checkUpdateVersion');\n \n // check app wide messages\n $controller->onBeforeAction = array($this, '_checkAppWideMessages');\n }", "private function _isAllowed()\r\n {\r\n $req = $this->app->request();\r\n $resource = strtoupper($req->getMethod()) . $req->getResourceUri() ;\r\n return in_array($resource, $this->config['allowed_resources']);\r\n }", "function isAuthorized($aro, $controller, $action = null)\n\t{\n\t\t//if the user is an admin -> allow\n\t\tif( !empty($this->admins) &&\n\t\t\t ((in_array($aro[$this->userModel][$this->role], $this->admins)\n\t\t\t \t|| in_array($aro[$this->userModel][$this->username], $this->admins)\n\t\t\t\t|| in_array($aro[$this->userModel]['id'], $this->admins))))\n\t\t{\n\t\t\t$this->admin = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the key doesnt exist - allow access\n\t\tif (is_array($this->access) && array_key_exists($action, $this->access))\n\t\t{\n\t\t\tif(!empty($aro[$this->userModel][$this->role]))\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->role], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//be sure to check if the user doesnt have the same username as the admin group\n\t\t\telseif($aro[$this->userModel][$this->username])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->username], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($aro[$this->userModel]['id'])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel]['id'], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if the action is an admin action and the user isnt an admin and the permissions for the action werent\n\t\t// defined\n\t\tif(strpos($action, Configure::read('Routing.admin')) === 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn\ttrue;\n\t}", "private function _actionExists($request) { \n $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); \n \n // Check controller \n if (!$dispatcher->isDispatchable($request)) { \n return false; \n } \n \n // Check action \n $controllerClassName = $dispatcher->formatControllerName( $request->getControllerName() ); \n $controllerClassFile = str_replace('_', '/', $controllerClassName) . '.php'; \n if ($request->getModuleName() != $dispatcher->getDefaultModule()) { \n $controllerClassName = ucfirst($request->getModuleName()) . '_' . $controllerClassName; \n } \n try { \n require_once 'Zend/Loader.php'; \n Zend_Loader::loadFile($controllerClassFile, $dispatcher->getControllerDirectory($request->getModuleName()), true); \n $actionMethodName = $dispatcher->formatActionName($request->getActionName()); \n if (@in_array($actionMethodName, get_class_methods($controllerClassName))) { \n return true; \n } \n return false; \n } catch(Exception $e) { \n return false; \n } \n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "public function is_accessible_controller() {\r\n\t\tinclude_once 'menu_aksi.php';\r\n\t\t$menu_aksi = new menu_aksi($this->Command);\r\n\t\tif($menu_aksi->getByController(true) != 0) {\r\n\t\t\tinclude_once 'menu_function_aksi.php';\r\n\t\t\t$menu_function_aksi = new menu_function_aksi($this->Command);\r\n\t\t\tif($menu_function_aksi->getByName(true) != 0) {\r\n\t\t\t\t$this->model = new permission();\r\n\t\t\t\t$this->model->set_select_full_prefix('select * from permission p,user u');\r\n\t\t\t\t$this->model->set_select_full_suffix('p.ROLE = u.ROLE and p.MENU = (select id_menu from menu where controller=\\'' . $this->Command->getControllerName() . '\\') and u.USERNAME=\\'' . $this->Command->getUserLogged()->get_username() . '\\' and menu_function=(select id_menu_function from menu_function where nama_menu_function=\"' . $this->Command->getFunction() . '\" limit 1)');\r\n\t\t\t\treturn ($this->svc->select_count($this->model) > 0) ? true : false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "protected function _checkIsForcedFormKeyAction()\n {\n return in_array($this->getRequest()->getActionName(), $this->_forcedFormKeyActions);\n }", "function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }", "protected function _isAllowed()\n {\n \n $actionName = $this->getRequest()->getActionName();\n switch ($actionName) {\n case 'index':\n case 'edit':\n case 'delete':\n // intentionally no break\n default:\n $adminSession = Mage::getSingleton('admin/session');\n $isAllowed = $adminSession\n ->isAllowed('testimonials_clients/client');\n break;\n }\n \n return $isAllowed;\n }", "public function isAllowed(): bool\n {\n foreach ($this->rights as $rights) {\n [$module, $action] = explode('/', $rights);\n\n // check action rights\n if ($module !== '' && $action !== '' && !BackendAuthentication::isAllowedAction($action, $module)) {\n return false;\n }\n }\n\n return true;\n }", "function isActionAllowed($controller_id = null, $action_id = null, $event_id = null, $model_id = null, $group_id = null)\n {\n\t\t$actionAllowed = parent::isActionAllowed($controller_id, $action_id, $event_id, $model_id, $group_id);\n\n\t\t$hikeStatus = EventNames::model()->getStatusHike($event_id);\n\t\t$rolPlayer = DeelnemersEvent::model()->getRolOfPlayer($event_id, Yii::app()->user->id);\n\t\treturn $actionAllowed;\n\t}", "function my_is_current_controller($names)\n {\n $names = array_map('trim', explode(',', $names));\n $current = explode('.', Route::currentRouteName())[0];\n return in_array($current, $names, true);\n }", "private static function action_allowed( $action ) {\n\t\tif ( in_array( $action, self::allowed_actions() ) ) {\n\t\t\t$class = route::action_class( $action );\n\t\t\tif ( self::check_interface( $class ) && self::check_parent_class( $class ) ) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t}", "private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "public function isActionAllowed($action){\r\n if(in_array($action,$this->_allowedActions)){\r\n return true;\r\n }\r\n return false;\r\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Lof_Outlet::outlet_edit');\n }", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "public function testRestricted()\n\t{\n\t\t$request = $this->getMockedRequest();\n\t\t$userbaseController = new UserbaseController($request);\n\t\t$this->assertCount(0, $userbaseController->restrictedAction());\n\t}", "function isAllowedAction($action) {\n\t\t\treturn true;\n\t\t}", "protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "function __permitted($controllerName, $actionName) {\n\t\t// Note that there is an identical function in /app/views/helpers/permission.php\n\t\t$debug_output = $dont_read_from_session = Configure::read('permissions_debug_mode');\n\t\t\n\t\t//Ensure checks are all made lower case\n\t\t$controllerName = low($controllerName);\n\t\t$actionName = low($actionName);\n\t\t//If permissions have not been cached to session...\n\t\tif ($dont_read_from_session || ! $this->Session->check('Permissions')){\n\t\t\t$permissions = $this->getPermissions();\n\t\t\t//write the permissions array to session\n\t\t\t$this->Session->write('Permissions', $permissions);\n\t\t} else {\n\t\t\t//...they have been cached already, so retrieve them\n\t\t\t$permissions = $this->Session->read('Permissions');\n\t\t}\n\t\t\n\t\t//Now iterate through permissions for a positive match\n\t\tforeach ($permissions as $permission) {\n\t\t\tif ($permission == '*') {\n\t\t\t\tif ($debug_output) $this->flash(\"User has permissions for $controllerName:$actionName (*)\", 'success');\n\t\t\t\treturn true;//Super Admin Bypass Found\n\t\t\t}\n\t\t\tif ($permission == $controllerName.':*') {\n\t\t\t\tif ($debug_output) $this->flash(\"User has permissions for $controllerName:$actionName ($controllerName:*)\", 'success');\n\t\t\t\treturn true;//Controller Wide Bypass Found\n\t\t\t}\n\t\t\tif ($permission == \"$controllerName:$actionName\") {\n\t\t\t\tif ($debug_output) $this->flash(\"User has permissions for $controllerName:$actionName\", 'success');\n\t\t\t\treturn true;//Specific permission found\n\t\t\t}\n\t\t}\n\t\tif ($debug_output) $this->flash(\"User DOES NOT have permission for $controllerName:$actionName\", 'error');\n\t\treturn false;\n\t}", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public static function isCurrentActionPublic() {\r\n $patterns = implode('|', self::$_publicActions);\r\n if (preg_match('#'.$patterns.'#', Dispatcher::getInstance()->getActionName())) {\r\n return true;\r\n }\r\n return false;\r\n }", "function menu_permissions($controller,$action,$userID) {\n\t\t App::import('Model','Permission');\n\t\t $this->Permission= new Permission;\n\t\t $cond = \"WHERE controller='$controller' AND action='$action'\";\n\t\t $permissionsResult = $this->Permission->find('first',array(\n\t\t 'fields' => array('user_id'),\n\t\t 'conditions' => $cond,\n\t\t ));\n\t\t if(!empty($permissionsResult)){\n\t\t $users = explode(\",\",$permissionsResult['Permission']['user_id']);\n\t\t\tif (in_array($userID,$users)) {\n\t\t\treturn true;\n\t\t }\n\t\t else{\n\t\t\treturn false;\n\t\t }\n\t\t }\n\t\t return true;\n\t\t \n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }", "public function supportsAction($actions);", "public function __checkAuthentication($user, $action) {\n $action = $this->action;\n $authFlag = false;\n $role = $this->UserAuth->user(\"user_role\");\n switch ($role) {\n case 1001:\n if (in_array($action, $this->superadminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1002:\n if (in_array($action, $this->adminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1003:\n if (in_array($action, $this->instituteAdminActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1004:\n if (in_array($action, $this->branchActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1005:\n if (in_array($action, $this->teacherActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1006:\n if (in_array($action, $this->accountantActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n case 1007:\n if (in_array($action, $this->parentActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break; \n default:\n if (in_array($action, $this->guestActions)) {\n $authFlag = true;\n $action = 'index';\n }\n break;\n }\n\n if (!$authFlag) {\n $this->_setFlashMsgs(__('You are not authorized for this action'), 'danger');\n $this->redirect($this->UserAuth->redirect());\n return false;\n } else {\n return true;\n }\n return self::isAuthorized($user);\n }", "private function checkForActiveControllerAndAction($filename, $navigation_controller_and_action)\n {\n $split_filename = explode(\"/\", $filename);\n $active_controller = $split_filename[0];\n $active_action = $split_filename[1];\n\n $split_filename = explode(\"/\", $navigation_controller_and_action);\n $navigation_controller = $split_filename[0];\n $navigation_action = $split_filename[1];\n\n if ($active_controller == $navigation_controller AND $active_action == $navigation_action) {\n return true;\n }\n // default return of not true\n return false;\n }", "public function hasActions();", "function __permitted($controllerName,$actionName){\r\n $controllerName = low($controllerName);\r\n $actionName = low($actionName);\r\n //If permissions have not been cached to session...\r\n if(!$this->Auth->Session->check('Permissions')){\r\n //...then build permissions array and cache it\r\n $permissions = array();\r\n //Import the User Model so we can build up the permission cache\r\n App::import('Model', 'User');\r\n $thisUser = new User;\r\n //Now bring in the current users full record along with groups\r\n $thisGroups = $thisUser->find(array('User.id'=>$this->Auth->user('id')));\r\n $thisGroups = $thisGroups['Group'];\r\n foreach($thisGroups as $thisGroup){\r\n $thisPermissions = $thisUser->Group->find(array('Group.id'=>$thisGroup['id']));\r\n $thisPermissions = $thisPermissions['Permission'];\r\n foreach($thisPermissions as $thisPermission){\r\n $permissions[]=$thisPermission['name'];\r\n }\r\n }\r\n //write the permissions array to session\r\n $this->Auth->Session->write('Permissions',$permissions);\r\n }else{\r\n //...they have been cached already, so retrieve them\r\n $permissions = $this->Auth->Session->read('Permissions');\r\n }\r\n //Now iterate through permissions for a positive match\r\n if (in_array('-*', $permissions)) {\r\n \t\treturn false;\t\r\n } else if (in_array('-' . $controllerName.':*', $permissions)) {\r\n \t\treturn false;\r\n } else if (in_array('-' . $controllerName.':'.$actionName, $permissions)) {\r\n \t\treturn false;\r\n }\r\n\r\n foreach($permissions as $permission){\r\n if($permission == '*'){\r\n return true;//Super Admin Bypass Found\r\n }\r\n if($permission == $controllerName.':*'){\r\n return true;//Controller Wide Bypass Found\r\n }\r\n if($permission == $controllerName.':'.$actionName){\r\n return true;//Specific permission found\r\n }\r\n }\r\n return false;\r\n }", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "protected function isAllowedAction($action)\n {\n return true;\n }", "public function authorize()\n\t{\n $subjectId = $this->route('subject');\n\n return Subject::find($subjectId)->user->id == Auth::id();\n\t}", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function isAuthorized($user) {\n if ($this->action === 'index') {\n return true;\n }\n\n if (in_array($this->action, array('upload','update','view'))) {\n if ($user['role']=='registrado') {\n return true;\n }\n }\n\n if (in_array($this->action, array('upload','update','view'))) {\n if ($user['role']=='director') {\n return true;\n }\n }\n\n if (in_array($this->action, array('upload','download','update','view','delete'))) {\n if ($user['role']=='administrator') {\n return true;\n }\n }\n\n\n if (in_array($this->action, array('upload','download','update','view','delete'))) {\n if ($user['role']=='sadmin') {\n return true;\n }\n }\n\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestudy_Menu::first_index');\n }", "public function accessControl($key = NULL) {\n // get the controller and action\n if (!$this->_request) {\n $this->_request = Zend_Controller_Front::getInstance()->getRequest();\n $this->_controller = $this->_request->getControllerName();\n $this->_action = $this->_request->getActionName();\n }\n \n // get the user role from the view\n if (!empty($this->view->user) && !empty($this->view->user->role_id)) {\n $role_id = (int) $this->view->user->role_id;\n } else {\n $role_id = Users::ROLE_GUEST;\n }\n \n // iterate down the restrictions chain for access\n if (isset($this->_restrictions[$role_id])) {\n if (isset($this->_restrictions[$role_id][APPLICATION_ENV])) {\n if (isset($this->_restrictions[$role_id][APPLICATION_ENV][$this->_controller])) {\n // check if disallowed controller access\n if ($this->_restrictions[$role_id][APPLICATION_ENV][$this->_controller] === '*') {\n return false;\n }\n // check if disallowed action access\n if (isset($this->_restrictions[$role_id][APPLICATION_ENV][$this->_controller][$this->_action])) {\n // check for level of action disallow\n if ($this->_restrictions[$role_id][APPLICATION_ENV][$this->_controller][$this->_action] === '*') {\n return false;\n }\n // check if disallowed key access\n if ($key !== NULL) {\n if (isset($this->_restrictions[$role_id][APPLICATION_ENV][$this->_controller][$this->_action][$key])) {\n return false;\n }\n }\n }\n }\n }\n }\n \n // unknown role id\n else {\n return false;\n }\n \n // all checks passed, they must be good\n return true;\n \n }", "public function authorize()\n {\n $user = auth()->user();\n $course = Course::find($this->input('course_id'));\n if (isset($user) && $user->can('update', $course)) {\n $class = $this->input('class');\n $ids = array_map(function ($order) {\n return $order[0];\n }, $this->input('orders'));\n switch ($class) {\n case \"Lesson\":\n return Lesson::whereIn('id', $ids)->where('course_id', '<>', $course->getKey())->doesntExist();\n case \"Topic\":\n return Topic::whereIn('id', $ids)->whereHas('lesson', function(Builder $query) use($course) {\n $query->where('course_id', $course->getKey());\n })->doesntExist();\n }\n\n return true;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/save');\n break;\n case 'delete':\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage/delete');\n default:\n return Mage::getSingleton('admin/session')->isAllowed('requestprice/manage');\n }\n }", "public function isAllowed($arrParam = null){\n\t\t$ns = new Zend_Session_Namespace('info');\n\t\t$nsInfo = $ns->getIterator();\n\t\t$privilege = $arrParam['module'] . '_' . $arrParam['controller'] . '_' . $arrParam['action']; \n\t\t$flagAccess = false;\n\t\t\n\t\tif($this->_acl->isAllowed($this->_role, null, $privilege)){\n\t\t\t$flagAccess = true;\n\t\t}\n\t\t\n\t\treturn $flagAccess;\n\t\t\n\t}", "public function authorize()\n {\n if(!isset($this->action)){\n return false;\n }\n\n if($this->action === \"add\"){\n return Auth::guard('api')->check();\n }else if($this->action === \"update\" || $this->action === \"delete\"){\n if(empty($this->income) || Helper::getStringType($this->income) !== \"integer\"){\n return false;\n }\n\n // not existing or deleted\n if(empty((new Income)->income($this->income))){\n return false;\n }\n\n return Income::canModify(Auth::guard('api')->id(), $this->income) && Auth::guard('api')->check();\n }\n\n return false;\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function isInContext(ControllerResultInterface $controllerResult, Request $request): bool;", "public function authorize()\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function isAuthorized($user) {\n if ($this->action === 'create' ||\n $this->action === 'subscribe' ||\n $this->action === 'search' ||\n $this->action ==='index')\n {\n return true;\n }\n return parent::isAuthorized($user);\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isAuthorized($user)\n{\n if (in_array($this->request->action,['postjob','apply','posted','applied','getjob'])) {\n return true;\n }\n // The owner of an job can edit and delete it\n if (in_array($this->request->action, ['edit', 'delete'])) {\n $jobId = (int)$this->request->params['pass'][0];\n if ($this->Jobs->isOwnedBy($jobId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "public function isAuthorized($user) {\n if ($this->action === 'apply' || $this->action === 'saveProject'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n } \n }\n \n if ($this->action === 'applied' || $this->action === 'saved'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n }\n }\n \n if ($this->action === 'add' || $this->action === 'applicants') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n \n if ($this->action === 'projects') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n\n if (in_array($this->action, array('edit', 'delete'))) {\n $projectId = (int) $this->request->params['pass'][0];\n if ($this->Project->isOwnedBy($projectId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "public function check()\n\t{\n\n\t\t$errors = [];\n\n\t\tif ($this->actor && !$this->isAllowed($this->action, 'authorized')) {\n\n\t\t\thttp_response_code(400);\n\n\t\t\t$errors[] = 'This action for authorized users is not found';\n\n\t\t} elseif (!$this->actor && !$this->isAllowed($this->action, 'unauthorized')) {\n\n\t\t\thttp_response_code(401);\n\n\t\t\t$errors[] = 'Unauthorized error';\n\n\t\t}\n\n\t\treturn $errors;\n\n\t}", "public function hasPermission($action = \"\");", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "protected function checkControllerRules($controller, $module=null, $application)\n {\n $accessArray = array();\n //user roles\n $user_actions = UsersActions::model()->findAll(\"controller like '$controller' and module like '$module'\");\n \n if($user_actions)\n {\n foreach($user_actions as $key => $user_action)\n {\n $array_action = array_map('trim',explode(\",\",trim($user_action->actions)));\n $accessArray[] = array($user_action->type,\n 'actions'=>$array_action,\n 'users'=>array($user_action->user->username), \n ); \n }\n }\n \n //menu roles\n $menu = Menus::model()->find(array('condition' => \"controller_name like '$controller' and module_name like '$module' and application_id = $application\", \n 'order' => 'desc')); \n if($menu)\n {\n $roles_menu = RolesMenus::model()->findAll(\"menu_id = $menu->id\");\n foreach($roles_menu as $key => $role_menu)\n {\n $array_action = array_map('trim',explode(\",\",trim($role_menu->actions)));\n $accessArray[] = array('allow',\n 'actions'=>$array_action,\n 'users'=>array('@'),\n 'expression'=>'Yii::app()->user->role_id == '.$role_menu->role_id\n ); \n }\n }\n $accessArray[] = array('deny', \n );\n\n return $accessArray;\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "public function isAuthorized($user)\n {\n if(isset($user['role']) and $user['role'] === 'user')\n {\n if(in_array($this->request->action, ['index','view', 'logout','impresion']))\n {\n return true;\n }\n }\n return parent::isAuthorized($user);\n }", "public function isAuthorized($user = null) {\n\t\t// Anyone can access this controller to login and logout\n\t\tif ($this->action == \"logout\" || $this->Action == \"login\")\n\t\t\treturn true;\n\t\t// Only admins can use this controller for manage users\n\t\telse if ($user != null && $user['type'] == User::type_admin)\n\t\t\treturn true;\n\t\telse if ($user != null && $user['type'] == User::type_researcher)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn false;\n\t}", "public function authorize()\n {\n $canAdd = Voyager::can('add_membercontacts');\n $canUpdate = Voyager::can('edit_membercontacts');\n if($canAdd && $canUpdate)\n {\n return true;\n }\n else\n {\n // fix this with redirection\n return false;\n }\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function authorize()\n\t{\n\t\t$expenses = $this->input('expense_ids');\n\t\tif($expenses != null && count($expenses) > 0) {\n\t\t\t$reportId = Expense::find($expenses[0])->report_id;\n\t\t\t$report = ExpenseReport::find($reportId);\n\t\t\tif($report->status) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected function _isAllowed()\n {\n \treturn true;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('AVATOR_ContactUs::contact');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user()->can('manage-routes');\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }", "function checkAccess( $action, $access = '' ) {\r\n $result = true;\r\n if ( is_array( $access ) && array_key_exists( $action, $access ) ) {\r\n if ( array_key_exists( 'role', $access[$action] ) ) {\r\n if ( in_array( $this->user_role, $access[$action]['role'])) {\r\n $result = false;\r\n }\r\n } else {\r\n if ( !in_array( $this->user_role, $access[$action] ) ) {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return $result;\r\n }", "public function authorize()\n {\n return auth()->user()->is_author($this->route('board'));\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}", "public function authorize(): bool\n {\n return $this->user()->can('anyAction', ChessRule::class);\n }", "public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }", "function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function authorize()\n {\n $internship = Internship::findOrFail($this->route('id'));\n $student = $internship->student;\n\n return $internship->state_id == State::CANCELED && $student->internship == null;\n }", "public function testIndexDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\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' => 'index',\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->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n return Auth::check() && optional($this->route('spacecraft'))->fleet_id == auth()->user()->fleet_id;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "public function isAuthorized($user=null){\n\t\tif($user['role']=='user'){\n\t\t\tif(in_array($this->action,array('add','index','view'))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->Session->setFlash('No puede acceder, NO TIENES PERMISOS!', 'default', array('class'=>'alert alert-danger'));\n\t\t\t\t$this->redirect(array('controller' =>'produccions','action'=>'index'));\n\n\t\t\t\t}\n\t\t\t}\n\t\tif($user['role']=='view'){\n\t\t\tif(in_array($this->action,array('index','view'))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->Session->setFlash('No puede acceder, NO TIENES PERMISOS!', 'default', array('class'=>'alert alert-danger'));\n\t\t\t\t$this->redirect(array('controller' =>'produccions','action'=>'index'));\n\n\t\t\t\t}\n\t\t\t}\n\t\treturn parent::isAuthorized($user);\n\t}", "public function authorize()\n { \n\n if($this->path() == 'add_vendor' || $this->path() == 'edit_vendor'){\n return true;\n }else{\n return false;\n }\n \n }", "public function verifyRequest(Request $request)\n {\n if($request->method() == 'GET') {\n return $this->currentUserCan('fcrm_manage_settings') || $this->currentUserCan('fcrm_manage_contacts');\n }\n\n return $this->currentUserCan('fcrm_manage_settings');\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }", "public function current_role_can(string $action): bool;", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }" ]
[ "0.72284794", "0.7045802", "0.6968813", "0.6601951", "0.6561469", "0.6438388", "0.641015", "0.63915116", "0.6387289", "0.6377999", "0.6369382", "0.6353566", "0.63106054", "0.62579525", "0.61957026", "0.6193204", "0.61681736", "0.61679536", "0.61679536", "0.6160561", "0.6159973", "0.61592364", "0.6099237", "0.60834956", "0.60812974", "0.6065604", "0.6060152", "0.6042336", "0.6000378", "0.59909433", "0.59741175", "0.59620655", "0.5948862", "0.59467345", "0.5920734", "0.59198904", "0.591268", "0.59085715", "0.5900438", "0.58677864", "0.5839552", "0.5836225", "0.5832544", "0.58314514", "0.5830084", "0.5826313", "0.5823069", "0.5822108", "0.58210546", "0.5817732", "0.5811986", "0.58048594", "0.58028936", "0.57957214", "0.5789975", "0.57839984", "0.5778432", "0.5773967", "0.577322", "0.57680655", "0.5765723", "0.5759492", "0.57529855", "0.5751878", "0.57511413", "0.57493585", "0.5749141", "0.5735766", "0.5730703", "0.5730477", "0.572462", "0.5724312", "0.5717725", "0.57116354", "0.57116354", "0.57115984", "0.57073593", "0.57048094", "0.5704461", "0.56994826", "0.56983155", "0.56824726", "0.5681346", "0.56798184", "0.56756735", "0.5674711", "0.5672695", "0.5672077", "0.56667113", "0.56641006", "0.5657043", "0.5657043", "0.5657043", "0.56562513", "0.5655525", "0.56500906", "0.56499976", "0.564824", "0.5639431", "0.5636441" ]
0.58839923
39
method to get unauthorized locations for current user based on the resource ownership of the vendor
private function _checkOwnerShip($targetId, $userRole, $entityId){ $target = 'Users'; $associationRoute = $this->_getFromKnownRoutes($this->reqController, $userRole); if(!$associationRoute){ $associationRoute = $this->_getAssociationRoute($this->reqController, $target, [], []); } if(!$associationRoute){ return true; } if ($associationRoute == $target) { if($targetId == $entityId){ return true; } return false; }elseif ($associationRoute[0] == $target && count($associationRoute) == 1) { $direct = true; $tableObject = TableRegistry::get($this->reqController); $associations = $tableObject->associations(); $foreignKey = $associations->get($target)->foreignKey(); $entity = $tableObject->findById($entityId)->where([$foreignKey => $targetId])->first(); } else{ $direct = false; $pathToModel = $this->_decorateRoute($associationRoute); $tableObject = TableRegistry::get($this->reqController); $entity = $tableObject->findById($entityId)->matching($pathToModel, function($q) use ($targetId, $target){ return $q->where([$target.'.id' => $targetId]); })->first(); } //Check Vendor OwnerShip if(isset($entity) && $entity){ return true; } unset($entity); //Check Super Admin OwnerShip return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n if (Auth::check()){//The user is logged in\n //Show all current managers associated to owner\n\n $managers = User::where('account_owner', Auth::user() -> id)\n ->where('user_role', 2)\n ->orderBy('name', 'desc')\n ->get();\n\n $locations = Location::all(); //<---- Need to change this through application to only get locations vendors items and others based on user id\n\n $user = Auth::user();\n \n return view('userProfile', ['user' => $user, 'managers' => $managers, 'locations' => $locations]);\n }else{\n return redirect('/auth/login');\n }\n \n }", "public function getUserLocation();", "public function get_authenty()\r\n {\r\n //right column defines how to treat each role for guessing the owner of the resource\r\n $roles=array(\r\n 'custodian' => 'owner',\r\n 'resourceProvider' => 'distributor',\r\n 'owner' => 'owner',\r\n 'user' => 'distributor',\r\n 'distributor' => 'distributor',\r\n 'originator' => 'owner',\r\n 'pointOfContact' => 'owner',\r\n 'principalInvestigator' => 'owner',\r\n 'processor' => 'owner',\r\n 'pubisher' => 'owner',\r\n 'author' => 'owner' \r\n );\r\n \r\n \r\n $countries=array();\r\n\r\n //check the ident_contact\r\n $contacts=$this->get_key_value('ident_contacts');\r\n \r\n if ($contacts)\r\n {\r\n foreach($contacts as $contact)\r\n {\r\n $role=NULL;\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n \r\n if ($role=='owner' && isset($contact['org_name'])) {\r\n return $contact['org_name'];\r\n }\r\n }\r\n }\r\n \r\n $meta_contacts=$this->get_key_value('metadata_contacts');\r\n \r\n if ($meta_contacts)\r\n {\r\n foreach($meta_contacts as $contact)\r\n {\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n \r\n if ($role=='owner' && isset($contact['org_name'])) {\r\n return $contact['org_name'];\r\n }\r\n }\r\n }\r\n \r\n return NULL;\r\n }", "function restrict_locs($user_locs = array(), $all_locs = array())\n{\n\treturn array_intersect_key($all_locs, array_flip($user_locs));\n}", "abstract function getNonRegisteredUsers();", "function isLocationowner(){\r\n\t\tif($this->user_type == 'LocationOwner'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getLocationPublications($user)\n {\n return $this->getByCategoryType('Location', $user);\n }", "function erp_company_get_locations() {\n global $wpdb;\n\n $cache_key = 'erp_company-location';\n $locations = wp_cache_get( $cache_key, 'wp-erp' );\n\n if ( false === $locations ) {\n $locations = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}erp_company_locations\" );\n wp_cache_set( $cache_key, $locations, 'wp-erp' );\n }\n\n return $locations;\n}", "public function getOwners()\n {\n if (array_key_exists(\"owners\", $this->_propDict)) {\n return $this->_propDict[\"owners\"];\n } else {\n return null;\n }\n }", "public function get_owner_country()\r\n {\r\n //contact can have the following roles\r\n //right column defines how to treat each role for guessing the owner of the resource\r\n $roles=array(\r\n 'custodian' => 'owner',\r\n 'resourceProvider' => 'distributor',\r\n 'owner' => 'owner',\r\n 'user' => 'distributor',\r\n 'distributor' => 'distributor',\r\n 'originator' => 'owner',\r\n 'pointOfContact' => 'owner',\r\n 'principalInvestigator' => 'owner',\r\n 'processor' => 'owner',\r\n 'pubisher' => 'owner',\r\n 'author' => 'owner' \r\n );\r\n \r\n $countries=array();\r\n\r\n //check the ident_contact\r\n $contacts=$this->get_key_value('ident_contacts');\r\n \r\n if ($contacts)\r\n {\r\n foreach($contacts as $contact)\r\n {\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n else{\r\n $role='distributor';\r\n }\r\n \r\n if ($contact['country']!==NULL){\r\n $countries[$role][]=$contact['country'];\r\n }\r\n }\r\n }\r\n \r\n $meta_contacts=$this->get_key_value('metadata_contacts');\r\n \r\n \r\n if ($meta_contacts)\r\n {\r\n foreach($meta_contacts as $contact)\r\n {\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n else{\r\n $role='distributor';\r\n }\r\n\r\n if ($contact['country']!==NULL){\r\n $countries[$role][]=$contact['country'];\r\n }\r\n }\r\n }\r\n \r\n if (isset($countries['owner']))\r\n {\r\n return array_unique($countries['owner']);\r\n }\r\n \r\n if (isset($countries['distributor']))\r\n {\r\n return array_unique($countries['distributor']);\r\n }\r\n \r\n return NULL;\r\n }", "public function getUsersWithinTenant(){\n\n\t\t$userTypes = Input::get('userTypes');\n\n\t\t$collegeId = Input::get('collegeId');\n\n\t\t$collegeDeptId = Input::get('departmentId');\n\n\t\tif (Cache::has('college_users_managed_cache'))\n\t\t{\n\t\t\t$users = Cache::get('college_users_managed_cache');\n\n\t\t}else {\n\n\t\t\t$college = College::findorFail($collegeId);\n\n\t\t\t$users = DB::table('users')\n\t\t\t\t->join('colleges', 'users.collegeId', '=', 'colleges.collegeId')\n\t\t\t\t->join('collegedepartments', 'collegedepartments.collegeId', '=', 'colleges.collegeId')\n\t\t\t\t->join('permission_user','permission_user.userId', '=', 'users.userId')\n\t\t\t\t->join('permissions', 'permissions.permissionId', '=', 'permission_user.permissionId')\n\t\t\t\t->join('roles','users.roleId', '=', 'roles.roleId')\n\t\t\t\t->select('users.firstName', 'users.lastName', 'users.userId', 'users.roleId', 'users.avatarUrl'\n\t\t\t\t\t,'permissions.permissionName','permission_user.isEnabled')\n\t\t\t\t->whereIn('users.roleId', array($userTypes))\n\t\t\t\t->where('colleges.collegeId', $collegeId)\n\t\t\t\t->where('collegedepartments.collegeDeptId', $collegeDeptId)\n\t\t\t\t->distinct()\n\t\t\t\t->get();\n\t\t\tdd($users);\n\n\t\t\t$users = $college->users()->get(['users.firstName', 'users.lastName', 'users.userId', 'users.roleId', 'users.avatarUrl']);\n\n\t\t\tCache::add('college_users_managed_cache', $users, 60);\n\t\t}\n\t\treturn response()->json([\n\t\t\t'totalItems'=>$users->count(),\n\t\t\t'items' => $users,\n\t\t],\n\t\t\t200\n\t\t);\n\t}", "public function getAllInUse()\n {\n return $this->auth->getAllPermissions();\n }", "public function attestationExcludedCredentials(): array;", "public function getUserLocation() {\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip_note = 'HTTP_CLIENT_IP='.$_SERVER['HTTP_CLIENT_IP'];\n $ip = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n $ip_note = 'HTTP_X_FORWARDED_FOR='.$_SERVER['HTTP_X_FORWARDED_FOR'];\n $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $ip_note = 'REMOTE_ADDR='.$_SERVER['REMOTE_ADDR'];\n $ip = $_SERVER['REMOTE_ADDR'];\n }\n $ip = '117.20.119.245';\n $loc = file_get_contents(\"http://ipinfo.io/\".$ip.\"/loc\");\n\n if($loc) {\n $array_loc = explode(',', $loc);\n return ['lat'=> ((isset($array_loc[0]))? $array_loc[0]:'') ,'lon'=> ((isset($array_loc[1]))? $array_loc[1]:'')];\n }\n\n return ['lat'=>'','lon'=>''];\n\n }", "public function unlinkedLocations() {\n\t\t$areaLocations = AreaLocationRepository::instance()->getAllLocations();\n\t\treturn $this->getModel()->whereNotIn('id', $areaLocations)->approved()->get();\n\t}", "function ppt_resources_get_role_accounts($user, $countries = array(), $only_valid_date = TRUE)\n{\n if (!$user) {\n global $user;\n }\n\n $uid = $user->uid;\n if (!$countries || !isset($countries) || empty($countries)) {\n $countries = get_user_countries($user);\n }\n\n $accounts = array();\n\n // Check for current user.\n if (is_sales_manager($user)) {\n // If the user is sales manager we will get the reps under it.\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries);\n // Get the accounts for each one of the reps.\n foreach ($reps as $rep) {\n $reps_accounts = get_accounts_for_current_user($rep->uid, FALSE);\n $accounts = array_merge($accounts, $reps_accounts);\n }\n } elseif (is_regional_lead($user)) {\n // Load all the sales manager for this regional lead and loop over them.\n $sales_managers = ppt_resources_get_regional_lead_sales_managers($uid);\n foreach ($sales_managers as $sales_manager) {\n $reps = ppt_resources_get_sales_manager_reps($sales_manager->uid, $countries);\n foreach ($reps as $rep) {\n $reps_accounts = get_accounts_for_current_user($rep->uid, FALSE);\n $accounts = array_merge($accounts, $reps_accounts);\n }\n }\n } elseif (is_comm_lead($user)) {\n $reps = ppt_resources_get_comm_lead_reps($user->uid);\n foreach ($reps as $rep) {\n $reps_accounts = get_accounts_for_current_user($rep->uid, FALSE);\n $accounts = array_merge($accounts, $reps_accounts);\n }\n } elseif (is_system_admin($user) || is_global_lead($user)) {\n\n foreach ($countries as $country) {\n $country_accounts = get_accounts_for_country($country);\n $accounts = array_merge($accounts, $country_accounts);\n }\n } elseif (is_data_admin($user)) {\n $reps = ppt_resources_get_data_admin_reps($user->uid);\n foreach ($reps as $rep) {\n $reps_accounts = get_accounts_for_current_user($rep->uid, FALSE);\n $accounts = array_merge($accounts, $reps_accounts);\n }\n } elseif (is_rep($user)) {\n $accounts = get_accounts_for_current_user($uid, $only_valid_date);\n }\n // Return array with removed dublication.\n return array_unique($accounts);\n}", "public function index(Request $request): Collection\n {\n $user = $request->user();\n\n /* We check that the user can create a box in the team */\n if (!$user->hasTeamPermission($user->current_team, 'location:read') ||\n !$user->tokenCan('location:read')\n ) {\n throw new AuthorizationException();\n }\n return Location::where('team_id', $request->user()->current_team_id)->get();\n }", "private function _checkUnAuthorized($unAuthorizedLocations){\n \n\t\tif(isset($unAuthorizedLocations[$this->reqController])){\n\n\t\t\tif($unAuthorizedLocations[$this->reqController][0] == 'all' || in_array($this->reqAction, $unAuthorizedLocations[$this->reqController])){\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\t\n\n\t\treturn true;\n\n\t}", "public function warehouses_ids_related_to_the_current_user(){\r\n $loc = $this->aauth->get_user()->loc;\r\n $this->db->select(' id ');\r\n $this->db->from('geopos_warehouse');\r\n $this->db->where('loc', $loc);\r\n $query = $this->db->get();\r\n return $query->result_array();\r\n }", "private function get_locations_repositry() {\n\t\t\t$this->wpseo_local_locations_repository = new WPSEO_Local_Locations_Repository();\n\t\t}", "public function getSalesCenterLocations(Request $request)\n {\n $client_id = $request->client_id;\n $salescenter_id = $request->salescenter_id;\n if(Auth::user()->access_level == 'sales_center') {\n $salescenter_id = Auth::user()->salescenter_id;\n }\n\n $locations = Salescenterslocations::where('status','active')->orderBy('name');\n if(!empty($client_id)) {\n $locations->where('client_id',$client_id);\n }\n if(!empty($salescenter_id)) {\n $locations->where('salescenter_id',$salescenter_id);\n }\n /* check user has multiple locations */\n if (auth()->user()->hasMultiLocations()) {\n $locationIds = auth()->user()->locations->pluck('id');\n $locations->whereIn('id', $locationIds);\n }\n /* check location level restriction */\n if(Auth::user()->isLocationRestriction()) {\n $locationId = Auth::user()->location_id;\n $locations->where('id',$locationId);\n }\n $locations =$locations->get();\n $res_options = \"\";\n if(!empty($locations)){\n foreach($locations as $location){\n $res_options.=\"<option value=\\\"{$location->id}\\\" >\".$location->name.\"</option>\";\n }\n }\n $response = array(\n 'status' => 'success',\n 'options' => $res_options,\n );\n return \\Response::json($response);\n }", "public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }", "function _getActiveVendors() {\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getActiveVendors('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR, \"person_archived\" => $archived))->result();\n\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }", "public function getRespondentOrganizations()\n {\n\n if (! $this->_hasVar('__allowedRespOrgs')) {\n $availableOrganizations = $this->util->getDbLookup()->getOrganizationsWithRespondents();\n $allowedOrganizations = $this->getAllowedOrganizations();\n\n $this->_setVar('__allowedRespOrgs', array_intersect($availableOrganizations, $allowedOrganizations));\n }\n // \\MUtil_Echo::track($this->_getVar('__allowedOrgs'));\n\n return $this->_getVar('__allowedRespOrgs');\n }", "public function get_scope_locations()\n { \n response_json(lookup_scope_locations(get_post('scope')));\n }", "private function returnCountriesForUser()\n {\n\n $tableCountryExt = CountryExt::tablename();\n $tableCountry = Country::tablename();\n\n /* $role=Yii::$app->user->getIdentity()->role;\n //If I'm admin just get all countries\n if($role==User::ROLE_ADMIN || $role==User::ROLE_SUPERADMIN || $role==User::ROLE_MARKETER)\n {\n $countries = Country::listAllCountries();\n }\n //otherwise find all countries where specific lanuage(language of current user is) is spoken\n else\n {\n $languageId = Language::getCurrentId(); //for example: 7\n $countries = Country::listCountries($languageId);\n\n } */\n\n //return countries per language\n $languageId = Language::getCurrentId(); //for example: 7\n $countries = Country::listCountries($languageId);\n\n return $countries;\n }", "public function getLocationList($return_active_only = TRUE);", "public function get_available_rights();", "function getNotPlantaUsuarios()\r\n\t{\r\n\t\treturn $this->Usuario->find('all',array('conditions' => array('Usuario.planta' => 0)));\r\n\t}", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function forAllUser(Request $request)\n {\n \n\t\t$licences = $this->licenceService->all();\n\t\t\n\t\tLog::info($licences);\n\n $values = $licences->load('client', 'token')->filter(function ($token) {\n return ! $token->client->firstParty() && ! $token->revoked;\n })->values();\n\t\t\n\t\t\n\t\tLog::info($values);\n\t\t\n\t\treturn $values;\n }", "function getLocationConfig()\n {\n $roleInfo = PEAR_Installer_Role_Common::getInfo('PEAR_Installer_Role_' . \n ucfirst(str_replace('pear_installer_role_', '', strtolower(get_class($this)))));\n if (PEAR::isError($roleInfo)) {\n return $roleInfo;\n }\n return $roleInfo['locationconfig'];\n }", "function fn_warehouses_get_location_from_cart($cart)\n{\n $location = [\n 'country' => isset($cart['user_data']['s_country']) ? $cart['user_data']['s_country'] : '',\n 'state' => isset($cart['user_data']['s_state']) ? $cart['user_data']['s_state'] : '',\n 'city' => isset($cart['user_data']['s_city']) ? $cart['user_data']['s_city'] : '',\n 'zipcode' => isset($cart['user_data']['s_zipcode']) ? $cart['user_data']['s_zipcode'] : '',\n 'address' => isset($cart['user_data']['s_address']) ? $cart['user_data']['s_address'] : '',\n ];\n\n return $location;\n}", "public function index() {\n $requiredPermissions = ['manage_location'];\n if(!parent::checkPermissions($requiredPermissions))\n {\n return Redirect::back()\n ->with('alert-class', 'error')\n ->with('flash-message', 'You do not have the required permissions to do that!');\n }\n \t$locations = Locations::orderBy('city', 'ASC')->get();\n \treturn View::make('admin.manage.locations')\n \t\t\t\t->with('locations', $locations);\n }", "function getdirections_locations_user_via_path($uids) {\n if (module_exists('location')) {\n return \"getdirections/locations_user_via/$uids\";\n }\n}", "function ppt_resources_get_user_clusters($data)\n{\n\n global $user;\n if ($user->uid == 0) {\n return services_error('Access Denied!', 403);\n }\n if (!isset($data['region'])) {\n return services_error('Missing Region!', 403);\n }\n $region = $data['region'];\n $clusters = array();\n $countries = get_user_countries($user);\n\n // Loop over the countries to get the clusters.\n foreach ($countries as $country) {\n $country_term = taxonomy_term_load($country);\n if (!isset($country_term->field_cluster[LANGUAGE_NONE])) {\n continue;\n }\n $cluster = $country_term->field_cluster[LANGUAGE_NONE][0]['target_id'];\n $cluster_term = taxonomy_term_load($cluster);\n if (!isset($cluster_term->field_region[LANGUAGE_NONE])) {\n continue;\n }\n $region_term = taxonomy_term_load($cluster_term->field_region[LANGUAGE_NONE][0]['target_id']);\n if (!isset($clusters[$cluster]) && $region == $region_term->tid) {\n $clusters[$cluster] = array('id' => $cluster, 'name' => $cluster_term->name);\n }\n }\n return $clusters;\n}", "public function getAllowedOrganizations()\n {\n\n if (! $this->_hasVar('__allowedOrgs')) {\n $this->refreshAllowedOrganizations();\n }\n // \\MUtil_Echo::track($this->_getVar('__allowedOrgs'));\n\n return $this->_getVar('__allowedOrgs');\n }", "public function getOwnerRequestedBy()\n {\n return $this->http->get('/users/%s/requested-by', 'self');\n }", "public function getAutoprovisioningLocations()\n {\n return $this->autoprovisioning_locations;\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "function getCustomerEngRegion($customer_id)\n {\n /* @changes: intersect of region\n * @author: Sagar Jogi dt: 09/08/2017\n */\n $user=DB::query(\"SELECT r.region FROM \" . CFG::$tblPrefix . \"user AS r WHERE active='1' and r.id=%d\",$_SESSION['user_login']['id']);\n $cust=DB::query(\" SELECT c.region_id as cregion FROM \" . CFG::$tblPrefix . \"user_region AS c WHERE c.user_id=%d\",$customer_id);\n foreach($cust as $k=>$v){\n $abc.=$cust[$k]['cregion'].',';\n }\n $check=DB::query(\"SELECT all_region FROM \" . CFG::$tblPrefix . \"user WHERE id=%d\",$_SESSION['user_login']['id']);\n if($check[0]['all_region']=='1') {\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region r WHERE status='1' and FIND_IN_SET( r.id, '$abc') order by name asc\");\n } else {\n \n \n// pre($abc);exit;\n $userexp= explode(',',$user[0]['region']);\n $custexp= explode(',',$abc);\n \n// pre($cust);exit;\n $result=array_intersect($userexp,$custexp);\n $resimp= implode(',', $result);\n// pre($cust);exit;\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r WHERE FIND_IN_SET( r.id, '$resimp')\"); \n }\n /*return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r LEFT JOIN \" . CFG::$tblPrefix . \"user AS u ON FIND_IN_SET( r.id, u.region ) >0\nWHERE u.id =%d and u.active='1' and r.status='1'\",$customer_id); */\n \n }", "public function userWithCoord() {\n $sql = \"select * from infos_contributeur where lat != 0 and lng != 0\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }", "public static function get_current_user_party(){\n $user_party = array();\n $current_user = wp_get_current_user();\n if ($current_user) {\n $user_party = self::get_user_party($current_user->ID);\n }\n return $user_party;\n }", "function monitor_list_owners() {\n $query = \"select distinct(`wf_owner`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_owner'];\n }\n return $ret;\n }", "function get_sp_sysuser_list() {\n\ttry {\n\t\treturn sp()->sysuser_list()->data;\n\t} catch ( \\ServerPilotException $e ) {\n\t\treturn new \\WP_Error( $e->getCode(), $e->getMessage() );\n\t}\n}", "public function getUserAllowedRoots()\n {\n $user = $this->getUser();\n\n if ($user->isAdmin) {\n return null;\n }\n\n return \\array_map('intval', (array) $user->newsAreaOfApplication_roots);\n }", "public function listLocations(): ApiResponse\n {\n $_reqBuilder = $this->requestBuilder(RequestMethod::GET, '/v2/locations')->auth('global');\n\n $_resHandler = $this->responseHandler()->type(ListLocationsResponse::class)->returnApiResponse();\n\n return $this->execute($_reqBuilder, $_resHandler);\n }", "public function only_logged_in_customer_can_see_placements_list()\n {\n $response = $this->get('/user/10/placements')\n ->assertRedirect('/login');\n\n }", "function culturefeed_search_ui_get_user_location_cookie() {\n\n if (!empty($_COOKIE['Drupal_visitor_uitid_userLocation'])) {\n $user_location = json_decode($_COOKIE['Drupal_visitor_uitid_userLocation']);\n if ($user_location instanceof stdClass) {\n return $user_location;\n }\n }\n\n return new stdClass();\n\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 getUsersAccessToken(){\n $result = $this->facebookModel->project(array(\"AccessToken\" => true, \"Current_city\" => true, \"_id\" => false))->get();\n return $result;\n }", "function get_user_countries($user = NULL)\n{\n if (!$user) {\n global $user;\n }\n\n $countries = array();\n if (is_rep($user)) {\n // Load current user.\n $loaded_user = user_load($user->uid);\n $loaded_user_wrapper = entity_metadata_wrapper('user', $loaded_user);\n $countries_terms = $loaded_user_wrapper->field_country->value();\n foreach ($countries_terms as $item) {\n $countries[] = $item->tid;\n }\n } // Get reps for comm_lead\n elseif (is_comm_lead($user)) {\n $reps = ppt_resources_get_comm_lead_reps($user->uid);\n foreach ($reps as $rep) {\n if (!isset($rep->field_country[LANGUAGE_NONE])) {\n continue;\n }\n // Loop over the user countries.\n foreach ($rep->field_country[LANGUAGE_NONE] as $item) {\n if (!isset($countries[$item['target_id']])) {\n $countries[] = $item['target_id'];\n }\n }\n }\n }\n // If the logged in user is a sales manager.\n elseif (is_sales_manager($user)) {\n // Get reps of sales manager.\n $reps = ppt_resources_get_sales_manager_reps($user->uid);\n foreach ($reps as $rep) {\n if (!isset($rep->field_country[LANGUAGE_NONE])) {\n continue;\n }\n // Loop over the user countries.\n foreach ($rep->field_country[LANGUAGE_NONE] as $item) {\n if (!isset($countries[$item['target_id']])) {\n $countries[] = $item['target_id'];\n }\n }\n }\n } elseif (is_regional_lead($user)) {\n $managers = ppt_resources_get_regional_lead_sales_managers($user->uid);\n $reps = array();\n foreach ($managers as $manager) {\n $reps_tmp = ppt_resources_get_sales_manager_reps($manager->uid);\n $reps = array_merge($reps, $reps_tmp);\n }\n foreach ($reps as $rep) {\n if (!isset($rep->field_country[LANGUAGE_NONE])) {\n continue;\n }\n // Loop over the user countries.\n foreach ($rep->field_country[LANGUAGE_NONE] as $item) {\n if (!isset($countries[$item['target_id']])) {\n $countries[] = $item['target_id'];\n }\n }\n }\n } elseif (is_global_lead($user)) {\n $vocabulary = taxonomy_vocabulary_machine_name_load('country');\n $countries = entity_load('taxonomy_term', FALSE, array('vid' => $vocabulary->vid));\n $countries = array_keys($countries);\n } elseif (is_data_admin($user)) {\n $account = user_load($user->uid);\n if (!isset($account->field_country[LANGUAGE_NONE])) {\n $countries = array();\n } else {\n foreach ($account->field_country[LANGUAGE_NONE] as $row) {\n $countries[] = $row['target_id'];\n }\n }\n } else {\n $vocabulary = taxonomy_vocabulary_machine_name_load('country');\n $countries = entity_load('taxonomy_term', FALSE, array('vid' => $vocabulary->vid));\n $countries = array_keys($countries);\n }\n return array_unique($countries);\n}", "public function getLocations()\n {\n return isset($this->Locations) ? $this->Locations : null;\n }", "private static function userLocationFallback(array &$location) {\r\n if (!isset($location['country']) && !isset($location['countryCode']) &&\r\n !isset($location['region']) && !isset($location['regionCode']) &&\r\n !isset($location['city']) && !isset($location['zip']) &&\r\n !isset($location['latitude']) && !isset($location['longitude'])) {\r\n if (function_exists('apache_note')) {\r\n if ($country = apache_note('GEOIP_COUNTRY_NAME')) {\r\n $location['country'] = $country;\r\n }\r\n if ($country_code = apache_note('GEOIP_COUNTRY_CODE')) {\r\n $location['countryCode'] = $country_code;\r\n }\r\n if ($region = apache_note('GEOIP_REGION_NAME')) {\r\n $location['region'] = $region;\r\n }\r\n if ($region_code = apache_note('GEOIP_REGION')) {\r\n $location['regionCode'] = $region_code;\r\n }\r\n if ($city = apache_note('GEOIP_CITY')) {\r\n $location['city'] = $city;\r\n }\r\n if ($zip = apache_note('GEOIP_POSTAL_CODE')) {\r\n $location['zip'] = $zip;\r\n }\r\n if ($latitude = apache_note('GEOIP_LATITUDE')) {\r\n $location['latitude'] = $latitude;\r\n }\r\n if ($longitude = apache_note('GEOIP_LONGITUDE')) {\r\n $location['longitude'] = $longitude;\r\n }\r\n }\r\n else {\r\n if (isset($_SERVER['GEOIP_COUNTRY_NAME'])) {\r\n $location['country'] = $_SERVER['GEOIP_COUNTRY_NAME'];\r\n }\r\n elseif (isset($_SERVER['HTTP_X_GEOIP_COUNTRY'])) {\r\n module_load_include('inc', 'smart_ip', 'includes/smart_ip.country_list');\r\n $countries = country_get_predefined_list();\r\n $location['country'] = $countries[$_SERVER['HTTP_X_GEOIP_COUNTRY']];\r\n }\r\n elseif (isset($_SERVER['HTTP_CF_IPCOUNTRY'])) {\r\n module_load_include('inc', 'smart_ip', 'includes/smart_ip.country_list');\r\n $countries = country_get_predefined_list();\r\n $location['country'] = $countries[$_SERVER['HTTP_CF_IPCOUNTRY']];\r\n }\r\n if (isset($_SERVER['GEOIP_COUNTRY_CODE'])) {\r\n $location['country'] = $_SERVER['GEOIP_COUNTRY_CODE'];\r\n }\r\n elseif (isset($_SERVER['HTTP_X_GEOIP_COUNTRY'])) {\r\n $location['countryCode'] = $_SERVER['HTTP_X_GEOIP_COUNTRY'];\r\n }\r\n elseif (isset($_SERVER['HTTP_CF_IPCOUNTRY'])) {\r\n $location['countryCode'] = $_SERVER['HTTP_CF_IPCOUNTRY'];\r\n }\r\n if (isset($_SERVER['GEOIP_REGION_NAME'])) {\r\n $location['region'] = $_SERVER['GEOIP_REGION_NAME'];\r\n }\r\n if (isset($_SERVER['GEOIP_REGION'])) {\r\n $location['regionCode'] = $_SERVER['GEOIP_REGION'];\r\n }\r\n if (isset($_SERVER['GEOIP_CITY'])) {\r\n $location['city'] = $_SERVER['GEOIP_CITY'];\r\n }\r\n if (isset($_SERVER['GEOIP_POSTAL_CODE'])) {\r\n $location['zip'] = $_SERVER['GEOIP_POSTAL_CODE'];\r\n }\r\n if (isset($_SERVER['GEOIP_LATITUDE'])) {\r\n $location['latitude'] = $_SERVER['GEOIP_LATITUDE'];\r\n }\r\n if (isset($_SERVER['GEOIP_LONGITUDE'])) {\r\n $location['longitude'] = $_SERVER['GEOIP_LONGITUDE'];\r\n }\r\n }\r\n }\r\n }", "function unauthorizedUsersOnly(){\n global $authenticatedUser;\n if(!empty($authenticatedUser)){\n header(\"HTTP/1.1 403 Forbidden\");\n header('Location: https://eso.vse.cz/~frim00/marvelous-movies/');\n exit();\n }\n }", "public function getCertLocation(): array {\n\t\t$disk = Config::get('fpx.certificates.uat.disk');\n\t\t$dir = Config::get('fpx.certificates.uat.dir');\n\n\n\t\tif (App::environment('production')) {\n\t\t\t$disk = Config::get('fpx.certificates.production.disk');\n\t\t\t$dir = Config::get('fpx.certificates.production.dir');\n\t\t}\n\n\t\treturn [$disk, $dir];\n\t}", "public function index(Request $request)\n {\n $query = Owner::query();\n\n // return new OwnersResource($query->where('id','>','0')->pluck('name', 'location'));\n\n if(isset($request->owner_name)){\n $query->where('name', $request->owner_name);\n }\n\n if(isset($request->owns_number_of_dogs)){\n $query->has('dogs', '=', $request->owns_number_of_dogs);\n }\n\n if(isset($request->location)){\n $query->where('location', $request->location);\n }\n\n $result = $query->get();\n\n return new OwnersResource($result);\n }", "public function show($id)\n\t{\n/*\t\t// - CHECK IF USER IS LOGGED IN - // \n\t\t$user = User::getUserInfos(Auth::user()->id); \n\n\t\tif ($user['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::route('AdminSignIn')->with('error_message', Lang::get('messages.not_logged_in'));\n\t\t}\n \n\t\t// - AUTHORITY CHECK STARTS HERE - //\n\t\t$hasAuthority = false;\n\n\t\tswitch ($user['user']->user_group)\n\t\t{ \n\t\t\tcase 'admin':\n\t\t\t// Admins should have authority\n\t\t\t$hasAuthority = true;\n\t\t\tbreak; \n\n\t\t\tdefault:\n\t\t\treturn Redirect::route('AdminSignIn')->with('error_message', Lang::get('core.unauthorized_access'));\n\t\t}\n\n\t\tif ($hasAuthority == false) \n\t\t{\n\t\t\treturn Redirect::route('AdminSignIn')->with('error_message', Lang::get('core.unauthorized_access'));\n\t\t}\n\t\t// - AUTHORITY CHECK ENDS HERE - // \n*/\n\t\t// Get data\n\n\t\t$regionlist = array();\n\t \t$region = Region::getEntries(null, null);\n\t \t\n\t\tif ($region['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::route('getDashboard')->with('error_message', Lang::get('core.msg_error_getting_entry'));\n\t\t}\n\t\tforeach ($region['entries'] as $region)\n\t\t{\n\t\t\t$regionlist[$region->id] = $region->name;\n\t\t}\n\n\t\t$citylist = array();\n\t \t$city = City::getEntries(null, null);\n\t \t\n\t\tif ($city['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::route('getDashboard')->with('error_message', Lang::get('core.msg_error_getting_entry'));\n\t\t}\n\t\tforeach ($city['entries'] as $city)\n\t\t{\n\t\t\t$citylist[$city->id] = $city->name;\n\t\t}\n\n\t\t$entry = Users::getEntries($id, null); \n\t\t$regionname = Region::getEntries($entry['entry']->region, null);\n\t\t$regionname = $regionname['entry']->name;\n\n\t\t$cityname = City::getEntries($entry['entry']->city, null);\n\t\t$cityname = $cityname['entry']->name;\n\n\n\n\n\t\tif ($entry['status'] == 0)\n\t\t{\n\t\t\treturn Redirect::route('getDashboard')->with('error_message', Lang::get('core.msg_error_getting_entry'));\n\t\t} \n\n\t\t$this->layout->title = 'Uređivanje korisnika | Prodaja drva';\n\n\t\t$this->layout->css_files = array(\n\t\t\t'css/backend/summernote.css'\t\t\t\n\t\t);\n\n\t\t$this->layout->js_footer_files = array(\n\t\t\t'js/backend/bootstrap-filestyle.min.js',\n\t\t\t'js/backend/summernote.js',\n\t\t\t'js/backend/jquery.stringtoslug.min.js',\n\t\t\t'js/backend/speakingurl.min.js'\n\t\t);\n\n\t\t$this->layout->content = View::make('backend.users.show', array('entry' => $entry['entry'], 'regionlist' => $regionlist, 'citylist' => $citylist, 'regionname' => $regionname, 'cityname' => $cityname));\n\t}", "public function getAllPotentialPageEditors() : array\n {\n $users = get_users();\n $potentials = [];\n foreach ($users as $user) {\n if (!$this->isAdmin($user->allcaps) && $user->allcaps['edit_pages']) {\n $potentials[] = $user;\n }\n }\n return $potentials;\n }", "function retrieve_promoter_guest_list_authorizations(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_promoter_guest_list_authorizations($this->promoter->up_id);\n\t\t\n\t}", "public function getAllLocations() {\n\t\t$query = $this->db->select(\"\n\t\t\tRoom.RoomID,\n\t\t\tRoomAbbr,\n\t\t\tRoomName,\n\t\t\tBuildingAbbr,\n\t\t\tRoom.IsApproved,\n\t\t\tBuilding.MapURL,\n\t\t\tOperators\")->\n\t\tfrom('Room')->\n\t\tjoin('Building', 'Building.BuildingID = Room.BuildingID')->\n\t\tjoin(\"\n\t\t\t(SELECT r.RoomID, GROUP_CONCAT(CONCAT(UserFname, ' ', UserLname)) AS Operators\n\t\t\tFROM User u\n\t\t\t\tJOIN UserRole ur ON u.UserID = ur.UserID\n\t\t\t\tJOIN UserRoom urm ON ur.UserRoleID = urm.UserRoleID\n\t\t\t\tJOIN Room r ON r.RoomID = urm.RoomID\n\t\t\tGROUP BY r.RoomID) AS other\", 'other.RoomID = Room.RoomID', 'left')->\n\t\tget();\n\n\t\treturn $query->result_array();\n\t}", "function userRequestedBy() {\n \t\n \t$user_requested_by_request_url = sprintf($this->api_urls['user_requested_by'], $this->access_token);\n \t\n \treturn $this->__apiCall($user_requested_by_request_url);\n \t\n }", "public function authorize()\n { \n\n if($this->path() == 'add_vendor' || $this->path() == 'edit_vendor'){\n return true;\n }else{\n return false;\n }\n \n }", "function get_all_access_level($not_include_admin = 0)\r\n{\r\n\tglobal $strings;\r\n $users[ACCESS_AD_CUSTOMER] = $strings['ACL_AD_CUSTOMER'];\r\n $users[ACCESS_BIG_CUSTOMER] = $strings['ACL_BIG_CUSTOMER'];\r\n $users[ACCESS_VIP_USER] = $strings['ACL_VIP_USER'];\r\n if(!$not_include_admin)$users[ACCESS_ADMIN] = $strings['ACL_ADMIN'];\r\n return $users;\r\n}", "public function getLocationOwnershipType()\n {\n return $this->location_ownership_type;\n }", "abstract function getBaseLocations();", "function getCustomerRegion($customer_id)\n {\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r LEFT JOIN \" . CFG::$tblPrefix . \"user AS u ON FIND_IN_SET( r.id, u.region ) >0\nWHERE u.id =%d and u.active='1' and r.status='1'\",$customer_id);\n }", "public function view_unauthorized()\n {\n return ee()->load->view('unauthorized', array(), TRUE);\n }", "public function authorize()\n {\n return $this->user()->memberOfTenant(tenant());\n }", "function GetAllDeniedPlacedOffers()\n {\n $placedOffersModel = new PlacedOffersModel();\n $placedOffersModel->GetAllDeniedPlacedOffers();\n }", "public function getUserAllowedUsageRoots()\n {\n $user = $this->getUser();\n\n if ($user->isAdmin) {\n return null;\n }\n\n return \\array_map('intval', (array) $user->newsUsage_roots);\n }", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "public function getCantPointsUserAction()\n {\n \t$cant = $this->pointServices->getCantPointsUser($this->getUser());\n \t\n return new Response($cant);\n }", "function getUserContacts() \r\n\t{\r\n\t\t# to access this area, the user have to be loggedin with an IDp an has a HybridAuth session\r\n\t\tif ( ! Hybrid_Auth::hasSession() )\r\n\t\t{\r\n\t\t\tthrow new Exception( \"HybridAuth can't access user profile data. The current user have to sign in with [{$this->providerId}] before any request!\" );\r\n\t\t}\r\n\r\n\t\tHybrid_Auth::addWarning( Hybrid_Auth::text( \"GET_USER_CONTACTS_UNSUPPORTED_WARNING\" ) ); \r\n\r\n\t\treturn NULL;\r\n\t}", "function get_location_list ($perm = 1) \n{\n \n $query = 'SELECT * \n FROM locations \n WHERE permanent = '.$perm;\n $result = mysql_query ($query);\n while ($row = mysql_fetch_array($result)) $return[] = $row;\n return $return;\n}", "public function show(Request $request, Location $location): Location\n {\n $user = $request->user();\n\n /* We check that the user can get a location in that team */\n if (!$user->hasTeamPermission($location->team, 'location:read') ||\n !$user->tokenCan('location:read')\n ) {\n throw new AuthorizationException();\n }\n\n return $location;\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "protected function getResourceOwner()\n {\n // guard\n if (!$this->access_token) {\n return;\n }\n\n try {\n // get the provider\n $provider = $this->getShopifyOauth2Provider();\n\n // set resource owner\n $resource_owner = $provider->getResourceOwner($this->access_token);\n } catch (\\Exception $e) {\n throw new ShopifyOauthCallbackException('Something went wrong: '. $e->getMessage());\n }\n\n // return the resource owner\n return $resource_owner;\n }", "public function companyOfUser(){\n\n $company = Auth::user()->companies;\n $location = Location::where('id', Auth::user()->company_location)->get();\n \n foreach($company as $c){\n $c['locations'] = $location;\n }\n\n return $company;\n }", "public function owners(){\n $users = User::with('potagers')\n ->owners()\n ->orderBy('updated_at', 'desc')\n ->paginate(100);\n\n return view('admin.users.owners', compact('users'));\n }", "public function getLocation_get(){\n $user_id = $this->input->get('user_id');\n\n $data = $this->User_model->select_data('latitude,longitude','tbl_users',array('id'=>$user_id));\n\n if(empty($data))\n\n {\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Not Found\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"getLocation\",\n \"ResponseCode\" => true,\n \"getLocationResponse\" => $data\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function getKnownUsers(){\n\t\tglobal $course;\n\t\t$context = get_context_instance(CONTEXT_COURSE, $course->id);\n\t\t$students = get_role_users(5 , $context);\n\t\t$tmp = (array)null;\n\n\t\tforeach($students as $student){\n\t\t\t$knownUser = (object) null;\n\t\t\t$knownUser->id = $student->id;\n\n\t\t\tif ($student->maildisplay){\n\t\t\t\t$knownUser->email = $student->email;\n\t\t\t}\n\t\t\t$fullname = $student->firstname.' '.$student->lastname;\n\n\t\t\tif (strlen(trim($fullname)) == 0) {\n\t\t\t\t$fullname = $student->username;\n\t\t\t}\n\t\t\t$knownUser->name = $fullname;\n\t\t\tif ($account_link = get_record(\"studynotes_account_links\", \"system\", \"moodle\", \"external_id\", $student->id)){\n\t\t\t\t$knownUser->mb_id = $account_link->internal_id;\n\t\t\t}\n\t\t\t$tmp[] = $knownUser;\n\t\t}\n\t\treturn $tmp;\n\t}", "public function index()\n {\n \n return $this->repository->findWithOwnerAndMember(\\Authorizer::getResourceOwnerId());\n }", "public function searchUnBlockedByUserList(Request $request) {\n try {\n $user = BlockedServiceProvider::getDateFilterBlockedUnblockedUsers($request->all(), Config::get('constants.unblocked_flag'));\n if ($user) {\n return json_encode($user);\n } else {\n Session::flash('status', trans('messages.admin.user_not_found'));\n return redirect('/admin/user');\n }\n } catch (\\Exception $e) {\n CommonUtility::logException(__METHOD__, $e);\n return $this->responseServerError(trans('messages.error.exception'));\n }\n }", "protected abstract function onAuthorizeMissingOwner(): Effect|Response;", "public function getActiveAccessReq() {\n if( !$this->security->isGranted('ROLE_RESAPP_COORDINATOR') ) {\n //exit('not granted ROLE_RESAPP_COORDINATOR ???!!!'); //testing\n return null;\n } else {\n //exit('granted ROLE_RESAPP_COORDINATOR !!!'); //testing\n }\n $userSecUtil = $this->container->get('user_security_utility');\n $accessreqs = $userSecUtil->getUserAccessRequestsByStatus($this->container->getParameter('resapp.sitename'),AccessRequest::STATUS_ACTIVE);\n return $accessreqs;\n }", "function v1_get_owners($object, &$error) {\n\n\t// XML functions\n\trequire_once \"php/funcs/xml_funcs.php\";\n\t// DB functions\n\trequire_once \"php/funcs/db_funcs.php\";\n\t// Static list of owners.. to reset owners-array when first called\n\tstatic $owners_list=array();\n\t\n\t// Global list of general owners\n\tglobal $gen_owners, $developer, $user_upload;\n\t\n\t// Prepare result\n\t$owners=array();\n\t$error=array();\n\t\n\t// Array of attributes name\n\t$owner_att_names=array(\"OWNER1\", \"OWNER2\", \"OWNER3\");\n\t\n\t// Get owners\n\tforeach ($owner_att_names as $owner_att_name) {\n\t\t$code=xml_get_att($object, $owner_att_name);\n\t\tif (!empty($code)) {\n\t\t\t$owner=array();\n\t\t\t$owner['code']=$code;\n\t\t\t$found=FALSE;\n\t\t\t// Check if code was already searched before\n\t\t\tforeach ($owners_list as $owner_listed) {\n\t\t\t\tif ($code!=$owner_listed['code']) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Get ID\n\t\t\t\t$id=$owner_listed['id'];\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t$found=TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// If not found in list, query DB\n\t\t\tif (!$found) {\n\t\t\t\t$id=db_get_cc_id($code);\n\t\t\t\tif (empty($id)) {\n\t\t\t\t\t$error['code']=9;\n\t\t\t\t\t$error['message']=\"There is no owner with such code: \\\"\".$code.\"\\\"\";\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t// Add to list of owners\n\t\t\t\tarray_push($owners_list, $owner);\n\t\t\t}\n\t\t\t// Add to owners array\n\t\t\tarray_push($owners, $owner);\n\t\t}\n\t}\n\n\t// If loader is not a developer, check permission to upload data for these owners\n\tif (!$developer && !empty($owners)) {\n\t\t// Local variables\n\t\t$found=array();\n\t\tforeach ($owners as $owner) {\n\t\t\tarray_push($found, FALSE);\n\t\t}\n\t\t// Loop on array of users who permitted user to upload data for them\n\t\tfor ($i=0; $i<count($user_upload['id']); $i++) {\n\t\t\t// For each owner\n\t\t\tforeach ($owners as $key => $owner) {\n\t\t\t\tif ($user_upload['id'][$i]==$owner) {\n\t\t\t\t\t$found[$key]=TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Check owners were found\n\t\tforeach ($found as $key => $found_owner) {\n\t\t\t// Check boolean\n\t\t\tif (!$found_owner) {\n\t\t\t\t$error['code']=3;\n\t\t\t\t$error['message']=\"You do not have the rights to upload for '\".$owners[$key].\"'. If you wish to be granted this permission, please contact them directly.\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Store owners in list\n\tarray_unshift($gen_owners, $owners);\n\t\n\treturn TRUE;\n}", "public function index()\n {\n return OrganizerResource::collection(\n Auth::user()->organizers\n );\n }", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "public function getRegistrants()\n {\n if (array_key_exists(\"registrants\", $this->_propDict)) {\n return $this->_propDict[\"registrants\"];\n } else {\n return null;\n }\n }", "function getPlantaUsuarios()\r\n\t{\r\n\t\treturn $this->Usuario->find('all',array('conditions' => array('Usuario.planta' => 1)));\r\n\t}", "function get_custom_location($obj, $returntype = \"string\", $rpart='')\n{\n\tif($returntype == \"string\")\n\t{\n\t\tif(!$obj->session->userdata('location_string') || ($obj->session->userdata('location_string') && $obj->session->userdata('resetlocation') && $obj->session->userdata('resetlocation') == 'Y'))\n\t\t{\n\t\t\t$location = $obj->Users->get_user_location();\n\t\t\tif(!empty($location['city']))\n\t\t\t{\n\t\t\t\t$slocation = ucwords(strtolower($location['city'].', '.$location['country']));\n\t\t\t\t\n\t\t\t\t$obj->session->set_userdata('location_string', $slocation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$slocation = \"Unknown Location\";\n\t\t\t}\n\t\t\t$obj->session->unset_userdata(array('resetlocation'=>''));\n\t\t\t\n\t\t\treturn $slocation;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $obj->session->userdata('location_string');\n\t\t}\n\t\t\n\t}\n\telse\n\t{\n\t\tif(!$obj->session->userdata('location_array') || ($obj->session->userdata('location_array') && $obj->session->userdata('resetlocation') && $obj->session->userdata('resetlocation') == 'Y'))\n\t\t{\n\t\t\t$location = $obj->Users->get_user_location();\n\t\t\tif(!empty($location) && !empty($location['zipcode']) && trim($location['zipcode']) != '-')\n\t\t\t{\n\t\t\t\t$obj->session->set_userdata('location_array', $location);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$location = array('country'=>'United States', 'zipcode'=>'10001', 'city'=>'Manhattan', 'region'=>'New York');\n\t\t\t}\n\t\t\t$obj->session->unset_userdata(array('resetlocation'=>''));\n\t\t\t\n\t\t\treturn $location;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $obj->session->userdata('location_array');\n\t\t}\n\t}\n}", "public function testDestiny2GetPublicVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function pickupLocations(Request $request) {\n\n $api_url = 'https://urgentcargus.azure-api.net/api/PickupLocations';\n $subscriptionKey = $request->subscriptionKey;\n $token = 'Bearer '.$request->token_cargus;\n\n $response = Http::withHeaders([\n 'Ocp-Apim-Subscription-Key' => $subscriptionKey,\n 'Authorization' => $token\n ])->get($api_url);\n\n return $response;\n }", "public function index()\n {\n $invlocations = InvLocation::getAllInvLocation();\n return InvLocationResource::collection($invlocations);\n }", "function get_registrants_of_webinars($webinar_id=false) \n {\n\t\tif($webinar_id)\n\t\t{\n\t\t\tif(!$this->organizer_key or !$this->access_token)\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t$return_array = array();\n\t\t\t\n\t\t\t$return_array = json_decode($this->make_request(\"https://api.citrixonline.com/G2W/rest/organizers/\".$this->organizer_key.\"/webinars/{$webinar_id}/registrants?oauth_token=\".$this->access_token), true);\n\n\t\t\tif(isset($reponse['int_err_code']) and $reponse['int_err_code'] != '')\n\t\t\t{\n\t\t\t\t$this->set_access_token('');\n\t\t\t\t$this->set_organizer_key('');\t\t\t\t\n\t\t\t\tthrow new Exception($reponse['int_err_code']);\n\t\t\t}\n\t\t}\n\t\t\t\n return $return_array;\n\t}", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public function index()\n {\n\n if (request('show_deleted') == 1) {\n if (! Gate::allows('property_delete')) {\n return abort(401);\n }\n $tenants = User::whereIn('property_id', Property::where('user_id', auth()->user()->id)->pluck('id'))->onlyTrashed()->get();\n } else {\n\n $tenants = User::whereIn('property_id', Property::where('user_id', auth()->user()->id)->pluck('id'))->get();\n }\n\n return view('admin.tenants.index', compact('tenants'));\n }", "public function get_available_tax_locations() {\n\n\t\t$countries = ( WC()->countries->countries ) ? WC()->countries->countries : array();\n\n\t\t// These countries can be supported at the state level\n\t\t$countries_with_jurisdictions = array(\n\t\t\t'BR',\n\t\t\t'CA',\n\t\t\t'IN',\n\t\t\t'US',\n\t\t);\n\n\t\t$locations = array();\n\n\t\tforeach ( $countries as $country_code => $country_name ) {\n\n\t\t\t$locations[ $country_code . ':*' ] = $country_name;\n\n\t\t\tif ( in_array( $country_code, $countries_with_jurisdictions ) && $states = WC()->countries->get_states( $country_code ) ) {\n\n\t\t\t\tforeach ( $states as $state_code => $state_name ) {\n\t\t\t\t\t$locations[ $country_code . ':' . $state_code ] = '&nbsp;&nbsp;&nbsp;&nbsp;' . $state_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Filter the locations where tax calculation is available from Avalara.\n\t\t *\n\t\t * @since 1.1.0\n\t\t * @param array $locations the locations in the format $country_code:$state_code => $country_name\n\t\t */\n\t\treturn apply_filters( 'wc_avatax_available_tax_locations', $locations );\n\t}", "function get_owner_data($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_owner_data' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n \n return json_decode($response,true);\n\n }", "protected function _getVendorCollection()\n {\n if (is_null($this->_vendorCollection)) {\n $queryText = $this->getQueryText();\n $vendorShoptable = $this->_resourceConnection->getTableName('ced_csmarketplace_vendor_shop');\n $this->_vendorCollection = $this->_collectionFactory->create();\n $this->_vendorCollection->addAttributeToSelect('*');\n //$this->_vendorCollection->getSelect()->join(['vendor_shop' => $vendorShoptable], 'e.entity_id=vendor_shop.vendor_id AND vendor_shop.shop_disable=' . Vshop::ENABLED, ['shop_disable']);\n\n $this->_vendorCollection->addAttributeToFilter('meta_keywords', ['like' => '%' . $queryText . '%']);\n if ($this->_csmarketplaceHelper->isSharingEnabled()) {\n $this->_vendorCollection->addAttributeToFilter('website_id', $this->_storeManager->getStore()->getWebsiteId());\n }\n\n if ($this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::MODULE_ENABLE)) {\n //------------------- Custom Filter----------------[START]\n\n $savedLocationFromSession = $this->_hyperlocalHelper->getShippingLocationFromSession();\n $filterType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_TYPE);\n $radiusConfig = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_RADIUS);\n $distanceType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::DISTANCE_TYPE);\n $apiKey = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::API_KEY);\n $filterProductsBy = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_PRODUCTS_BY);\n\n if ($filterProductsBy == 'vendor_location' || $filterType == 'distance') {\n $vendorIds = [0];\n if ($savedLocationFromSession) {\n\n /** Filter Products By Vendor Location */\n if ($filterType == 'city_state_country') {\n\n //------------------- Filter By City,country & state----------------[START]\n $locationCollection = $this->_hyperlocalHelper->getFilteredlocationByCityStateCountry($savedLocationFromSession);\n if ($locationCollection) {\n $vendorIds = $locationCollection->getColumnValues('vendor_id');\n }\n\n //------------------- Filter By City,country & state----------------[END]\n } elseif ($filterType == 'zipcode' && isset($savedLocationFromSession['filterZipcode'])) {\n\n //------------------- Filter By Zipcode----------------[START]\n $resource = $this->_resourceConnection;\n $tableName = $resource->getTableName('ced_cshyperlocal_shipping_area');\n $this->zipcodeCollection->getSelect()->joinLeft($tableName, 'main_table.location_id = ' . $tableName . '.id', ['status', 'is_origin_address']);\n $this->zipcodeCollection->addFieldToFilter('main_table.zipcode', $savedLocationFromSession['filterZipcode'])\n ->addFieldToFilter('status', Shiparea::STATUS_ENABLED);\n $this->zipcodeCollection->getSelect()->where(\"`is_origin_address` IS NULL OR `is_origin_address` = '0'\");\n $vendorIds = $this->zipcodeCollection->getColumnValues('vendor_id');\n //------------------- Filter By Zipcode----------------[END]\n } elseif ($filterType == 'distance') {\n $tolat = $savedLocationFromSession['latitude'];\n $tolong = $savedLocationFromSession['longitude'];\n $vIds = [];\n if ($tolat != '' && $tolong != '') {\n $vendorCollection = $this->_collectionFactory->create();\n $vendorCollection->addAttributeToSelect('*');\n if ($vendorCollection->count()) {\n foreach ($vendorCollection as $vendor) {\n $distance = $this->_hyperlocalHelper->calculateDistancebyHaversine($vendor->getLatitude(), $vendor->getLongitude(), $tolat, $tolong);\n if ($distance <= $radiusConfig) {\n $vendorIds[] = $vendor->getId();\n }\n }\n }\n }\n }\n $this->_vendorCollection->addAttributeToFilter('entity_id', ['in' => $vendorIds]);\n }\n }\n //------------------- Custom Filter ----------------[END]\n }\n\n $this->prepareSortableFields();\n }\n return $this->_vendorCollection;\n }" ]
[ "0.6630221", "0.57750076", "0.5684562", "0.55618614", "0.5341715", "0.5269406", "0.5243142", "0.5201039", "0.51915646", "0.5186802", "0.5152518", "0.5141708", "0.5141471", "0.51251006", "0.509583", "0.5089354", "0.5084619", "0.5062845", "0.5049751", "0.5042079", "0.5038659", "0.5038466", "0.5011715", "0.49934947", "0.49861717", "0.4978971", "0.49609146", "0.49437907", "0.4934241", "0.4932545", "0.49270087", "0.4920743", "0.49170524", "0.49067244", "0.48977575", "0.4895424", "0.48779026", "0.48747498", "0.48744842", "0.48657185", "0.48292243", "0.48032835", "0.4797097", "0.4789546", "0.47828773", "0.47750357", "0.47482276", "0.47464803", "0.47459856", "0.47322318", "0.47253433", "0.4722011", "0.4713635", "0.47083205", "0.47074407", "0.47070485", "0.46983865", "0.46972588", "0.46949103", "0.46901336", "0.46857235", "0.46820498", "0.4681529", "0.4677669", "0.4677357", "0.46744764", "0.4671227", "0.4670596", "0.4669058", "0.46672562", "0.4666749", "0.46644133", "0.46630085", "0.4659631", "0.46593103", "0.46574128", "0.46532217", "0.46487382", "0.4647655", "0.4645937", "0.4642105", "0.46382806", "0.46345365", "0.46320713", "0.4631666", "0.46251753", "0.46224073", "0.4617775", "0.4615785", "0.4614549", "0.46120107", "0.46109766", "0.46059954", "0.46002194", "0.45928442", "0.4579994", "0.45747668", "0.45741335", "0.45685178", "0.45641974", "0.4563701" ]
0.0
-1
Calculates an association route between source and target model
private function _getAssociationRoute($source, $target, $route, $exclude){ if($source == $target) { return $target; } $tableObject = TableRegistry::get($source); $entityClass = $tableObject->entityClass(); $entityClass = (new \ReflectionClass($entityClass))->getShortName(); //Check if Model Exists or not ($entityClass will equal to 'Entity if no model exists') if($entityClass == 'Entity'){ return false; } $associations = $tableObject->associations(); unset($tableObject); $array = $associations->keys(); $source = strtolower($source); $target = strtolower($target); if(!$array){ return false; } if(in_array($target, $array)){ $route[] = $associations->get($target)->name(); return $route; }else{ $exclude[] = $source; foreach ($array as $key => $value) { if(!in_array($value, $exclude)){ $value = $associations->get($value)->name(); $check = $this->_getAssociationRoute($value, $target, $route, $exclude); if($check != false){ $check[] = $value; return $check; } } } return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destinations(){\n $this->belongsToMany(Destination::class);\n }", "public function route(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = route_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Route::class);\n\t}", "public function link($from,$to)\n {\n //\n $relation = new Relation;\n\t$relation->from = $from;\n $relation->to = $to;\n\t$relation->save();\n\t\n }", "public function routes(){\n\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = company_id, localKey = id)\n return $this->hasMany(Route::class);\n }", "public function outgoingPaths()\n {\n return $this->hasMany(Path::class,'first_node_id','id');\n }", "public function getAssociationTargets()\n {\n }", "public function routeCost(){\n return $this->hasMany(RouteCost::class, 'rute_id', 'id');\n }", "public function getDestination()\n {\n return $this->hasOne(Destination::className(), ['id' => 'destination_id']);\n }", "protected function destinations()\n {\n $list = $this->hasMany(Mapping\\ArticleDestination::class, 'article_id', 'article_id');\n return $list->getResults();\n }", "public function uriRelationships();", "public function getRoutes()\n {\n return $this->hasMany(Route::className(), ['PK_Trip' => 'PK_Trip']);\n }", "public function buildRelations()\n\t{\n $this->addRelation('Track', 'Track', RelationMap::MANY_TO_ONE, array('track_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Featurevectortype', 'Featurevectortype', RelationMap::MANY_TO_ONE, array('featurevectortype_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('File', 'File', RelationMap::MANY_TO_ONE, array('file_id' => 'id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('DistanceRelatedByTrackAId', 'Distance', RelationMap::ONE_TO_MANY, array('track_id' => 'track_a_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('DistanceRelatedByTrackBId', 'Distance', RelationMap::ONE_TO_MANY, array('track_id' => 'track_b_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Distancejob', 'Distancejob', RelationMap::ONE_TO_MANY, array('track_id' => 'track_id', ), 'RESTRICT', 'CASCADE');\n $this->addRelation('Featurevectorsegment', 'Featurevectorsegment', RelationMap::ONE_TO_MANY, array('track_id' => 'track_id', ), 'RESTRICT', 'CASCADE');\n\t}", "public function build_relationship()\n {\n $joins = array();\n\n $main_table = strtolower($this->_model->clean_table());\n\n foreach ($this->associations as $one) {\n\n if (!!$one) {\n $table = strtolower(DB_SUFFIX.'_'.$one);\n\n $clean_one = str_replace( DB_SUFFIX .'_', '', $table );\n\n $joins[] = 'LEFT JOIN '.$table.' ON '.DB_SUFFIX.'_'.$main_table.'.'.$clean_one.'_id = '.$table.'.id';\n\n // Set the columns within the one loop\n $this->get_has_one_columns($one);\n }\n }\n\n if ( count($joins) > 0 ) {\n $result = implode( ' ', $joins );\n } else {\n $result = false;\n }\n\n return $result;\n }", "public function getNodeRoute();", "public function relationshipsAction()\n\t{\n\t\t$params = $this->getRequest()->getPost();\n\t\tif(!isset($params['uri']) || empty($params['uri'])) {\n\t\t\t$this->_forward('error', 'api', null, array(\n\t\t\t\t'code' => 'RequiredError',\n\t\t\t\t'message' => 'Not all parameters given. This method requires: uri.'\n\t\t\t));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$uri = $this->escape($params['uri'], 'uri');\n\t\tif(!($id = $this->loadUri($uri))) {\n\t\t\treturn;\n\t\t}\n\n\t\t$relationships = array();\n\t\tforeach($params as $key => $value) {\n\t\t\tif($key != 'uri' && isset($this->_relationships[$key]))\n\t\t\t\t$relationships[] = $key;\n\t\t}\n\t\t$relationships = array_unique($relationships);\n\n\t\tif(count($relationships) == 0)\n\t\t\t$relationships = array_keys($this->_relationships);\n\n\t\t$query = $this->_queryPrefix .\n\t\t\t'SELECT ?to ?p ?label WHERE {' .\n\t\t\t\t'{ <' . $id . '> ?p ?to . }' .\n\t\t\t\t' UNION ' .\n\t\t\t\t'{ <' . $id . '> owl:sameAs ?sameas . ' .\n\t\t\t\t'?sameas ?p ?to . ' .\n\t\t\t\t'OPTIONAL { ?sameas rdfs:label ?label . } }' .\n\t\t\t\t'FILTER(';\n\n\t\t$first = true;\n\t\tforeach($relationships as $rel) {\n\t\t\tif($first)\n\t\t\t\t$first = false;\n\t\t\telse\n\t\t\t\t$query .= ' || ';\n\t\t\t$query .= ' ?p = <' . $this->_relationships[$rel] . '> ';\n\t\t}\n\t\t$query .= ') }';\n\n\t\t$store = $this->getBrowserStore();\n\t\t$rows = $store->query($query, 'rows');\n\t\tif($errors = $store->getErrors()) {\n\t\t\t$this->forwardTripleStoreError($errors);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$rels = array();\n\t\tforeach($rows as $row) {\n\t\t\tif(isset($rels[$row['to']])) \n\t\t\t\t$rels[$row['to']] .= ',';\n\t\t\telse\n\t\t\t\t$rels[$row['to']] = '';\n\n\t\t\t$rels[$row['to']] .= array_search($row['p'], $this->_relationships);\n\t\t}\n\n\t\t$xml = '<result>';\n\n\t\tforeach($rels as $to => $rel) {\n\t\t\t$profile = $this->getProfile($to, $store);\n\t\t\tif($profile === false)\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t$xml .= '<relationship from=\"' . $id . '\"';\n\t\t\t\n\t\t\tif(isset($row['label']) && !empty($row['label'])) {\n\t\t\t\t$xml .= ' label=\"' . htmlentities($row['label'], ENT_COMPAT, 'UTF-8') . '\"';\n\t\t\t}\n\n\t\t\t$xml .= ' type=\"' . $rel . '\">';\n\t\t\t$xml .= $profile;\n\t\t\t$xml .= '</relationship>';\n\t\t}\n\n\t\t$xml .= '</result>';\n\t\t\t\n\t\t$this->outputXml($xml);\n\t}", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "function getDepartamentalRoute($originCity, $destinyCity)\n {\n }", "public function destinationMethods()\n {\n return $this->belongsToMany('App\\Method', 'prices', 'destination_country_id', 'method_id');\n }", "public function journey()\n {\n return $this->belongsTo(Journey::class);\n }", "public function getLinkJoinAttribute()\n\t{\n\t\treturn route('Cup@joinTeam', ['id' => $this -> cup_id, 'name' => $this->cup->name, 'team' => $this->id, 'team_name'=>$this->name]);\n\t}", "public function route() {\n\t\t$route = $this->sets[':default']->route();\n\t\tif (!$route&&sizeof($this->route_extra)==0) return false;\n\t\tif (!$route) $route = new CMS_Navigation3_LinkSet();\n\t\t$n = $route->count();\n\t\tforeach($this->route_extra as $r) {\n\t\t\t$item = $r[1];\n\t\t\t$item['id'] = $n;\n\t\t\t$n++;\n\t\t\t$route->add($r[0],$item);\n\t\t}\t\n\t\treturn $route;\n\t}", "public static function workflowRelations();", "public function buildRelations()\n {\n $this->addRelation('RemoteApp', 'Slashworks\\\\AppBundle\\\\Model\\\\RemoteApp', RelationMap::MANY_TO_ONE, array('remote_app_id' => 'id', ), 'CASCADE', 'CASCADE');\n }", "public function getNodeOriginalRoute();", "public function get_directions();", "public function addAssociationTarget($target)\n {\n }", "function getAssociationMappedByTargetField($assocName);", "public function setupAssociations() \n {\n \n }", "public function targets()\n {\n return $this->hasMany('App\\Target');\n }", "protected function default_mapping() {\n\t\t$from\t= $this->from();\n\t\t$to\t\t= $this->to();\n\n\t\t// Fk of source entity exists in target entity ? => one to many\n\t\t$fk\t\t= $from->fk();\n\t\t$errors\t= $to->fields_validate(array_values($fk));\n\t\tif (count($errors) === 0)\n\t\t\treturn $fk;\n\n\t\t// Fk of target entity exists in source entity ? => many to one\n\t\t$fk\t\t= $to->fk();\n\t\t$errors\t= $from->fields_validate(array_values($fk));\n\t\tif (count($errors) === 0)\n\t\t\treturn array_flip($fk);\n\n\t\t// Associative entity ? => many to many\n\t\ttry {\n\t\t\t$pivot\t\t= ($this->from < $this->to) ? $this->from.'2'.$this->to : $this->to.'2'.$this->from;\n\t\t\t$pivot\t\t= glue::entity($pivot); // Will raise exception if no such entity.\n\t\t\t$from_fk\t= $from->fk();\n\t\t\t$to_fk\t\t= $to->fk();\n\t\t\t$errors\t\t= $pivot->fields_validate(array_merge(array_values($from_fk), array_values($to_fk)));\n\t\t\tif (count($errors) === 0) {\n\t\t\t\tforeach($from_fk as $src => $trg) $mapping[$src] = $pivot->name().'.'.$trg;\n\t\t\t\tforeach($to_fk as $trg => $src) $mapping[$pivot->name().'.'.$src] = $trg;\n\t\t\t\treturn $mapping;\n\t\t\t}\n\t\t} catch(Exception $e) { /* means there is no such associative entity */ }\n\n\t\t// Matching pk ? => one to one\n\t\t$from_pk\t= $from->pk();\n\t\t$to_pk\t\t= $to->pk();\n\t\tif (count($from_pk) === count($to_pk) && count(array_diff($from_pk, $to_pk)) === 0)\n\t\t\treturn array_combine($from_pk, $from_pk);\n\n\t\t// Otherwise error.\n\t\tthrow new Kohana_Exception(\"Impossible to guess field mapping from entity '\".$this->from.\"' to entity'\".$this->to.\"'\");\n\t}", "public function route(): BelongsTo\n {\n return $this->belongsTo(Route::class);\n }", "public function directions()\n {\n return $this->hasMany('App\\Direction');\n }", "abstract protected function getRoute($destination);", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function createRouteObject();", "public function objectRouteClass();", "public function routes()\n {\n\n return $this->belongsToMany(Stations::class, 'route_stops' , 'stop_point' , ' route_id')->withPivot('stop_order', 'created_at', 'updated_at');\n\n }", "public function getRoute();", "public function shortestPath($source, $target)\n {\n //vertex\n $d = array();\n //array of predecessors for each vertex\n $pi = array();\n //queue of all unoptimized vertives\n $Q = new SplPriorityQueue();\n\n foreach($this->graph as $v => $adj)\n {\n $d[$v] = INF; //set intitial distance to \"infinity\"\n $pi[$v] = null; // no known predecessors yet\n foreach($adj as $w => $cost)\n {\n //use the edge cost as the priority\n $Q->insert($w, $cost);\n }\n }\n\n //initial distance at source is 0\n $d[$source] = 0;\n\n while(!$Q->isEmpty())\n {\n //extract min cost\n $u = $Q->extract();\n if(!empty($this->graph[$u]))\n {\n //alternate route length to adjacent neightbor\n $alt = $d[$u] + $cost;\n //if alternate route is shorter\n if($alt < $d[$v])\n {\n $d[$v] = $alt;//update minimun length to vertex\n $pi[$v] = $u;//add neighbor to predecessors for vertex\n }\n }\n }\n }", "public function getAllRoute()\n {\n return $this->hasMany('Api\\Model\\IntraHyperRoute', 'fk_buyer_seller_post_id', 'id')->where('lkp_service_id', '=', _HYPERLOCAL_);\n }", "abstract public function getRoute();", "public function getLinks(){\n return $this->hasMany('App\\LinkCircular','id_circular');\n }", "protected static function _relations() {\n\n\t}", "public function incomingPaths()\n {\n return $this->hasMany(Path::class, 'last_node_id','id');\n }", "public function get_matched_route()\n {\n }", "public function travel(){\n \treturn $this->hasOne('App\\Models\\Travel', 'eventId');\n }", "function getNationalRoute($originCity, $destinyCity)\n {\n }", "private function executeRelationshipQueries(QueryEventArgs $eventArgs) {\n $targetClass = $eventArgs->getTargetEntity();\n $entityManager = $eventArgs->getEntityManager();\n $results = $eventArgs->getResults();\n\n /** @var ManyToOne[] $manyToOnes */\n $manyToOnes = $this->hydrator->extractSpecAnnotations($targetClass, ManyToOne::class);\n /** @var JoinColumns[] $joinsColumns */\n $joinsColumns = $this->hydrator->extractSpecAnnotations($targetClass, JoinColumns::class);\n\n foreach ($manyToOnes as $propName => $mto) {\n if (!isset($joinsColumns[$propName])) {\n continue;\n }\n\n foreach ($joinsColumns as $joinsColumn) {\n /** @var JoinColumn[] $joinColumns */\n $joinColumns = $joinsColumn->value;\n foreach ($joinColumns as $joinColumn) {\n $colunmName = AnnotationEntityHydrator::camelizeString($joinColumn->referencedColumnName);\n foreach ($results as $key => $result) {\n if (property_exists(get_class($result), $colunmName)) {\n $value = $this->hydrator->extract($result, $colunmName);\n $relObject = $entityManager->getRepository($mto->targetEntity)\n ->findOneBy([$colunmName => $value]);\n $this->hydrator->hydrate($results[$key], [$colunmName => $relObject]);\n }\n }\n }\n }\n }\n\n $eventArgs->setResults($results);\n }", "public function sources() {\n return $this->hasMany(Location::class);\n }", "protected static final function resolveRelationship($name, $class_a, $class_b)\n {\n # TODO: change func name of Orm::name() to something like Orm::internalizeName()\n $possibilities = array();\n foreach (self::getSchema($name) as $rule) {\n if ($rule->input == $class_a && $rule->output == $class_b) {\n $possiblities[] = $rule;\n } elseif ($rule->input == $class_b && $rule->output == $class_a) {\n $possiblities[] = $rule;\n }\n }\n\n switch (sizeof($possiblities)) {\n case 0:\n throw new OrmRelationshipResolutionException('Failed to resolve relationship: no matches found');\n case 1:\n return reset($possibilities);\n default:\n foreach ($possiblities as $r)\n $matches[] = sprintf('%s to %s as %s', $r->input, $r->output, $r->relationship);\n throw new OrmRelationshipResolutionException('Failed to resolve relationship: multiple matches found: %s', implode(', ', $matches));\n }\n }", "public function buildRelations()\n {\n $this->addRelation('Website', '\\\\CE\\\\Model\\\\Website', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':website_id',\n 1 => ':id',\n ),\n), 'CASCADE', 'CASCADE', null, false);\n $this->addRelation('WebsiteRouting', '\\\\CE\\\\Model\\\\WebsiteRouting', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':website_routing_id',\n 1 => ':id',\n ),\n), 'CASCADE', 'CASCADE', null, false);\n }", "public function getAddress()\n {\n //Read it as select * from address, person where address.relatedmodel_id = person.id AND person.id = customer.person_id\n //Thus when via is used second param in the link correspond to via column in the relation.\n return $this->hasOne(Address::className(), ['relatedmodel_id' => 'id'])\n ->where('relatedmodel = :rm AND type = :type', [':rm' => 'Person', ':type' => Address::TYPE_DEFAULT])\n ->via('person');\n }", "public function journey() {\n return $this->hasOne('TravelingChildrenProject\\Journey', 'id', 'likes_journey');\n }", "public function redirectConstellation(&$from, &$to) {\n if ($from == null || $from->getID() == null || $to == null || $to->getID() == null) {\n return false;\n }\n\n if ($this->connector != null) {\n // Find all in-relations to the from constellation\n $result = $this->connector->run(\"MATCH p=()-[]->(b:Identity {id: {icid}}) return p;\",\n [\n 'icid' => \"{$from->getID()}\"\n ]\n );\n\n foreach ($result->getRecords() as $record) {\n $path = $record->pathValue(\"p\");\n\n // Source of relation\n $startID = $path->start()->value(\"id\");\n $startLabels = $path->start()->labels();\n $startType = $startLabels[0] ?? null;\n\n if ($startType == null) {\n throw new \\snac\\exceptions\\SNACDatabaseException(\"Neo4J Node did not have a type\");\n }\n\n if (count($path->relationships()) > 1) {\n $this->logger->addWarning(\"Redirected a Constellation, {$from->getID()}, which had two in-relations from the same source.\");\n }\n // Relationship id/version\n foreach ($path->relationships() as $relation) {\n // Need to know Relation type (ICRELATION, RRELATION, HIRELATION)\n $type = $relation->type();\n\n $data = [];\n\n // Resource Relations have id/version\n if ($relation->hasValue('id'))\n $data[\"id\"] = $relation->value('id');\n if ($relation->hasValue('version'))\n $data[\"version\"] = $relation->value('version');\n\n // Constellation Relations have arcrole\n if ($relation->hasValue('arcrole'))\n $data[\"arcrole\"] = $relation->value('arcrole');\n\n // Add the relation to the other Constellation if the ids are different\n if ($startID != $to->getID()) {\n // Note: matches the two nodes, and if a relation already exists of this type (ICRELATION,\n // RRELATION, HIRELATION) then it will just update that relation and overwrite any\n // values in Neo4J. If the relation doesn't exist, it will instead create the\n // relation with the information.\n $result = $this->connector->run(\"MATCH (a:$startType {id: {id1} }),(b:Identity {id: {id2} })\n MERGE (a)-[r:$type]->(b) SET r += {infos}\",\n [\n 'id1' => $startID,\n 'id2' => \"{$to->getID()}\", // need a string for neo4j\n 'infos' => $data\n ]);\n }\n }\n\n }\n\n $this->deleteConstellation($from);\n\n return true;\n }\n\n return false;\n\n }", "public function targets()\n {\n return $this->hasMany(\\App\\Target::class);\n }", "public function moves(){\n return $this->hasMany(\"App\\Models\\Move\");\n }", "public function getRelations();", "public function getRelations();", "public function getSource()\n {\n return 'baiyang_sms_relationship';\n }", "protected function default_type() {\n\t\t$src_multiple = false;\n\t\t$trg_multiple = false;\n\t\tforeach($this->joins as $trg_entity => $arr1) {\n\t\t\tforeach($arr1 as $src_entity => $arr2) {\n\t\t\t\t// Check trg cardinality :\n\t\t\t\tif ( ! $trg_multiple) {\n\t\t\t\t\t$fields\t= array_keys($arr2);\n\t\t\t\t\t$pk\t\t= glue::entity($trg_entity)->pk();\n\t\t\t\t\tif (count($pk) !== count($fields) || count(array_diff($fields, $pk)) !== 0)\n\t\t\t\t\t\t$trg_multiple = true;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// Check src cardinality :\n\t\t\t\tif ( ! $src_multiple) {\n\t\t\t\t\t$fields\t= array_values($arr2);\n\t\t\t\t\t$pk\t\t= glue::entity($src_entity)->pk();\n\t\t\t\t\tif (count($pk) !== count($fields) || count(array_diff($fields, $pk)) !== 0)\n\t\t\t\t\t\t$src_multiple = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Compute relationship type :\n\t\tif ($src_multiple) {\n\t\t\tif ($trg_multiple)\n\t\t\t\t$type = self::MANY_TO_MANY;\n\t\t\telse\n\t\t\t\t$type = self::MANY_TO_ONE;\n\t\t}\n\t\telse {\n\t\t\tif ($trg_multiple)\n\t\t\t\t$type = self::ONE_TO_MANY;\n\t\t\telse\n\t\t\t\t$type = self::ONE_TO_ONE;\n\t\t}\n\n\t\treturn $type;\n\t}", "public function viewRouteByAddresses($init, $dest) {\n// $data = json_encode($route);\n// echo $data;\n }", "public function route(): RouteContract;", "public function buildRelations()\n {\n $this->addRelation('Country', 'Slashworks\\\\AppBundle\\\\Model\\\\Country', RelationMap::MANY_TO_ONE, array('country_id' => 'id', ), null, 'CASCADE');\n $this->addRelation('RemoteApp', 'Slashworks\\\\AppBundle\\\\Model\\\\RemoteApp', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'SET NULL', 'CASCADE', 'RemoteApps');\n $this->addRelation('UserCustomerRelation', 'Slashworks\\\\AppBundle\\\\Model\\\\UserCustomerRelation', RelationMap::ONE_TO_MANY, array('id' => 'customer_id', ), 'CASCADE', 'CASCADE', 'UserCustomerRelations');\n }", "private function addEdge($fromId, $toId, $weight) {\r\n $aux = 0;\r\n \r\n if ($weight < 1) {\r\n $weight = 1;\r\n //To-do: Exception\r\n }\r\n \r\n $this->inLinks[$toId][$fromId] = $weight;\r\n $this->outLinks[$fromId][$toId] = $weight;\r\n }", "public function actionGetOtherDestination(){\n\t\t$destination = new Destinations();\n\t\t$tour = new Tours();\n\n\t\t$id = $_GET['id'];\n\t\t$models = $destination->getOtherDestination($id);\n\n\t\t$data = array();\n\t\tforeach ($models as $model) {\n\t\t\t$totalTours = count($tour->getTourInDestination($model->id));\n\n\t\t\t$data[] = array('des' => $model, 'totalTours' => $totalTours);\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\theader(\"Access-Control-Allow-Origin: *\");\n header(\"Access-Control-Allow-Methods: GET, POST, PUT, DELETE\");\n echo json_encode($data);\n\t}", "public function getRelatedResourceReference(ResourceSet $sourceResourceSet, \n $sourceEntityInstance, \n ResourceSet $targetResourceSet,\n ResourceProperty $targetProperty\n ) {\n $result = null;\n $srcClass = get_class($sourceEntityInstance);\n $navigationPropName = $targetProperty->getName();\n if ($srcClass === 'Order') {\n if ($navigationPropName === 'Customer') {\n if (empty($sourceEntityInstance->CustomerID)) {\n $result = null;\n } else { \n $query = \"SELECT * FROM Customers WHERE CustomerID = '$sourceEntityInstance->CustomerID'\"; \n $stmt = sqlsrv_query($this->_connectionHandle, $query);\n if ($stmt === false) {\n $errorAsString = self::_getSQLSRVError();\n \t throw ODataException::createInternalServerError($errorAsString);\n }\n\n if (!sqlsrv_has_rows($stmt)) {\n $result = null;\n }\n\n $result = $this->_serializeCustomer(sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC));\n }\n } else {\n die('Customer does not have navigation porperty with name: ' . $navigationPropName);\n } \n } else if ($srcClass === 'Order_Details') {\n if ($navigationPropName === 'Order') {\n if (empty($sourceEntityInstance->OrderID)) {\n $result = null;\n } else {\n $query = \"SELECT * FROM Orders WHERE OrderID = $sourceEntityInstance->OrderID\";\n $stmt = sqlsrv_query($this->_connectionHandle, $query);\n if ($stmt === false) {\n $errorAsString = self::_getSQLSRVError();\n \t throw ODataException::createInternalServerError($errorAsString);\n }\n \n if (!sqlsrv_has_rows($stmt)) {\n $result = null;\n }\n \n $result = $this->_serializeOrder(sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC));\n }\n } else {\n die('Order_Details does not have navigation porperty with name: ' . $navigationPropName);\n }\n } \n\n return $result;\n }", "protected function getTargetIdentifier(): string\n {\n return 'route';\n }", "public function routeUrlDestinationAutodetect()\n {\n\n }", "public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }", "public function getActualOverheadOtherCosts(){\n return $this->hasMany(Overhead_other_costs::class, 'mfp_procurement_id', 'id'); \n }", "public function buildRelations()\n\t{\n\t\t$this->addRelation('AmistadRelatedById_usuario', 'Amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'AmistadsRelatedById_usuario');\n\t\t$this->addRelation('AmistadRelatedByid_usuarioamigo', 'Amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuarioamigo', ), null, null, 'AmistadsRelatedByid_usuarioamigo');\n\t\t$this->addRelation('Calificacion', 'Calificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Calificacions');\n\t\t$this->addRelation('Comentario', 'Comentario', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Comentarios');\n\t\t$this->addRelation('LibroRelatedByUsuario_ult_acc', 'Libro', RelationMap::ONE_TO_MANY, array('id' => 'usuario_ult_acc', ), null, null, 'LibrosRelatedByUsuario_ult_acc');\n\t\t$this->addRelation('LibroRelatedById_usuario', 'Libro', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'LibrosRelatedById_usuario');\n\t\t$this->addRelation('Usuario_intereses', 'Usuario_intereses', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Usuario_interesess');\n\t\t$this->addRelation('Lista', 'Lista', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario', ), null, null, 'Listas');\n\t\t$this->addRelation('Libro_colaborador', 'Libro_colaborador', RelationMap::ONE_TO_MANY, array('id' => 'idusuario', ), null, null, 'Libro_colaboradors');\n\t\t$this->addRelation('Libro_version', 'Libro_version', RelationMap::ONE_TO_MANY, array('id' => 'idusuario', ), null, null, 'Libro_versions');\n\t\t$this->addRelation('MensajeRelatedById_usuario_destinatario', 'Mensaje', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_destinatario', ), null, null, 'MensajesRelatedById_usuario_destinatario');\n\t\t$this->addRelation('MensajeRelatedById_usuario_remitente', 'Mensaje', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_remitente', ), null, null, 'MensajesRelatedById_usuario_remitente');\n\t\t$this->addRelation('NotificacionRelatedById_emisor', 'Notificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_emisor', ), null, null, 'NotificacionsRelatedById_emisor');\n\t\t$this->addRelation('NotificacionRelatedById_receptor', 'Notificacion', RelationMap::ONE_TO_MANY, array('id' => 'id_receptor', ), null, null, 'NotificacionsRelatedById_receptor');\n\t\t$this->addRelation('Solicitud_amistadRelatedById_usuario_solicitado', 'Solicitud_amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitado', ), null, null, 'Solicitud_amistadsRelatedById_usuario_solicitado');\n\t\t$this->addRelation('Solicitud_amistadRelatedById_usuario_solicitante', 'Solicitud_amistad', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitante', ), null, null, 'Solicitud_amistadsRelatedById_usuario_solicitante');\n\t\t$this->addRelation('Solicitud', 'Solicitud', RelationMap::ONE_TO_MANY, array('id' => 'id_usuario_solicitante', ), null, null, 'Solicituds');\n\t\t$this->addRelation('Postulantes', 'Postulantes', RelationMap::ONE_TO_MANY, array('id' => 'id_postulante', ), null, null, 'Postulantess');\n\t}", "public function outgoingEdges()\n {\n return $this->hasMany(Edge::class, 'parent_id','id');\n }", "function getRoute($con, $start_id, $end_id, $cost){\t\n\n\t\t$arrayData = array(); \t\t\t\t// Store geometric results from query in arrays\t\t\n\t\t$t1 = array();\n\t\t$t2 = array();\n\t\t$t3 = array();\n\t\t$t4 = array();\n\t\t$t5 = array();\n\t\t$t6 = array();\t\n\t\t\t\n\t\t$sql_routing = \"SELECT ST_AsGeoJSON(geom),\n\t\t\t\t\t\t\t\tt1, t2, t3, t4, t5, t6\n\t\t\t\t\t\t FROM dublin_traffic\n\t\t\t\t\t\t\t\tJOIN\n\t\t\t\t\t\t\t\t (SELECT * FROM shortest_path('\n\t\t\t\t\t\t\t\t\t SELECT id AS id, \n\t\t\t\t\t\t\t\t\t\t source::int4 AS source, \n\t\t\t\t\t\t\t\t\t\t target::int4 AS target, \n\t\t\t\t\t\t\t\t\t\t $cost::float8 AS cost\n\t\t\t\t\t\t\t\t\t FROM dublin_traffic',\n\t\t\t\t\t\t\t\t $start_id,\n\t\t\t\t\t\t\t\t $end_id,\n\t\t\t\t\t\t\t\t false,\n\t\t\t\t\t\t\t\t false)) AS route\n\t\t\t\t\t\t\tON\n\t\t\t\t\t\t dublin_traffic.id = route.edge_id;\";\n\n\t\t$query = pg_query($con, $sql_routing);\t\t// Run query\t\n\t\t$route = array(); \t\t\t\t\t\t\t// Store results in array\n\t\twhile($r = pg_fetch_row($query) ) {\t\t\t// Parse results\t\t\t\n\t\t\t\t$route[] = $r[0];\t\t\t\n\t\t\t\t$t1[] = $r[1];\t\t\t\n\t\t\t\t$t2[] = $r[2];\t\t\n\t\t\t\t$t3[] = $r[3];\t\t\n\t\t\t\t$t4[] = $r[4];\t\t\n\t\t\t\t$t5[] = $r[5];\t\t\n\t\t}\t\t\n\n\t\t/* function to calculate average */\n\t\tfunction avgT($a){\n\t\t\treturn array_sum($a) / count($a);\t\n\t\t}\n\n\t$avgTraffic = array(avgT($t1), avgT($t2), avgT($t3), avgT($t4), avgT($t5));\n\t\t \t\n\t\t\t\t\n\t\treturn \tarray(\t'start_id' => $start_id, \n\t\t\t\t\t\t'end_id' => $end_id,\n\t\t\t\t\t\t't1' => $t1,\n\t\t\t\t\t\t't2' => $t2,\n\t\t\t\t\t\t't3' => $t3,\n\t\t\t\t\t\t't4' => $t4,\n\t\t\t\t\t\t't5' => $t5,\t\n\t\t\t\t\t\t'avg' => $avgTraffic,\t\t\t\t\t\t\n\t\t\t\t\t\t'roads' => $route\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t \n\t}", "public function destinationPrices()\n {\n return $this->hasMany('App\\Price', 'destination_country_id');\n }", "public function buildRelations()\n {\n $this->addRelation('CastleType', 'CastleType', RelationMap::MANY_TO_ONE, array('castle_type_id' => 'id', ), null, null);\n $this->addRelation('CastleLocation', 'CastleLocation', RelationMap::MANY_TO_ONE, array('castle_location_id' => 'id', ), null, null);\n $this->addRelation('User', 'User', RelationMap::MANY_TO_ONE, array('user_id' => 'id', ), null, null);\n $this->addRelation('Attack2castle', 'Attack2castle', RelationMap::ONE_TO_MANY, array('id' => 'castle_id', ), null, null, 'Attack2castles');\n $this->addRelation('TargetActions', 'TargetActions', RelationMap::ONE_TO_MANY, array('id' => 'castle_id', ), null, null, 'TargetActionss');\n $this->addRelation('Attack', 'Attack', RelationMap::MANY_TO_MANY, array(), null, null, 'Attacks');\n }", "function jeanisRoute($citys, $roads) {\n // 需要投递的城市\n $deliverMap = [];\n $k = count($citys);\n foreach ($citys as $city) {\n $deliverMap[$city] = true;\n }\n \n // road转成connectMap\n $connectMap = [];\n foreach ($roads as $item) {\n $connectMap[$item[0]][$item[1]] = $connectMap[$item[1]][$item[0]] = $item[2];\n }\n \n // 以第一个节点作为根\n $root = 1;\n \n // 其所有子节点中待投递城市的数量\n $subDeliveryCountArr = [];\n \n // 所有走过的边的距离之和\n $result = 0;\n \n // 最长距离\n $globalMaxDis = 0;\n \n processDis($subDeliveryCountArr, $connectMap, $deliverMap, $result, $globalMaxDis, $root, 0, $k);\n\n \n return 2 * $result - $globalMaxDis;\n}", "public function getDestination()\n\t{\n\t\treturn $this->resource->model_destination;\n\t}", "public function createLinksFromRelations(Metadata $operation);", "public function routes()\n {\n $pivotTable = config('permission.database.permission_routes_table');\n\n $relatedModel = config('permission.database.routes_model');\n\n return $this->belongsToMany($relatedModel, $pivotTable, 'permission_id', 'route_id')->withTimestamps();\n }", "public function get_routes($punto1, $punto2, &$routes, &$route = array()){\r\n \r\n $origin_connections = $this->connections[$punto1];\r\n \r\n foreach ($origin_connections as $city => $cost) {\r\n \r\n if(!in_array($city , $this->ruta) && $cost > 0){\r\n $this->ruta[] = $city;\r\n if($city == $punto2){\r\n $routes[] = $this->ruta;\r\n array_splice($this->ruta, array_search($city, $this->ruta ));\r\n }else{\r\n $this->get_routes($city, $punto2, $routes, $route);\r\n }\r\n }\r\n }\r\n array_splice($this->ruta, count($this->ruta)-1);\r\n\r\n }", "public function getSimilarDestinationIds()\n {\n return $this->similar_destination_ids;\n }", "public function buildRelations()\n\t{\n $this->addRelation('Genero', 'Genero', RelationMap::MANY_TO_ONE, array('id_genero' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tematica', 'Tematica', RelationMap::MANY_TO_ONE, array('id_tematica' => 'id', ), null, 'CASCADE');\n $this->addRelation('Autor', 'Autor', RelationMap::MANY_TO_ONE, array('id_autor' => 'id', ), null, 'CASCADE');\n $this->addRelation('Materia', 'Materia', RelationMap::MANY_TO_ONE, array('id_materia' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tipopublicacion', 'Tipopublicacion', RelationMap::MANY_TO_ONE, array('id_tipopublicacion' => 'id', ), null, 'CASCADE');\n\t}", "public function profileLocation()// notacion: camelCase, modelointermedio+modelofinal\n {\n return $this->hasOneThrough('App\\Location', 'App\\Profile');//1er parametro: direccion modelofinal, 2do parametro: direccion modelointermedio\n }", "public function getRoute(): Route;", "public function addConstraints()\n {\n if (static::$constraints) {\n /*\n * For belongs to relationships, which are essentially the inverse of has one\n * or has many relationships, we need to actually query on the primary key\n * of the parent model matching on the INCOMING relationship by name.\n *\n * We are trying to achieve a Cypher that goes something like:\n *\n * MATCH (phone:`Phone`), (phone)<-[:PHONE]-(owner:`User`)\n * WHERE id(phone) = 1006\n * RETURN owner;\n *\n * (phone:`Phone`) represents a matching statement where\n * 'phone' is the parent Node's placeholder and '`Phone`' is the parentLabel.\n * All node placeholders must be lowercased letters and will be used\n * throught the query to represent the actual Node.\n *\n * Resulting from:\n * class Phone extends NeoEloquent {\n *\n * public function owner()\n * {\n * return $this->belongsTo('User', 'PHONE');\n * }\n * }\n */\n\n // Get the parent node's placeholder.\n $parentNode = $this->query->getQuery()->modelAsNode($this->parent->nodeLabel());\n // Tell the query that we only need the related model returned.\n $this->query->select($this->relation);\n // Set the parent node's placeholder as the RETURN key.\n $this->query->getQuery()->from = array($parentNode);\n // Build the MATCH ()<-[]-() Cypher clause.\n $this->query->matchOut($this->parent, $this->related, $this->relation, $this->relationType, $this->otherKey, $this->parent->{$this->otherKey});\n // Add WHERE clause over the parent node's matching key = value.\n $this->query->where($this->otherKey, '=', $this->parent->{$this->otherKey});\n }\n }" ]
[ "0.54888225", "0.54252654", "0.53722924", "0.53400636", "0.52018255", "0.5178212", "0.51626736", "0.51306427", "0.5101064", "0.49980292", "0.49609435", "0.49051705", "0.48482326", "0.4824491", "0.48200256", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.47924343", "0.4785142", "0.4777729", "0.47744823", "0.477202", "0.47599688", "0.47551736", "0.47461382", "0.4743821", "0.4724241", "0.47178882", "0.471525", "0.47045493", "0.47005188", "0.46939167", "0.4691366", "0.46877807", "0.46729589", "0.46617076", "0.46617076", "0.46617076", "0.46617076", "0.46617076", "0.46617076", "0.46617076", "0.46617076", "0.4626171", "0.46169937", "0.45934704", "0.4589032", "0.45845547", "0.45651594", "0.45615476", "0.455865", "0.454074", "0.4537452", "0.45260525", "0.45171407", "0.4516165", "0.45111534", "0.45039824", "0.4500051", "0.44934636", "0.44928354", "0.44896775", "0.44882426", "0.44871104", "0.44777203", "0.44698063", "0.44698063", "0.44604647", "0.44547898", "0.44503114", "0.44439664", "0.44430953", "0.4439304", "0.44179124", "0.44160077", "0.44148758", "0.44124967", "0.44045204", "0.4400241", "0.4399093", "0.43986765", "0.4394149", "0.4386905", "0.43864042", "0.43838382", "0.4383383", "0.4380916", "0.43783695", "0.43753242", "0.43741086", "0.4365331", "0.43639114", "0.43637902", "0.43616283" ]
0.6623788
0
Check the session for previously entered form data.
protected function loadFormData() { $app = JFactory::getApplication(); $data = $app->getUserState('com_jvisualcontent.edit.extrafield.data', array()); if (empty($data)) { $data = $this->getItem(); } $this->preprocessData('com_jvisualcontent.extrafield', $data); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function InitIsValidPost() \r\n\t{\t\t\r\n\t\t$sVar = (isset($_POST['__SVar']) ? $_POST['__SVar'] : ( isset($_GET['__SVar']) ? $_GET['__SVar'] : \"\" ));\r\n\r\n\t\t$this->isValidPost = ($sVar == $_SESSION['myHiddenVar']);\r\n\r\n\t\tSession::SessionInit($mySessionVar);\r\n\r\n\t\treturn $this->isValidPost;\r\n\t}", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "function currentFormHasData() {\n global $double_data_entry, $user_rights, $quesion_by_section, $pageFields;\n\n $record = $_GET['id'];\n if ($double_data_entry && $user_rights['double_data'] != 0) {\n $record = $record . '--' . $user_rights['double_data'];\n }\n\n if (PAGE != 'DataEntry/index.php' && $question_by_section && Records::fieldsHaveData($record, $pageFields[$_GET['__page__']], $_GET['event_id'])) {\n // The survey has data.\n return true;\n }\n\n if (Records::formHasData($record, $_GET['page'], $_GET['event_id'], $_GET['instance'])) {\n // The data entry has data.\n return true;\n }\n\n return false;\n }", "function checkTextFormValues($session){\r\n\t\tif ($session == \"imageName\" && strlen($_POST[$session]) > 50) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t} elseif ($session == \"description\" && strlen($_POST[$session]) > 500) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t} elseif ($session == \"author\" && strlen($_POST[$session]) > 50) {\r\n\t\t\t$_POST[$session] = null;\r\n\t\t}\r\n\r\n\t\tif (!empty($_POST[$session]) && is_string($_POST[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_POST[$session])) {\r\n\t\t\t$return = $_POST[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "public function oldInputIsEmpty()\n {\n return (isset($this->session) && count($this->session->getOldInput()) == 0);\n }", "public static function checkSession() {\n\t\t// Set any API keys\n\t\t$api_keys = array();\n\t\t// Check API Key or Session Authentication\n\t\t$key = \"\";\n\t\tif (isset($_GET['key'])) {\n\t\t\t$key = $_GET['key'];\n\t\t}\n\t\tif (!isset($_SESSION['user']) && !in_array($key, $api_keys)) {\n\t\t\texit('{\"status\":\"error\",\"message\":\"Authentication Error\"}');\n\t\t}\n\t}", "function session_check() {\n\tif (!isset($_POST['session'])) {\n\t\tsend_message('error', array('reason' => 'no_session_token','message' => 'No session token passed'));\n\t}\n}", "public static function validateAll()\n {\n\n foreach ($_SESSION as $key => $value) {\n\n if (strpos($key, \"form_\") !== false) {\n\n $id = $value[\"form_id\"];\n\n if (!empty($_POST[\"check\"])) {\n\n self::validate($id);\n }\n }\n }\n }", "function checkSession()\r\n {\r\n if (!$this->Session->check('User'))\r\n {\r\n \t// Force the user to login\r\n $this->redirect('/user/login');\r\n exit();\r\n }\r\n }", "function checkEmailFormValues($session){\r\n\t\tif (!empty($_POST[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_POST[$session]) && filter_var($_POST[$session], FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t$return = $_POST[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "private function check()\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "public function formIsValid()\n {\n $data = array();\n foreach ($this->getSessionNamespace() as $key => $info) {\n $data[$key] = $info;\n }\n \n return $this->getForm()->isValid($data);\n }", "protected final function is_still_valid($session)\n {\n }", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "function checkApplicationState(){\n\t// if the session var isn't there OR if we're reloading from a URL var\n\tif ( !isset ( $_SESSION[ SESSION_NAME_SPACE ] )\n\t\tor \n\t\tisset( $_GET[ RELOAD_KEY ] ) && trim( $_GET[ RELOAD_KEY ] ) == RELOAD_KEY_VALUE ) {\n\n\t\tstartApplication();\t\n\t}\n}", "function processIncomingData() {\n\t \tglobal $TSFE;\n\n\t \t\t// fetch incoming POST data and restore current session data:\n\t \t$incomingData = t3lib_div::_GP($this->prefixId);\n\t \t\n\t \tif (!is_array ($this->sessionData)) {\n\t \t\t$this->sessionData = array (\n\t \t\t\t'data' => array(),\n\t \t\t\t'submitCount' => 0,\n\t \t\t\t'currentStep' => 1,\n\t\t\t\t'submissionId' => md5(t3lib_div::getIndpEnv('REMOTE_ADDR').microtime()),\n\t \t\t);\n\t \t}\n\t \tif (!is_array ($incomingData['data'])) {\n\t \t\t$incomingData['data'] = array();\n\t \t}\n\n\t \t\t// To avoid submit spamming attacks we restrict each session to a certain amount of submits:\n\t\t$this->sessionData['submitCount']++;\n\t\tif ($this->sessionData['submitCount'] < $this->maxSubmitsPerSession) {\n\n\t\t\t\t// Now proceed according to the type of submission:\n\t\t\tif (isset ($incomingData['submitcancel'])) {\n\t\t\t\t$this->submitType = 'cancel';\n\t\t\t\t$this->sessionData['data'] = array();\n\t\t\t\t$this->sessionData['currentStep'] = 1;\n\t\t\t\t\t// Reset submission id. This is used for making sure that a submission is only processed once. It must be handled by the extension\n\t\t\t\t\t// which processes the form:\n\t\t\t\t$this->sessionData['submissionId'] = md5(t3lib_div::getIndpEnv('REMOTE_ADDR').microtime());\n\t\t\t} elseif (isset ($incomingData['submitproceed'])) {\n\t\t\t\t$this->submitType = 'proceed';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\n\t\t\t\t$evalResult = $this->evaluate_stepFields ($incomingData['currentstep'], $this->sessionData['data']);\n\t\t\t\tif ($evalResult === TRUE) {\n\t\t\t\t\t$this->sessionData['currentStep']= $incomingData['currentstep'] + 1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->submitType = 'evalerror';\n\t\t\t\t}\n\t\t\t} elseif (isset ($incomingData['submitback'])) {\n\t\t\t\t$this->submitType = 'back';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\t\t\t\t$this->sessionData['currentStep']= $incomingData['currentstep'] - 1;\n\t\t\t} elseif (isset ($incomingData['submitsubmit'])) {\n\t\t\t\t$this->submitType = 'submit';\n\t\t\t\t$this->sessionData['data'] = (t3lib_div::array_merge_recursive_overrule ($this->sessionData['data'], $incomingData['data']));\n\t\t\t\t$evalResult = $this->evaluate_allFields ($this->sessionData['data']);\n\t\t\t\tif ($evalResult !== TRUE) {\n\t\t\t\t\t$this->submitType = 'evalerror';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$TSFE->fe_user->setKey ('ses', $this->prefixId, $this->sessionData);\n\t\t$this->currentStep = $this->sessionData['currentStep'];\n\t }", "private function _check_csrf()\n {\n if (!_is_post()) return;\n \n if (_post('form_key') !== Session::form_key())\n {\n Log::write(chr(27) . '[41m' . chr(27) . '[37m** POSSIBLE CSRF **' . chr(27) . '[0m');\n Errors::show_404();\n }\n }", "private static function isLoginPOST() {\n return isset($_POST[\"LoginView::Login\"]);\n }", "private function checkSession()\n\t\t{\n\t\t\tif(!empty($_SESSION['auth_username']) && !empty($_SESSION['auth_password']))\n\t\t\t\treturn $this->check($_SESSION['auth_username'], $_SESSION['auth_password']);\n\t\t}", "function CheckSession(){\n if(isset($_SESSION[\"userSession\"]->id)){\n // VALIDA SI TIENE CREDENCIALES PARA LA URL CONSULTADA\n $_SESSION['userSession']->status= userSessionStatus::nocredencial;\n $_SESSION['userSession']->url = $_POST[\"url\"];\n $urlarr = explode('/', $_SESSION['userSession']->url);\n $myUrl = end($urlarr)==''?'index.html':end($urlarr);\n foreach ($_SESSION['userSession']->eventos as $evento) {\n if(strtolower($myUrl) == strtolower($evento->url)){\n $_SESSION['userSession']->status= userSessionStatus::login;\n break;\n }\n }\n }\n else {\n $this->status= userSessionStatus::invalido;\n $this->url = $_POST[\"url\"];\n $_SESSION[\"userSession\"]= $this;\n }\n }", "public function validate()\n {\n return $_POST['formkey'] === $this->oldFormkey;\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 static function check($token) \n{\n // set the `$tokenKey variable` by calling `get method` on `Config object`\n $tokenKey = Config::get('session.tokenKey'); // returns string\n\n /* checks whether `token` KEY exists in the `$_SESSION[] array` AND\n `form's token value` is equal to `token VALUE` in the `$_SESSION[] array` */\n if(Session::exists($tokenKey) && $token == Session::get($tokenKey)) {\n Session::delete($tokenKey);\n return true;\n }\n\n return false;\n}", "public function setFormSessionData(): void\n {\n $session = (array) $this->request->getSession()->get(config('form.session_key'));\n\n $formId = $this->form->getID();\n if (array_key_exists($formId, $session)) {\n $data = $session[$formId];\n\n $this->data = array_key('data', $data, []);\n $this->errors = array_key('messages', $data, []);\n }\n array_map(\n function ($name, $message) {\n $this->form->getField($name)->setErrorMessage($message);\n },\n array_keys($this->errors),\n $this->errors\n );\n \n array_key_unset(config('form.csrf_field_name'), $this->data);\n \n $this->form->setValues($this->data);\n $this->removeSessionData();\n }", "private function check_isvalidated()\n \t{\n\n \t\t// if user has login session return true\n\t\tif(isset($_SESSION['admin_name']))\n\t\t{\n\t\t\treturn true;\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t\t\n\t\t\n\t}", "private function check_session()\n\t{\n\t\tif(isset($_SESSION['admin_id']))\n\t\t{\n\t\t\t/* \n\t\t\tTODO: check double device login\n\t\t\t*/\n\t\t}\n\t\telse if(isset($_SESSION['login_id']))\n\t\t{\n\t\t\tredirect(base_url() . 'contestant');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url());\n\t\t}\n\t}", "public function checkForm()\n\t{\n\t\t$name = $_POST['name'];\n\t\t$email = $_POST['email'];\n\t\t$pass = $_POST['pass'];\n\t\t$conf_pass = $_POST['conf_pass'];\n\t\t$result = $this -> facade -> checkRegister($name, $email, $pass,\n\t\t$conf_pass);\n\t\tif($result === true)\n\t\t{\n\t\t\t$add = $this -> facade -> addUser();\n\t\t\t$data = $this -> facade -> getArray();\n\t\t\t$this -> view -> showForm($data);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this -> facade -> getArray();\n\t\t\t$this -> view -> showForm($data);\n\t\t\treturn true;\n\t\t}\n\t}", "function saveDataToSession(){\n\t\t$data = $this->getData();\n\t\tunset($data[\"AccountInfo\"]);\n\t\tunset($data[\"LoginDetails\"]);\n\t\tunset($data[\"LoggedInAsNote\"]);\n\t\tunset($data[\"PasswordCheck1\"]);\n\t\tunset($data[\"PasswordCheck2\"]);\n\t\tSession::set(\"FormInfo.{$this->FormName()}.data\", $data);\n\t}", "function _session_is_valid(){\n\t\treturn session_is_valid($this->_state_session_id);\n\t}", "public static function check() {\n session_start();\n if (!isset($_SESSION['user'])) {\n header('Location: /');\n exit;\n }\n }", "public function check()\n {\n // TODO : Verif csrf\n // TODO : Oublie de mot de passe & mail divers\n }", "function formSubmitted()\n\t{\n\t\t// Do we have a form name? If so, if we have this form name, then this\n\t\t// particular form has been submitted.\n\t\tif ($this->formName) {\n\t\t\treturn (isset($_POST['update']) && $_POST['update'] == $this->formName);\t\n\t\t} \n\t\t// No form name, just detect our hidden field.\n\t\telse {\n\t\t\treturn (isset($_POST['update']));\n\t\t}\n\t}", "public function valid() {\n\t\t$key = key($this->session);\n\n\t\treturn ($key == null || $key == false) ? false : true;\n\t}", "function loadFromSession($name = '') {\n\t\tif(!$name) $name = $this->owner->FormName();\n\n\t\t$formSession = \\Session::get(\"FormInfo.{$name}.data\");\n\t\tif($formSession) $this->owner->loadDataFrom($formSession);\n\t}", "public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }", "public function isUsed()\n\t{\n\t\treturn $this->data && $this->data['forms_attempts'] > 0;\n\t}", "public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }", "public function validatePostAuthentication()\n {\n $this->sessionStorage->postAuthenticationValidated = true;\n }", "public function checkUsersSession(){\n\t}", "protected function checkSessionToken() {}", "public function check() {\n return (isset($_SESSION['usuario']));\n }", "function check() \n\t{\n\t\t//On creation store the useragent fingerprint\n\t\tif(empty($_SESSION['fingerprint'])) \n\t\t{\n\t\t\t$_SESSION['fingerprint'] = $this->generate_fingerprint();\n\t\t} \n\t\t//If we should verify user agent fingerprints (and this one doesn't match!)\n\t\telseif($this->match_fingerprint && $_SESSION['fingerprint'] != $this->generate_fingerprint()) \n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//If an IP address is present and we should check to see if it matches\n\t\tif(isset($_SESSION['ip_address']) && $this->match_ip) \n\t\t{\n\t\t\t//If the IP does NOT match\n\t\t\tif($_SESSION['ip_address'] != ip_address()) \n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//Set the users IP Address\n\t\t$_SESSION['ip_address'] = ip_address();\n\n\t\t//If a token was given for this session to match\n\t\tif($this->match_token) \n\t\t{\n\t\t\tif(empty($_SESSION['token']) OR $_SESSION['token'] != $this->match_token) \n\t\t\t{\n\t\t\t\t//Remove token check\n\t\t\t\t$this->match_token = FALSE;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t//Set the session start time so we can track when to regenerate the session\n\t\tif(empty($_SESSION['last_activity'])) \n\t\t{\n\t\t\t$_SESSION['last_activity'] = time();\n\t\t}\n\t\t//Check to see if the session needs to be regenerated\n\t\telseif($_SESSION['last_activity'] + $this->expiration < time()) \n\t\t{\n\t\t\t//Generate a new session id and a new cookie with the updated id\n//\t\t\tsession_regenerate_id(TRUE);\n session_regenerate_id();\n\n\t\t\t//Store new time that the session was generated\n\t\t\t$_SESSION['last_activity'] = time();\n\n\t\t}\n\t\treturn TRUE;\n\t}", "function save_input_data()\r\n{\r\n foreach ($_POST as $key => $value) {//key : name, password... and value : field value\r\n //save datas in an array\r\n if (strpos($key, 'password') === false) {//in key : find password. if false : value not found\r\n $_SESSION['input'][$key] = $value;\r\n }\r\n }\r\n}", "public function checkDataSubmission() {\n\t\t$this->main('', array());\n }", "private function establishCaptchaData()\n {\n // If the same request-object is used in multiple forms of a page,\n // there might already be captchaData in the session.\n // If this is the case, we use that.\n // Otherwise we generate a new captcha-question and an answer.\n\n if (session()->has($this->sessionKey)) {\n $sessionData = session()->get($this->sessionKey);\n $this->question = $sessionData['question'];\n $this->answer = $sessionData['answer'];\n } else {\n $this->generateCaptchaData();\n }\n }", "function csrfVerify(){\n\tstatic $valid=NULL;\n\tif(is_null($valid)){\n\t\tif($_SESSION['ver'] && hashEquals($_POST['ver'],$_SESSION['ver']))$valid=true;\n\t\tunset($_POST['ver'],$_SESSION['ver']);\n\t}\n\treturn $valid;\n}", "public function isSubmitted()\n\t{\n\t\tif ($this->http_method == 'get') {\n\t\t\t// GET form is always submitted\n\t\t\treturn TRUE;\n\t\t} else if (isset($this->raw_input['__'])) {\n\t\t\t$__ = $this->raw_input['__'];\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ((array) $__ as $token => $x) {\n\t\t\t$t = static::validateFormToken($token, $this->id);\n\t\t\tif ($t !== FALSE) {\n\t\t\t\t// Submitted\n\t\t\t\tif ($this->form_ttl > 0 && time() - $t > $this->form_ttl) {\n\t\t\t\t\t$this->form_errors[self::E_FORM_EXPIRED] = array(\n\t\t\t\t\t\t'message' => _('The form has expired, please check entered data and submit it again.')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function verifySession() {\n\t\t$this->reload();\n\t\tif ($this->getSession() == session_id())\n\t\t\treturn true;\n\t\telse {\n\t\t\tif($_SESSION[\"loginUser\"])\n\t\t\t\tunset($_SESSION[\"loginUser\"]);\n\t\t\treturn false;\n\t\t}\n\t}", "function checkSessionAjax(){\r\n if (!$this->Session->check('User'))\r\n {\r\n \t// Force the user to login\r\n $this->redirect('/user/ajaxnologin');\r\n exit();\r\n }\r\n\t}", "private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['user'] !== NULL)\n return true;\n return false;\n }", "protected function validateSession()\n {\n if (empty(session()->get('user'))) {\n return false;\n }\n return true;\n }", "function checkErrors() {\n if ($_SESSION['errorForm'] != \"\") {\n include_once getenv('APP_DUOQ_ROOT_PATH') . '/view/Modal.php';\n }\n}", "function checkInput(){\t\t\n\n\t\t//posting new sets the state to 'newentry' for the table sonstruction to handle later\n\t\tif(isset($_POST['new'])){\n\t\t\t$this->state->setNewEntry();\n\t\t\t$this->refreshTable();\n\t\t}\n\t\t//similar to posting new, posting edit marks the row being edited for the table construction to handle later\n\t\tif(isset($_POST['edit'])){\n\t\t\t$this->currentEdit = $_POST['id'];\n\t\t}\n\t\t//submit constructs the form submitted and adds it to the table. it will be written to file at a later date\n\t\t//NOTE: cookies are also set here\n\t\tif(isset($_POST['submit'])){\n\t\t\t$user = $_POST['user'];\n\n\t\t\t//make sure the user doesnt already exist\n\t\t\tif(array_key_exists ($user, $this->users) && !$this->canEdit($user)){\n\t\t\t\t$this->logMsg(WARNING, 'User already exists, and you arent the creator. operation aborted');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//add a cookie to store the people we edited\n\t\t\telse{\n\t\t\t\tif(array_key_exists ($user, $this->users)) $this->logMsg(SUCCESS, 'The user was overwritten');\n\t\t\t\tsetcookie($user, \"created\", time()+3600);\n\t\t\t\t$_COOKIE[$user] = \"created\";//add a fake cookie to allow editing of the new element\n\t\t\t}\n\t\t \n\t\t if($user==''){\n\t\t\t\t$this->logMsg(WARNING, 'No user name included in the submission, operation aborted');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//build the array\n\t\t\t$schedule = array();\t\n\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\tif($key != 'submit' && $key != 'user')array_push($schedule, $key);\n\t\t\t}\n\n\t\t\t//add/update the edited row\n\t\t\tif($_POST['row']-1 < sizeof($this->users)) $this->users = deleteIndex($this->users, $_POST['row']-1); //remove the row if its in teh user set\n\t\t\t$this->users[$user] = $schedule; //add the row\n\n\t\t\t$this->updateUsers();\n\t\t}\n\t}", "function hasValidPostUid()\n{\n $validState =\n isset($_POST[\"state\"]) && isUid($_POST[\"state\"]);\n \n $validSession =\n isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n \n if($validState && $validSession)\n {\n return $_SESSION[\"state\"] == $_POST[\"state\"];\n }\n else\n {\n return false;\n }\n}", "public function checkSession() {\n if ($this->session->userdata('ohadmin')) {\n return TRUE;\n }\n else {\n return FALSE;\n }\n }", "protected function hasLoginBeenProcessed() {}", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "public function verifySession()\n\t{\n\t\t$userData = array(\n\t\t\t'email' \t=> $this->input->post('email'),\n\t\t\t'password' \t=> sha1($this->input->post('password'))\n \t\t);\n\n\t\treturn $this->assistant_model->verifySession($userData);\n\t}", "public function validate() {\n \n $session_id = 0;\n\t\t$session_hash = '';\n\t\n if (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) { \n \t $cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$session_id = $cookie_array[0];\n\t\t\t\t$session_hash = $cookie_array[1];\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\n if (!($session_id && $session_hash)) { return false; }\n\n /* Pull the information for the SessionID out of the database. */\n\n $this->load($session_id);\n\t\tif ($this->sessionid == 0 || $this->expired == 1) {\n\t\t\treturn false;\n\t\t}\n\n $ipaddress = $_SERVER['REMOTE_ADDR'];\n $session_string = $this->session;\n\n if ($session_hash == md5($session_string . $ipaddress . 'scfgshatfk')) {\n return true;\n } elseif ($session_hash == md5($session_string . 'scfgshatfk')) {\n return true; \n } else {\n\t\t\t$this->clear();\n\t\t\treturn false;\n\t\t}\n }", "private function checkPresharedkeyForm(){\n\t\tif(!isset($_POST['services_ipsec_key_pskey'])){\n\t\t\tErrorHandler::addError('formerror','services_ipsec_key_pskey');\n\t\t}\n\t\t\n\t\tif(ErrorHandler::errorCount() > 0){\n\t\t\tthrow new Exception('There is invalid form input');\n\t\t}\n\t}", "public function formIsValid() {\n $data = array();\n foreach ($this->getSessionNamespace() as $key => $info) {\n $data[$key] = $info[$key];\n }\n return (count($this->getStoredForms()) < count($this->getPotentialForms()))? false : $this->getForm()->isValid($data);\n }", "public function verify_user_data()\n {\n\n if(isset($_SESSION['id']) AND $_SESSION['id'] == $_GET['id'])\n {\n\n $this->user_data_check = true;\n\n }else{\n\n $this->user_data_check = false;\n\n }\n\n return $this->user_data_check;\n\n }", "private function checkCSRFToken() {\r\n\t\t// Check if a form has been sent, and this is not a client init request \r\n\t\tif( $this->input('request', 'submit') &&\r\n\t\t !($this->getClass() === 'ActionsClient' && $this->getMethod() === 'init')) {\r\n\t\t\t// It did, check the token\r\n\t\t\tif( $this->input('session', 'token') !== $this->input('request', 'token') ) {\r\n\t\t\t\t// The token isn't valid! Raise an error but don't log it\r\n\t\t\t\terror('Invalid CSRF token!', false);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function saveDataToSession()\n {\n $data = $this->getData();\n if (isset($data['MinimumPrice']) && !$data['MinimumPrice']) {\n unset($data['MinimumPrice']);\n }\n if (isset($data['MaximumPrice']) && !$data['MaximumPrice']) {\n unset($data['MaximumPrice']);\n }\n if (isset($data['ShortKeyword']) && $data['ShortKeyword']) {\n $data['Keyword'] = $data['ShortKeyword'];\n }\n if (isset($data['Keyword']) && $data['Keyword']) {\n $data['ShortKeyword'] = $data['Keyword'];\n }\n Session::set($this->Config()->get('form_data_session_variable'), $data);\n }", "public function clearForms(){\n if( is::existset(munla::$session, 'forms') )\n unset(munla::$session['forms']);\n }", "public function validateForm() {\n\n\t\t$validated_ok = $this->adapter->revalidate();\n\n\t\treturn !$validated_ok;\n\t}", "function checkSession() \n {\n if (!$this->Session->check('User')) \n { \n // Force the user to login \n $this->redirect('/homes'); \n exit(); \n } \n }", "function persisted($posted_key) {\n\n $form_data = Session::getFormData();\n if (isset($form_data[$posted_key])) {\n echo $form_data[$posted_key];\n }\n \n}", "private function check_message ()\n\t{\t\tif (isset($_SESSION['message']))\n\t\t{\n\t\t\t// Add it as an attribute and erase the stored version\n\t\t\t$this->message = $_SESSION['message'];\n\t\t\tunset($_SESSION['message']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->message = \"\";\n\t\t}\n\t}", "private function check_login(){\n if (isset($_SESSION['email'])){\n $this->email=$_SESSION['email'];\n\t\t\t$this->role=$_SESSION['role'];\n\t\t\t$this->id=$_SESSION['id'];\n $this->signed_in=true;\n }\n else{\n unset($this->email);\n $this->signed_in=false;\n }\n }", "public function sess_read()\n\t{\n\t\treturn ($this->session_valid()) ? parent::sess_read() : FALSE;\n\t}", "protected function loadFormData()\n\t{\n\t\t// Check the session for previously entered form data.\n\t\t$data = Factory::getApplication()->getUserState('com_tkdclub.email.data', array());\n\n\t\treturn $data;\n\t}", "protected function checkSessionLifetime() {}", "public function checkHoneypotFields(): bool {\n\t\tforeach($this->honeypotFields as $field) {\n\t\t\tif($this->currentForm !== $field->formId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(! isset($_POST[$field->name])) {\n\t\t\t\t$_POST[$field->name] = '';\n\t\t\t}\n\n\t\t\t// ensure null (string) check, because JS acts strangly sometimes...\n\t\t\tif(! empty($_POST[$field->name]) && $_POST[$field->name] !== 'null') {\n\t\t\t\t$this->spamAttempts++;\n\t\t\t\t$this->saveSession();\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "private function check_stored_login() {\n if(isset($_SESSION['admin_id'])) {\n $this->admin_id = $_SESSION['admin_id'];\n $this->username = $_SESSION['username'];\n $this->user_level = $_SESSION['user_level'];\n $this->last_login = $_SESSION['last_login'];\n }\n }", "public static function check_session() {\n\t\t\t// get redirect_to_default\n\t\t\t$redirect_to_default = Cookie::get('redirect_to_default');\n\t\t\t\n\t\t\t// if empty redirect_to_default set from default settings\n\t\t\tif(empty($redirect_to_default)){$redirect_to_default = REDIRECT_TO_DEFAULT;}\n\t\t\t\t\t\t\n\t\t\t// check if auth token is submitted\n\t\t\tif(isset($_GET['authtoken']))\n\t\t\t{\n\t\t\t\t// check auth token\n\t\t\t\t$authtoken = Functions::encrypt_decrypt('decrypt', $_GET['authtoken'], \"\\x73\\x6f\\x6d\\x31\\x34\\x31\\x30\\x40\\x73\\x6f\\x6d\\x6e\\x65\\x74\\x69\\x63\\x73\");\n\t\t\t\t\t\n\t\t\t\t// get auth token\n\t\t\t\t$authtoken = json_decode($authtoken);\n\t\t\t\t\n\t\t\t\t// set active session\n\t\t\t\tif(!isset($authtoken->keep_session)){$authtoken->keep_session = true;}\n\t\t\t\t\n\t\t\t\t// unset login state\n\t\t\t\tif(!$authtoken->keep_session){self::set_state(false);}\n\t\t\t}\n\t\t\t\n\t\t\t// if session exists\n\t\t\tif(!self::get_state())\n\t\t\t{\t\n\t\t\t\t// check requested url\n\t\t\t\tif(trim(REQUEST_URI) != trim(APP_PATH.'/'.$redirect_to_default))\n\t\t\t\t{\t\n\t\t\t\t\t// get return url\t\t\t\t\t\n\t\t\t\t\t$returnUrl = urlencode(ltrim(str_replace(APP_PATH, '', REQUEST_URI), '/'));\n\t\t\t\t\t\n\t\t\t\t\t// check if auth token is submitted\n\t\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t\t{\n\t\t\t\t\t\t/*\n // get guest user info\n\t\t\t\t\t\t$guest_user = ORM::for_table('sys_user_login');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user pass is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_pass))\n\t\t\t\t\t\t$guest_user = $guest_user->where('user_pass', $authtoken->auth_pass);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user company is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_comp))\n\t\t\t\t\t\t$guest_user = $guest_user->where('sys_company_id', $authtoken->auth_comp);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user name is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_name))\n\t\t\t\t\t\t\t$guest_user = $guest_user->where('user_name', $authtoken->auth_name)->find_one();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$guest_user = $guest_user->find_one($authtoken->auth_user);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// check if user exists\n\t\t\t\t\t\tif(is_object($guest_user))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t// start session and set session values\n\t\t\t\t\t\t\tself::set_state(true);\n\t\t\t\t\t\t\tself::set('user_id', $guest_user->id);\n\t\t\t\t\t\t\tself::set('user_name', $guest_user->user_name);\n\t\t\t\t\t\t\tself::set('first_name', $guest_user->first_name);\n\t\t\t\t\t\t\tself::set('last_name', $guest_user->last_name);\n\t\t\t\t\t\t\tself::set('full_name', trim($guest_user->first_name.' '.$guest_user->last_name));\n\t\t\t\t\t\t\tself::set('email', $guest_user->email);\n\t\t\t\t\t\t\tself::set('mobile', $guest_user->mobile);\n\t\t\t\t\t\t\tself::set('company_id', (empty($guest_user->sys_company_id) ? $authtoken->company_id : $guest_user->sys_company_id));\n\t\t\t\t\t\t\tself::set('is_super_admin', $guest_user->is_super_admin);\t\n\t\t\t\t\t\t\tself::set('is_guest', ($authtoken->auth_user==GUEST_ID ? 1 : 0));\t\n\t\t\t\t\t\t\tself::set('last_login', $guest_user->last_login);\t\n\t\t\t\t\t\t\tself::set('logged_with_master_password', false);\n\t\t\t\t\t\t\tself::set('authtoken', $authtoken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t\t}\n */\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.(empty($returnUrl) ? '' : '?returnUrl='.$returnUrl));\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t// check if auth token is submitted\n\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t{\n\t\t\t\t\t// check for valid auth user\n\t\t\t\t\tif($authtoken->auth_user!=GUEST_ID)\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t}", "function checkTextFormValuesGet($session){\r\n\t\tif (!empty($_GET[$session]) && is_string($_GET[$session]) && !preg_match( '/(galery_users|galery_photos|galery_superusers|DELETE|DROP|TABLE)/', $_GET[$session])) {\r\n\t\t\t$return = $_GET[$session];\r\n\t\t} else {\r\n\t\t\t$return = null;\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}", "function _inputCheck(){\n if (isset($_POST['verder']) && $this->_verify() == \"\") {\n return true;\n }\n else {\n return false;\n }\n }", "protected function valid()\r\n {\r\n return isset($_SESSION['user']['user_id']) ? true : false;\r\n }", "private function checkPost() {\r\n \r\n if (!is_null(filter_input(INPUT_POST, self::FORM_NAME_GAME_ADD))) {\r\n $this->dealWithAddNewGame();\r\n } else if (!is_null(filter_input(INPUT_POST, self::FORM_NAME_GAME_EDIT))) {\r\n $this->dealWithEditGame();\r\n }\r\n }", "function check_submit_form()\n {\n }", "public function state()\n {\n return isset($_SESSION['id']);\n }", "function sessionSet(){\r\n\t\tif(isset($_SESSION[\"$this->session_name\"])) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private function setSession()\n {\n try\n {\n # Get the Populator object and set it to a local variable.\n $populator=$this->getPopulator();\n # Get the User object and set it to a local variable.\n $user_obj=$populator->getUserObject();\n\n # Set the form URL's to a variable.\n $form_url=$populator->getFormURL();\n # Set the current URL to a variable.\n $current_url=FormPopulator::getCurrentURL();\n # Check if the current URL is already in the form_url array. If not, add the current URL to the form_url array.\n if(!in_array($current_url, $form_url)) $form_url[]=$current_url;\n\n # Create a session that holds all the POST data (it will be destroyed if it is not needed.)\n $_SESSION['form']['password']=\n array(\n 'EmailPassword'=>$populator->getEmailPassword(),\n 'FormURL'=>$form_url\n );\n }\n catch(Exception $e)\n {\n throw $e;\n }\n }", "function clear_input_data()\r\n{\r\n if (isset($_SESSION['input'])) {\r\n $_SESSION['input'] = [];\r\n }\r\n}", "public function validateForm(){\n\n if (isset($_POST['sign-up'])) {\n self::registrationForm();\n };\n\n if(isset($_POST['login-form'])){\n self::loginForm();\n }\n }", "public function check_admin_session() {\n $admin_session = $this->input->cookie(APP_NAME.'_admin_session', FALSE);\n if ($admin_session != '') {\n $admin_id = $this->encrypt->decode($admin_session);\n $mode = $admin_session[APP_NAME.'_session_admin_mode'];\n $condition = array('admin_id' => $admin_id);\n $query = $this->admin_model->get_all_details($mode, $condition);\n if ($query->num_rows() == 1) {\n $privileges = $query->row()->privileges;\n\t\t\t\tif(is_array($privileges)){\n\t\t\t\t\t$priv =$privileges;\n\t\t\t\t} else {\n\t\t\t\t\t$priv = @unserialize($query->row()->privileges);\n\t\t\t\t}\n $admindata = array(\n APP_NAME.'_session_admin_id' => $query->row()->admin_id,\n APP_NAME.'_session_admin_name' => $query->row()->admin_name,\n APP_NAME.'_session_admin_email' => $query->row()->email,\n APP_NAME.'_session_admin_mode' => $mode,\n APP_NAME.'_session_admin_privileges' => $priv\n );\n $this->session->set_userdata($admindata);\n $newdata = array(\n 'last_login_date' => date(\"Y-m-d H:i:s\"),\n 'last_login_ip' => $this->input->ip_address()\n );\n $condition = array('admin_id' => $query->row()->admin_id);\n $this->admin_model->update_details(ADMIN, $newdata, $condition);\n }\n }\n }", "function Check()\n {\n $this->_RegenerateId();\n return (isset($_SESSION['ss_fprint1']) && $_SESSION['ss_fprint1'] == $this->_Fingerprint());\n }", "private function check_message(){\t\t\tif(isset($_SESSION['message'])){\r\n\t\t\t\t// Add it as an attribute and erase the stored version\r\n\t\t\t\t\r\n\t\t\t\t$this->message = $_SESSION['message'];\r\n\t\t\t\tunset($_SESSION['message']);\r\n\t\t\t}else{\r\n\t\t\t\t$this->message=\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "public function getUserInput() {\n\n $backWithSession = isset($_SESSION['isLoggedIn']);\n $this->setBackWithSession($backWithSession);\n $userIsLoggedIn = $this->gateKeeper->getIsLoggedIn();\n $wantsToLogout = isset($_REQUEST[self::$logout]);\n $hasUserCookieSet = isset($_COOKIE[self::$cookieName]);\n $wantsToLogin = isset($_REQUEST[self::$login]);\n $postedRegistrationForm = $_SERVER[\"REQUEST_METHOD\"] === \"POST\" && isset($_REQUEST[\"register\"]);\n $clickedRegistrationLink = isset($_REQUEST[\"register\"]) && $_REQUEST[\"register\"] === \"1\";\n\n if ($userIsLoggedIn || $backWithSession) {\n\n if ($wantsToLogout) {\n $this->setWantsToLogout(true);\n }\n\n if ($backWithSession && $hasUserCookieSet) {\n $this->setWantsToLogin(true);\n $this->setBackWithSession(true);\n $this->user = new User();\n $this->user->setSessionID($this->getRandomSessionCookie($_COOKIE[self::$cookieName]));\n $this->user->setUsername($_COOKIE[self::$cookieName]);\n\n }\n\n } else {\n\n if ($wantsToLogin) {\n $this->setWantsToLogin(true);\n $this->initializeLogin();\n\n } else if ($postedRegistrationForm) {\n $this->setWantsToRegister(true);\n $this->initializeRegistration();\n\n } else if ($clickedRegistrationLink) {\n $this->setWantsToRegister(true);\n $this->shouldBypassController = true;\n\n }\n }\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "public static function check(){\n\t\tif (isset($_SESSION['username'])) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validate()\n\t{\n\t\tswitch ($_REQUEST[STR_URL_QUERY_STRING]) {\n\t\t/**\n\t\t\t * If we're on the Logout page, logout by clearing sessions and cookies.\n\t\t\t * Redirect to the login page.\n\t\t\t */\n\t\t\tcase FILE_LOGOUT:\n\t\t\t\t$this->logout();\n\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the Register page, logout (clear sessions and cookies)\n\t\t\t * Don't redirect: allow user to stay on this page so he/she can register\n\t\t\t */\n\t\t\tcase FILE_REGISTER:\n\t\t\t\t$this->logout();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're on the login page, run ->login();\n\t\t\t */\n\t\t\tcase FILE_LOGIN:\n\t\t\tcase \"/\" .FILE_LOGIN:\n\t\t\t\t$this->login();\n\t\t\t\tbreak;\n\t\t\t/**\n\t\t\t * If we're creating a new user, \"pass through\" - \n\t\t\t */\n\t\t\tcase FILE_CREATE_USER:\n\t\t\t\treturn;\n\t\t\t/**\n\t\t\t * On any other page....see if a user is logged in\n\t\t\t */\n\t\t\tdefault:\n\t\t\t\tif (!$this->is_logged_in())\n\t\t\t\t{\n\t\t\t\t\tROCKETS_HTTP::redirect(RPATH_ROOT . \"/\" . FILE_LOGIN);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function isNotPost() : void\n {\n if(!($_SERVER['REQUEST_METHOD'] === 'POST'))\n {\n (new Session())->set('user','error', InputError::basicError());\n header('Location:' . self::REDIRECT_SIGNIN);\n die();\n }\n }", "abstract function check_data($formdata);", "function inicie_sesion(){\n return (isset($_SESSION['usuario'])&&$_SESSION['usuario']!=''&&isset($_SESSION['session_key']));\n}", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }" ]
[ "0.6498352", "0.6336637", "0.62124085", "0.6132207", "0.6114657", "0.60743725", "0.6069858", "0.60587907", "0.6043341", "0.6013429", "0.6007634", "0.6000854", "0.5997324", "0.59227365", "0.5922305", "0.590197", "0.58918464", "0.58865273", "0.5857186", "0.5856016", "0.58518445", "0.58375335", "0.58303785", "0.58176523", "0.5795732", "0.5794525", "0.5786441", "0.576167", "0.5760584", "0.57575285", "0.5755553", "0.5750328", "0.5750283", "0.57479066", "0.57364434", "0.57295185", "0.57262486", "0.5722111", "0.5721189", "0.5716519", "0.57092893", "0.57091576", "0.56962544", "0.56948024", "0.56911856", "0.56878597", "0.5683102", "0.56819105", "0.56648105", "0.5645554", "0.5633725", "0.5626477", "0.56244504", "0.5617569", "0.5613383", "0.561331", "0.56095845", "0.5605569", "0.5605569", "0.5604356", "0.5598484", "0.55866075", "0.55832916", "0.5581783", "0.5580882", "0.55731696", "0.5571545", "0.5570944", "0.5570864", "0.55680305", "0.55633444", "0.5561716", "0.55599576", "0.5557172", "0.5549187", "0.55418944", "0.55407935", "0.5540609", "0.5540247", "0.55396265", "0.5531441", "0.55313694", "0.553089", "0.55282015", "0.55275637", "0.5519897", "0.5519747", "0.5517375", "0.55049634", "0.5503166", "0.54984677", "0.5496535", "0.54908264", "0.54775584", "0.54760516", "0.5461844", "0.54615486", "0.54602516", "0.54539824", "0.54491526", "0.5448262" ]
0.0
-1
For methods that require Auth Adding Middle Layer to authenticate every request Checking if the request has valid api key as part of the parameters
function authenticate(\Slim\Route $route) { // Getting request headers //$headers = apache_request_headers(); $response = array(); $app = \Slim\Slim::getInstance(); $apiKey = $app->request->params('apikey'); // Verifying Authorization Header if (isset($apiKey)) { $db = new DbHandler(); if (!$db->isValidApiKey($apiKey)) { // api key is not present in users table $response["error"] = TRUE; $response["message"] = "Access Denied. Invalid Api key"; echoRespnse(401, $response); $app->stop(); } else { global $user_id; // get user primary key id $user_id = $db->getUserId($apiKey); } } else { // api key is missing in header $response["error"] = TRUE; $response["message"] = "Api key is missing"; echoRespnse(400, $response); $app->stop(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authenticate(\\Slim\\Route $route) {\r\n // getting request header\r\n $headers = apache_request_headers();\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n // verifying authorization header\r\n \r\n if (isset($headers['Authorization'])) {\r\n // $db = new DbHandler();\r\n // get the api key\r\n $api_key = $headers['Authorization'];\r\n // validating api key\r\n //echo $api_key;\r\n if ($api_key!='123456') {\r\n \t//echo '1';\r\n \r\n $response['error'] = true;\r\n $response['message'] = 'Access denied. Invalid api key';\r\n \r\n jsonResponse1( 200, $response );\r\n // echoResponse(401, $response);\r\n $app->stop();\r\n } else {\r\n \t//echo '2';\r\n \t//jsonResponse1( 200, $response );\r\n /* global $user_id;\r\n // get user primary key id\r\n $user = $db->getUserId($api_key);\r\n if ($user != NULL) {\r\n $user_id = $user['id'];\r\n } */\r\n }\r\n } else {\r\n // api key is missing in header\r\n $response['error'] = true;\r\n $response['message'] = \"Api key is missing\";\r\n echoResponse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $client_id;\n // get user primary key id\n $client_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function authenticate(\\Slim\\Route $route) {\r\n // Getting request headers\r\n $headers = apache_request_headers();\r\n $response = array();\r\n $app = \\Slim\\Slim::getInstance();\r\n\r\n // Verifying Authorization Header\r\n if (isset($headers['Authorization'])) {\r\n $db = new DbHandler();\r\n\r\n // get the api key\r\n $api_key = $headers['Authorization'];\r\n // validating api key\r\n if (!$db->isValidApiKey($api_key)) {\r\n // api key is not present in users table\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\r\n echoRespnse(401, $response);\r\n $app->stop();\r\n } else {\r\n global $user_id;\r\n // get user primary key id\r\n $user_id = $db->getUserId($api_key);\r\n }\r\n } else {\r\n // api key is missing in header\r\n $response[\"error\"] = true;\r\n $response[\"message\"] = \"Api key is misssing\";\r\n echoRespnse(400, $response);\r\n $app->stop();\r\n }\r\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"errorcode\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"errorcode\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function auth_apikey($key){\n\t\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new dbUser();\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidApiKey($api_key)) {\n // api key is not present in users table\n response('Invalid user ','Authorization', 'failed',true);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($api_key);\n }\n } else {\n // api key is missing in header\n response('Api Key is missing ','Authorization', 'failed',true);\n $app->stop();\n }\n}", "function authenticate(\\Slim\\Route $route) {\n\n $app = \\Slim\\Slim::getInstance();\n // Getting request headers\n $api_key = $app->request->headers(\"Authorization\");\n // Verifying Authorization Header\n $db = new DbHandler();\n if (!$db->isValidHeader($api_key)) {\n $app->stop();\n }\n}", "function authenticate(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $apikey = $headers['Authorization'];\n // validating apikey\n if (!$db->isValidApiKey($apikey)) {\n // apikey is not present in users table\n $response['error'] = \"true\";\n $response['rest'] = \"authenticate\";\n\t\t $response['message'] = \"Apikey Error\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $user_id;\n // get user primary key id\n $user_id = $db->getUserId($apikey);\n }\n } else {\n // apikey is missing in header\n\t\t$response['error'] = \"true\";\n\t\t$response['rest'] = \"authenticate\";\n\t\t$response['message'] = \"Apikey Missing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "function authenticated(\\Slim\\Route $route) {\n // Getting request headers\n $headers = apache_request_headers();\n $response = array();\n $app = \\Slim\\Slim::getInstance();\n\n // Verifying Authorization Header\n if (isset($headers['Authorization'])) {\n $db = new DbHandler();\n\n // get the api key\n $api_key = $headers['Authorization'];\n // validating api key\n if (!$db->isValidProffApiKey($api_key)) {\n // api key is not present in users table\n $response[\"error\"] = true;\n $response[\"message\"] = \"Access Denied. Invalid Api key\";\n echoRespnse(401, $response);\n $app->stop();\n } else {\n global $proff_id;\n // get user primary key id\n $proff_id = $db->getProffId($api_key);\n }\n } else {\n // api key is missing in header\n $response[\"error\"] = true;\n $response[\"message\"] = \"Api key is misssing\";\n echoRespnse(400, $response);\n $app->stop();\n }\n}", "public function processApi() {\r\n\tif($this->securedRest){\r\n\t if(!isset($this->requestSecure) || !isset($this->requestPublicKey)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t if(!$this->verifyKeys($this->requestPublicKey, $this->requestSecure)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t}\r\n\t\r\n\t$func = $this->_method;\r\n\tif ((int) method_exists($this, $func) > 0){\r\n\t $this->$func();\r\n\t}else{\r\n\t $this->response('', 404);\r\n\t}\r\n\t\r\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "private function verify_request()\n {\n try{\n $headers = $this->input->request_headers();\n $token = $headers['X-API-KEY'];\n if(!$token) {\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n return;\n }\n\n $data = AUTHORIZATION::validateToken($token);\n if($data === false){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized accesss'];\n $this->response($res, $status);\n exit();\n }else{\n return $data;\n }\n\n }catch(Exception $e){\n $status = parent::HTTP_UNAUTHORIZED;\n $res = ['status' => $status, 'msg' => 'Unauthorized access!'];\n $this->response($res, $status);\n }\n }", "protected function verify_token()\n {\n // lookup API Key record by value from HTTP header\n if (isset($this->rest->key) && is_null($this->rest->key)) {\n $key = $this->input->get_request_header(config_item('rest_key_name'));\n if (is_null($key)) {\n $key = $this->input->get_post('Token');\n }\n if (is_null($key)) {\n return;\n }\n $this->mApiKey = $this->api_keys->get_by(config_item('rest_key_column'), $key);\n if (!is_null($this->mApiKey)) {\n $this->rest->key = $this->mApiKey->{config_item('rest_key_column')};\n\n isset($this->mApiKey->user_id) && $this->rest->user_id = $this->mApiKey->user_id;\n isset($this->mApiKey->level) && $this->rest->level = $this->mApiKey->level;\n isset($this->mApiKey->ignore_limits) && $this->rest->ignore_limits = $this->mApiKey->ignore_limits;\n\n $this->_apiuser = $this->mApiKey;\n }\n\n } else {\n $this->mApiKey = $this->_apiuser;\n }\n\n if (!empty($this->mApiKey)) {\n $this->mUser = $this->users->get_by('username', $this->mApiKey->user_id);\n // only when the API Key represents a user\n if (!empty($this->mUser)) {\n $this->mUserRoles = $this->i2_auth->get_user_roles($this->mUser->id);\n// $this->mUserTenant = $this->users->get_user_tenant($this->mUser->id);\n $this->mUserTenant = $this->i2_auth->get_user_tenant($this->mUser->id);\n $this->tenant_table_prefix = $this->mUserTenant->tenant_name;\n $this->set_t_prefix();\n $this->mUserMainRole = $this->mUserRoles[0]->name;\n } else {\n // anonymous access via API Key\n $this->mUserMainRole = 'anonymous';\n }\n }\n }", "public function validateAuthKey($authKey){\n }", "public function authenticate() {}", "public function validateApiKey()\n {\n $request = $this->call('GET', 'helper/ping');\n return !empty($request);\n }", "public function checkAuthentication(\\WP_Rest_Request $request)\n {\n if ($request->get_param('key') != $this->key) {\n $this->responseJson(['message' => 'Key invalid'], 422);\n }\n\n return $this->handle($request);\n }", "function base_request(Request $request, $key) {\r\n if($this->needs_auth($key)) {\r\n echo 'needs auth';\r\n session(['return_url' => $request->fullUrl()]);\r\n session()->save();\r\n\r\n if(phpsaaswrapper()->authorize($key) !== true) {\r\n $cookie = cookie('eon_referrer', $request->fullUrl(), 45000);\r\n return redirect(phpsaaswrapper()->authorize($key))->withCookie($cookie);\r\n }\r\n\r\n dd(phpsaaswrapper()->authorize($key));\r\n } else {\r\n // consume service\r\n\r\n return phpsaaswrapper()->display_api_uses($key);\r\n }\r\n }", "abstract public function authenticate(Request $request);", "public function is_apikey($apikey){\n $this->apiKey = false;\n if(!empty($apikey) &&$apikey==AUTH_KEY){\n $this->apiKey = true;\n }\n }", "public function __construct()\n {\n $this->middlewere('api.auth', ['except'=>['index','show']]);\n }", "public function authenticate($request);", "private function verify_request()\n{\n $headers = $this->input->request_headers();\n // Extract the token\n $token = $headers['Authorization'];\n // Use try-catch\n // JWT library throws exception if the token is not valid\n try {\n // Validate the token\n // Successfull validation will return the decoded user data else returns false\n $data = AUTHORIZATION::validateToken($token);\n if ($data === false) {\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access!'];\n $this->response($response, $status);\n exit();\n } else {\n return $data;\n }\n } catch (Exception $e) {\n // Token is invalid\n // Send the unathorized access message\n $status = parent::HTTP_UNAUTHORIZED;\n $response = ['status' => $status, 'msg' => 'Unauthorized Access! '];\n $this->response($response, $status);\n }\n}", "public function apikey_validate(Request $request)\r\n {\r\n $validator = Validator::make($request->all(), [\r\n 'domain' => 'required',\r\n 'key' => 'required',\r\n 'secret_key' => 'required',\r\n ]);\r\n \r\n if ($validator->fails()) {\r\n $response = api_create_response($validator->errors(), $this->failureText, 'Please enter valid input.');\r\n return response()->json($response, $this->statusCodes->bad_request);\r\n }\r\n \r\n\t\t$validateKeys = array(\r\n\t\t\t'key' => $request->key,\r\n\t\t\t'secret_key' => $request->secret_key,\r\n\t\t\t'domain' => $request->domain,\r\n\t\t);\r\n $data = ApikeyModel::where($validateKeys)->first();\r\n\r\n if(isset($data)) {\r\n \r\n // Update used_at\r\n $data->used_at = date('Y-m-d H:i:s');\r\n $data->save();\r\n\r\n $this->responseStatusCode = $this->statusCodes->success;\r\n $response = api_create_response($data, $this->successText, 'Api Key Details.');\r\n \r\n }else{\r\n\r\n $this->responseStatusCode = $this->statusCodes->not_found;\r\n $response = api_create_response(2, $this->failureText, 'No Api Key Found.');\r\n }\r\n \r\n return response()->json($response, $this->responseStatusCode);\r\n }", "public function authenticateApiKey(MvcEvent $event)\n {\n $routeMatch = $event->getRouteMatch();\n if (!$routeMatch->getParam('__API__')) {\n // This is not an API request.\n return;\n }\n\n $identity = $event->getRequest()->getQuery('key_identity');\n $credential = $event->getRequest()->getQuery('key_credential');\n\n if (is_null($identity) || is_null($credential)) {\n // No identity/credential key to authenticate against.\n return;\n }\n\n $auth = $event->getApplication()->getServiceManager()\n ->get('Omeka\\AuthenticationService');\n $auth->getAdapter()->setIdentity($identity);\n $auth->getAdapter()->setCredential($credential);\n $auth->authenticate();\n }", "public function authorizeRequest(Http\\HapiClient $hapiClient, Http\\Request $request);", "public function checkAuthentication() {}", "function validateApiCredentials() { \n if( $this->options['api_type'] == \"\" || $this->options['api_path'] == \"\" ) {\n $this->error_handler( 'Repository url not valid' );\n } elseif($this->options['username'] == \"\") {\n $this->error_handler( 'Username Required' );\n } else if($this->options['password'] == \"\") {\n $this->error_handler( 'Password Required' );\n }\n }", "public function authenticate() {\n }", "function authenticate() {}", "public function validateAuthKey($authKey) {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function preAuth(Request $request, Response $response);", "public function preAuth(Request $request, Response $response);", "abstract protected function auth();", "public function validateAuthKey($authKey)\n {}", "public function getApiKey();", "public function authenticate(Request $request)\n\n {\n\n $this->validate($request, [\n\n 'email' => 'required',\n\n 'password' => 'required'\n\n ]);\n\n $user = User::where('email', $request->input('email'))->first();\n\n if(Hash::check($request->input('password'), $user->password)){\n\n $apikey = base64_encode(str_random(40));\n\n User::where('email', $request->input('email'))->update(['api_key' => \"$apikey\"]);;\n\n return response()->json(['status' => 'success','api_key' => $apikey]);\n\n }else{\n\n return response()->json(['status' => 'fail'],401);\n\n }\n\n }", "function checkAPICall()\r\n{\r\n $request = [];\r\n $request['method'] = $_SERVER['REQUEST_METHOD'];\r\n $request['url'] = rtrim($_SERVER['REQUEST_URI'], '/');\r\n \r\n $trimmed_url = ltrim($_SERVER['REQUEST_URI'], '/');\r\n $url_parts = explode('/', $trimmed_url);\r\n\r\n $request['url_parts'] = $url_parts;\r\n\r\n if (in_array($_SERVER['REQUEST_METHOD'], ['POST', 'PUT'])) {\r\n $request['body'] = json_decode(file_get_contents('php://input'), true);\r\n }\r\n \r\n if ($url_parts[0] === 'api') {\r\n array_shift($url_parts);\r\n if (count($url_parts) >= 1) {\r\n $api_function_name = array_shift($url_parts);\r\n $params = $url_parts;\r\n $request['params'] = $params;\r\n array_unshift($params, $request);\r\n\r\n $request_uri = $request['method'] . ' /' . $api_function_name;\r\n if (array_key_exists($request_uri, API_FN)) {\r\n call_user_func_array(API_FN[$request_uri], $params);\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n die();\r\n }\r\n}", "protected function authenticateRequest($autho_key){\n $api_autho_key_model = new ApiAuthoKeysModel($this->cnx);\n $api_autho_key = $api_autho_key_model->getByAuthoKey($autho_key);\n if(!$api_autho_key){\n return false;\n }\n if($api_autho_key->autho_key !== $autho_key){\n return false;\n }\n return true;\n }", "public function handle($request, Closure $next, $keyPair = NULL) {\n\n //IF no keypair defined,\n // developer responsibility through testing to solve this\n if (empty($keyPair)) {\n return $this->abort(Response::HTTP_INTERNAL_SERVER_ERROR, Err::KEYSECRET__AUTHORITY_NOT_DEFINED);\n }\n\n // Put the key pair in uppercase to reflect env\n $keyPair = strtoupper($keyPair);\n $key = env('KS_'.$keyPair.'_KEY');\n\n // IF the requested keypair not found in env\n // developer responsibility through testing to solve this\n if( empty($key)){\n return $this->abort(Response::HTTP_INTERNAL_SERVER_ERROR, Err::KEYSECRET__AUTHORITY_NOT_SET);\n }\n\n // Do not sent cache control headers on testing.\n // Fails phpUnits\n if( !App::environment('testing')){\n header('Cache-Control: no-cache, must-revalidate, max-age=0');\n }\n\n // Check validity\n $has_supplied_credentials = $request->headers->has('php-auth-user') && $request->headers->has('php-auth-pw');\n if( !$has_supplied_credentials){\n return $this->abort(Response::HTTP_UNAUTHORIZED, Err::KEYSECRET__AUTHORITY_MISSING);\n }\n\n\n $is_not_authenticated = (\n !$has_supplied_credentials ||\n $request->headers->get('php-auth-user') != $key ||\n $request->headers->get('php-auth-pw') != env('KS_'.$keyPair.'_SECRET')\n );\n\n // Unabled to match key pair with request\n if ($is_not_authenticated) {\n return $this->abort(Response::HTTP_UNAUTHORIZED, Err::KEYSECRET__AUTHORITY_UNKNOWN);\n }\n\n return $next($request);\n }", "private function checkApiKey(): ?Response\n {\n $keyConfig = Configuration::getConfiguration('key');\n if ($keyConfig['enable']) {\n $apiKey = $this->request->getHeader($keyConfig['header_name']);\n if (is_null($apiKey)) {\n $apiKey = $this->request->getParameter($keyConfig['parameter_name']);\n }\n if ($apiKey != $keyConfig['key']) {\n return $this->abortForbidden();\n }\n }\n return null;\n }", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function authenticate();", "public function authenticate();", "public function authenticate();", "public function processApi(){\n\t\t\t$func = explode('/', trim($_SERVER['PATH_INFO'],'/'))[0];\n\n\t\t\t$good = false;\n\t\t\tforeach ($this->AUTHORIZED_FUNCTION as $authorizedFunc){\n\t\t\t\tif($authorizedFunc == $func){\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! $good) $this->response('', 404);\n\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->sendMessage('', 404);\n\t\t}", "function permly_api($api_key=''){\n\t\t$this->api_key = $api_key;\n\t\t$this->url = $this->api_server_protocol.\"://\".$this->api_server.\"/?remote_service=rs_external_api&key=1&interface=eai_permly&version=\".$this->api_version;\n\t}", "function verifyKey($msg){\n\n // TODO: check if this key is in the database!\n if(isset($_GET['key'])){\n $apiKey = $_GET['key'];\n $userid = $_GET['userid'];\n\n if($apiKey == getApiKey($userid)){\n // Fillter on datatype\n filterRequest($msg);\n }else{\n $msg->message = 'Invalid key!';\n $msg->toJson();\n }\n }else{\n $msg->message = 'Key not set!';\n $msg->toJson();\n }\n}", "public function validateAuth(Request $request){\n\n $api_url = 'https://app.nemoexpress.ro/nemo/API/list_services';\n $api_key = $request->api_key;\n \n \n $response = Http::get($api_url, [\n \n 'api_key' => $api_key,\n ]);\n\n\n if($response->getStatusCode()!=200) {\n return response([\n 'success' => 0,\n 'message' => 'Eroare la logare'\n \n \n ], 200);\n\n }\n\n else {\n\n $response = json_decode($response);\n if (isset($response->error)){\n\n return response([\n 'success' => 0,\n 'message' => 'Eroare la logare'\n \n \n ], 200);\n\n }\n return response([\n 'success' => 1,\n 'message' => 'Autentificare reusita'\n \n ], 200);\n }\n \n }", "public function checkAuth();", "public function checkAuth();", "public function __construct()\r\n {\r\n $this->middleware('auth:api', ['except' => ['login', 'recovery', 'testRecoveryCode', 'updatePassword']]);\r\n }", "function auth (){\n //$app = \\Slim\\Slim::getInstance();\n //$headers = $app->request()->headers();\n //$token = JWT::decode($headers['X-Auth-Token'], 'secret_server_key');\n //print_r($token);\n //echo $headers['X-Auth-Token'];\n}", "public function handle($request, Closure $next)\n {\n \n if(!empty(Request::get('user_key')) && !empty(Request::get('api_key'))){ \n\n $user = User::where('api_user_key',Request::get('user_key'))->first();\n\n if($user){\n if($user->is_active === 1){\n if($user->api->first()->api_key == Request::get('api_key')){\n\n if(Auth::loginUsingId($user->id)){\n return $next($request);\n }\n else\n {\n return response(['Error: Authentication Failed']);\n }\n }\n else{\n return response(['Error: Posted Api Key does not match Stored Api Key']);\n }\n }\n else{\n return response(['Error: User is no longer active']);\n }\n\n }\n else{\n return response(['Error: Posted User Key does not match Stored User Key']);\n }\n }\n else\n {\n return response(['Warning: Invalid Credentials']);\n }\n }", "public function __construct(){\n //laravel passport api protection against unauthenticated users\n $this->middleware('auth:api');\n }", "abstract public function authorize();", "abstract public function authorize();", "abstract public function authenticate(CakeRequest $request, CakeResponse $response);", "static public function key_is_correct($api_key = '') {\n\n\t\treturn preg_match('/^[a-z\\d]{3,15}$|^$/', $api_key);\n\n\t}", "function authGet() { }", "public function __construct(){\n\n $this->middleware('auth:api');\n\n}", "function validateToken(){\n $CI = get_instance();\n if (array_key_exists('HTTP_AUTHORIZATION', $_SERVER) && !empty($_SERVER['HTTP_AUTHORIZATION'])) {\n $decodedToken = AUTHORIZATION::validateToken($_SERVER['HTTP_AUTHORIZATION']);\n if ($decodedToken != false) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}", "public function handle($request, Closure $next)\n {\n if ($this->config['status'] === static::STATUS_ON) {\n\n // get excludes_handler\n $excludes_handler = $this->config['excludes']['handler'];\n if (!is_callable($excludes_handler)) {\n throw new RuntimeException('config(\"api_auth.excludes.handler\") is not function !');\n }\n\n if (call_user_func_array($excludes_handler, [$request, $this->config['excludes']['urls']])) {\n return $next($request);\n }\n\n // get error_handler\n $error_handler = $this->config['error_handler'];\n if (!is_callable($error_handler)) {\n throw new RuntimeException('config(\"api_auth.error_handler\") is not function !');\n }\n\n // get excludes_handler\n $auth_info_getter = $this->config['auth_info_getter'];\n if (!is_callable($auth_info_getter)) {\n throw new RuntimeException('config(\"api_auth.auth_info_getter\") is not function !');\n }\n\n list($access_key, $timestamp, $echostr, $signature) = call_user_func_array($auth_info_getter, [$request]);\n\n if (empty($timestamp) || empty($access_key) || empty($echostr) || empty($signature)) {\n return call_user_func_array($error_handler, [\n $request,\n LaravelApiAuth::LACK_HEADER\n ]); // 缺少请求头\n }\n\n $roles = $this->config['roles'];\n if (!isset($roles[$access_key])) {\n return call_user_func_array($error_handler, [\n $request,\n LaravelApiAuth::ACCESS_KEY_ERROR\n ]); // access_key 不存在\n }\n\n // get encrypting\n $encrypting = $this->config['encrypting'];\n if (!is_callable($encrypting)) {\n throw new RuntimeException('config(\"api_auth.encrypting\") is not function !');\n }\n\n // get rule\n $rule = $this->config['rule'];\n if (!is_callable($rule)) {\n throw new RuntimeException('config(\"api_auth.rule\") is not function !');\n }\n\n $server_signature = call_user_func_array($encrypting, [$roles[$access_key]['secret_key'], $echostr, $timestamp]);\n\n if (!call_user_func_array($rule, [$roles[$access_key]['secret_key'], $signature, $server_signature])) {\n return call_user_func_array($error_handler, [\n $request,\n LaravelApiAuth::SIGNATURE_ERROR\n ]); // 签名不一致\n }\n\n $timeout = $this->config['timeout'] ?? 60;\n if (time() - $timestamp > $timeout) {\n return call_user_func_array($error_handler, [\n $request,\n LaravelApiAuth::SIGNATURE_LAPSE\n ]); // 签名失效\n }\n\n if (!is_null(app('cache')->pull('api_auth:' . $signature))) {\n return call_user_func_array($error_handler, [\n $request,\n LaravelApiAuth::SIGNATURE_REPETITION\n ]); // 签名重复(已存在该签名记录)\n } else {\n app('cache')->put('api_auth:' . $signature, $request->getClientIp(), $timeout / 60);\n }\n\n /**\n * 添加 role_name 到 $request 中\n */\n if ($request->has('client_role')) {\n $request->offsetSet('_client_role', $request->get('client_role'));\n }\n $request->offsetSet('client_role', $roles[$access_key]['name']);\n }\n return $next($request);\n }", "public function validateAuthKey($authKey): bool {\n }", "private function check_api_key() {\n return true;\n $post_token = $this->input->post('App-Request-Token');\n $post_datetime = $this->input->post('App-Request-Timestamp');\n if ($post_token && $post_datetime) {\n $date = gmdate('Y-m-d H:i:s');\n if (strtotime($post_datetime) >= (strtotime($date) - 300) && strtotime($post_datetime) <= strtotime($date)) {\n $token = sha1(config_item('api_request_key') . $post_datetime);\n if ($post_token === $token) {\n return true;\n }\n }\n } else {\n $this->send_error('ERROR');\n exit;\n }\n }", "public function authenticate(Request $request)\n {\n $this->validate($request, [\n 'email' => 'required',\n 'password' => 'required'\n ]);\n $user = Users::where('email', $request->input('email'))->first();\n if(Hash::check($request->input('password'), $user->password)){\n $apikey = base64_encode(str_random(40));\n $after1hour = date('Y-m-d H:i:s', strtotime('+1 hour'));\n Users::where('email', $request->input('email'))->update(['api_key' => \"$apikey\",'expired_at' => $after1hour ]);\n return response()->json(['status' => 'success','token' => $apikey, 'ttl' => '3600']);\n }else{\n return response()->json(['status' => 'fail'],401);\n }\n }", "public function _construct(){\n $this->middleware('auth:api', ['except' => ['login', 'register']]);\n }", "public function getApiKey(): string;", "public function __construct() {\n\t\t$this->middleware('auth:api');\n\t}", "public function __construct() {\n $this->middleware('auth:api');\n }", "public function validateAuthKey($authKey): bool;", "public function authorize(): bool\n {\n return auth('api')->check();\n }", "public function authorize(): bool\n {\n return auth('api')->check();\n }", "private function prepareAPIRequest()\n {\n $api_key = $this->getAPIKey();\n\n $api_key_parts = \"\";\n if (count($api_key_parts = explode(\"-\", $api_key)) != 2) {\n throw new Exception(\"Invalid API Key\");\n }\n\n $this->setAPIEndpoint(\"https://$api_key_parts[1].api.mailchimp.com/\" . $this->api_version);\n }", "public function verifyApiCaller() : bool\n {\n $verified = false;\n\n // check for NOAUTH and no-auth-pages configuration for current page\n // these two settings must be present for the endpoint to be visible outside of REDCap\n if (isset($_GET['NOAUTH']) && in_array($_GET['page'], parent::getConfig()[\"no-auth-pages\"])) \n {\n // MODIFY THIS CHECK for the security needs of your system.\n // This hardcoded token should be changed and pulled from a secure location,\n // if using with a third-party service.\n $rctoken = $_REQUEST['rctoken'];\n if ($rctoken === 'ca5d63d58b507615c328da941270ddf0')//IMPORTANT: modify token and pull from a secure location\n {\n $verified = true;\n }\n }\n // if endpoint is not externally accessible, then this endpoint user has been authenticated by REDCap\n else\n {\n $verified = true;\n }\n\n\n return $verified;\n }", "function check_apikey ($apikey)\n{\n\t//check message with global_hush_hush\n\tglobal $global_hush_hush, $global_mysqli_link;\n\t$global_hush_hush = false;\n\t\n\t//check apikey: is this api key exist in database?\t\n\t$apisqlquerry = mysqli_query($global_mysqli_link, \"SELECT apikeys.verifier, apikeys.ipFilter FROM apikeys WHERE\n\t\t\tapikeys.verifier = '$apikey'\") or die_nice(\"failed to execute query on Apikey check.\");\n\t\t\n\t// if it exist, it must be found 1 row (because apiKeyOrDomain are unique)\n\tif ($querry = mysqli_fetch_array($apisqlquerry))\n\t{\n\t\t// check for ip filter\t\n\t\tif ($_SERVER['REMOTE_ADDR'] != $querry['ipFilter'] && $querry['ipFilter'] != NULL)\n\t\t{\n\t\t\tdie_nice(\"IP address is not accepted for this API key.\");\n\t\t}\n\t} \n\telse\n\t{\n\t\tdie_nice(\"API key is not recognized: $apikey.\");\n\t}\n}", "public function testApikey() {\n $this->assertNotNull($this->object->apikey('8f14e45fceea167a5a36dedd4bea2543'));\n }", "public function isAuth() {}", "function api_key() {\n\tif(check_value(chevereto_config('api_key'))) return chevereto_config('api_key');\n}", "public function __construct() {\n $this->middleware('auth:api', ['except' => []]);\n }", "public function __construct()\n {\n $this->middleware('auth:api');\n }", "public function __construct()\n {\n $this->middleware('auth:api');\n }", "public function __construct()\n {\n $this->middleware('auth:api');\n }", "public function __construct()\n {\n $this->middleware('auth:api', ['except' => ['login','signup']]);\n }", "public function doAuthentication();", "private function getApikey() {\n\t\treturn $this->_apikey;\n\t}", "public function __construct()\n {\n $this->middleware([\"auth:api\", 'checkActive'], ['except' => ['store']]);\n }", "public function __construct()\n {\n $this->middleware('auth:api', ['except' => [\n 'login', \n 'signup', \n 'signupGoogle', \n 'signupFacebook', \n 'signupLinkedIn']]);\n }", "public function isAuthenticated()\n {\n //get headers from postMan\n $this->headers = getallheaders();\n //cut the first word from the header, ex:Bearer, the space before and after the token\n $token = !empty($this->headers['Authorization']) ? trim(substr($this->headers['Authorization'], 6)) : null;\n\n //request in the database to take the token\n $tokenDataBase = $this->authToken->getToken();\n\n //the token in the header must exist and be the same as in the base date in order to make the request\n if (!$token || $token !== $tokenDataBase) {\n http_response_code(401);\n echo json_encode(array(\"message\" => \"Unauthorized\"));\n exit;\n }\n }", "public function __construct()\n {\n \n // API accepts only POST request for now\n if ($_SERVER['REQUEST_METHOD'] != 'POST') {\n // echo \"Method is not post\";\n $this->throwException(REQUEST_METHOD_NOT_VALID, 'Request Method is not valid');\n }\n // open input stream from HTTP POST\n $input_stream = fopen('php://input', 'r');\n $this->request = stream_get_contents($input_stream);\n \n $this->validateRequest($this->request);\n \n // generate user object\n $this->user = new user();\n \n \n // Switch-case to handle different type request\n // Probalby best practice is list all cases here, so not a single service(function) is available without intend\n switch ($this->serviceName) \n {\n\n case \"validateAccessToken\":\n $this->validateAccessToken();\n break;\n case \"validateRefreshToken\":\n $this->validateRefreshToken();\n break;\n case \"generateToken\":\n //\n break;\n case \"getUserPermById\":\n $this->validateAccessToken();\n $this->getUserPermById();\n break;\n // list all authorization needed services here\n case \"startProcessingImages\":\n case \"getEventCodes\":\n case \"editEvent\":\n case \"getEventList\":\n case \"eventFromHashId\":\n case \"printUnusedCodes\":\n case \"clearUnusedCodes\":\n case \"generateCodes\":\n case \"getUnusedCodes\":\n case \"getUsedCodes\":\n case \"deleteUser\":\n case \"addUser\":\n case \"editUser\":\n case \"getUsers\":\n case \"getPermissions\":\n case \"getRoles\":\n case \"testAuthorization\":\n $this->validateAccessToken();\n break;\n // These request do not require authorization\n // Carefully add functions here\n case \"getGallery\":\n case \"isGalleryAvailable\":\n break;\n default:\n //If service is allready implemented but not list above we get this error\n $this->throwException(API_DOES_NOT_EXIST, \"API does not exist.\");\n }\n \n }", "public function __construct()\n {\n $this->middleware('auth:api', ['except' => ['login', 'createUser', 'getToken']]);\n }", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}" ]
[ "0.7394396", "0.7387564", "0.7354594", "0.73307085", "0.732884", "0.732884", "0.732862", "0.72336626", "0.7229021", "0.71814793", "0.70410246", "0.6886968", "0.6789589", "0.6789589", "0.66653436", "0.65309656", "0.6482107", "0.64532775", "0.6401184", "0.63812876", "0.6373667", "0.6330658", "0.6305012", "0.63007885", "0.62968814", "0.62806606", "0.6247256", "0.62166613", "0.62060124", "0.6197131", "0.61970085", "0.6192592", "0.61616296", "0.61395496", "0.61395496", "0.61395496", "0.61395496", "0.61395496", "0.61395496", "0.6139228", "0.6139228", "0.6136708", "0.6126064", "0.611673", "0.6115695", "0.6108121", "0.60650843", "0.6056893", "0.605428", "0.60538405", "0.6048271", "0.6048271", "0.6048271", "0.60459316", "0.5997082", "0.5987983", "0.59833205", "0.59824204", "0.59824204", "0.5976933", "0.5973037", "0.59654546", "0.59650344", "0.59336257", "0.59336257", "0.59240466", "0.5909041", "0.5908945", "0.590368", "0.5901082", "0.58998936", "0.588126", "0.5880915", "0.5862777", "0.58627397", "0.58626556", "0.58582735", "0.58572567", "0.5856754", "0.58504045", "0.58504045", "0.5844631", "0.58418757", "0.58378345", "0.5809619", "0.58079666", "0.58063906", "0.5802003", "0.5799071", "0.5799071", "0.5799071", "0.57806265", "0.5776722", "0.5775089", "0.5775071", "0.5768654", "0.5767564", "0.5763676", "0.5762088", "0.5760654" ]
0.7400555
0
Register new JOIN with specified type with set of on conditions (linking one table to another, no parametric on conditions allowed here).
public function join($type, $table, $on = null) { $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []]; return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "private function addJoin(string $type, string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n\r\n $this -> joins[] = ['table' => $tableName, 'alias' => $tableAlias, 'conditions' => $conditions, 'type' => $type];\r\n return $this;\r\n }", "private function joinInternal($type, $table, $conditions = '', $params = array())\n\t{\n\t\tif (strpos($table, '(') === false)\n\t\t{\n\t\t\tif (preg_match('/^(.*?)(?i:\\s+as\\s+|\\s+)(.*)$/', $table, $matches))\t// with alias\n\t\t\t\t$table = $this->_connection->quoteTableName($matches[1]) . ' ' . $this->_connection->quoteTableName($matches[2]);\n\t\t\telse\n\t\t\t\t$table = $this->_connection->quoteTableName($table);\n\t\t}\n\n\t\t$conditions = $this->processConditions($conditions);\n\t\tif ($conditions != '')\n\t\t\t$conditions = ' ON ' . $conditions;\n\n\t\tif (isset($this->_query['join']) && is_string($this->_query['join']))\n\t\t\t$this->_query['join'] = array($this->_query['join']);\n\n\t\t$this->_query['join'][] = strtoupper($type) . ' ' . $table . $conditions;\n\n\t\tforeach ($params as $name => $value)\n\t\t\t$this->params[$name] = $value;\n\t\treturn $this;\n\t}", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function addJoin($type, $table, $alias, $on_statement, $using_statement = '', $use_index = '', $ignore_index = '')\n\t{\n\t\t// @todo: verify join type\n\t\tif (is_object($table))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$table = $table->getName();\n\t\t\t} catch (Exception $e)\n\t\t\t{\n\t\t\t\tthrow(new UnvalidObjectException(\"Table must be an object of type Table or a string\"));\n\t\t\t}\n\t\t}\n\n\t\t$this->joins[] = array('type' => $type, 'table' => $table, 'on_statement' => $on_statement, 'using_statement' => $using_statement, 'alias' => $alias, 'use_index' => $use_index, 'ignore_index' => $ignore_index);\n\t\treturn $this;\n\t}", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}", "public function join(string $table, string $condition, string $type = 'left'): self\n {\n $this->joins[$type][] = [$table, $condition];\n return $this;\n }", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function addJoinWithVariables($type, $modelName, $alias, $condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addJoinWithVariables($type, $modelName, $alias, $condition, array());\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "public function join(string $table, string $condition, string $type=''): QueryBuilderInterface\n\t{\n\t\t// Prefix and quote table name\n\t\t$table = explode(' ', mb_trim($table));\n\t\t$table[0] = $this->driver->quoteTable($table[0]);\n\t\t$table = $this->driver->quoteIdent($table);\n\t\t$table = implode(' ', $table);\n\n\t\t// Parse out the join condition\n\t\t$parsedCondition = $this->parser->compileJoin($condition);\n\t\t$condition = $table . ' ON ' . $parsedCondition;\n\n\t\t$this->state->appendMap(\"\\n\" . strtoupper($type) . ' JOIN ', $condition, 'join');\n\n\t\treturn $this;\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "function getJoinType() ;", "public function getJoinType() {}", "public function addJoin( $join, $type = null ) {\n if ( !$join ) {\n return;\n }\n $this->join[] = $type ? sprintf( \"%s JOIN %s\", $type, $join ) : sprintf( \"JOIN %s\", $join );\n }", "public function join($type, $conditions)\n\t{\n\t\t$this->_join[] = strtoupper($type).' JOIN '.$conditions;\n\n\t\treturn $this;\n\t}", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function join($table, $type = NULL){\n $this->_last_join = new Join($table, $type);\n $this->_last_join->setQuoter($this->quoter);\n $this->_join[] = $this->_last_join;\n return $this;\n }", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function join($table, $column1, $operator = null, $column2 = null, $type = 'INNER')\n\t{\n\t\t// If the \"column\" is really an instance of a Closure, the developer is\n\t\t// trying to create a join with a complex \"ON\" clause. So, we will add\n\t\t// the join, and then call the Closure with the join/\n\t\tif ($column1 instanceof \\Closure)\n\t\t{\n\t\t\t$this->joins[] = new Query\\Join($type, $table);\n\n\t\t\t$column1(end($this->joins));\n\t\t}\n\n\t\t// If the column is just a string, we can assume that the join just\n\t\t// has a simple on clause, and we'll create the join instance and\n\t\t// add the clause automatically for the develoepr.\n\t\telse\n\t\t{\n\t\t\t$join = new Query\\Join($type, $table);\n\n\t\t\t$join->on($column1, $operator, $column2);\n\n\t\t\t$this->joins[] = $join;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function join(SourceInterface $left, SourceInterface $right,\n $joinType, JoinConditionInterface $joinCondition);", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function join($joinTable, $joinCondition, $joinType = '')\r\n {\r\n $allowedTypes = array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER');\r\n $joinType = strtoupper(trim($joinType));\r\n\r\n if ($joinType && !in_array($joinType, $allowedTypes)) {\r\n return $this;\r\n }\r\n $this->_join[] = Array($joinTable, $joinCondition, $joinType);\r\n return $this;\r\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function join($table, $type = NULL)\n {\n if ($type !== '')\n {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n {\n $type = '';\n }\n else\n {\n $type .= ' ';\n }\n }\n\n // Assemble the JOIN statement\n $table = $this->table_prefix($table);\n $table = $this->quote_identifier($table);\n $this->_join[] = $type.'JOIN '.$table;\n\n return $this;\n }", "public function join( $table, $type = '' ) {\n if ( !is_string($table) ) {\n throw new Exception( \"Invalid argument type, [table] must be string type\", 1 );\n }\n\n if ( $type == 'join' ) {\n $type = '';\n }\n\n $this->_lastJoin = $table;\n\n $exceptedTypes = array( 'left', 'right', '' );\n if ( !in_array(strtolower($type), $exceptedTypes) ) {\n $type = $exceptedTypes[0];\n }\n\n $type = strtoupper( $type );\n\n $this->_currentImplement['join'][] = array( 'table' => $table, 'type' => $type );\n return $this;\n }", "protected abstract function joinTypes();", "public function join(string $table, string $local_column, string $operator, string $joined_column, bool $is_pivot = false, string $type = 'join')\n {\n $this->join[$table] = ['local_column' => $local_column, 'operator' => $operator, 'joined_column' => $joined_column, 'type' => $type, 'is_pivot' => $is_pivot];\n \n return $this;\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function join($table, $column_one = null, $column_two = null, $type = '')\r\n {\r\n if (func_num_args() < 3) {\r\n @list($query, $params) = func_get_args();\r\n\r\n $params = (array) $params;\r\n\r\n $this->join[] = compact('query', 'params');\r\n\r\n $this->add_bind('join', $params);\r\n }\r\n\r\n else {\r\n $this->join[] = compact('table', 'column_one', 'column_two', 'type');\r\n }\r\n\r\n return $this;\r\n }", "public function getMockJoin ( $table, $on = null )\n {\n return $this->getMock(\n '\\r8\\Query\\Join',\n array('getJoinType'),\n array( $table, $on )\n );\n }", "function addJoin($name, $joinType, $tableA, $tableB, $fieldA, $fieldB) {\n\t\t$this->addBlock('from', $name, array(array($joinType, $tableA, $tableB, $fieldA, $fieldB)));\n\t\treturn $this;\n\t}", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function joinTable($joinTableName, $joinCondition, $joinType = \"INNER JOIN\") {\r\n $this->joinTable[] = array(\r\n \"table\" => $joinTableName,\r\n \"condition\" => $joinCondition,\r\n \"type\" => $joinType\r\n );\r\n return $this;\r\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "function getJoinCondition() ;", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function leftJoin($table, $conditions = []);", "public function getJoinCondition() {}", "public function create_join_table($model_one, $model_two) {\n $table_name = NimbleAssociation::generate_join_table_name(array($model_one, $model_two));\n $table = $this->create_table($table_name, array('id' => false));\n $table->references($model_one);\n $table->references($model_two);\n $table->go();\n }", "public function join($type, $col1, $col2) \n {\n // Make sure we have a valid type\n $type = strtoupper( \" \".$type );\n switch($type)\n {\n case \" INNER\":\n case \" LEFT\":\n case \" RIGHT\":\n case \" FULL\":\n break;\n default:\n $type = \" INNER\";\n break;\n }\n \n // Build our statement\n $this->sql .= $type .\" JOIN `\". $col1 .\"` ON `\". $col2 .\"`\";\n return $this;\n }", "protected function performJoinForEloquentPowerJoinsForHasMany()\n {\n return function ($builder, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $alias ?: $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $builder->{$joinType}($this->query->getModel()->getTable(), function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n $fk,\n '=',\n \"{$parentTable}.{$this->localKey[$i]}\"\n );\n }\n } else {\n $join->on(\n $this->foreignKey,\n '=',\n \"{$parentTable}.{$this->localKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\n \"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\"\n );\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public static function join($joinTable, $joinCondition, $joinType = '')\r\n {\r\n return self::$PDO->join($joinTable, $joinCondition, $joinType);\r\n }", "protected function performJoinForEloquentPowerJoinsForBelongsTo()\n {\n return function ($query, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $query->{$joinType}($joinedTable, function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n \"{$parentTable}.{$fk}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey[$i]}\"\n );\n }\n } else {\n $join->on(\n \"{$parentTable}.{$this->foreignKey}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\");\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function setJoinType($value)\n {\n return $this->set(self::_JOIN_TYPE, $value);\n }", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function join($what, $on, $type = 1, $using=false)\n\t\t{\n\t\t\tif(is_int($type))\n\t\t\t{\n\t\t\t\t$this->joins[] = array($what, $on, $type, $using);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tthrow new \\Exception('Statement.join(): Invalid parameter type given.');\n\t\t}", "function joinQuery()\n {\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function join($tables, $columnName, $joinType = 'JOIN')\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$totalTables = count($tables);\r\n\t\t\t\r\n\t\t\tif(is_array($columnName)){\r\n\t\t\t\t$colsIsArray = true;\r\n\t\t\t\tif(count($columnName) != $totalTables){\r\n\t\t\t\t\techo \"DB Join error. columnName passed as an array but does not match tables count. \";\r\n\t\t\t\t\techo \"columnName is an array of: \" . count($colsIsArray) . \" while tables is an array of: \" . $totalTables;\r\n\t\t\t\t\tdie();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse $colsIsArray = false;\r\n\t\t\t$c = 0;\r\n\r\n//SELECT column_list\r\n//FROM t1\r\n//INNER JOIN t2 ON join_condition1\r\n//INNER JOIN t3 ON join_condition2\r\n\r\n\t\t\t$joinSQL = \"`{$this->_prefix}{$tables[0]}` \";\r\n\r\n\t\t\tfor($n = 0; $n < $totalTables; $n += 1){\r\n\r\n\t\t\t\tif($n+1 < $totalTables){\r\n\t\t\t\t\t$joinSQL .= \"{$joinType} `{$this->_prefix}{$tables[$n+1]}` \";\r\n\t\t\t\t\tif($colsIsArray) $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName[$c]}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName[$c+1]}` \";\r\n\t\t\t\t\telse $joinSQL .= \"ON `{$this->_prefix}{$tables[$n]}`.`{$columnName}` = `{$this->_prefix}{$tables[$n+1]}`.`{$columnName}` \";\r\n\t\t\t\t\t$c += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//lets prepare our query string\r\n\t\t\t$this->_sql = \"SELECT {$this->_select} FROM \" . $joinSQL . $this->_where . $this->_orderBy . $this->_limit;\r\n\r\n\t\t\t//build an additional query string for our count ready for numRows() method\r\n\t\t\t$this->_sqlCount = \"SELECT COUNT(*) FROM \" . $joinSQL . $this->_where;\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare($this->_sql);\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\treturn $this;\r\n\t\t}", "protected function _joinVersionData($select, $joinType, $joinConditions)\n\t{\n\t\t$select->$joinType(array($this->_versionTableAlias => $this->_versionTable),$joinConditions,array('version_id', 'version_number', 'label', 'access_level', 'version_user_id' => 'user_id'));\n\t\treturn $select;\n\t}", "public function join ( $sTable, $sCondition, $sType = '' )\n {\n if ($sType != '')\n {\n $sType = strtoupper(trim($sType));\n $sType = (in_array($sType, $this->aJoinTypes)) ? $sType . ' ' : '';\n }\n /*\n Save.\n */\n $this->aJoin = array_merge($this->aJoin, array($sType, $sTable, $sCondition));\n /*\n Return for method chaining.\n */\n return $this;\n }", "public function scopeModelJoin($query, $relation_name, $operator = '=', $type = 'left', $where = false) {\n $relation = $this->$relation_name();\n $table = $relation->getRelated()->getTable();\n if ($relation instanceof BelongsTo) {\n //this tables key pointing to remote table\n $one = $this->getTable() . \".\" . $relation->getForeignKey();\n //remote table primary key\n $two = $relation->getRelated()->getQualifiedKeyName();\n } else { //HasMany or HasOne\n //current table id column\n $one = $relation->getParent()->getQualifiedKeyName();\n //remote table column related to this id\n $two = $relation->getForeignKey();\n }\n //counties.state_id = state.id\n if (empty($query->columns)) {\n $query->select($this->getTable().\".*\");\n }\n\n //$join_alias = $table;\n $prefix = $query->getQuery()->getGrammar()->getTablePrefix();\n $join_alias = $relation_name;\n foreach (\\Schema::getColumnListing($table) as $related_column) {\n $query->addSelect(\\DB::raw(\"`$prefix$join_alias`.`$related_column` AS `$join_alias.$related_column`\"));\n }\n $two = str_replace($table . \".\", $join_alias . \".\", $two);\n return $query->join(\"$table AS $prefix$relation_name\", $one, $operator, $two, $type, $where); //->with($relation_name);\n\n }", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "private function makeRelationBetweenCategoryAndDummyTable() {}", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "public function on($c1, $op, $c2)\n {\n if (!empty($this->using)) {\n throw new QuarkException('JOIN ... ON ... cannot be combined with JOIN ... USING ...');\n }\n\n $this->on[] = array($c1, $op, $c2);\n\n return $this;\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function joinUsing($table, $column, $type = 'INNER')\n\t{\n\t\treturn $this->join($table, $this->from . '.' . $column, '=', $table . '.' . $column, $type);\n\t}", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public static function posts_join( $join_sql, $query ) {\n\t\t\tglobal $wpdb;\n\t\t\t$joins = array();\n\n\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t$event_start_key = '_EventStartDate';\n\t\t\t$event_end_key = '_EventEndDate';\n\n\t\t\t/**\n\t\t\t * When the \"Use site timezone everywhere\" option is checked in events settings,\n\t\t\t * the UTC time for event start and end times will be used. This filter allows the\n\t\t\t * disabling of that in certain contexts, so that local (not UTC) event times are used.\n\t\t\t *\n\t\t\t * @since 4.6.10\n\t\t\t *\n\t\t\t * @param boolean $force_local_tz Whether to force the local TZ.\n\t\t\t */\n\t\t\t$force_local_tz = apply_filters( 'tribe_events_query_force_local_tz', false );\n\n\t\t\tif ( Tribe__Events__Timezones::is_mode( 'site' ) && ! $force_local_tz ) {\n\t\t\t\t$event_start_key .= 'UTC';\n\t\t\t\t$event_end_key .= 'UTC';\n\t\t\t}\n\n\t\t\t// if it's a true event query then we want create a join for where conditions\n\t\t\tif ( $query->tribe_is_event || $query->tribe_is_event_category || $query->tribe_is_multi_posttype ) {\n\t\t\t\tif ( $query->tribe_is_multi_posttype ) {\n\t\t\t\t\t// if we're getting multiple post types, we don't need the end date, just get the start date\n\t\t\t\t\t// for events-only post type queries, the start date postmeta join is already added by the main query args\n\t\t\t\t\t$joins['event_start_date'] = \" LEFT JOIN {$wpdb->postmeta} as {$postmeta_table} on {$wpdb->posts}.ID = {$postmeta_table}.post_id AND {$postmeta_table}.meta_key = '$event_start_key'\";\n\t\t\t\t} else {\n\t\t\t\t\t// for events-only post type queries, we should also get the end date for display\n\t\t\t\t\t$joins['event_end_date'] = \" LEFT JOIN {$wpdb->postmeta} as tribe_event_end_date ON ( {$wpdb->posts}.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '$event_end_key' ) \";\n\t\t\t\t}\n\t\t\t\t$joins = apply_filters( 'tribe_events_query_posts_joins', $joins, $query );\n\n\t\t\t\treturn $join_sql . implode( '', $joins );\n\t\t\t}\n\n\t\t\treturn $join_sql;\n\t\t}", "public function join(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER') {\r\n\t\t$this->addJoin($other, $fieldOrExpr, $operator, $valueOrExpr, $type, $other->resolveTable());\r\n\t}", "public function getJoinType()\n {\n return $this->joinType;\n }", "protected function _joinPageData($select, $joinType, $joinConditions)\n\t{\n\t\t$select->$joinType(array($this->_pageTableAlias => $this->_pageTable),$joinConditions, array('title'));\n\t\treturn $select;\n\t}", "abstract public function join($alias_from, $rel_name, $alias_to);", "public function join($relations, $type = 'left')\n\t{\n\t\tforeach ((array) $relations as $relation) {\n\t\t\tif (in_array($relation, $this->joined)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (strpos($relation, '.') !== false) {\n\t\t\t\t$this->joinNested($relation, $type);\n\t\t\t} else {\n\t\t\t\t$this->joined[] = $relation;\n\t\t\t\t$relation = $this->getRelation($this->model, $relation);\n\t\t\t\t$this->joinRelation($relation, $type);\n\t\t\t}\n\t\t}\n\n\t\t$this->checkQuerySelects();\n\n\t\t// @todo resarch when/if group by's are necessary\n\t\t// $this->checkQueryGroupBy();\n\n\t\treturn $this;\n\t}", "public function setRelationshipMultiCondition($parameters)\n {\n foreach ($parameters as $parameter) {\n $sourceTable = $parameter['table'];\n $sourceColumn = $parameter['table'] . \".\" . $parameter['index'];\n $destinationColumn = $parameter['foreign'];\n $this->Model = $this->Model->join($sourceTable, $sourceColumn, \"=\", DB::raw($destinationColumn), \"LEFT\");\n }\n }", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "protected function getJoin ($joinType, $leftAlias, $rightTable, $rightAlias, $fieldNames, $extraCrit = false) {\n $db = $this->db;\n $la = $db->NameQuote($leftAlias);\n $ra = $db->NameQuote($rightAlias);\n $res = $joinType.' JOIN '.$db->NameQuote($rightTable);\n if ($rightAlias) $res .= ' AS '.$ra.' ON ';\n else {\n $res .= ' ON ';\n $ra = $db->NameQuote($rightTable);\n }\n $on = array();\n foreach ($fieldNames as $leftField => $rightField) {\n $on[] = $la.'.'.$db->NameQuote($leftField).' = '.$ra.'.'.$db->NameQuote($rightField);\n }\n if (strlen($extraCrit)) $on[] = \"($extraCrit)\";\n $res .= implode(' AND ', $on);\n return $res;\n }", "protected function getJoin ($joinType, $leftAlias, $rightTable, $rightAlias, $fieldNames, $extraCrit = false) {\n $db = $this->db;\n $la = $db->NameQuote($leftAlias);\n $ra = $db->NameQuote($rightAlias);\n $res = $joinType.' JOIN '.$db->NameQuote($rightTable);\n if ($rightAlias) $res .= ' AS '.$ra.' ON ';\n else {\n $res .= ' ON ';\n $ra = $db->NameQuote($rightTable);\n }\n $on = array();\n foreach ($fieldNames as $leftField => $rightField) {\n $on[] = $la.'.'.$db->NameQuote($leftField).' = '.$ra.'.'.$db->NameQuote($rightField);\n }\n if ($extraCrit) $on[] = \"($extraCrit)\";\n $res .= implode(' AND ', $on);\n return $res;\n }", "public final function addJoin($tbl, $as, $by, $condition, $reset=false)\n {\n if ($reset==true)\n \t$this->join = array();\n\n $this->join[] = array(\n 'tbl' => $tbl,\n 'as' => $as,\n 'by' => $by,\n 'cond' => $condition\n );\n\n return $this;\n }", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "public function rightJoin($table, $conditions = []);", "protected function parseJoin(int $type): string\n {\n switch ($type) {\n case IConnection::JOIN_INNER:\n return 'INNER JOIN';\n break;\n case IConnection::JOIN_LEFT:\n return 'LEFT JOIN';\n break;\n case IConnection::JOIN_RIGHT:\n return 'RIGHT JOIN';\n break;\n case IConnection::JOIN_FULL:\n return 'FULL OUTER JOIN';\n break;\n case IConnection::JOIN_CROSS:\n return 'CROSS JOIN';\n break;\n default:\n return 'JOIN';\n break;\n }\n }", "private function joinWithRelation($parent, $child, $joinType)\n {\n $via = $child->via;\n $child->via = null;\n if ($via instanceof ActiveQuery) {\n // via table\n $this->joinWithRelation($parent, $via, $joinType);\n $this->joinWithRelation($via, $child, $joinType);\n return;\n } elseif (is_array($via)) {\n // via relation\n $this->joinWithRelation($parent, $via[1], $joinType);\n $this->joinWithRelation($via[1], $child, $joinType);\n return;\n }\n\n list ($parentTable, $parentAlias) = $this->getQueryTableName($parent);\n list ($childTable, $childAlias) = $this->getQueryTableName($child);\n\n if (!empty($child->link)) {\n\n if (strpos($parentAlias, '{{') === false) {\n $parentAlias = '{{' . $parentAlias . '}}';\n }\n if (strpos($childAlias, '{{') === false) {\n $childAlias = '{{' . $childAlias . '}}';\n }\n\n $on = [];\n foreach ($child->link as $childColumn => $parentColumn) {\n $on[] = \"$parentAlias.[[$parentColumn]] = $childAlias.[[$childColumn]]\";\n }\n $on = implode(' AND ', $on);\n if (!empty($child->on)) {\n $on = ['and', $on, $child->on];\n }\n } else {\n $on = $child->on;\n }\n $this->join($joinType, empty($child->from) ? $childTable : $child->from, $on);\n\n if (!empty($child->where)) {\n $this->andWhere($child->where);\n }\n if (!empty($child->having)) {\n $this->andHaving($child->having);\n }\n if (!empty($child->orderBy)) {\n $this->addOrderBy($child->orderBy);\n }\n if (!empty($child->groupBy)) {\n $this->addGroupBy($child->groupBy);\n }\n if (!empty($child->params)) {\n $this->addParams($child->params);\n }\n if (!empty($child->join)) {\n foreach ($child->join as $join) {\n $this->join[] = $join;\n }\n }\n if (!empty($child->union)) {\n foreach ($child->union as $union) {\n $this->union[] = $union;\n }\n }\n }", "public function innerJoin($table, $conditions = []);" ]
[ "0.759629", "0.7317749", "0.71656543", "0.7034575", "0.6906883", "0.66534823", "0.66329795", "0.658463", "0.6429498", "0.6390415", "0.63331795", "0.632487", "0.63027173", "0.6288177", "0.62751377", "0.62631816", "0.6245539", "0.6235607", "0.6204659", "0.6176801", "0.6175807", "0.6147344", "0.6135564", "0.611468", "0.60789585", "0.60761464", "0.6029137", "0.5997856", "0.59640867", "0.59463125", "0.5868272", "0.58511925", "0.5836299", "0.5815482", "0.58075225", "0.5789884", "0.5722352", "0.56709903", "0.5657141", "0.5630671", "0.5629377", "0.5625901", "0.5596335", "0.55912447", "0.5578894", "0.5524078", "0.5518917", "0.55181324", "0.5497221", "0.54967314", "0.548456", "0.54659283", "0.5458164", "0.54540396", "0.54399794", "0.5435473", "0.54283476", "0.5419292", "0.5389658", "0.5388738", "0.5385463", "0.5365504", "0.5362373", "0.5359527", "0.5353559", "0.5342279", "0.53340364", "0.5318366", "0.53099835", "0.53078085", "0.5302839", "0.5290854", "0.52718544", "0.5255075", "0.5217012", "0.52088594", "0.5190553", "0.5171056", "0.5168909", "0.51684874", "0.51544875", "0.514944", "0.51455736", "0.5140169", "0.5120886", "0.5106992", "0.50912505", "0.50883687", "0.508618", "0.50760245", "0.5045383", "0.50370586", "0.5015227", "0.5013165", "0.5005323", "0.5005107", "0.50023353", "0.4994192", "0.49926692", "0.4976819" ]
0.66332775
6
Register new INNER JOIN with set of on conditions (linking one table to another, no parametric on conditions allowed here).
public function innerJoin($table, $on = null) { $this->joinTokens[$this->activeJoin = $table] = ['type' => 'INNER', 'on' => []]; return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function innerJoin($table, $conditions = []);", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function addInnerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, false);\n \n return $this;\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "function innerJoin($conditions)\n\t{\n\t\treturn $this->join('INNER', $conditions);\n\t}", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function innerJoin($table);", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function innerJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (get_class($this) == $joined || in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_innerJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "public function innerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::INNER, $table, $fields, $on);\n }", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "function getJoinCondition() ;", "public function getJoinCondition() {}", "public function inner($table, $on, $field = null, $comparitor = null);", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function outer($table, $on, $field = null, $comparitor = null);", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}", "function joinQuery()\n {\n }", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "public function addInnerJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, true);\n \n return $this;\n }", "public function testImplicitJoinWithCartesianProductAndConditionInWhere(): void\n {\n $this->assertValidDQL('SELECT u, a FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u, Doctrine\\Tests\\Models\\CMS\\CmsArticle a WHERE u.name = a.topic');\n }", "public function addOuterJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function innerJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"INNER JOIN\");\n //var_dump($this);\n return $this;\n \n }", "public function on($c1, $op, $c2)\n {\n if (!empty($this->using)) {\n throw new QuarkException('JOIN ... ON ... cannot be combined with JOIN ... USING ...');\n }\n\n $this->on[] = array($c1, $op, $c2);\n\n return $this;\n }", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "public function innerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, false);\n \n return $this;\n }", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "function setExtraJoins($extraJoins) {\n $this->extraJoins = $extraJoins;\n }", "private function joinInternal($type, $table, $conditions = '', $params = array())\n\t{\n\t\tif (strpos($table, '(') === false)\n\t\t{\n\t\t\tif (preg_match('/^(.*?)(?i:\\s+as\\s+|\\s+)(.*)$/', $table, $matches))\t// with alias\n\t\t\t\t$table = $this->_connection->quoteTableName($matches[1]) . ' ' . $this->_connection->quoteTableName($matches[2]);\n\t\t\telse\n\t\t\t\t$table = $this->_connection->quoteTableName($table);\n\t\t}\n\n\t\t$conditions = $this->processConditions($conditions);\n\t\tif ($conditions != '')\n\t\t\t$conditions = ' ON ' . $conditions;\n\n\t\tif (isset($this->_query['join']) && is_string($this->_query['join']))\n\t\t\t$this->_query['join'] = array($this->_query['join']);\n\n\t\t$this->_query['join'][] = strtoupper($type) . ' ' . $table . $conditions;\n\n\t\tforeach ($params as $name => $value)\n\t\t\t$this->params[$name] = $value;\n\t\treturn $this;\n\t}", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t\n\t\t$this->sqlConditionJoins = \", wcf\".WCF_N.\"_user_notification_event_to_user event_to_user\";\n\t\t$this->getConditionBuilder()->add(\"event_to_user.userID = user_table.userID\");\n\t}", "protected function performJoinForEloquentPowerJoinsForHasMany()\n {\n return function ($builder, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $alias ?: $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $builder->{$joinType}($this->query->getModel()->getTable(), function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n $fk,\n '=',\n \"{$parentTable}.{$this->localKey[$i]}\"\n );\n }\n } else {\n $join->on(\n $this->foreignKey,\n '=',\n \"{$parentTable}.{$this->localKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\n \"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\"\n );\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public function on($column1,$column2,$operator = \"=\");", "public function leftJoin($table, $conditions = []);", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "final public static function innerJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //inicia o select\n self::$query .= \" INNER JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "public function join(Select $table, $alias, $on)\n {\n return $this->innerJoin($table, $alias, $on);\n }", "public function testImplicitJoinInWhereOnSingleValuedAssociationPathExpression(): void\n {\n // SQL: SELECT ... FROM forum_user fu INNER JOIN forum_avatar fa ON fu.avatar_id = fa.id WHERE fa.id = ?\n $this->assertValidDQL('SELECT u FROM Doctrine\\Tests\\Models\\Forum\\ForumUser u JOIN u.avatar a WHERE a.id = ?1');\n }", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "public function addConstraints()\n {\n $throughValue = $this->farChild[$this->secondKey];\n\n $this->performJoin();\n\n if (static::$constraints) {\n $this->query->where($this->getQualifiedSecondOwnerKeyName(), '=', $throughValue);\n }\n\n }", "static function fetch($conditions = [ ], $joins = [ ], $debug = false) {\n\t\t\tself::$bind_params = [ ];\n\t\t\t$table = self::getTableName();\n\t\t\t$cols = &self::getTableCols();\n\t\t\t\n\t\t\tif ((is_array($conditions) && count($conditions) == 0) ||\n\t\t\t\t(!is_array($conditions) && !($conditions instanceof Condition))) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidConditions);\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t$errors = self::validateConditions($conditions);\n\t\t\tif (count($errors)) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidConditions);\n\t\t\t\t$res->errors = $errors;\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\tforeach($cols as $colname => $col) {\n\t\t\t\t$s = $col->type == 'timestamp' ? \"unix_timestamp(a.$colname)\" : \"a.$colname\";\n\t\t\t\t$q []= \"$s as a_{$colname}\";\n\t\t\t}\n\t\t\t$query_select_columns = [ implode(', ', $q) ];\n\t\t\t\n\t\t\t$query_from_tables = [ ];\n\t\t\t$query_joins = [ ];\n\t\t\t$i = 0;\n\t\t\t\n\t\t\t$add_join = function(&$join, &$parent = null) use (&$i, &$query_select_columns, &$query_joins, &$add_join) {\n\t\t\t\t$join->prefix = $prefix = chr(98 + $i++);\n\t\t\t\t$join->parent = $parent;\n\t\t\t\t$join->stalled = false;\n\t\t\t\t$parent_prefix = ($parent ? $parent->prefix : 'a');\n\t\t\t\t\n\t\t\t\t$cla = $join->class;\n\t\t\t\t$jtable = $cla::getTableName();\n\t\t\t\t$cols = $cla::getTableCols();\n\t\t\t\t\n\t\t\t\t$q = [ ];\n\t\t\t\tforeach ($cols as $colname => $col) {\n\t\t\t\t\t$s = ($col->type == 'timestamp' ? \"unix_timestamp($prefix.$colname)\" : \"$prefix.$colname\");\n\t\t\t\t\t$q []= \"$s as {$prefix}_{$colname}\";\n\t\t\t\t}\n\t\t\t\t$query_select_columns []= implode(', ', $q);\n\t\t\t\t\n\t\t\t\t$join_conditions = [ ];\n\t\t\t\tforeach ($join->cols as $k => $v) {\n\t\t\t\t\tif (is_string($k)) $join_conditions []= \"$parent_prefix.$k = $prefix.$v\";\n\t\t\t\t\telse $join_conditions []= \"$parent_prefix.$v = $prefix.$v\";\n\t\t\t\t}\n\t\t\t\t$query_joins []= \"left join $jtable as $prefix on \" . implode(' and ', $join_conditions);\n\t\t\t\t\n\t\t\t\tforeach($join->joins as $k => &$j) {\n\t\t\t\t\tif (!($j instanceof Join)) unset($join->joins[$k]);\n\t\t\t\t\telse $add_join($j, $join);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\tif (!is_array($joins)) $joins = [ $joins ];\n\t\t\tforeach ($joins as $k => &$j) {\n\t\t\t\tif (!($j instanceof Join)) unset($joins[$k]);\n\t\t\t\telse $add_join($j);\n\t\t\t}\n\t\t\n\t\t\t$query_select_columns = implode(', ', $query_select_columns);\n\t\t\t$query_joins = implode(' ', $query_joins);\n\t\t\t\n\t\t\t$cond = self::getCondStr_AndAddBindParams($conditions, 'a');\n\t\t\t\n\t\t\t$q = \"select $query_select_columns from $table as a $query_joins $cond\";\n\t\t\tif ($debug) var_dump($q);\n\t\t\t$st = self::$pdo->prepare($q);\n\t\t\t\n\t\t\tself::bindBindParams($st);\n\t\t\t\n\t\t\t$r = $st->execute();\n\t\t\tif ($r === false) {\n\t\t\t\t$res = new TMResult(TMResult::InternalError);\n\t\t\t\t$res->errors = $st->errorInfo();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$base_objs = [ ];\n\t\t\t$increments_from_stalled_joins = [ ];\n\t\t\t\n\t\t\t$destall = function(&$join) use (&$increments_from_stalled_joins, &$destall) {\n\t\t\t\tforeach($join->joins as &$_j)\n\t\t\t\t\t$destall($_j);\n\t\t\t\t$join->stalled = false;\n\t\t\t\tunset($increments_from_stalled_joins[$join->prefix]);\n\t\t\t};\n\t\t\t\n\t\t\t$recursively_add_row = function(&$j, &$parent_obj) use (&$row, &$increments_from_stalled_joins, &$destall, &$recursively_add_row) {\n\t\t\t\tif ($j->stalled) return;\n\t\t\t\t\n\t\t\t\t$cla = $j->class;\n\t\t\t\t$table = $cla::getTableName();\n\t\t\t\t$prefix = $j->prefix;\n\t\t\t\t\n\t\t\t\t$cols = $cla::getTableCols();\n\t\t\t\t$col_keys = array_keys($cols);\n\t\t\t\t$id_column = array_shift($col_keys);\n\t\t\t\tif ($row[\"{$prefix}_$id_column\"] == null) {\n\t\t\t\t\t$j->stalled = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset($parent_obj->$table)) $n = count($parent_array = $parent_obj->$table);\n\t\t\t\telse $n = 0;\n\t\t\t\t\n\t\t\t\t// Check for cyclic repetition\n\t\t\t\tif ($n > 1 and !$parent_array[0]->wouldDifferFromRow($row, $prefix)) {\n\t\t\t\t\t$j->stalled = true;\n\t\t\t\t\t$increments_from_stalled_joins[$prefix] = $n;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// If new, add, destall descendants, & recurse\n\t\t\t\tif (!$n or $parent_array[$n - 1]->wouldDifferFromRow($row, $prefix)) {\n\t\t\t\t\t$obj = $cla::objFromRow($row, $prefix);\n\t\t\t\t\tif (!$obj) ; // Bad\n\t\t\t\t\t\n\t\t\t\t\t$parent_obj->appendToArray($table, $obj);\n\t\t\t\t\tforeach ($j->joins as &$_j) $destall($_j);\n\t\t\t\t\tforeach ($j->joins as &$_j) $recursively_add_row($_j, $obj);\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t\t\t$row = $st->fetch(PDO::FETCH_ASSOC);\n\t\t\twhile ($row) {\n\t\t\t\t$n = count($base_objs);\n\t\t\t\tif (!$n or $base_objs[$n - 1]->wouldDifferFromRow($row, 'a')) {\n\t\t\t\t\tif (!$obj = self::objFromRow($row, 'a'))\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t$base_objs []= &$obj;\n\t\t\t\t\tforeach ($joins as &$_j) $destall($_j);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$obj = &$base_objs[$n - 1];\n\t\t\t\t\n\t\t\t\tforeach($joins as &$_j)\n\t\t\t\t\t$recursively_add_row($_j, $obj);\n\t\t\t\t$inc = 1;\n\t\t\t\tforeach($increments_from_stalled_joins as $x) $inc *= $x;\n\t\t\t\tfor ($i=0; $i < $inc; $i++)\n\t\t\t\t\t$row = $st->fetch(PDO::FETCH_ASSOC);\n\t\t\t\tunset($obj);\n\t\t\t}\n\t\t\t\n\t\t\t$res = new TMResult(TMResult::Success);\n\t\t\t$res->result = &$base_objs;\n\t\t\treturn $res;\n\t\t}", "public function addOuterJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, true);\n \n return $this;\n }", "public function getJoinExpression();", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "public function on($joined = null, $operator = null, $outer = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->onWrapper()\n );\n\n return $this;\n }", "public function setRelationshipMultiCondition($parameters)\n {\n foreach ($parameters as $parameter) {\n $sourceTable = $parameter['table'];\n $sourceColumn = $parameter['table'] . \".\" . $parameter['index'];\n $destinationColumn = $parameter['foreign'];\n $this->Model = $this->Model->join($sourceTable, $sourceColumn, \"=\", DB::raw($destinationColumn), \"LEFT\");\n }\n }", "public function rightJoin($table, $conditions = []);", "public function testBuildSelectWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->fields()\n ->addField('user@email', 'email')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->fields()\n ->addField('user@email', 'email')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n \"'user@email' AS table1__email, 'user@email' AS table2__email\",\n $query->buildSelectFields()\n );\n }", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }", "protected function performJoinForEloquentPowerJoinsForBelongsTo()\n {\n return function ($query, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $query->{$joinType}($joinedTable, function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n \"{$parentTable}.{$fk}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey[$i]}\"\n );\n }\n } else {\n $join->on(\n \"{$parentTable}.{$this->foreignKey}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\");\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function outerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "function _add_where_clause($where_clauses, $join)\n {\n foreach ($where_clauses as $clause) {\n // $clause => array(\n // 'column' => 'ID',\n // 'value' =>\t1210,\n // 'compare' => '='\n // )\n // Determine where what the where clause is comparing\n switch ($clause['column']) {\n case 'author':\n case 'author_id':\n $this->object->_query_args['author'] = $clause['value'];\n break;\n case 'author_name':\n $this->object->_query_args['author_name'] = $clause['value'];\n break;\n case 'cat':\n case 'cat_id':\n case 'category_id':\n switch ($clause['compare']) {\n case '=':\n case 'BETWEEN':\n case 'IN':\n if (!isset($this->object->_query_args['category__in'])) {\n $this->object->_query_args['category__in'] = array();\n }\n $this->object->_query_args['category__in'][] = $clause['value'];\n break;\n case '!=':\n case 'NOT BETWEEN':\n case 'NOT IN':\n if (!isset($this->object->_query_args['category__not_in'])) {\n $this->object->_query_args['category__not_in'] = array();\n }\n $this->object->_query_args['category__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'category_name':\n $this->object->_query_args['category_name'] = $clause['value'];\n break;\n case 'post_id':\n case $this->object->get_primary_key_column():\n switch ($clause['compare']) {\n case '=':\n case 'IN':\n case 'BETWEEN':\n if (!isset($this->object->_query_args['post__in'])) {\n $this->object->_query_args['post__in'] = array();\n }\n $this->object->_query_args['post__in'][] = $clause['value'];\n break;\n default:\n if (!isset($this->object->_query_args['post__not_in'])) {\n $this->object->_query_args['post__not_in'] = array();\n }\n $this->object->_query_args['post__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'pagename':\n case 'postname':\n case 'page_name':\n case 'post_name':\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['page_name__like'] = $clause['value'];\n } elseif ($clause['compare'] == '=') {\n $this->object->_query_args['pagename'] = $clause['value'];\n } elseif ($clause['compare'] == 'IN') {\n $this->object->_query_args['page_name__in'] = $clause['value'];\n }\n break;\n case 'post_title':\n // Post title uses custom WHERE clause\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['post_title__like'] = $clause['value'];\n } else {\n $this->object->_query_args['post_title'] = $clause['value'];\n }\n break;\n default:\n // Must be metadata\n $clause['key'] = $clause['column'];\n unset($clause['column']);\n // Convert values to array, when required\n if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {\n $clause['value'] = explode(',', $clause['value']);\n foreach ($clause['value'] as &$val) {\n if (!is_numeric($val)) {\n // In the _parse_where_clause() method, we\n // quote the strings and add slashes\n $val = stripslashes($val);\n $val = substr($val, 1, strlen($val) - 2);\n }\n }\n }\n if (!isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query'] = array();\n }\n $this->object->_query_args['meta_query'][] = $clause;\n break;\n }\n }\n // If any where clauses have been added, specify how the conditions\n // will be conbined/joined\n if (isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query']['relation'] = $join;\n }\n }", "protected function innerJoin() {\n return \" INNER JOIN ImageDetails ON MainPostImage = ImageID\n INNER JOIN Users ON Posts.UserID = Users.UserID\"; }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function leftOuterJoin($table);", "public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }", "private function _hookup_joins($include_phone=FALSE)\n {\n $select = TBL_HOOKUPS.'.*,';\n \n $select .= TBL_HOOKUP_REQUESTS.'.user_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.hookup_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.is_accepted,'; \n $select .= TBL_HOOKUP_REQUESTS.'.date_requested,'; \n\n $select .= TBL_PAYMENTS.'.*';\n\n $this->db->select($select);\n $this->db->from(TBL_HOOKUPS);\n $this->db->join(TBL_HOOKUP_REQUESTS,TBL_HOOKUPS.'.request_id = '.TBL_HOOKUP_REQUESTS.'.id');\n $this->db->join(TBL_PAYMENTS,TBL_HOOKUPS.'.payment_id = '.TBL_PAYMENTS.'.id');\n }", "public function addConstraints()\n {\n $this->setJoin ()->setWhere ();\n }", "public function addJoinWithVariables($type, $modelName, $alias, $condition, array $variables) {\n $condition = $this->parseVariables($condition, $variables);\n\n parent::addJoinWithVariables($type, $modelName, $alias, $condition, array());\n }", "public function innerJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::INNER, $table, $where, true);\n \n return $this;\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function on( $on ) {\n $this->_lastOn = $on;\n $this->_currentImplement['join'][count( $this->_currentImplement['join']) - 1] += array('on' => $on );\n return $this;\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "public function joinOnAndQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('AND', $other, $whereQuery);\r\n\t}", "private function addJoin(string $type, string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n\r\n $this -> joins[] = ['table' => $tableName, 'alias' => $tableAlias, 'conditions' => $conditions, 'type' => $type];\r\n return $this;\r\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}", "public function fullOuterJoin($table);", "abstract public function join($alias_from, $rel_name, $alias_to);", "public static function posts_join( $join_sql, $query ) {\n\t\t\tglobal $wpdb;\n\t\t\t$joins = array();\n\n\t\t\t$postmeta_table = self::postmeta_table( $query );\n\n\t\t\t$event_start_key = '_EventStartDate';\n\t\t\t$event_end_key = '_EventEndDate';\n\n\t\t\t/**\n\t\t\t * When the \"Use site timezone everywhere\" option is checked in events settings,\n\t\t\t * the UTC time for event start and end times will be used. This filter allows the\n\t\t\t * disabling of that in certain contexts, so that local (not UTC) event times are used.\n\t\t\t *\n\t\t\t * @since 4.6.10\n\t\t\t *\n\t\t\t * @param boolean $force_local_tz Whether to force the local TZ.\n\t\t\t */\n\t\t\t$force_local_tz = apply_filters( 'tribe_events_query_force_local_tz', false );\n\n\t\t\tif ( Tribe__Events__Timezones::is_mode( 'site' ) && ! $force_local_tz ) {\n\t\t\t\t$event_start_key .= 'UTC';\n\t\t\t\t$event_end_key .= 'UTC';\n\t\t\t}\n\n\t\t\t// if it's a true event query then we want create a join for where conditions\n\t\t\tif ( $query->tribe_is_event || $query->tribe_is_event_category || $query->tribe_is_multi_posttype ) {\n\t\t\t\tif ( $query->tribe_is_multi_posttype ) {\n\t\t\t\t\t// if we're getting multiple post types, we don't need the end date, just get the start date\n\t\t\t\t\t// for events-only post type queries, the start date postmeta join is already added by the main query args\n\t\t\t\t\t$joins['event_start_date'] = \" LEFT JOIN {$wpdb->postmeta} as {$postmeta_table} on {$wpdb->posts}.ID = {$postmeta_table}.post_id AND {$postmeta_table}.meta_key = '$event_start_key'\";\n\t\t\t\t} else {\n\t\t\t\t\t// for events-only post type queries, we should also get the end date for display\n\t\t\t\t\t$joins['event_end_date'] = \" LEFT JOIN {$wpdb->postmeta} as tribe_event_end_date ON ( {$wpdb->posts}.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '$event_end_key' ) \";\n\t\t\t\t}\n\t\t\t\t$joins = apply_filters( 'tribe_events_query_posts_joins', $joins, $query );\n\n\t\t\t\treturn $join_sql . implode( '', $joins );\n\t\t\t}\n\n\t\t\treturn $join_sql;\n\t\t}", "public function create_join_table($model_one, $model_two) {\n $table_name = NimbleAssociation::generate_join_table_name(array($model_one, $model_two));\n $table = $this->create_table($table_name, array('id' => false));\n $table->references($model_one);\n $table->references($model_two);\n $table->go();\n }", "function query_main_join( $sql, $engine ) {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $engine ) ) {\n\t\t\t$engine = null;\n\t\t}\n\n\t\t// if WooCommerce is sorting results we need to tell SearchWP to return them in that order\n\t\tif ( $this->is_woocommerce_search() ) {\n\n\t\t\tif ( ! isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\t$this->get_woocommerce_ordering();\n\t\t\t}\n\n\t\t\t// depending on the sorting we need to do different things\n\t\t\tif ( isset( $this->ordering['wc_orderby'] ) ) {\n\t\t\t\tswitch ( $this->ordering['wc_orderby'] ) {\n\t\t\t\t\tcase 'price':\n\t\t\t\t\tcase 'price-desc':\n\t\t\t\t\tcase 'popularity':\n\t\t\t\t\t\t$meta_key = 'price' === $this->ordering['wc_orderby'] ? '_price' : 'total_sales';\n\t\t\t\t\t\t$sql = $sql . $wpdb->prepare( \" LEFT JOIN {$wpdb->postmeta} AS swpwc ON {$wpdb->posts}.ID = swpwc.post_id AND swpwc.meta_key = %s\", $meta_key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'rating':\n\t\t\t\t\t\t$sql = $sql . \" LEFT OUTER JOIN {$wpdb->comments} swpwpcom ON({$wpdb->posts}.ID = swpwpcom.comment_post_ID) LEFT JOIN {$wpdb->commentmeta} swpwpcommeta ON(swpwpcom.comment_ID = swpwpcommeta.comment_id) \";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// for visibility we always need to join postmeta\n\t\t\tif ( function_exists( 'WC' ) && ! empty( WC()->version ) && version_compare( WC()->version, '2.6.0', '<' ) ) { // Moved to a taxonomy\n\t\t\t\t$sql = $sql . \" INNER JOIN {$wpdb->postmeta} as woovisibility ON {$wpdb->posts}.ID = woovisibility.post_id \";\n\t\t\t}\n\n\t\t}\n\n\t\treturn $sql;\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }" ]
[ "0.67993444", "0.63841873", "0.62103987", "0.6159764", "0.6095986", "0.60927427", "0.6042208", "0.6017697", "0.5971336", "0.596147", "0.5944028", "0.59108245", "0.59045464", "0.5901086", "0.58964753", "0.5883165", "0.58322394", "0.5820531", "0.5813977", "0.57628953", "0.5760806", "0.5757346", "0.571127", "0.57089126", "0.56761324", "0.56640065", "0.5610338", "0.55836713", "0.5566125", "0.55440557", "0.5540258", "0.552735", "0.55199444", "0.55165356", "0.5486004", "0.54716223", "0.54336756", "0.5396329", "0.539272", "0.5384427", "0.53757864", "0.53686446", "0.5344151", "0.53074646", "0.5272929", "0.5269237", "0.5266121", "0.5264702", "0.5252017", "0.5239094", "0.5237007", "0.5224832", "0.5223201", "0.5192988", "0.5182935", "0.51801354", "0.51666194", "0.5162259", "0.5137073", "0.5132072", "0.512592", "0.5118998", "0.5115489", "0.5101434", "0.5100194", "0.50927514", "0.50864", "0.50830823", "0.50811225", "0.5076021", "0.5058191", "0.50562155", "0.505571", "0.5051069", "0.5044581", "0.50360674", "0.50334835", "0.50331074", "0.50257933", "0.50238127", "0.50221866", "0.5019035", "0.50163597", "0.5007274", "0.5006989", "0.50032806", "0.49995282", "0.4988873", "0.49846417", "0.49818736", "0.49713898", "0.49602982", "0.49565583", "0.49537668", "0.49402156", "0.49394011", "0.49056542", "0.4895902", "0.48842242", "0.48803127" ]
0.5798907
19
Register new RIGHT JOIN with set of on conditions (linking one table to another, no parametric on conditions allowed here).
public function rightJoin($table, $on = null) { $this->joinTokens[$this->activeJoin = $table] = ['type' => 'RIGHT', 'on' => []]; return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rightJoin($table, $conditions = []);", "function rightJoin($conditions)\n\t{\n\t\treturn $this->join('RIGHT', $conditions);\n\t}", "public static function rightJoin($source, $on, $alias = null, array $bindings = []);", "public function rightJoin($table, $key, ?string $operator = null, $foreign = null);", "public function right_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('right join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "public function rightJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::RIGHT, $table, $fields, $on);\n }", "public function rightJoin($table, $condition)\n {\n return $this->addJoin($table, $condition, 'RIGHT');\n }", "public function addRightJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::RIGHT, $table, $where, false);\n \n return $this;\n }", "public function rightOuterJoin($table);", "final public static function rightJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //inicia o select\n self::$query .= \" RIGHT JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function right($table, $on, $field = null, $comparitor = null);", "public function testRightJoinStmt()\n {\n $rightJoin = $this->joinTemplate()(\"RIGHT\");\n return $this->assertEquals($rightJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog RIGHT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function rightJoin($fromAlias, $join, $alias, $condition = null)\n {\n return $this->add('join', array(\n $fromAlias => array(\n 'joinType' => 'right',\n 'joinTable' => $join,\n 'joinAlias' => $alias,\n 'joinCondition' => $condition\n )\n ), true);\n }", "public function addRightJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::RIGHT, $table, $where, true);\n \n return $this;\n }", "public function rightJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"RIGHT JOIN\");\n return $this;\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function rightJoin(string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n return $this -> addJoin('right', $tableName, $tableAlias, $conditions);\r\n }", "public function rightJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::RIGHT, $table, $where, false);\n \n return $this;\n }", "public function rightJoin($fromAlias, $join, $alias, $condition = null)\n\t{\n\t\t$join = $this->getTableName($join, ConnectionManager::MODE_READ);\n\n\t\treturn parent::rightJoin($fromAlias, $join, $alias, $condition);\n\t}", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function rightJoinRelations($relations)\n {\n $relations = is_array($relations) ? $relations : func_get_args();\n\n return $this->joinRelations($relations, 'right');\n }", "function joinRight($field, $select, $foreign) {\n\t\tif ($select instanceof \\Library\\Database\\LinqSelect) {\n\t\t\t$this->join[] = array(\"RIGHT\", $field, $select, $foreign);\n\t\t} else {\n\t\t\tdie(\"Not valid table\");\n\t\t}\n\t\treturn $this;\n\t}", "public function join($table, $on, $field = null, $comparitor = null);", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function rightJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'RIGHT JOIN', $condition);\n return $this;\n }", "public function rightJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::RIGHT, $table, $where, true);\n \n return $this;\n }", "protected function performJoinForEloquentPowerJoinsForHasMany()\n {\n return function ($builder, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $alias ?: $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $builder->{$joinType}($this->query->getModel()->getTable(), function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n $fk,\n '=',\n \"{$parentTable}.{$this->localKey[$i]}\"\n );\n }\n } else {\n $join->on(\n $this->foreignKey,\n '=',\n \"{$parentTable}.{$this->localKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\n \"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\"\n );\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function leftJoin($table, $conditions = []);", "public static function doRightJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->rightJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "function return_join_table_data($rt_or_left_or_none,$tableleft,$tableright,$on_a_and_b,$whereby=null,$orderby=null,$returnrows=\"a.*,b.*\") {\n\t$q = \"\n\tSELECT \".$returnrows.\"\n\tFROM \".$tableleft.\" AS a \".$rt_or_left_or_none.\" JOIN \".$tableright.\" AS b ON \".$on_a_and_b.\" \n\t\".$whereby.\" \n\t\".$orderby.\" \n\t\";\n\t//echo $q;\n\t$r = mysql_query($q) or die(\"return_join_table_data($rt_or_left_or_none,$tableleft,$tableright): \".mysql_error());\n\treturn check_results($r);\n}", "public function rightJoin(string $table, string $local_column, string $operator, string $joined_column, bool $is_pivot = false)\n {\n $this->join($table, $local_column, $operator, $joined_column, $is_pivot, 'right join');\n \n return $this;\n }", "public function setRelationshipMultiCondition($parameters)\n {\n foreach ($parameters as $parameter) {\n $sourceTable = $parameter['table'];\n $sourceColumn = $parameter['table'] . \".\" . $parameter['index'];\n $destinationColumn = $parameter['foreign'];\n $this->Model = $this->Model->join($sourceTable, $sourceColumn, \"=\", DB::raw($destinationColumn), \"LEFT\");\n }\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function getJoinCondition() {}", "function getJoinCondition() ;", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function add_filter_join($field, $join_type = 'or')\n\t{\n\t\tif (!empty($this->filter_join) AND is_string($this->filter_join))\n\t\t{\n\t\t\t$this->filter_join = array($this->filter_join);\n\t\t}\n\t\t$this->filter_join[$field] = $join_type;\n\t}", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "private function set_relation_joins() {\n if(!$this->use_relations) return;\n $relations = [];\n foreach ($this->colmodel as $i => $col) {\n if (!isset($col['relation']))\n continue;\n foreach (explode('>', $col['relation']) as $relation) {\n if (!str_contains($relation, '.'))\n continue;\n list($model_name, $relation_name) = explode('.', $relation);\n if ($relation_name != '' && !in_array($relation, $relations)) {\n $this->set_relation_join($model_name, $relation_name);\n $relations[] = $relation;\n }\n }\n }\n }", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function addJoin($table, $condition, $joinType)\n {\n $this->appendSql($this->filterJoinType($joinType))->\n appendSql(' JOIN ')->\n appendSql($table)->\n appendSql(' ON ')->\n appendSql(\"({$condition})\");\n return $this;\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "private function joinInternal($type, $table, $conditions = '', $params = array())\n\t{\n\t\tif (strpos($table, '(') === false)\n\t\t{\n\t\t\tif (preg_match('/^(.*?)(?i:\\s+as\\s+|\\s+)(.*)$/', $table, $matches))\t// with alias\n\t\t\t\t$table = $this->_connection->quoteTableName($matches[1]) . ' ' . $this->_connection->quoteTableName($matches[2]);\n\t\t\telse\n\t\t\t\t$table = $this->_connection->quoteTableName($table);\n\t\t}\n\n\t\t$conditions = $this->processConditions($conditions);\n\t\tif ($conditions != '')\n\t\t\t$conditions = ' ON ' . $conditions;\n\n\t\tif (isset($this->_query['join']) && is_string($this->_query['join']))\n\t\t\t$this->_query['join'] = array($this->_query['join']);\n\n\t\t$this->_query['join'][] = strtoupper($type) . ' ' . $table . $conditions;\n\n\t\tforeach ($params as $name => $value)\n\t\t\t$this->params[$name] = $value;\n\t\treturn $this;\n\t}", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function join($builder, $relation, $model = null, $method = 'leftJoin')\n {\n $model = $model ?? $builder->getModel();\n\n if ($builder instanceof \\Illuminate\\Database\\Eloquent\\Relations\\Relation) {\n $builder = $builder->getQuery();\n }\n \n\n $relations = explode('.', $relation);\n\n $currentTableAlias = $model->getTable();\n $basePrimaryKey = $model->getKeyName();\n\n $currentModel = $model;\n\n foreach ($relations as $i => $relation) {\n $relatedRelation = $currentModel->$relation();\n $relatedRelation::noConstraints(function () use ($relation, &$currentModel, &$currentTableAlias, $relations, $i, $method, $builder) {\n $relatedRelation = $currentModel->$relation();\n $relatedModel = $relatedRelation->getRelated();\n $relationName = $this->parseAlias(array_slice($relations, 0, $i + 1));\n\n $joinQuery = $relatedModel->getTable().($relatedModel->getTable() !== $relationName ? ' as '.$relationName : '');\n\n // @TODO, check if same joinQuery is already in $builder\n foreach ($this->getResolvers()->toArray() as $key => $resolverClass) {\n if ($relatedRelation instanceof $key) {\n $resolver = new $resolverClass;\n\n $resolver\n ->setRelationName($relationName)\n ->setMethod($method)\n ->setRelation($relatedRelation)\n ->setSourceTable($currentTableAlias)\n ->setTargetTable($relationName)\n ;\n\n $resolver->resolve($builder);\n\n break; //uhm..........\n }\n }\n\n $currentModel = $relatedModel;\n $currentTableAlias = $relationName;\n });\n }\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function innerJoin($table, $conditions = []);", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "protected function performJoinForEloquentPowerJoinsForBelongsTo()\n {\n return function ($query, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $query->{$joinType}($joinedTable, function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n \"{$parentTable}.{$fk}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey[$i]}\"\n );\n }\n } else {\n $join->on(\n \"{$parentTable}.{$this->foreignKey}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\");\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "protected function getJoin ($joinType, $leftAlias, $rightTable, $rightAlias, $fieldNames, $extraCrit = false) {\n $db = $this->db;\n $la = $db->NameQuote($leftAlias);\n $ra = $db->NameQuote($rightAlias);\n $res = $joinType.' JOIN '.$db->NameQuote($rightTable);\n if ($rightAlias) $res .= ' AS '.$ra.' ON ';\n else {\n $res .= ' ON ';\n $ra = $db->NameQuote($rightTable);\n }\n $on = array();\n foreach ($fieldNames as $leftField => $rightField) {\n $on[] = $la.'.'.$db->NameQuote($leftField).' = '.$ra.'.'.$db->NameQuote($rightField);\n }\n if ($extraCrit) $on[] = \"($extraCrit)\";\n $res .= implode(' AND ', $on);\n return $res;\n }", "protected function getJoin ($joinType, $leftAlias, $rightTable, $rightAlias, $fieldNames, $extraCrit = false) {\n $db = $this->db;\n $la = $db->NameQuote($leftAlias);\n $ra = $db->NameQuote($rightAlias);\n $res = $joinType.' JOIN '.$db->NameQuote($rightTable);\n if ($rightAlias) $res .= ' AS '.$ra.' ON ';\n else {\n $res .= ' ON ';\n $ra = $db->NameQuote($rightTable);\n }\n $on = array();\n foreach ($fieldNames as $leftField => $rightField) {\n $on[] = $la.'.'.$db->NameQuote($leftField).' = '.$ra.'.'.$db->NameQuote($rightField);\n }\n if (strlen($extraCrit)) $on[] = \"($extraCrit)\";\n $res .= implode(' AND ', $on);\n return $res;\n }", "public function join(string $table, string $condition, string $type=''): QueryBuilderInterface\n\t{\n\t\t// Prefix and quote table name\n\t\t$table = explode(' ', mb_trim($table));\n\t\t$table[0] = $this->driver->quoteTable($table[0]);\n\t\t$table = $this->driver->quoteIdent($table);\n\t\t$table = implode(' ', $table);\n\n\t\t// Parse out the join condition\n\t\t$parsedCondition = $this->parser->compileJoin($condition);\n\t\t$condition = $table . ' ON ' . $parsedCondition;\n\n\t\t$this->state->appendMap(\"\\n\" . strtoupper($type) . ' JOIN ', $condition, 'join');\n\n\t\treturn $this;\n\t}", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "private function addJoin(string $type, string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n\r\n $this -> joins[] = ['table' => $tableName, 'alias' => $tableAlias, 'conditions' => $conditions, 'type' => $type];\r\n return $this;\r\n }", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function or_on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'OR');\n return $this;\n }", "public static function add_wp_query_join( $join, $wp_query ) {\n\t\tglobal $wpdb;\n\n\t\t$search = $wp_query->get( 'search' );\n\t\tif ( $search ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->postmeta} AS attr_search_meta\n\t\t\t\t\t\tON {$wpdb->posts}.ID = attr_search_meta.post_id\n\t\t\t\t\t\tAND attr_search_meta.meta_key LIKE 'attribute_%' \";\n\t\t}\n\n\t\tif ( wc_product_sku_enabled() && ! strstr( $join, 'wc_product_meta_lookup' ) ) {\n\t\t\t$join .= \" LEFT JOIN {$wpdb->wc_product_meta_lookup} wc_product_meta_lookup\n\t\t\t\t\t\tON $wpdb->posts.ID = wc_product_meta_lookup.product_id \";\n\t\t}\n\n\t\treturn $join;\n\t}", "function joinQuery()\n {\n }", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function addJoin($assocTable, $col1, $col2, $last = true, $type = \"left\") {\n // Joins will always be on selects\n list($this->sql, $this->from) = splitString($this->sql, \"FROM\");\n // Take care of aliased columns\n if (!empty($assocTable->aliases)) {\n $this->sql .= \", \";\n foreach($assocTable->aliases as $c => $a) {\n $this->sql .= $assocTable->name . \".$c as $a,\";\n }\n // Take the comma off the end\n $this->sql = trim($this->sql, \",\");\n }\n $type = strtoupper($type);\n $this->join .= \" $type JOIN \" . $assocTable->name;\n $this->join .= \" ON \" . $this->table->name . \".\" . $col1 . \" = \" . $assocTable->name . \".\" . $col2;\n if ($last) {\n $this->sql .= \" $this->from\";\n $this->sql .= $this->join;\n }\n }", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "public function joinOnOrQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('OR', $other, $whereQuery);\r\n\t}", "public function join(SourceInterface $left, SourceInterface $right,\n $joinType, JoinConditionInterface $joinCondition);", "public function join(string $table, string $condition, string $type = 'left'): self\n {\n $this->joins[$type][] = [$table, $condition];\n return $this;\n }", "private function addJoin(Query $other, $fieldOrExpr, $operator, $valueOrExpr, $type = 'INNER', $table, $withOtherDatas=TRUE) {\r\n\t\tif (isset($this->_salt_joins[$other->_salt_alias])) {\r\n\t\t\tthrow new SaltException(L::error_query_duplicate_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$this->_salt_joins[$other->_salt_alias]=array(\r\n\t\t\t'type'=>strtoupper($type),\r\n\t\t\t'table'=>$table,\r\n\t\t\t'on'=>array(),\r\n\t\t);\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, 'AND', $clause);\r\n\r\n\t\tif ($withOtherDatas) {\r\n\t\t\t// Merge of others parameters\r\n\t\t\tif (count($other->_salt_fields) > 0) {\r\n\t\t\t\t$this->_salt_fields=array_merge($this->_salt_fields, $other->_salt_fields);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::SELECT);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_wheres) > 0) {\r\n\t\t\t\t//$this->addWhereClause('AND', $other->wheres);\r\n\t\t\t\t$this->addJoinOnClause($other, 'AND', $other->_salt_wheres);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_groups) > 0) {\r\n\t\t\t\t$this->_salt_groups=array_merge($this->_salt_groups, $other->_salt_groups);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::GROUP);\r\n\t\t\t}\r\n\t\t\tif (count($other->_salt_orders) > 0) {\r\n\t\t\t\t$this->_salt_orders=array_merge($this->_salt_orders, $other->_salt_orders);\r\n\t\t\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::ORDER);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// join (Select ...) : link ALL binds, because we include full query text\r\n\t\t\t$this->linkBindsOf($other, ClauseType::JOIN);\r\n\t\t}\r\n\t}", "private function addJoinOn($type, Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\tif (!array_key_exists($other->_salt_alias, $this->_salt_joins)) {\r\n\t\t\tthrow new SaltException(L::error_query_missing_join($other->_salt_alias));\r\n\t\t}\r\n\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::JOIN, $fieldOrExpr);\r\n\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::JOIN, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$clause = $absoluteField.' '.$operator.' '.$valueOrExpr;\r\n\r\n\t\t$this->addJoinOnClause($other, $type, $clause);\r\n// \t\t$this->joins[$other->alias]['on'][]=' '.$type.' '.$clause;\r\n\t}", "public function leftJoin(\n $joined,\n $on = null,\n $fields = [],\n $additionalJoins = [],\n $grouped = false,\n $iterator = null\n ) {\n $relations = explode('~', $joined, 2);\n $modelClass = $relations[0];\n if (!class_exists($modelClass)) {\n throw new Exceptions\\ModelNotFoundException($modelClass);\n }\n if (count($relations) === 2) { // Index\n throw new Exceptions\\UnsupportedActionException('Cannot perform LEFT JOIN <index>');\n } else {// Model\n if (is_string($on)) {\n $on = new Expressions\\Conditions\\Generic($on, null, $this);\n }\n $this->withVirtualFields(\n $fields,\n function ($model, $field) use ($modelClass, $joined, $on, $grouped, $additionalJoins) {\n $mongoNotationOn = $on->mongoNotation;\n $modelName = ClassFinder::getClassBasename(get_class($this));\n\n $queryData = [];\n $fieldsInConditions = [];\n // @TODO: optimization: move this out of the callback\n $joinedModelKey = null;\n foreach ($mongoNotationOn as $left => $right) {\n // @TODO: nested conditions\n $leftField = (new \\Zer0\\Model\\Subtypes\\Field($left))->parseName();\n if ($right instanceof \\Zer0\\Model\\Subtypes\\Field) {\n // Field - Field predicate\n $rightField = $right->parseName();\n\n // If 'base.field = joined.field'\n if (isset($leftField['model']) && $modelName === $leftField['model']) {\n // then reverse it\n unset($mongoNotationOn[$left]);\n $mongoNotationOn[(string)$right] = new \\Zer0\\Model\\Subtypes\\Field($left);\n [$left, $right] = [$right, $left];\n [$leftField, $rightField] = [$rightField, $leftField];\n }\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] =\n new \\Zer0\\Model\\Subtypes\\Placeholder(count($queryData));\n // Base (right) model values to pass to where() on joined model\n if (is_array($model)) {\n throw new \\Exception('generic model array problem');\n }\n $queryData[] = $model->values($rightField['name']);\n $fieldsInConditions[] = $rightField['name'];\n $joinedModelKey = $leftField['name'];\n } else {\n // Field - Value predicate\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] = $right;\n }\n }\n\n $origModelKey = $fieldsInConditions[0]; // @TODO: foreach\n $on->setValues($queryData);\n $on = $on->mutateWithMongoNotation($mongoNotationOn);\n $joinedData = [];\n\n // Fetch data from joined model\n $models = $modelClass::where((string)$on, $on->getValues());\n if (isset($additionalJoins) && count($additionalJoins)) {\n foreach ($additionalJoins as $joinItem) {\n $models = $models->withVirtualFields($joinItem);\n }\n }\n $models = $models->load();\n foreach ($models as $item) {\n if ($grouped) {\n if (!isset($joinedData[$item[$joinedModelKey]])) {\n $joinedData[$item[$joinedModelKey]] = [];\n }\n $joinedData[$item[$joinedModelKey]] [] = $item;\n } else {\n $joinedData[$item[$joinedModelKey]] = $item;\n }\n }\n if ($grouped) {\n foreach ($model->values($joinedModelKey) as $k) {\n if (!isset($joinedData[$k])) {\n $joinedData[$k] = [];\n }\n }\n }\n $model->addDataFromJoin(\n $origModelKey,\n $joinedData,\n $field\n );\n },\n $iterator\n );\n }\n return $this;\n }", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "function MWX__join ($join)\n{\n global $wpdb;\n\n if (current_user_can ('edit_users'))\n return $join;\n\n return $join .= \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'maturity'\";\n}", "public function create_join_table($model_one, $model_two) {\n $table_name = NimbleAssociation::generate_join_table_name(array($model_one, $model_two));\n $table = $this->create_table($table_name, array('id' => false));\n $table->references($model_one);\n $table->references($model_two);\n $table->go();\n }", "public function testWriteJoinSnippets()\n\t{\n\t\t$queryWriter = R::getWriter();\n\t\tasrt( ( $queryWriter instanceof SQLiteT ), TRUE );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page' ); //default must be LEFT\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' LEFT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'LEFT' );\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' LEFT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'RIGHT' );\n\t\tasrt( is_string( $snippet ), TRUE );\n\t\tasrt( ( strlen( $snippet ) > 0 ), TRUE );\n\t\tasrt( ' RIGHT JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'INNER' );\n\t\tasrt( ' INNER JOIN `page` ON `page`.id = `book`.page_id ', $snippet );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\t$snippet = $queryWriter->writeJoin( 'book', 'page', 'MIDDLE' );\n\t\t}\n\t\tcatch(\\Exception $e) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof RedException ), TRUE );\n\t\t$errorMessage = $exception->getMessage();\n\t\tasrt( is_string( $errorMessage ), TRUE );\n\t\tasrt( ( strlen( $errorMessage ) > 0 ), TRUE );\n\t\tasrt( $errorMessage, 'Invalid JOIN.' );\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }" ]
[ "0.75426203", "0.6993322", "0.6663103", "0.66162723", "0.655545", "0.64825094", "0.6346379", "0.61344033", "0.6092237", "0.6002024", "0.59078836", "0.5905868", "0.59005636", "0.59003294", "0.58639234", "0.5802059", "0.5767909", "0.5750758", "0.5744014", "0.5729698", "0.57258123", "0.5621246", "0.5614563", "0.55151165", "0.5513659", "0.5424756", "0.540545", "0.5383216", "0.5381906", "0.5373996", "0.53412235", "0.53233325", "0.5306939", "0.53056514", "0.5281421", "0.5274697", "0.5233252", "0.5217815", "0.5214578", "0.51850927", "0.5172795", "0.5142123", "0.51259416", "0.50741416", "0.50330853", "0.502014", "0.50064635", "0.49689636", "0.49412143", "0.49324587", "0.49179062", "0.49159887", "0.49101686", "0.49039635", "0.49025866", "0.48893973", "0.4888294", "0.48677817", "0.48658687", "0.48542243", "0.4848947", "0.48442218", "0.48219228", "0.4821172", "0.4814153", "0.4814096", "0.48105115", "0.48042303", "0.48007375", "0.4799942", "0.47835422", "0.47823015", "0.4762925", "0.47491688", "0.47481143", "0.47446966", "0.47394747", "0.4738432", "0.4735926", "0.4735217", "0.47350737", "0.47303176", "0.47289416", "0.47209758", "0.47204578", "0.47140718", "0.47133765", "0.47122443", "0.47064072", "0.47047457", "0.46989846", "0.46915746", "0.46879166", "0.46843937", "0.4679562", "0.4668116", "0.46567363", "0.4648034", "0.46479008", "0.464569" ]
0.6469522
6
Register new LEFT JOIN with set of on conditions (linking one table to another, no parametric on conditions allowed here).
public function leftJoin($table, $on = null) { $this->joinTokens[$this->activeJoin = $table] = ['type' => 'LEFT', 'on' => []]; return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function leftJoin($table, $conditions = []);", "public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "public static function leftJoin($source, $on, $alias = null, array $bindings = []);", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function leftJoin($table, $key, ?string $operator = null, $foreign = null);", "public function leftJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::LEFT, $table, $fields, $on);\n }", "public function left_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('left join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function leftJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_leftJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function leftJoin($table, $condition)\n {\n return $this->addJoin($table, $condition, 'LEFT');\n }", "public function leftJoin(\n $joined,\n $on = null,\n $fields = [],\n $additionalJoins = [],\n $grouped = false,\n $iterator = null\n ) {\n $relations = explode('~', $joined, 2);\n $modelClass = $relations[0];\n if (!class_exists($modelClass)) {\n throw new Exceptions\\ModelNotFoundException($modelClass);\n }\n if (count($relations) === 2) { // Index\n throw new Exceptions\\UnsupportedActionException('Cannot perform LEFT JOIN <index>');\n } else {// Model\n if (is_string($on)) {\n $on = new Expressions\\Conditions\\Generic($on, null, $this);\n }\n $this->withVirtualFields(\n $fields,\n function ($model, $field) use ($modelClass, $joined, $on, $grouped, $additionalJoins) {\n $mongoNotationOn = $on->mongoNotation;\n $modelName = ClassFinder::getClassBasename(get_class($this));\n\n $queryData = [];\n $fieldsInConditions = [];\n // @TODO: optimization: move this out of the callback\n $joinedModelKey = null;\n foreach ($mongoNotationOn as $left => $right) {\n // @TODO: nested conditions\n $leftField = (new \\Zer0\\Model\\Subtypes\\Field($left))->parseName();\n if ($right instanceof \\Zer0\\Model\\Subtypes\\Field) {\n // Field - Field predicate\n $rightField = $right->parseName();\n\n // If 'base.field = joined.field'\n if (isset($leftField['model']) && $modelName === $leftField['model']) {\n // then reverse it\n unset($mongoNotationOn[$left]);\n $mongoNotationOn[(string)$right] = new \\Zer0\\Model\\Subtypes\\Field($left);\n [$left, $right] = [$right, $left];\n [$leftField, $rightField] = [$rightField, $leftField];\n }\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] =\n new \\Zer0\\Model\\Subtypes\\Placeholder(count($queryData));\n // Base (right) model values to pass to where() on joined model\n if (is_array($model)) {\n throw new \\Exception('generic model array problem');\n }\n $queryData[] = $model->values($rightField['name']);\n $fieldsInConditions[] = $rightField['name'];\n $joinedModelKey = $leftField['name'];\n } else {\n // Field - Value predicate\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] = $right;\n }\n }\n\n $origModelKey = $fieldsInConditions[0]; // @TODO: foreach\n $on->setValues($queryData);\n $on = $on->mutateWithMongoNotation($mongoNotationOn);\n $joinedData = [];\n\n // Fetch data from joined model\n $models = $modelClass::where((string)$on, $on->getValues());\n if (isset($additionalJoins) && count($additionalJoins)) {\n foreach ($additionalJoins as $joinItem) {\n $models = $models->withVirtualFields($joinItem);\n }\n }\n $models = $models->load();\n foreach ($models as $item) {\n if ($grouped) {\n if (!isset($joinedData[$item[$joinedModelKey]])) {\n $joinedData[$item[$joinedModelKey]] = [];\n }\n $joinedData[$item[$joinedModelKey]] [] = $item;\n } else {\n $joinedData[$item[$joinedModelKey]] = $item;\n }\n }\n if ($grouped) {\n foreach ($model->values($joinedModelKey) as $k) {\n if (!isset($joinedData[$k])) {\n $joinedData[$k] = [];\n }\n }\n }\n $model->addDataFromJoin(\n $origModelKey,\n $joinedData,\n $field\n );\n },\n $iterator\n );\n }\n return $this;\n }", "final public static function leftJoin(string $table, string $primaryKey, string $foreignKey)\n {\n //Init the select\n self::$query .= \" LEFT JOIN \" . $table . \" ON $table.$primaryKey = \" . self::tableName() . \".$foreignKey \";\n return (new static);\n }", "public function addLeftJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, true);\n \n return $this;\n }", "public function leftOuterJoin($table);", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "public function leftJoin(Select $table, $alias, $on)\n {\n $this->joins[] = array(\"subject\"=>$table, \"ali\"=>$alias, \"on\"=>$on, \"join\"=>\"LEFT JOIN\");\n return $this;\n }", "public function leftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function leftJoin($fromAlias, $join, $alias, $condition = null)\n {\n return $this->add('join', array(\n $fromAlias => array(\n 'joinType' => 'left',\n 'joinTable' => $join,\n 'joinAlias' => $alias,\n 'joinCondition' => $condition\n )\n ), true);\n }", "public function leftJoin(string $tableName, string $tableAlias = null, string $conditions = null): self {\r\n return $this -> addJoin('left', $tableName, $tableAlias, $conditions);\r\n }", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function leftJoin($fromAlias, $join, $alias, $condition = null)\n\t{\n\t\t$join = $this->getTableName($join, ConnectionManager::MODE_READ);\n\n\t\treturn parent::leftJoin($fromAlias, $join, $alias, $condition);\n\t}", "public function leftjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "function joinLeft($field, $select, $foreign) {\n\t\tif ($select instanceof LinqSelect) {\n\t\t\t$this->join[] = array(\"LEFT\", $field, $select, $foreign);\n\t\t} else {\n\t\t\tdie(\"Not valid table\");\n\t\t}\n\t\treturn $this;\n\t}", "public function leftJoinUsing($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, true);\n \n return $this;\n }", "public function testLeftJoinStmt()\n {\n $leftJoin = $this->joinTemplate()('LEFT');\n return $this->assertEquals($leftJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog LEFT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function leftJoin($table, $foreign_key, $operator, $local_key)\r\n\t{\r\n\t\t$this->model = $this->model\r\n\t\t\t\t\t\t\t->leftJoin($table, $foreign_key, $operator, $local_key);\r\n\t\treturn $this;\r\n\t}", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function left($table, $on, $field = null, $comparitor = null);", "public function leftJoin($table, $column1, $operator = null, $column2 = null)\n\t{\n\t\treturn $this->join($table, $column1, $operator, $column2, 'LEFT');\n\t}", "function sql_leftJoin(){\n\t\t$dbconnection = $this->db_connect();\n\t\tif($dbconnection !=1)\n\t\t{\n\t\t\t$result=\"MySql Connection Error\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//LIST OF SELECTIONS\n\t\t\t//INSTEAD of a listOfFields I need a listOfSelections like \"db.tbl_1.fld_1\"\n\t\t\t// a_selections = array(\"db.tbl_1.fld_1\",\"db.tbl_1.fld_2\",\"db.tbl_2.fld_1\");\n\t\t\t\n\t\t\tif($this->a_fields !=\" \"){\n\t\t\t\t$a_selections = $this->arraySELECTIONS($this->db,$this->table,$this->a_fields);\n\t\t\t}else{\n\t\t\t\t$a_selections = $this->db.\".\".$this->table.\" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->a_fields2 !=\" \"){\n\t\t\t\t$a_selections2 = $this->arraySELECTIONS($this->db2,$this->table2,$this->a_fields2);\n\t\t\t}else{\n\t\t\t\t$a_selections2 = $this->db2.\".\".$this->table2.\" *\";\n\t\t\t}\n\t\t\t\n \t\t\t$listOfSelections = $this->arrayFieldsToList($a_selections);\n\t\t\t$listOfSelections2 = $this->arrayFieldsToList($a_selections2);\n\t\t\t\n \t\t\t$sql = mysql_query(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n\t\t\t\n \t\t\t //echo(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n \t\t\t\tif (mysql_num_rows($sql) > 0) \n\t\t\t \t{\n\t\t\t \twhile ($row = mysql_fetch_assoc($sql)) \n\t\t\t \t{\n\t\t\t \t$a_data[]=$row ;\n\t\t\t \t}\n\t\t \t\t$result= $a_data;\t\n\t\t\t\t}else{\n\t\t\t\t\t$result=\"NO DATA AVAILABLE\";\n\t\t\t\t}\n\t\t}\n\t\treturn $result;\n\t\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "protected function getLeftJoins()\n {\n return array(\n \"rr\" => \"entity.requiredExerciseResources\",\n \"rk\" => \"entity.requiredKnowledges\"\n );\n }", "public function leftJoin(string $table, string $local_column, string $operator, string $joined_column, bool $is_pivot = false)\n {\n $this->join($table, $local_column, $operator, $joined_column, $is_pivot, 'left join');\n \n return $this;\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public static function doLeftJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->leftJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "public function leftJoin(string $name, ?string $alias = null, ?string $condition = null): Query\n {\n $this->resetStatement();\n $key = $alias ?? $name;\n $this->tables[$key] = new Table($name, $alias, 'LEFT JOIN', $condition);\n return $this;\n }", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function basic_join_setup()\r\n {\r\n \r\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function leftjoinrecto($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".\" . strtolower($classnameon) . \"_id = \" . strtolower($classnameon) . \".id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "public function leftJoinRelations($relations)\n {\n $relations = is_array($relations) ? $relations : func_get_args();\n\n return $this->joinRelations($relations, 'left');\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function leftGroupedJoin(\n $joined,\n $on = null,\n $fields = [],\n $additionalJoins = [],\n $iterator = null\n ) {\n $this->leftJoin($joined, $on, $fields, $additionalJoins, true, $iterator);\n return $this;\n }", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "public function join($table, $on, $field = null, $comparitor = null);", "function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {\r\n parent::construct($table, $left_table, $left_field, $field, $extra, $type);\r\n\r\n $this->left_query = $this->definition['left query'];\r\n }", "public function testBuildJoinDefaultWithAliases()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 AS table2_alias ON table1_alias.id = table2_alias.id',\n $query->buildJoin()\n );\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t\n\t\t$this->sqlConditionJoins = \", wcf\".WCF_N.\"_user_notification_event_to_user event_to_user\";\n\t\t$this->getConditionBuilder()->add(\"event_to_user.userID = user_table.userID\");\n\t}", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function setRelationshipMultiCondition($parameters)\n {\n foreach ($parameters as $parameter) {\n $sourceTable = $parameter['table'];\n $sourceColumn = $parameter['table'] . \".\" . $parameter['index'];\n $destinationColumn = $parameter['foreign'];\n $this->Model = $this->Model->join($sourceTable, $sourceColumn, \"=\", DB::raw($destinationColumn), \"LEFT\");\n }\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function rightJoin($table, $conditions = []);", "public function join()\n {\n $this->defaultjoinsetted = true;\n if (!empty($this->entity_link_list)) {\n foreach ($this->entity_link_list as $entity_link) {\n $this->defaultjoin .= \" left join `\" . strtolower(get_class($entity_link)) . \"` on \" . strtolower(get_class($entity_link)) . \".id = \" . $this->table . \".\" . strtolower(get_class($entity_link)) . \"_id\";\n }\n }\n return $this;\n }", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "private function addJoinOnQuery($type, Query $other, Query $whereQuery) {\r\n\t\t//$this->joins[$other->alias]['on'][]=' '.$type.' ('.implode(' ', $whereQuery->wheres).')';\r\n\t\t$this->addJoinOnClause($other, $type, '('.implode(' ',$whereQuery->_salt_wheres).')');\r\n\t\t$this->linkBindsOf($other, ClauseType::JOIN, ClauseType::WHERE);\r\n\t}", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "function joinQuery()\n {\n }", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "protected function addInitialQueryJoins(Builder $query, string $pivotTable, int $initialDepth): void\n {\n if ($initialDepth < 0) {\n $query->join(\n $pivotTable,\n $this->getQualifiedLocalKeyName(),\n '=',\n $this->getQualifiedParentKeyName()\n );\n } elseif ($initialDepth > 0) {\n $query->join(\n $pivotTable,\n $this->getQualifiedLocalKeyName(),\n '=',\n $this->getQualifiedChildKeyName()\n );\n }\n }", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "protected function performJoins()\n {\n $query = $this->query;\n\n $predecessor = $this->related;\n\n $this->through_parents->each(function ($model) use ($query, &$predecessor) {\n $first = $predecessor->getQualifiedKeyName();\n $joined = $model->qualifyColumn($this->getForeignKeyName($predecessor));\n\n $query->join($model->getTable(), $first, '=', $joined);\n\n if ($this->hasSoftDeletes($model)) {\n $this->query->whereNull($model->getQualifiedDeletedAtColumn());\n }\n\n $predecessor = $model;\n });\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function on($joined = null, $operator = null, $outer = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->onWrapper()\n );\n\n return $this;\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "function setExtraJoins($extraJoins) {\n $this->extraJoins = $extraJoins;\n }", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "private function makeRelationBetweenCategoryAndDummyTable() {}", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "public function getMockJoin ( $table, $on = null )\n {\n return $this->getMock(\n '\\r8\\Query\\Join',\n array('getJoinType'),\n array( $table, $on )\n );\n }", "protected function performJoinForEloquentPowerJoinsForHasMany()\n {\n return function ($builder, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $alias ?: $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $builder->{$joinType}($this->query->getModel()->getTable(), function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n $fk,\n '=',\n \"{$parentTable}.{$this->localKey[$i]}\"\n );\n }\n } else {\n $join->on(\n $this->foreignKey,\n '=',\n \"{$parentTable}.{$this->localKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\n \"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\"\n );\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "protected function performJoinForEloquentPowerJoinsForBelongsTo()\n {\n return function ($query, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $query->{$joinType}($joinedTable, function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n \"{$parentTable}.{$fk}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey[$i]}\"\n );\n }\n } else {\n $join->on(\n \"{$parentTable}.{$this->foreignKey}\",\n '=',\n \"{$joinedTable}.{$this->ownerKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\");\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "function getJoinCondition() ;", "private function _hookup_joins($include_phone=FALSE)\n {\n $select = TBL_HOOKUPS.'.*,';\n \n $select .= TBL_HOOKUP_REQUESTS.'.user_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.hookup_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.is_accepted,'; \n $select .= TBL_HOOKUP_REQUESTS.'.date_requested,'; \n\n $select .= TBL_PAYMENTS.'.*';\n\n $this->db->select($select);\n $this->db->from(TBL_HOOKUPS);\n $this->db->join(TBL_HOOKUP_REQUESTS,TBL_HOOKUPS.'.request_id = '.TBL_HOOKUP_REQUESTS.'.id');\n $this->db->join(TBL_PAYMENTS,TBL_HOOKUPS.'.payment_id = '.TBL_PAYMENTS.'.id');\n }", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "public function addJoinUser(\\Ophp\\SqlQueryBuilder_Select $query, $onColumn) {\n\t\t$query->join('LEFT JOIN `user` ON `user`.`user_id` = ' . $onColumn)\n\t\t\t\t->select('user.name as username');\n\t\treturn $query;\n\t}", "protected function applyPrejoin($query)\n {\n if (count($this->prejoin)>0) {\n foreach ($this->prejoin as $prejoin) {\n $DBColumn = QueryColumnFactoryStorage::byValueKey($prejoin);\n\n if (!$DBColumn->isFetchable()) {\n continue;\n }\n\n if ($DBColumn->needsJoin()) {\n $query->join($DBColumn);\n }\n }\n }\n }", "public function getJoinCondition() {}" ]
[ "0.75580126", "0.723384", "0.6936638", "0.68953705", "0.67973894", "0.67409563", "0.6729952", "0.66230464", "0.6607875", "0.64992785", "0.6400107", "0.6260476", "0.6236505", "0.6222576", "0.6211636", "0.61573154", "0.6120269", "0.61052996", "0.60741925", "0.6011203", "0.59848565", "0.5945651", "0.5917231", "0.59027374", "0.588534", "0.5844997", "0.5838454", "0.58210444", "0.58128923", "0.57909155", "0.5746129", "0.5727188", "0.57185805", "0.5693562", "0.5639023", "0.5634592", "0.55549026", "0.5538141", "0.55351156", "0.5509744", "0.5509299", "0.5473491", "0.5464184", "0.54527825", "0.54406226", "0.54303", "0.54129255", "0.5402995", "0.5394151", "0.5366638", "0.53569937", "0.5351952", "0.5317494", "0.53060627", "0.5273156", "0.52360874", "0.523352", "0.5219088", "0.52032036", "0.5188714", "0.51354754", "0.5128767", "0.5118284", "0.50922096", "0.507363", "0.5062563", "0.5012951", "0.5012315", "0.50019306", "0.49994555", "0.49830502", "0.49804327", "0.4976526", "0.4964232", "0.4953508", "0.49351865", "0.4931426", "0.4923263", "0.49169746", "0.49094498", "0.487699", "0.4875511", "0.48710316", "0.48709813", "0.486605", "0.4865622", "0.4865302", "0.48604056", "0.48487964", "0.48281965", "0.48232973", "0.4814737", "0.48143953", "0.48062056", "0.4805167", "0.47948903", "0.47940907", "0.4790696", "0.47843423", "0.47675386" ]
0.6800365
4
Register new FULL JOIN with set of on conditions (linking one table to another, no parametric on conditions allowed here).
public function fullJoin($table, $on = null) { $this->joinTokens[$this->activeJoin = $table] = ['type' => 'FULL', 'on' => []]; return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fullOuterJoin($table);", "public function leftJoin($table, $conditions = []);", "public function join($table, $on, $field = null, $comparitor = null);", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "public function rightJoin($table, $conditions = []);", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function leftOuterJoin($table);", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function leftJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'LEFT', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "protected function _addJoin($type, $table, $fields, $on = []) {\n $repo = $this->getRepository();\n $join = new Join($type);\n $conditions = [];\n\n if (is_array($table)) {\n $alias = $table[1];\n $table = $table[0];\n } else {\n $alias = $table;\n }\n\n foreach ($on as $pfk => $rfk) {\n if (strpos($pfk, '.') === false) {\n $pfk = $repo->getAlias() . '.' . $pfk;\n }\n\n if (strpos($rfk, '.') === false) {\n $rfk = $alias . '.' . $rfk;\n }\n\n $conditions[$pfk] = $rfk;\n }\n\n $this->_joins[] = $join->from($table, $alias)->on($conditions)->fields($fields);\n\n return $this;\n }", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function leftJoin(\n $joined,\n $on = null,\n $fields = [],\n $additionalJoins = [],\n $grouped = false,\n $iterator = null\n ) {\n $relations = explode('~', $joined, 2);\n $modelClass = $relations[0];\n if (!class_exists($modelClass)) {\n throw new Exceptions\\ModelNotFoundException($modelClass);\n }\n if (count($relations) === 2) { // Index\n throw new Exceptions\\UnsupportedActionException('Cannot perform LEFT JOIN <index>');\n } else {// Model\n if (is_string($on)) {\n $on = new Expressions\\Conditions\\Generic($on, null, $this);\n }\n $this->withVirtualFields(\n $fields,\n function ($model, $field) use ($modelClass, $joined, $on, $grouped, $additionalJoins) {\n $mongoNotationOn = $on->mongoNotation;\n $modelName = ClassFinder::getClassBasename(get_class($this));\n\n $queryData = [];\n $fieldsInConditions = [];\n // @TODO: optimization: move this out of the callback\n $joinedModelKey = null;\n foreach ($mongoNotationOn as $left => $right) {\n // @TODO: nested conditions\n $leftField = (new \\Zer0\\Model\\Subtypes\\Field($left))->parseName();\n if ($right instanceof \\Zer0\\Model\\Subtypes\\Field) {\n // Field - Field predicate\n $rightField = $right->parseName();\n\n // If 'base.field = joined.field'\n if (isset($leftField['model']) && $modelName === $leftField['model']) {\n // then reverse it\n unset($mongoNotationOn[$left]);\n $mongoNotationOn[(string)$right] = new \\Zer0\\Model\\Subtypes\\Field($left);\n [$left, $right] = [$right, $left];\n [$leftField, $rightField] = [$rightField, $leftField];\n }\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] =\n new \\Zer0\\Model\\Subtypes\\Placeholder(count($queryData));\n // Base (right) model values to pass to where() on joined model\n if (is_array($model)) {\n throw new \\Exception('generic model array problem');\n }\n $queryData[] = $model->values($rightField['name']);\n $fieldsInConditions[] = $rightField['name'];\n $joinedModelKey = $leftField['name'];\n } else {\n // Field - Value predicate\n unset($mongoNotationOn[(string)$left]);\n $mongoNotationOn[$leftField['name']] = $right;\n }\n }\n\n $origModelKey = $fieldsInConditions[0]; // @TODO: foreach\n $on->setValues($queryData);\n $on = $on->mutateWithMongoNotation($mongoNotationOn);\n $joinedData = [];\n\n // Fetch data from joined model\n $models = $modelClass::where((string)$on, $on->getValues());\n if (isset($additionalJoins) && count($additionalJoins)) {\n foreach ($additionalJoins as $joinItem) {\n $models = $models->withVirtualFields($joinItem);\n }\n }\n $models = $models->load();\n foreach ($models as $item) {\n if ($grouped) {\n if (!isset($joinedData[$item[$joinedModelKey]])) {\n $joinedData[$item[$joinedModelKey]] = [];\n }\n $joinedData[$item[$joinedModelKey]] [] = $item;\n } else {\n $joinedData[$item[$joinedModelKey]] = $item;\n }\n }\n if ($grouped) {\n foreach ($model->values($joinedModelKey) as $k) {\n if (!isset($joinedData[$k])) {\n $joinedData[$k] = [];\n }\n }\n }\n $model->addDataFromJoin(\n $origModelKey,\n $joinedData,\n $field\n );\n },\n $iterator\n );\n }\n return $this;\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "public function leftJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::LEFT, $table, $fields, $on);\n }", "function joinQuery()\n {\n }", "public function setRelationshipMultiCondition($parameters)\n {\n foreach ($parameters as $parameter) {\n $sourceTable = $parameter['table'];\n $sourceColumn = $parameter['table'] . \".\" . $parameter['index'];\n $destinationColumn = $parameter['foreign'];\n $this->Model = $this->Model->join($sourceTable, $sourceColumn, \"=\", DB::raw($destinationColumn), \"LEFT\");\n }\n }", "public function left_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('left join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "function getJoinCondition() ;", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "public function rightOuterJoin($table);", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function join($tables, $overwrite = false);", "public function getMockJoin ( $table, $on = null )\n {\n return $this->getMock(\n '\\r8\\Query\\Join',\n array('getJoinType'),\n array( $table, $on )\n );\n }", "function return_join_table_data($rt_or_left_or_none,$tableleft,$tableright,$on_a_and_b,$whereby=null,$orderby=null,$returnrows=\"a.*,b.*\") {\n\t$q = \"\n\tSELECT \".$returnrows.\"\n\tFROM \".$tableleft.\" AS a \".$rt_or_left_or_none.\" JOIN \".$tableright.\" AS b ON \".$on_a_and_b.\" \n\t\".$whereby.\" \n\t\".$orderby.\" \n\t\";\n\t//echo $q;\n\t$r = mysql_query($q) or die(\"return_join_table_data($rt_or_left_or_none,$tableleft,$tableright): \".mysql_error());\n\treturn check_results($r);\n}", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function innerJoin($table, $conditions = []);", "protected function _addJoinTables()\n {\n $this->addTable('gems__respondents', array('gap_id_user' => 'grs_id_user'));\n\n if ($this->has('gap_id_organization')) {\n $this->addTable(\n 'gems__organizations',\n array('gap_id_organization' => 'gor_id_organization'),\n 'gor',\n false\n );\n }\n if ($this->has('gap_id_attended_by')) {\n $this->addLeftTable(\n 'gems__agenda_staff',\n array('gap_id_attended_by' => 'gas_id_staff'),\n 'gas',\n false\n );\n }\n /*\n if ($this->has('gap_id_referred_by')) {\n $this->addLeftTable(\n array('ref_staff' => 'gems__agenda_staff'),\n array('gap_id_referred_by' => 'ref_staff.gas_id_staff')\n );\n } // */\n if ($this->has('gap_id_activity')) {\n $this->addLeftTable(\n 'gems__agenda_activities',\n array('gap_id_activity' => 'gaa_id_activity'),\n 'gap',\n false\n );\n }\n if ($this->has('gap_id_procedure')) {\n $this->addLeftTable(\n 'gems__agenda_procedures',\n array('gap_id_procedure' => 'gapr_id_procedure'),\n 'gapr',\n false\n );\n }\n if ($this->has('gap_id_location')) {\n $this->addLeftTable(\n 'gems__locations',\n array('gap_id_location' => 'glo_id_location'),\n 'glo',\n false\n );\n }\n }", "public static function leftJoin($source, $on, $alias = null, array $bindings = []);", "function cf_search_join($join) {\n global $wpdb;\n\n if (is_search()) {\n $join .=' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "public function getJoinCondition() {}", "function cf_search_join( $join ) {\n global $wpdb;\n if ( is_search() ) {\n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n return $join;\n}", "public function outer($table, $on, $field = null, $comparitor = null);", "public function leftJoin($table, $key, ?string $operator = null, $foreign = null);", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "function cf_search_join( $join ) {\n global $wpdb;\n\n if ( is_search() ) { \n $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n }\n\n return $join;\n}", "function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "abstract protected function appendJoins(QueryBuilder $queryBuilder);", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "function cf_search_join( $join ) {\n\t global $wpdb;\n\n\t if ( is_search() ) { \n\t $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t }\n\t \n\t return $join;\n\t}", "function cf_search_join( $join ) {\n\t\tglobal $wpdb;\n\n\t\tif ( is_search() ) {\n\t\t\t$join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\t\t}\n\n\t\treturn $join;\n\t}", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "private function _hookup_joins($include_phone=FALSE)\n {\n $select = TBL_HOOKUPS.'.*,';\n \n $select .= TBL_HOOKUP_REQUESTS.'.user_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.hookup_id,'; \n $select .= TBL_HOOKUP_REQUESTS.'.is_accepted,'; \n $select .= TBL_HOOKUP_REQUESTS.'.date_requested,'; \n\n $select .= TBL_PAYMENTS.'.*';\n\n $this->db->select($select);\n $this->db->from(TBL_HOOKUPS);\n $this->db->join(TBL_HOOKUP_REQUESTS,TBL_HOOKUPS.'.request_id = '.TBL_HOOKUP_REQUESTS.'.id');\n $this->db->join(TBL_PAYMENTS,TBL_HOOKUPS.'.payment_id = '.TBL_PAYMENTS.'.id');\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function right_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('right join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "public function on( $on ) {\n $this->_lastOn = $on;\n $this->_currentImplement['join'][count( $this->_currentImplement['join']) - 1] += array('on' => $on );\n return $this;\n }", "public function create_join_table($model_one, $model_two) {\n $table_name = NimbleAssociation::generate_join_table_name(array($model_one, $model_two));\n $table = $this->create_table($table_name, array('id' => false));\n $table->references($model_one);\n $table->references($model_two);\n $table->go();\n }", "public function join($table, $on, $type){\n\t\t$this->joins[] = array($table, $on, $type);\n\t\treturn $this;\n\t}", "public function leftJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_leftJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "protected function performJoinForEloquentPowerJoinsForHasMany()\n {\n return function ($builder, $joinType, $callback = null, $alias = null, bool $disableExtraConditions = false) {\n $joinedTable = $alias ?: $this->query->getModel()->getTable();\n $parentTable = $this->getTableOrAliasForModel($this->parent, $this->parent->getTable());\n\n $builder->{$joinType}($this->query->getModel()->getTable(), function ($join) use ($callback, $joinedTable, $parentTable, $alias, $disableExtraConditions) {\n if ($alias) {\n $join->as($alias);\n }\n\n if (is_array($this->foreignKey)) {\n foreach ($this->foreignKey as $i => $fk) {\n $join->on(\n $fk,\n '=',\n \"{$parentTable}.{$this->localKey[$i]}\"\n );\n }\n } else {\n $join->on(\n $this->foreignKey,\n '=',\n \"{$parentTable}.{$this->localKey}\"\n );\n }\n\n if ($disableExtraConditions === false && $this->usesSoftDeletes($this->query->getModel())) {\n $join->whereNull(\n \"{$joinedTable}.{$this->query->getModel()->getDeletedAtColumn()}\"\n );\n }\n\n if ($disableExtraConditions === false) {\n $this->applyExtraConditions($join);\n }\n\n if ($callback && is_callable($callback)) {\n $callback($join);\n }\n }, $this->query->getModel());\n };\n }", "public function ADD_ON($left_right_map, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$left_field_name = key($left_right_map);\n\t\t$right_field_name = current($left_right_map); \n\t\treturn $this->ON($left_field_name, $right_field_name, $left_table_offset, $right_table_offset);\n\t}", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "public function crossJoin($table);", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "function sql_leftJoin(){\n\t\t$dbconnection = $this->db_connect();\n\t\tif($dbconnection !=1)\n\t\t{\n\t\t\t$result=\"MySql Connection Error\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//LIST OF SELECTIONS\n\t\t\t//INSTEAD of a listOfFields I need a listOfSelections like \"db.tbl_1.fld_1\"\n\t\t\t// a_selections = array(\"db.tbl_1.fld_1\",\"db.tbl_1.fld_2\",\"db.tbl_2.fld_1\");\n\t\t\t\n\t\t\tif($this->a_fields !=\" \"){\n\t\t\t\t$a_selections = $this->arraySELECTIONS($this->db,$this->table,$this->a_fields);\n\t\t\t}else{\n\t\t\t\t$a_selections = $this->db.\".\".$this->table.\" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->a_fields2 !=\" \"){\n\t\t\t\t$a_selections2 = $this->arraySELECTIONS($this->db2,$this->table2,$this->a_fields2);\n\t\t\t}else{\n\t\t\t\t$a_selections2 = $this->db2.\".\".$this->table2.\" *\";\n\t\t\t}\n\t\t\t\n \t\t\t$listOfSelections = $this->arrayFieldsToList($a_selections);\n\t\t\t$listOfSelections2 = $this->arrayFieldsToList($a_selections2);\n\t\t\t\n \t\t\t$sql = mysql_query(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n\t\t\t\n \t\t\t //echo(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n \t\t\t\tif (mysql_num_rows($sql) > 0) \n\t\t\t \t{\n\t\t\t \twhile ($row = mysql_fetch_assoc($sql)) \n\t\t\t \t{\n\t\t\t \t$a_data[]=$row ;\n\t\t\t \t}\n\t\t \t\t$result= $a_data;\t\n\t\t\t\t}else{\n\t\t\t\t\t$result=\"NO DATA AVAILABLE\";\n\t\t\t\t}\n\t\t}\n\t\treturn $result;\n\t\n\t}", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "private function makeRelationBetweenCategoryAndDummyTable() {}", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function makeSearchJoin($join)\n {\n global $wpdb;\n\n if (is_search()) {\n\n $join .= ' LEFT JOIN ' . $wpdb->postmeta . ' ON ' . $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';\n\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $join .= \" LEFT JOIN $wpdb->postmeta as $values ON $wpdb->posts.ID = $values.post_id\";\n\n }\n }\n\n }\n\n return $join;\n }", "public function rightJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'RIGHT', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "function joined(Illuminate\\Database\\Eloquent\\Builder $builder, string $table): bool\n {\n foreach ((array) $builder->getQuery()->joins as $join) {\n if ($join->table === $table) {\n return true;\n }\n }\n\n return false;\n }", "public function joinComplex( $table, $condition, $joint = null )\n {\n $table = $this->addTable($table);\n $this->addJoint($table, $condition, $joint);\n return $this;\n }", "public function innerJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'INNER', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "protected function formJoinsUsingFilters(&$builder)\n {\n $this->join_models = [];\n foreach ($this->filters as $filter){\n $field_parts = explode('.', $filter[self::FILTER_PARAM_FIELD]);\n if (count($field_parts) > 1) {\n unset($field_parts[count($field_parts) - 1]);\n $this->formJoins($builder, $field_parts);\n }\n }\n }", "public function rightJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::RIGHT, $table, $fields, $on);\n }", "public final function addJoin($tbl, $as, $by, $condition, $reset=false)\n {\n if ($reset==true)\n \t$this->join = array();\n\n $this->join[] = array(\n 'tbl' => $tbl,\n 'as' => $as,\n 'by' => $by,\n 'cond' => $condition\n );\n\n return $this;\n }", "protected function addSimpleJoint($table, $leftCol, $rightCol, $joint = null)\n {\n $this->addJoint($table, new Condition('AND', [$leftCol, $rightCol], $this), $joint);\n }", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "public function join($builder, $relation, $model = null, $method = 'leftJoin')\n {\n $model = $model ?? $builder->getModel();\n\n if ($builder instanceof \\Illuminate\\Database\\Eloquent\\Relations\\Relation) {\n $builder = $builder->getQuery();\n }\n \n\n $relations = explode('.', $relation);\n\n $currentTableAlias = $model->getTable();\n $basePrimaryKey = $model->getKeyName();\n\n $currentModel = $model;\n\n foreach ($relations as $i => $relation) {\n $relatedRelation = $currentModel->$relation();\n $relatedRelation::noConstraints(function () use ($relation, &$currentModel, &$currentTableAlias, $relations, $i, $method, $builder) {\n $relatedRelation = $currentModel->$relation();\n $relatedModel = $relatedRelation->getRelated();\n $relationName = $this->parseAlias(array_slice($relations, 0, $i + 1));\n\n $joinQuery = $relatedModel->getTable().($relatedModel->getTable() !== $relationName ? ' as '.$relationName : '');\n\n // @TODO, check if same joinQuery is already in $builder\n foreach ($this->getResolvers()->toArray() as $key => $resolverClass) {\n if ($relatedRelation instanceof $key) {\n $resolver = new $resolverClass;\n\n $resolver\n ->setRelationName($relationName)\n ->setMethod($method)\n ->setRelation($relatedRelation)\n ->setSourceTable($currentTableAlias)\n ->setTargetTable($relationName)\n ;\n\n $resolver->resolve($builder);\n\n break; //uhm..........\n }\n }\n\n $currentModel = $relatedModel;\n $currentTableAlias = $relationName;\n });\n }\n }", "private function makeJoins(ParseLoop $parse, $join)\n {\n $model = ModelTools::buildModelName($join['REFERENCED_TABLE_NAME']);\n $parse->setData('joins', [\n 'tablejoin' => $model,\n 'table' => $model . '::TABLE',\n 'leftcol' => $this->classname . '::' . ModelTools::getFieldConstant($this->table, $join['COLUMN_NAME']),\n 'rightcol' => $model . '::' . ModelTools::getFieldConstant($join['REFERENCED_TABLE_NAME'], $join['REFERENCED_COLUMN_NAME'])\n \n ]);\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public static function rightJoin($source, $on, $alias = null, array $bindings = []);", "public function leftJoin($table, $condition)\n {\n return $this->addJoin($table, $condition, 'LEFT');\n }", "function GetJoins() { return array(); }", "public function groupJoin($values);", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "function custom_search_join($join) {\r\n if ( is_search() && isset($_GET['s'])) {\r\n global $wpdb;\r\n $join = \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id \";\r\n }\r\n return($join);\r\n}", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "public function getRelationTableForJoin($fullName) {\n if (!$this->tableName) {\n $class = $this->model;\n $this->tableName = $class::getTableName();\n }\n return \"`\" . $this->tableName . \"` as `\" . ($this->tableAlias = str_replace('.', '_', $fullName)) . \"`\";\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "function query() {\n dpm($this);\n $this->ensure_my_table();\n\n // First, relate our current table to the link table via the field\n $first = array(\n 'left_table' => $this->table_alias,\n 'left_field' => $this->field, // @TODO real_field?\n 'table' => $this->definition['link table'],\n 'field' => $this->definition['link field'],\n );\n\n if (!empty($this->options['required'])) {\n $first['type'] = 'INNER';\n }\n\n if (!empty($this->definition['link_join_extra'])) {\n $first['extra'] = $this->definition['link_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $first_join = new $this->definition['join_handler'];\n }\n else {\n $first_join = new views_join();\n }\n $first_join->definition = $first;\n $first_join->construct();\n $first_join->adjusted = TRUE;\n\n $this->first_alias = $this->query->add_table($this->definition['link table'], $this->relationship, $first_join);\n\n // Second, relate the link table to the entity specified using\n // the specified base fields on the base and link tables.\n $second = array(\n 'left_table' => $this->first_alias,\n 'left_field' => $this->definition['base link field'],\n 'table' => $this->definition['base'],\n 'field' => $this->definition['base field'],\n );\n\n if (!empty($this->options['required'])) {\n $second['type'] = 'INNER';\n }\n\n if (!empty($this->definition['base_join_extra'])) {\n $second['extra'] = $this->definition['base_join_extra'];\n }\n\n if (!empty($this->definition['join_handler']) && class_exists($this->definition['join_handler'])) {\n $second_join = new $this->definition['join_handler'];\n }\n else {\n $second_join = new views_join();\n }\n $second_join->definition = $second;\n $second_join->construct();\n $second_join->adjusted = TRUE;\n\n // use a short alias for this:\n // @TODO real_field?\n $alias = $this->field . '_' . $this->definition['base'];\n\n $this->alias = $this->query->add_relationship($alias, $second_join, $this->definition['base'], $this->relationship);\n }", "public function canAutoJoin()\n {\n return ($this instanceof SingleRelation);\n }", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "function makeCompatible($dbAndTable1, $dbAndTable2, $notCompatArr){\n\n\n\n}" ]
[ "0.5942434", "0.5643703", "0.55640864", "0.55603325", "0.5541785", "0.53078884", "0.5291819", "0.5225621", "0.5197811", "0.51808584", "0.51302886", "0.51093346", "0.5107836", "0.5074838", "0.50630224", "0.50248724", "0.49944013", "0.49753523", "0.49329835", "0.49230638", "0.49138245", "0.4893548", "0.48798567", "0.48795575", "0.4862953", "0.48553392", "0.4837014", "0.4830115", "0.48246518", "0.4810775", "0.48086336", "0.479039", "0.47857195", "0.47808516", "0.4774157", "0.47690186", "0.4767728", "0.4762005", "0.4756684", "0.4734839", "0.47339317", "0.47308528", "0.47185406", "0.47167382", "0.4714891", "0.4703006", "0.46943694", "0.46942902", "0.46936613", "0.46891612", "0.46581128", "0.46565777", "0.4640204", "0.4638594", "0.46380442", "0.46355987", "0.45876917", "0.4567842", "0.4567557", "0.45669752", "0.45668164", "0.45524365", "0.4545523", "0.45208916", "0.4512257", "0.45019874", "0.44946218", "0.44935343", "0.44884574", "0.44866022", "0.44723344", "0.44691697", "0.4466883", "0.44651186", "0.44590166", "0.44525358", "0.4445601", "0.4444099", "0.4439644", "0.44264337", "0.44169912", "0.44076586", "0.4404554", "0.43956167", "0.438067", "0.4376966", "0.43672922", "0.43578368", "0.43519428", "0.43513843", "0.4344833", "0.4338865", "0.43125686", "0.4291739", "0.42848572", "0.42815483", "0.42768124", "0.4271569", "0.42711222", "0.42692742" ]
0.64135015
0
Simple ON condition with various set of arguments. Can only be used to link column values together, no parametric values allowed.
public function on($joined = null, $operator = null, $outer = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->onWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function on($column1,$column2,$operator = \"=\");", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function andOn(array|string $column, string $op = null, array|string $value = null): void\n {\n call_user_func_array([$this, 'on'], func_get_args());\n }", "function getJoinCondition() ;", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function getJoinCondition() {}", "public function on(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'AND'];\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function join($table, $on, $field = null, $comparitor = null);", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "public function leftJoin($table, $conditions = []);", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function join($table, $condition = null, $type = 'LEFT', $escape = null)\n {\n if ($type !== '') {\n $type = strtoupper(trim($type));\n\n if ( ! in_array($type, ['LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'], true)) {\n $type = '';\n } else {\n $type .= ' ';\n }\n }\n\n // Extract any aliases that might exist. We use this information\n // in the protectIdentifiers to know whether to add a table prefix\n $this->trackAliases($table);\n\n is_bool($escape) || $escape = $this->conn->protectIdentifiers;\n\n if ( ! $this->hasOperator($condition)) {\n $condition = ' USING (' . ($escape\n ? $this->conn->escapeIdentifiers($condition)\n : $condition) . ')';\n } elseif ($escape === false) {\n $condition = ' ON ' . $condition;\n } else {\n // Split multiple conditions\n if (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $condition, $joints, PREG_OFFSET_CAPTURE)) {\n $conditions = [];\n $joints = $joints[ 0 ];\n array_unshift($joints, ['', 0]);\n\n for ($i = count($joints) - 1, $pos = strlen($condition); $i >= 0; $i--) {\n $joints[ $i ][ 1 ] += strlen($joints[ $i ][ 0 ]); // offset\n $conditions[ $i ] = substr($condition, $joints[ $i ][ 1 ], $pos - $joints[ $i ][ 1 ]);\n $pos = $joints[ $i ][ 1 ] - strlen($joints[ $i ][ 0 ]);\n $joints[ $i ] = $joints[ $i ][ 0 ];\n }\n } else {\n $conditions = [$condition];\n $joints = [''];\n }\n\n $condition = ' ON ';\n for ($i = 0, $c = count($conditions); $i < $c; $i++) {\n $operator = $this->getOperator($conditions[ $i ]);\n $condition .= $joints[ $i ];\n $condition .= preg_match(\n \"/(\\(*)?([\\[\\]\\w\\.'-]+)\" . preg_quote($operator) . \"(.*)/i\",\n $conditions[ $i ],\n $match\n )\n ? $match[ 1 ] . $this->conn->protectIdentifiers(\n $match[ 2 ]\n ) . $operator . $this->conn->protectIdentifiers($match[ 3 ])\n : $conditions[ $i ];\n }\n }\n\n // Do we want to escape the table name?\n if ($escape === true) {\n $table = $this->conn->protectIdentifiers($table, true, null, false);\n }\n\n // Assemble the JOIN statement\n $this->builderCache->join[] = $type . 'JOIN ' . $table . $condition;\n\n return $this;\n }", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "function __construct(\\entity $e, array $foreigns, $type='INNER JOIN'){\n //\n //Every join must have a type which is a string i.e inner join \n //outer join etc\n $this->type=$type;\n //\n //Get the join \n $this->entity= $e;\n //\n $this->foreigns=$foreigns;\n //\n //Formulate the on clauses \n $this->ons= $this->get_ons();\n }", "public function left_join($table, $on=null)\n {\n $alias = null;\n\n if (is_string($table) && strpos($table, ' ') && !preg_match('/^\\s*\\(/i', $table))\n {\n list ($table, $alias) = preg_split('/\\s+/', trim($table));\n $table = self::quote_name($table);\n }\n\n $args = func_get_args(); array_shift($args);\n $clause = call_user_func_array('self::clause', $args);\n\n $this->join[] = sprintf('left join '. $table .($alias ? ' '.$alias:'') . ' on ' . $clause);\n\n return $this;\n }", "public function getJoinExpression();", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function join(\n $table,\n $column1,\n $operator,\n $column2,\n $type\n );", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function addAcfCondition($chain, $arguments, &$array)\n {\n $table_pm = $this->addAcfJoint();\n $condition = $this->addComplexCondition($chain, $array)->where($table_pm->alias . '.meta_key', $arguments[0]);\n $arguments[0] = $table_pm->alias . '.meta_value';\n call_user_func_array([$condition, 'where'], $arguments);\n }", "public function straightJoin($table, array $fields, array $on = []) {\n return $this->_addJoin(Join::STRAIGHT, $table, $fields, $on);\n }", "public function leftJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'LEFT', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "function clause_mode() {\n return 'AND';\n }", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function join($table, $condition = [], $join = '')\n\t{\n\t\tif(count($condition) == 3)\n\t\t\t$this->_query .= strtoupper($join) . // convert $join to upper case (left -> LEFT)\n\t\t\t\t\" JOIN {$table} ON {$condition[0]} {$condition[1]} {$condition[2]}\";\n\n\t\t// that's it now return object from this class\n\t\treturn $this;\n }", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = []);", "public function setViaTableCondition($value);", "public function getViaTableCondition();", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public static function leftJoin($source, $on, $alias = null, array $bindings = []);", "public function leftJoin($table, $key, ?string $operator = null, $foreign = null);", "function outerJoin($conditions)\n\t{\n\t\treturn $this->join('OUTER', $conditions);\n\t}", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "protected function addCondition($condition, $one)\n {\n // query by primary key\n if($one && !empty($condition) && !is_array($condition))\n {\n $this->andWhere(static::primaryKey() . '=:id', [':id'=>$condition]);\n }\n elseif(!empty($condition))\n {\n foreach($condition as $key => $value)\n {\n if(is_array($value))\n $this->andWhere(['in', $key, $value]);\n else\n $this->andWhere($key . \"=:value$key\", [\":value$key\" => $value]);\n }\n }\n }", "public function set_join($table_or_alias, $on = null, $type='LEFT')\n { \n $table = $this->getJoinableTable($table_or_alias);\n if(!$this->is_used_table($table))\n {\n $table = (MormConf::isInConf($table_or_alias)) ? $this->add_table($table_or_alias) : $this->add_table($table);\n $this->join_tables[] = $table;\n }\n if(!is_null($on))\n {\n $tables = array_keys($on);\n $this->joins[] = array(array($tables[0] => $tables[1]), $on);\n }\n else\n {\n $key = $this->base_models[$this->base_table]->getForeignKeyFrom($table_or_alias);\n try\n {\n $ft_key = $this->base_models[$this->base_table]->getForeignTableKey($key);\n }\n catch (Exception $e)\n {\n if($this->base_models[$this->base_table]->isForeignUsingTable ($table))\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsUsingKey($table);\n else\n $ft_key = $this->base_models[$this->base_table]->getForeignMormonsKey($table);\n }\n $this->joins[] = array(array($this->base_table => $table), array($this->base_table => $key, $table => $ft_key));\n }\n //@todo put executed tu false only when join has changed\n $this->_executed = false;\n // switch($type)\n // {\n // case 'LEFT':\n // break;\n // case 'RIGHT':\n // break;\n // default:\n // throw new Exception(\"The join type \".$type.\" does not exist or is not yet supported by Mormons\");\n // break;\n // }\n }", "public function leftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function on($c1, $op, $c2)\n {\n if (!empty($this->using)) {\n throw new QuarkException('JOIN ... ON ... cannot be combined with JOIN ... USING ...');\n }\n\n $this->on[] = array($c1, $op, $c2);\n\n return $this;\n }", "public function join($table, $key, ?string $operator = null, $foreign = null, string $type = self::INNER_JOIN);", "public function join($type, $table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => strtoupper($type), 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 2));\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "public function orOn(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'OR'];\n }", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function outerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "public function fullJoin($table, $on = null)\n {\n $this->joinTokens[$this->activeJoin = $table] = ['type' => 'FULL', 'on' => []];\n\n return call_user_func_array([$this, 'on'], array_slice(func_get_args(), 1));\n }", "public function testBuildJoinDefault()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id',\n $query->buildJoin()\n );\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "function map($column){\n //\n //Get the entity name\n $entity=$column->get_parent();\n $ename=$entity->name;\n //\n //Get the cname\n $cname=$column->name;\n //\n //Get the referenced table name \n $ref=$column->ref_table_name;\n //\n //Return a string version of the on clause\n return\"\\t{$ename}.{$cname}={$ref}.{$ref}\\t\";\n }", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function on( $on ) {\n $this->_lastOn = $on;\n $this->_currentImplement['join'][count( $this->_currentImplement['join']) - 1] += array('on' => $on );\n return $this;\n }", "public function testImplicitJoinWithCartesianProductAndConditionInWhere(): void\n {\n $this->assertValidDQL('SELECT u, a FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u, Doctrine\\Tests\\Models\\CMS\\CmsArticle a WHERE u.name = a.topic');\n }", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "public function findOne($condition = [], $params = [], $mode = PDO::FETCH_ASSOC){\n\t\t$this->beforeFind();\n\t\t$tableName = $this->tableName();\n\t\t$tables = $tableName;\n\t\t$sql = '';\n\t\t$bindValues = [];\n\n\t\tif(is_array($condition)){\n\t\t\tforeach($condition as $key => $value){\n\t\t\t\tif(is_array($value)){\n\t\t\t\t\t$sql .= $tableName . '.' . $key . ' IN (';\n\t\t\t\t\tforeach($value as $inKey => $inValue){\n\t\t\t\t\t\t$sql .= ':' . $key . $inKey;\n\t\t\t\t\t\tif($inKey !== array_key_last($value)) $sql .= ', ';\n\t\t\t\t\t\t$bindValues[':' . $key . $inKey] = $inValue;\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= ') ';\n\t\t\t\t} else {\n\t\t\t\t\t$sql .= $tableName . '.' . $key . ' = :' . $key . ' ';\n\t\t\t\t\t$bindValues[':' . $key] = $value;\n\t\t\t\t}\n\t\t\t\tif($key !== array_key_last($condition)) $sql .= 'AND ';\n\t\t\t}\n\t\t} else {\n\t\t\t$primary = $this->getPrimaryKey();\n\t\t\t$sql = $tableName . '.' . $primary . ' = :' . $primary . ' ';\n\t\t\t$bindValues[':' . $primary] = $condition;\n\t\t}\n\n\t\t// If there is orderBy param. Note: column name strings cannot be set as placeholders (column order numbers could though)\n\t\t// so model column names are used as a filter check to permit the passing of a string value to the statement.\n\t\tif(array_key_exists('orderBy', $params)){\n\t\t\t// Make sure the column name exists in model and direction is ASC or DESC\n\t\t\tif(property_exists($this, $params['orderBy'][0]) ){\n\t\t\t\t$sql .= ' ORDER BY ' . $params['orderBy'][0];\n\t\t\t\tif(strtolower($params['orderBy'][1]) === 'asc') $sql .= ' ASC';\n\t\t\t\telse if(strtolower($params['orderBy'][1]) === 'desc') $sql .= ' DESC';\n\t\t\t}\n\t\t}\n\n\t\t// Join related table.\n\t\tif(array_key_exists('join', $params)){\n\t\t\t$relation = $this->relations()[$params['join']];\n\t\t\t// Many-to-many relation between tables.\n\t\t\tif($relation[0] == 'manyToMany'){\n\t\t\t\t// Get relation table models and instantiate.\n\t\t\t\trequire_once(APPROOT . 'models/' . $relation[1] . '.php');\n\t\t\t\t$relatedTable = new $relation[1];\n\t\t\t\trequire_once(APPROOT . 'models/' . $relation[2] . '.php');\n\t\t\t\t// Get tale names and build inner joins.\n\t\t\t\t$joinTable = new $relation[2];\n\t\t\t\t$joinTableName = $joinTable->tableName();\n\t\t\t\t$relatedTableName = $relatedTable->tableName();\n\t\t\t\t$tables .= ' INNER JOIN ' . $joinTableName . ' ON ' . $tableName . '.' . $relation[3] . ' = ' . $joinTableName . '.' . $relation[3];\n\t\t\t\t$tables .= ' INNER JOIN ' . $relatedTableName . ' ON ' . $joinTableName . '.' . $relation[4] . ' = ' . $relatedTableName . '.' . $relation[4];\n\t\t\t}\n\t\t}\n\n\t\t$statement = $this->db->prepare('SELECT * FROM ' . $tables . ' WHERE ' . $sql . ' LIMIT 1');\n\t\tforeach($bindValues as $key => $value){\n\t\t\t$this->binder($statement, $key, $value);\n\t\t}\n\t\ttry {\n\t\t\t$statement->execute();\n\t\t} catch (Exception $e){\n\t\t\techo $e->getMessage();\n\t\t}\n\t\t$result = $statement->fetch($mode);\n\t\t$this->afterFind($result);\n\t\treturn $result;\n\t}", "public function orWhere($table,$column,$data = \"\");", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function onWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "public function innerJoin($table, $conditions = []);", "public function __construct() {\n\t\tparent::__construct();\n\t\t\n\t\t$this->sqlConditionJoins = \", wcf\".WCF_N.\"_user_notification_event_to_user event_to_user\";\n\t\t$this->getConditionBuilder()->add(\"event_to_user.userID = user_table.userID\");\n\t}", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "public function equiJoinCondition($selector1Name, $property1Name, $selector2Name, $property2Name);", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "public function addOuterJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function __construct($glue = 'AND')\n {\n if (($glue !== self::SQL_AND) &&\n ($glue !== self::SQL_OR) &&\n ($glue !== self::SQL_XOR)\n ) {\n /**\n * @see Brvr_Db_Query_WhereCondition_Exception\n */\n require_once 'Brvr/Db/Query/WhereCondition/Exception.php';\n throw new Brvr_Db_Query_WhereCondition_Exception('Only \\'AND\\', '\n . '\\'OR\\' or \\'XOR\\' are valid for the \\'glue\\' parameter');\n }\n $this->_glue = $glue;\n }", "public function join($table, $column_one = null, $column_two = null, $type = '')\r\n {\r\n if (func_num_args() < 3) {\r\n @list($query, $params) = func_get_args();\r\n\r\n $params = (array) $params;\r\n\r\n $this->join[] = compact('query', 'params');\r\n\r\n $this->add_bind('join', $params);\r\n }\r\n\r\n else {\r\n $this->join[] = compact('table', 'column_one', 'column_two', 'type');\r\n }\r\n\r\n return $this;\r\n }", "public function or_on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'OR');\n return $this;\n }", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function andOn($joined = null, $operator = null, $outer = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->onWrapper()\n );\n\n return $this;\n }", "function _buildAttributeQuery($glue, $criteria, $join = false)\n {\n /* Initialize the clause that we're building. */\n $clause = '';\n\n /* Get the table alias to use for this set of criteria. */\n if ($join) {\n $alias = $this->_getAlias(true);\n } else {\n $alias = $this->_getAlias();\n }\n\n foreach ($criteria as $key => $vals) {\n if (!empty($vals['OR']) || !empty($vals['AND'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= '(' . $this->_buildAttributeQuery($glue, $vals) . ')';\n } elseif (!empty($vals['JOIN'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= $this->_buildAttributeQuery($glue, $vals['JOIN'], true);\n } else {\n if (isset($vals['field'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $vals['field'], $vals['op'], $vals['test']);\n } else {\n foreach ($vals as $test) {\n if (!empty($clause)) {\n $clause .= ' ' . $key . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $test['field'], $test['op'], $test['test']);\n }\n }\n }\n }\n\n return $clause;\n }", "public function outer($table, $on, $field = null, $comparitor = null);", "function whereJoin($relName, $s)\n{\n\t$this->tryModify();\n\n\t$rel = new Relation($this->newModel(null), $relName);\n\n\t$s = $this->setWhereParams($s, func_get_args(), 2);\n\n\t$table = $rel->params['table'];\n\t$join = $rel->getJoinCondition();\n\n\tif(!isset($this->query['whereJoin'])) $this->query['whereJoin'] = array();\n\n\tif ($rel->getType() == 'many_to_many') {\n\t\t$joinTable = $rel->getJoinTableName();\n\t\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table,$joinTable where $join and ($s))\";\n\t\treturn $this;\n\t}\n\n\t$this->query['whereJoin'][] = \"EXISTS (SELECT * FROM $table WHERE $join AND ($s))\";\n\treturn $this;\n}", "public function andWhere($conditions);", "public function join($tb1,$tb2,$on=[],$mod=\"inner\"){\n\n\t\tif($this->name!=\"\"){\n\t\t\t$mod=$on;$on = $tb2;$tb2= $tb1;$tb1 = $this;\n\t\t}\n\n\t\tif(gettype($on)==\"string\") $on = [$on ,$on];\n\t\tif(gettype($mod)!=\"string\") $mod= \"inner\";\n\t\treturn new $this::$tclass($tb1,$tb2,$on,$mod);\n\n\t}", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "public function outerJoin($table, array $fields = [], array $on = []) {\n return $this->_addJoin(Join::OUTER, $table, $fields, $on);\n }", "private function sql_whereAnd_enableFields()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n $andWhere = $this->pObj->cObj->enableFields( $table );\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "public function ON($left_field_name, $right_field_name, $left_table_offset = -2, $right_table_offset = null) {\n\t\t$jointset = $this->lastSet('joint') ;\n\t\tif (!$jointset) $jointset = $this->add_SET('joint');\n\n\t\t$left_ptr = $this->fieldByAlias($left_field_name);\n\t\tif (!$left_ptr) $left_ptr = $this->add_FIELD($left_field_name, null, $this->lastTable($left_table_offset), null);\n\n\t\t$right_ptr = $this->fieldByAlias($right_field_name);\n\t\tif (!$right_ptr) $right_ptr = $this->add_FIELD($right_field_name, null, $this->lastTable($right_table_offset), null);\n\n\t\t//remove right_ptr->table from tableset?\n\t\t$this->rem_TABLE($right_ptr->asTable());\n\n\t\t$this->add_JOIN($left_ptr, $right_ptr, $jointset);\n\t}" ]
[ "0.6634879", "0.638205", "0.6163566", "0.59587705", "0.59395903", "0.59362954", "0.5868449", "0.5858704", "0.5756276", "0.56096816", "0.55098665", "0.5501396", "0.5479497", "0.5459679", "0.54548246", "0.5427898", "0.5417509", "0.5366299", "0.5338554", "0.53203535", "0.5317379", "0.5299916", "0.52898043", "0.528969", "0.52292615", "0.51891947", "0.5162629", "0.51600504", "0.5148724", "0.5147908", "0.51361537", "0.51334184", "0.51183873", "0.5113733", "0.5113011", "0.5111851", "0.5097662", "0.5089326", "0.50833476", "0.5065883", "0.5062039", "0.50619024", "0.50527996", "0.5051074", "0.50456643", "0.50394404", "0.50392604", "0.50261", "0.501353", "0.50127125", "0.50122285", "0.49800527", "0.49778605", "0.49777356", "0.49708706", "0.49649173", "0.49629498", "0.49610764", "0.49360192", "0.49345145", "0.49336827", "0.49282348", "0.4918089", "0.49111706", "0.4895398", "0.48950368", "0.4882961", "0.48788995", "0.48706916", "0.48657638", "0.48644608", "0.4862342", "0.48612309", "0.48568976", "0.4848567", "0.48460674", "0.4844203", "0.48391926", "0.48355082", "0.4827802", "0.48270324", "0.48261893", "0.48103422", "0.47847483", "0.47836053", "0.47828194", "0.47761643", "0.47609895", "0.47593167", "0.47590202", "0.47580588", "0.4755751", "0.47546047", "0.4753723", "0.474092", "0.47407404", "0.4716017", "0.47142115", "0.4707364", "0.47017348" ]
0.51672
26
Simple AND ON condition with various set of arguments. Can only be used to link column values together, no parametric values allowed.
public function andOn($joined = null, $operator = null, $outer = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->onWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "public function andWhere($field, $operator, $value);", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function andWhere($conditions);", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function andWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'where'), func_get_args());\r\n\t\treturn $this;\r\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function andOn(array|string $column, string $op = null, array|string $value = null): void\n {\n call_user_func_array([$this, 'on'], func_get_args());\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function wAnd()\n {\n $this->setDefaultOperator(PredicateSet::OP_AND);\n \n if (func_num_args()) {\n call_user_func_array([$this, 'condition'], func_get_args());\n $this->endAnd();\n }\n \n return $this;\n }", "public function where(...$args)\n {\n $this->addCondition('and', $args, $this->conditions);\n return $this;\n }", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "final public static function and($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' AND ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' AND ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function whereAcf(...$args)\n {\n $this->addAcfCondition('and', $args, $this->conditions);\n return $this;\n }", "public function joinOnAnd(Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$this->addJoinOn('AND', $other, $fieldOrExpr, $operator, $valueOrExpr);\r\n\t}", "public function andClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'AND', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function andOnWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "public function andWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_AND) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('where', $where, true);\n }", "function where_and($conditions = array())\n {\n return $this->object->_where($conditions, 'AND');\n }", "private function sql_whereAnd_enableFields()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n $andWhere = $this->pObj->cObj->enableFields( $table );\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function andWhere($field, $predicate): self;", "public function andWhere($identifier, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken('AND', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function andWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value);\n\t}", "public function on(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'AND'];\n }", "public function and_on($c1, $op, $c2)\n {\n return $this->on($c1, $op, $c2);\n }", "function clause_mode() {\n return 'AND';\n }", "public function and_where ( $mFields, $mValue = null )\n {\n /*\n Return for method chaining.\n */\n return $this->where($mFields, $mValue, 'AND');\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function and_where_open()\n {\n $this->_where[] = array('AND' => '(');\n return $this;\n }", "public function onWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "public function joinOnAndQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('AND', $other, $whereQuery);\r\n\t}", "public function andSql($fieldCondition, $value) {\r\n $this->where($fieldCondition, $value);\r\n return $this;\r\n }", "public function isAnd();", "public function and(string $key, ...$arguments) : Api\n {\n return $this->where($key, ...$arguments);\n }", "function variant_and($left, $right) {}", "public function conditionalAndExpression(){\n try {\n // Sparql11query.g:389:3: ( valueLogical ( AND valueLogical )* ) \n // Sparql11query.g:390:3: valueLogical ( AND valueLogical )* \n {\n $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1326);\n $this->valueLogical();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:390:16: ( AND valueLogical )* \n //loop49:\n do {\n $alt49=2;\n $LA49_0 = $this->input->LA(1);\n\n if ( ($LA49_0==$this->getToken('AND')) ) {\n $alt49=1;\n }\n\n\n switch ($alt49) {\n \tcase 1 :\n \t // Sparql11query.g:390:17: AND valueLogical \n \t {\n \t $this->match($this->input,$this->getToken('AND'),self::$FOLLOW_AND_in_conditionalAndExpression1329); \n \t $this->pushFollow(self::$FOLLOW_valueLogical_in_conditionalAndExpression1331);\n \t $this->valueLogical();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop49;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function on($joined = null, $operator = null, $outer = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->onWrapper()\n );\n\n return $this;\n }", "public function on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'AND');\n return $this;\n }", "public function on($column1,$column2,$operator = \"=\");", "public function andWhere($condition) {\n return $this->where($condition, 'AND');\n }", "public static function static_logicalAnd($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function and( string $options )\n\t{\n\t\t$query_part = 'AND ' . $options;\n\t\t$this->and = $query_part;\n\n\t\treturn $this;\n\t}", "public function rawAndWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings);\n\t}", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public function addAcfCondition($chain, $arguments, &$array)\n {\n $table_pm = $this->addAcfJoint();\n $condition = $this->addComplexCondition($chain, $array)->where($table_pm->alias . '.meta_key', $arguments[0]);\n $arguments[0] = $table_pm->alias . '.meta_value';\n call_user_func_array([$condition, 'where'], $arguments);\n }", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public static function buildAnd(array $criteria)\n {\n return new LogicalAnd($criteria);\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function andWhere($where, $params = array()) {\n parent::andWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "function getJoinCondition() ;", "public function getJoinCondition() {}", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "public static function logicalAnd(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalAnd(func_get_args());\n }", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function whereAndObject($objects) {\r\n\t\t$this->addWhereObject('AND', $objects);\r\n\t}", "public function _and($column, $value = null) {\n if (!is_array($column)) {\n $column = array($column => $value);\n }\n\n $this->query['where'][count($this->query['where']) - 1] = array_merge(\n $this->query['where'][count($this->query['where']) - 1],\n $column\n );\n\n return $this;\n }", "public function andWhere($condition)\n {\n $this->appendWhereString(\" AND \")->where($condition);\n return $this;\n }", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function Qand( $field, $exp = NULL, $val = NULL ) {\n $this->where( $field, $exp, $val );\n\n $current = count( $this->_currentImplement['where'] ) - 1;\n $this->_currentImplement['where'][$current] = ' AND ' . $this->_currentImplement['where'][$current];\n\n return $this;\n }", "public function andWhere($field, $operator = null, $value = null)\n\t{\n\t\t$this->query->where($field, $operator, $value);\n\n\t\treturn $this;\n\t}", "public function andWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->andWhere($where, $params);\n }", "public function whereAndQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('AND', $subQuery);\r\n\t}", "public function andWhere($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Where expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->where = $this->where ? '(' . $this->where . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('where', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function andWhere($column, $op = null, $value = null)\n\t{\n\t\tif($column instanceof \\Closure)\n\t\t{\n\t\t\t$this->andWhereOpen();\n\t\t\t$column($this);\n\t\t\t$this->whereClose();\n\n\t\t\treturn $this;\n\t\t}\n\n\t\tif (func_num_args() === 2)\n\t\t{\n\t\t\t$value = $op;\n\t\t\t$op = is_array($value) ? 'in' : '=';\n\t\t}\n\n\t\treturn $this->addCondition('where', 'and', $column, $op, $value);\n\t}", "public function where($identifier, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken('AND', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function whereAnd($fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$this->addWhere('AND', $fieldOrExpr, $operator, $valueOrExpr);\r\n\t}", "public function and_where(array $conditions): self\n\t{\n\t\tif (isset($conditions) && !empty($conditions))\n\t\t{\n\t\t\t$this->create_where_field('$and');\n\t\t\t\n\t\t\tforeach ($conditions as $field => $value)\n\t\t\t{\n\t\t\t\tif (is_string($field) && $field != '')\n\t\t\t\t{\n\t\t\t\t\t$this->wheres['$and'][] = [$field => $value];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Each field name in list must not be an empty string', __METHOD__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function compileAnd()\n {\n if ($this->firstClause) {\n return '';\n }\n\n $operator = $this->and ? ' & ' : ' | ';\n\n return $operator;\n }", "public function equiJoinCondition($selector1Name, $property1Name, $selector2Name, $property2Name);", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function andWhere($col, $oper,$val)\n {\n if(!in_array($oper, $this->_allowedOpperators)){\n $oper = '=';\n }\n $this->_rawWhereData[] = strip_tags(trim(implode(\" \",[$col,$oper,'?'])));\n $this->_addWhereArr[] = $this->clean($val);\n\n return $this;\n }", "protected function parseAndConditions(array $conditions, bool $skipFirstAnd = true): string\n {\n // define string\n $sql = '';\n\n $i = 0;\n foreach ($conditions as $column => $value) {\n // append AND\n $sql .= ($i == 0 && $skipFirstAnd ? '' : ' AND ');\n\n if (is_array($value)) {\n // multiple conditions on a column\n $ii = 0;\n foreach ($value as $val) {\n // append AND\n $sql .= ($ii != 0 ? ' AND ' : '');\n\n // write condition\n $sql .= $column . $this->parseValue($val);\n\n // count up\n $ii++;\n }\n } else {\n // one condition on a column\n $sql .= $column . $this->parseValue($value);\n }\n\n $i++;\n }\n\n // return string\n return $sql;\n }", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function andFilterWhere(string $leftOperand): SimpleFilterBuilder {\n return new SimpleFilterBuilder($this, $leftOperand, 'and');\n }", "public function orOnWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "function where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'AND ', $escape);\r\n\t}", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function andWhere($where): QueryBuilderInterface;", "public function whereLessThanOrEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERELTE][$field] = [self::OPERATORS['lte'] => $value];\n return $this;\n }", "public function condition(string $field, string $compare, string $operator = \"=\", string $connector = \"AND\");", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public static function and_() {\n $result = new qti_variable('single', 'boolean', array('value' => true));\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\n if (!$param->value) {\n $result->value = false;\n return $result;\n }\n }\n return $result;\n }", "public function and_where($col, $val, $opp = '=') \n {\n // Check for an array\n if(is_array($col))\n {\n // Combine arrays, set our array pointer to 1\n $array = array_combine($col, $val);\n $i = 0;\n \n // Loop through and add each if we have any\n if(count($array) > 0)\n {\n foreach($array as $key => $value)\n {\n // Some light cleaning\n $this->and_where($key, $value, $opp[$i]);\n ++$i;\n }\n }\n }\n else\n {\n // Some light cleaning\n $col = $this->clean($col);\n $val = $this->clean($val);\n \n // Add quotes on non-numeric values\n if(!is_numeric($val))\n {\n $val = \"'\". $val .\"'\";\n }\n $this->sql .= \" AND \". $col . $opp . $val;\n }\n return $this;\n }", "public function testBuildWhereWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE alias.param1 = 'value1' AND alias.param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "function query($args, $operator = 'AND')\n {\n }", "public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function andWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'and',\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "static function logicalAnd()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalAnd', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function addAnd($mWhere, $mValue = null)\n\t{\n\t\tif(!empty($this->sWhere))\n\t\t{\n\t\t\t$this->sWhere .= ' AND ';\n\t\t}\n\n\t\t$this->sWhere .= $this->parse($mWhere, $mValue);\n\n\t\treturn $this;\n\t}", "protected function user_where_clause() {}" ]
[ "0.75649023", "0.6955614", "0.6759863", "0.66151446", "0.6552937", "0.6537053", "0.65040386", "0.64872473", "0.64791954", "0.6450177", "0.638853", "0.6384082", "0.632392", "0.6207506", "0.6198633", "0.61416954", "0.6119272", "0.6106958", "0.610402", "0.6074517", "0.6070675", "0.60522527", "0.60298747", "0.59561646", "0.5942322", "0.5911348", "0.58793306", "0.5848086", "0.5838488", "0.5829973", "0.5826385", "0.58187234", "0.5814715", "0.57881784", "0.57793283", "0.57632595", "0.57617253", "0.57529294", "0.57520753", "0.5733117", "0.57103044", "0.5704976", "0.5698653", "0.569352", "0.56886023", "0.5652904", "0.56500393", "0.5644572", "0.56333774", "0.5630751", "0.56287694", "0.562125", "0.56190187", "0.5597901", "0.5592021", "0.5576151", "0.55669194", "0.55577666", "0.5551676", "0.5548318", "0.5526199", "0.5485943", "0.5482807", "0.5464578", "0.54562366", "0.54519624", "0.5446408", "0.54314363", "0.5418272", "0.541816", "0.54159963", "0.5415526", "0.5412043", "0.54118973", "0.5405611", "0.540393", "0.53940415", "0.5383223", "0.5381631", "0.53612363", "0.53395617", "0.533062", "0.5317002", "0.53068876", "0.53066236", "0.5296851", "0.52827495", "0.5277501", "0.5272252", "0.526837", "0.5267501", "0.5265406", "0.52645606", "0.52627766", "0.52612156", "0.5253952", "0.5239468", "0.5235578", "0.5232886", "0.52309036" ]
0.6064994
21
Simple OR ON condition with various set of arguments. Can only be used to link column values together, no parametric values allowed.
public function orOn($joined = null, $operator = null, $outer = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->onWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "public function orOn(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'OR'];\n }", "public function orWhere($column, $operator = null, $value = null);", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "public function orWhere($table,$column,$data = \"\");", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function orWhere() {\r\n\t\t$args = func_get_args();\r\n\t\tif (count($this->_wheres)) {\r\n\t\t\t$criteria = call_user_func_array(array($this->_wheres[count($this->_wheres)- 1], 'orWhere'), $args);\r\n\t\t} else {\r\n\t\t\t$statement = array_shift($args);\r\n\t\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t\t$this->_wheres[] = $criteria;\r\n\t\t}\r\n\t\treturn $criteria;\r\n\t}", "public function or_on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'OR');\n return $this;\n }", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "public function orWhere(...$args)\n {\n $this->addCondition('or', $args, $this->conditions);\n return $this;\n }", "function or_where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'OR ', $escape);\r\n\t}", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "public function orWhereAcf(...$args)\n {\n $this->addAcfCondition('or', $args, $this->conditions);\n return $this;\n }", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "public function orWhere($field, $operator, $value);", "public function orWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'orWhere'), func_get_args());\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function orWhere($column, $value = false, $operator = '=')\n {\n\t\treturn $this->condition($column, $value, $operator, 'OR', 'where');\n\t}", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function on($column1,$column2,$operator = \"=\");", "public function or_where($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_where', $key, $value, 'OR ', $escape);\n\t}", "public function or_where($column, $op = null, $value = null)\n {\n if (is_array($column))\n {\n foreach ($column as $key => $val)\n {\n if (is_array($val))\n {\n $this->or_where($val[0], $val[1], $val[2]);\n }\n else\n {\n $this->or_where($key, '=', $val);\n }\n }\n }\n else\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n $this->_where[] = array('OR' => array($column, $op, $value));\n }\n\n return $this;\n }", "static function _OR($params1, $params2){\n /* del parametro 1 separa el campo del valor */\n $params_1 = explode('=', $params1);\n $campo1 = trim($params_1[0]);\n $var1 = trim($params_1[1]);\n\n /* del parametro 2 separa el campo del valor */\n $params_2 = explode('=', $params2);\n $campo2 = trim($params_2[0]);\n $var2 = trim($params_2[1]);\n\n if($campo1 != $campo2)\n throw new \\Exception('Unexpected error creating OR clause. The fields involved should be the same.');\n\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($campo1) == 'STRING'){\n return \"(\". $campo1 . \"= '\" .(strip_tags($var1)). \"' {or} \". $campo2 . \"= '\" .(strip_tags($var2)) .\"')\";\n }else\n return '('. $params1 . ' {or} '. $params2 .')';\n }", "public function andOn(array|string $column, string $op = null, array|string $value = null): void\n {\n call_user_func_array([$this, 'on'], func_get_args());\n }", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'OR', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function orOnWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "public function addWhereOr($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'OR ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function orWhere($data, $conditional = 'AND') {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\tif(is_null($this->_where)) {\n\t\t\t\t$this->_where = ' WHERE ';\n\t\t\t} else {\n\t\t\t\t$this->_where .= \" $conditional \";\n\t\t\t}\n\n\t\t\tif($fields < 2) {\n\t\t\t\tthrow new Exception('Para utlizar o metodo orWhere é necessário pelo menos 2 clausulas');\n\t\t\t}\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\tif($i == 0) {\n\t\t\t\t\t$this->_where .= '(' . $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t} else if ( $i+1 == $fields) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ')';\n\t\t\t\t} else {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\treturn $this;\n\t }", "public function or_where($clause, $join = \"AND\")\n\t{\n\t\t$this->_where .= \" OR \";\n\t\t$this->where($clause, $join);\n\t}", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "public function or_where($key, $char = NULL)\r\n {\r\n return $this->_where($key, $char, 'OR ');\r\n }", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function orWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_OR) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "public function orWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value, 'OR');\n\t}", "function variant_or($left, $right) {}", "public static function static_logicalOr($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function orwhere($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where($column, $sign, $value, 'or');\n else\n return $this->where($column, $sign, $value, 'where');\n }", "public function orWhere($column, $operator = null, $value = null)\n {\n return $this->where($column, $operator, $value, 'or');\n }", "public static function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orWhere($prop,$value,$operator);\r\n }", "public function orWhere(...$conditions)\n {\n $this->where(...$conditions);\n return $this;\n }", "final public static function or($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' OR ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' OR ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function rawOrWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings, 'OR');\n\t}", "public function on(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'AND'];\n }", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function orWhere($key = null, $condition = null, $value = null)\n {\n $this->_orConditions [] = [\n 'key' => $key,\n 'condition' => $condition,\n 'value' => $value,\n ];\n\n return $this;\n }", "public function isOr();", "public function or_where_in($key = NULL, $values = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_where_in($key, $values, FALSE, 'OR ', $escape);\n\t}", "public static function logicalOr(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalOr(func_get_args());\n }", "public function orFlag($or = null)\n {\n if(null === $or)\n {\n return $this->property('or');\n }\n return $this->property('or', (bool) $or);\n }", "public function orSql($fieldCondition, $value) {\r\n $this->where($fieldCondition, $value, 'OR');\r\n return $this;\r\n }", "private function mergeOrWhere(){\n $wheres = $this->orWheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" OR \";\n }\n return rtrim($whereString, \" OR \");\n }", "public function or_where_open()\n {\n $this->_where[] = array('OR' => '(');\n\n return $this;\n }", "public function orWhere($column, string $operator = null, $value = null) : self\n {\n return $this->where($column, $operator, $value, 'or');\n }", "public function orWhere($column, $op = null, $value = null)\n\t{\n\t\tif($column instanceof \\Closure)\n\t\t{\n\t\t\t$this->orWhereOpen();\n\t\t\t$column($this);\n\t\t\t$this->whereClose();\n\n\t\t\treturn $this;\n\t\t}\n\n\t\tif (func_num_args() === 2)\n\t\t{\n\t\t\t$value = $op;\n\t\t\t$op = is_array($value) ? 'in' : '=';\n\t\t}\n\n\t\treturn $this->addCondition('where', 'or', $column, $op, $value);\n\t}", "public function testBuildWhereWithOrComplex()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where(\n $this->getQuery()\n ->where('is_super_admin', 1)\n ->where('can_be_super_admin', 1)\n )\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR (is_super_admin = '1' AND can_be_super_admin = '1'))\",\n $query->buildWhere()\n );\n }", "function or_where_in($key = NULL, $values = NULL)\r\n\t{\r\n\t \treturn $this->_where_in($key, $values, FALSE, 'OR ');\r\n\t}", "public function or_where($col, $val, $opp = '=') \n {\n // Check for an array\n if(is_array($col))\n {\n // Combine arrays, set our array pointer to 1\n $array = array_combine($col, $val);\n $i = 0;\n \n // Loop through and add each if we have any\n if(count($array) > 0)\n {\n foreach($array as $key => $value)\n {\n // Some light cleaning\n $this->or_where($key, $value, $opp[$i]);\n ++$i;\n }\n }\n }\n else\n {\n // Some light cleaning\n $col = $this->clean($col);\n $val = $this->clean($val);\n \n // Add quotes on non-numeric values\n if(!is_numeric($val))\n {\n $val = \"'\". $val .\"'\";\n }\n $this->sql .= \" OR \". $col . $opp . $val;\n }\n return $this;\n }", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "public function orCondition($first, $operator, $second)\n\t{\n\t\t$this->_query['orCondition'] = (object)array(\n\t\t\t'first' => $first,\n\t\t\t'operator' => $operator,\n\t\t\t'second' => $second\n\t\t);\n\n\t\treturn $this;\n\t}", "public function where_or($pairs)\n {\n $tmp = $this->where;\n $this->where = array();\n foreach ($pairs as $key => $val)\n {\n if (is_array($val)) $this->where_in($key, $val);\n else $this->where($key, $val);\n }\n $tmp[] = sprintf('(%s)', join(' or ', $this->where));\n $this->where = $tmp;\n return $this;\n }", "public function joinOnOr(Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$this->addJoinOn('OR', $other, $fieldOrExpr, $operator, $valueOrExpr);\r\n\t}", "public function or_where(array $conditions): self\n\t{\n\t\tif (isset($conditions) && !empty($conditions))\n\t\t{\n\t\t\t$this->create_where_field('$or');\n\t\t\t\n\t\t\tforeach ($conditions as $field => $value)\n\t\t\t{\n\t\t\t\tif (is_string($field) && $field != '')\n\t\t\t\t{\n\t\t\t\t\t$this->wheres['$or'][] = [$field => $value];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Each field name in list must not be an empty string', __METHOD__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function orWhere($where, $params = array()) {\n parent::orWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "public function orWhere($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'OR ', $escape, 'where');\n }", "public function joinOnOrQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('OR', $other, $whereQuery);\r\n\t}", "public function orWhere($identifier, $variousA = [], $variousB = null, $variousC = null)\n {\n $this->whereToken('OR', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function orWhereOpen()\n\t{\n\t\t$this->where[] = array(\n\t\t\t'type' => 'or',\n\t\t\t'nesting' => 'open',\n\t\t);\n\n\t\treturn $this;\n\t}", "public function whereOrObject($objects) {\r\n\t\t$this->addWhereObject('OR', $objects);\r\n\t}", "public function hasOrWhere()\n {\n return $this->_has('_orWhere');\n }", "public function orWhere(Array $restraints){\r\n $subclause = $this->where->addClause(\"or\");\r\n foreach($restraints as $rest){\r\n $this->__where_restraint($rest, $subclause);\r\n }\r\n return $this;\r\n }", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "public function orWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->orWhere($where, $params);\n }", "public function orWhereRaw(/*# string */ $rawString, array $params = []);", "public function or($column, $operator = null, $value = null)\n {\n $column = $column instanceof \\Closure ? new SubQuery('query', $column(static::new())->getQuery()) : $column;\n $this->setWhereQuery('or', $column, $operator, $value);\n\n return $this;\n }", "public function orConditions($data = array()) {\r\n $filter = $data['filter'];\r\n $condition = array(\r\n 'OR' => array(\r\n $this->alias . '.title LIKE' => '%' . $filter . '%',\r\n $this->alias . '.body LIKE' => '%' . $filter . '%',\r\n )\r\n );\r\n return $condition;\r\n }", "public function orIn($column,$val);", "public function orWhere($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_whereString($key, $val, 'OR');\n\t}", "public function orHaving(\n Closure | string $column,\n string $operator,\n Closure | float | int | string | null ...$values\n ) : static {\n return $this->addHaving('OR', $column, $operator, $values);\n }", "public function orWhere($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value);\n }", "public function orWhere($field, $operator, $value){\n array_push($this->orWheres, $field.\" \".$operator.\" ?\");\n array_push($this->bindings, $value);\n return $this;\n }", "static function logicalOr()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::logicalOr', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function whereLessThanOrEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERELTE][$field] = [self::OPERATORS['lte'] => $value];\n return $this;\n }", "public function orBracketOpen()\n {\n return $this->bracketOpen('', 'OR ');\n }", "public function orwhere_str($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where_str($column, $sign, $value, 'or');\n else\n return $this->where_str($column, $sign, $value, 'where');\n }", "function or_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side);\r\n\t}", "public function orFilter($column, $operator = '=', $value = null): Builder\n {\n [$value, $operator] = $this->prepareValueAndOperator(\n $value, $operator, func_num_args() === 2\n );\n\n return $this->addFilter($column, $operator, $value, 'or');\n }", "function getJoinCondition() ;", "public function orWhere($condition) {\n return $this->where($condition, 'OR');\n }", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function getJoinCondition() {}", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public function or_where ( $mFields, $mValue = null )\n {\n /*\n Return for method chaining.\n */\n return $this->where($mFields, $mValue, 'OR');\n }" ]
[ "0.7143903", "0.7027942", "0.69334835", "0.6727424", "0.66723424", "0.66529894", "0.66154176", "0.6558359", "0.6479069", "0.64590067", "0.6384072", "0.6356165", "0.63420206", "0.6311057", "0.62997836", "0.61352277", "0.61336637", "0.6122162", "0.60913664", "0.60602856", "0.6054508", "0.60483176", "0.6040139", "0.59904766", "0.59868", "0.590272", "0.58980274", "0.5886504", "0.58732843", "0.5872315", "0.58639705", "0.585997", "0.58576447", "0.5834106", "0.58285373", "0.58272195", "0.58181256", "0.58107024", "0.57820714", "0.5754297", "0.57481605", "0.5732447", "0.57076216", "0.5703946", "0.56989133", "0.5697117", "0.56944615", "0.5681141", "0.56776625", "0.56463885", "0.5640599", "0.5636119", "0.5630397", "0.5627754", "0.56264544", "0.56168526", "0.56155753", "0.5603033", "0.55891776", "0.55732226", "0.5572612", "0.5567437", "0.5563866", "0.55273473", "0.5518676", "0.5512273", "0.551039", "0.5504805", "0.5496854", "0.5480283", "0.54708517", "0.5448938", "0.54407966", "0.54395217", "0.5428887", "0.5420112", "0.5413485", "0.53987074", "0.5378074", "0.53690773", "0.5366233", "0.53631955", "0.53630435", "0.5361168", "0.5359683", "0.5352392", "0.5343046", "0.5341975", "0.53385794", "0.5335278", "0.53261364", "0.5323648", "0.5319495", "0.5292937", "0.52913904", "0.5275023", "0.5255123", "0.5247575", "0.52470493", "0.5241066" ]
0.57306653
42
Simple ON WHERE condition with various set of arguments. You can use parametric values in such methods.
public function onWhere($joined, $variousA = null, $variousB = null, $variousC = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->whereWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function on($column1,$column2,$operator = \"=\");", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "protected function user_where_clause() {}", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function setOn($on = null): void\n {\n if (null !== $on) {\n if (self::CROSS === $this->p_type) {\n throw new InvalidArgumentException('No join conditions are allowed for CROSS JOIN');\n } elseif (!empty($this->p_natural) || !empty($this->p_using)) {\n throw new InvalidArgumentException('Only one of NATURAL, USING, ON clauses should be set for JOIN');\n }\n if (is_string($on)) {\n $on = $this->getParserOrFail('an ON expression')->parseExpression($on);\n }\n if (!($on instanceof ScalarExpression)) {\n throw new InvalidArgumentException(sprintf(\n '%s requires an SQL expression string or an instance of ScalarExpression, %s given',\n __METHOD__,\n is_object($on) ? 'object(' . get_class($on) . ')' : gettype($on)\n ));\n }\n }\n $this->setProperty($this->p_on, $on);\n }", "abstract public function where(array $where);", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "public function andOn(array|string $column, string $op = null, array|string $value = null): void\n {\n call_user_func_array([$this, 'on'], func_get_args());\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "protected function addCondition($condition, $one)\n {\n // query by primary key\n if($one && !empty($condition) && !is_array($condition))\n {\n $this->andWhere(static::primaryKey() . '=:id', [':id'=>$condition]);\n }\n elseif(!empty($condition))\n {\n foreach($condition as $key => $value)\n {\n if(is_array($value))\n $this->andWhere(['in', $key, $value]);\n else\n $this->andWhere($key . \"=:value$key\", [\":value$key\" => $value]);\n }\n }\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "public function on(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'AND'];\n }", "public function andWhere($conditions);", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function where($clause, array $params);", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n return parent::where(...Factory::resolve(func_get_args()));\n }", "protected function getGeneralWhereClause() {}", "protected abstract function getWhereClause(array $conditions);", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "public function where(string ...$condition): self\n {\n $this->where = array_merge($this->where, $condition);\n return $this;\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function testBuildWhereWithOneArgument()\n {\n $query = $this->getQuery()\n ->where('param', 'value')\n ;\n\n $this->assertSame(\n \"WHERE param = 'value'\",\n $query->buildWhere()\n );\n }", "public function testBuildWhereWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE alias.param1 = 'value1' AND alias.param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function orWhere($table,$column,$data = \"\");", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "public function testBuildWhereWithTwoArguments()\n {\n $query = $this->getQuery()\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE param1 = 'value1' AND param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "protected function where($data, $conditional = false) {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\t$this->_where = ' WHERE ';\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\tif ( $fields == 1) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tif ( $i+1 == $fields) {\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cond = ($conditional) ? $conditional[$i] : 'AND';\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' ' . $cond . ' ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t }", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function where($table,$column,$data = \"\");", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public static function where(array $where);", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "protected function getWhereClause() {}", "public function where(...$args)\n {\n $this->addCondition('and', $args, $this->conditions);\n return $this;\n }", "public function where($conditions = null, $overwrite = false);", "public function Where($key, $value)\n {\n $this->where = \"WHERE $key = '$value'\";\n }", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }", "function where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'AND ', $escape);\r\n\t}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "public function getJoinCondition() {}", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "public function andWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'where'), func_get_args());\r\n\t\treturn $this;\r\n\t}", "public function andWhere($field, $operator, $value);", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "function getJoinCondition() ;", "public function where($column, $value, $operator = '=')\n {\n }", "protected function getWhereSql($cond, $args)\n{\n\tif (is_numeric($cond)) throw new \\InvalidArgumentException;\n\tif (is_array($cond)) {\n\t\tforeach($cond as $k => $v){\n\t\t\t$s .= \" AND \".$this->escape($k,'ident').\"='\".$this->escape($v).\"'\";\n\t\t}\n\t\t$where = substr($s, 5);\n\t}\n\telseif (is_string($cond)) {\n\t\tif ($args) {\n\t\t\tif (is_array($args[0])) $params = $args[0]; else $params = $args;\n\t\t\t$where = $this->setParams($cond, $params);\n\t\t}\n\t\telse $where = $cond;\n\t}\n\telse throw new \\InvalidArgumentException;\n\treturn $where;\n}", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "public function where($cond){\n\t$this->where.=\"WHERE(\".$cond.\")\";\n\t\treturn $this;\n\t}", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "public function outerJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "function _where ($identifier_array, $o = TRUE) {\n\t\t$statement = '';\n\t\tif ( !isset($identifier_array) || !$identifier_array ) {\n\t\t\treturn $statement;\n\t\t}\n\t\t$statement .= $o ? ' WHERE ' : ' ';\n\t\tforeach ($identifier_array as $query_array) {\n\t\t\t$sub_stmt = '(';\n\t\t\tif ( isset($query_array['name']) && ! is_array($query_array['value']) ) {\n\t\t\t\t$regex = isset($query_array['regex']) ? $query_array['regex'] : '@';\n\t\t\t\t$sub_stmt .= '`' . $query_array['name'] . '` ';\n\t\t\t\t$sub_stmt .= (isset($query_array['ctype']) ? $query_array['ctype'] : '=') . ' ';\n\t\t\t\t$sub_stmt .= $this->escape($query_array['value'], $regex, FALSE);\n\t\t\t} else {\n\t\t\t\t// Incoming value is an array.\n\t\t\t\t$sub_stmt .= $this->_where($query_array['value'], FALSE);\n\t\t\t}\n\t\t\t$sub_stmt .= ')';\n\t\t\t$sub_stmt .= (isset($query_array['atype']) ? (' ' . $query_array['atype']).' ' : '');\n\t\t\t$statement .= $sub_stmt;\n\t\t}\n\t\treturn $statement; \n\t}", "public function addAcfCondition($chain, $arguments, &$array)\n {\n $table_pm = $this->addAcfJoint();\n $condition = $this->addComplexCondition($chain, $array)->where($table_pm->alias . '.meta_key', $arguments[0]);\n $arguments[0] = $table_pm->alias . '.meta_value';\n call_user_func_array([$condition, 'where'], $arguments);\n }", "public function where(array $params)\n {\n }", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "function _where($conditions = array(), $operator)\n {\n $where_clauses = array();\n // If conditions is not an array, make it one\n if (!is_array($conditions)) {\n $conditions = array($conditions);\n } elseif (!empty($conditions) && !is_array($conditions[0])) {\n // Just a single condition was passed, but with a bind\n $conditions = array($conditions);\n }\n // Iterate through each condition\n foreach ($conditions as $condition) {\n if (is_string($condition)) {\n $clause = $this->object->_parse_where_clause($condition);\n if ($clause) {\n $where_clauses[] = $clause;\n }\n } else {\n $clause = array_shift($condition);\n $clause = $this->object->_parse_where_clause($clause, $condition);\n if ($clause) {\n $where_clauses[] = $clause;\n }\n }\n }\n // Add where clause to query\n if ($where_clauses) {\n $this->object->_add_where_clause($where_clauses, $operator);\n }\n return $this->object;\n }", "public function join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)\n {\n throw new NotImplementedException('Joins are not implemented in Crate');\n }", "public static function where($column, $value, $operator = '=');", "public function where(array $condition)\n {\n if (empty($condition)) {\n $this->where_str = '1=1';\n return $this;\n }\n $this->where_str = $this->buildWhereStr($condition);\n return $this;\n }", "public function where($column, $operator, $value);", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function where($conditions)\n {\n if(!$this->query)\n {\n return false;\n }\n \n // Were multiple arguments passed?\n if(func_num_args() > 1)\n {\n $conditions = func_get_args();\n }\n \n $conditions = stripslashes($this->san($conditions));\n $this->query .= \"WHERE {$conditions} \";\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function addLeftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "public function\r\n add_conditions_to_where_clause(\r\n $conditions\r\n );", "public function whereAcf(...$args)\n {\n $this->addAcfCondition('and', $args, $this->conditions);\n return $this;\n }", "public function testImplicitJoinWithCartesianProductAndConditionInWhere(): void\n {\n $this->assertValidDQL('SELECT u, a FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u, Doctrine\\Tests\\Models\\CMS\\CmsArticle a WHERE u.name = a.topic');\n }", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "public function where($conditions){\n\t\t\t$string = self::WHERE;\n\t\t\t\n\t\t\tforeach($conditions as $val){\n\t\t\t\t$typeR = gettype($val['right']);\n\n\t\t\t\t$string .= ' ' . ((isset($val['link']) && !empty($val['link'])) ? $val['link'] . ' ' : '');\n\n\t\t\t\tif(isset($val['paranthesis']) && isset($val['paranthesis']['open']))\n\t\t\t\t\t$string .= '(';\n\t\t\t\t$string .= $val['left'] . ' ' . $val['operator'] . ' ' . ($typeR == \"string\" ? \"'\" . $val['right'] . \"'\" : $val['right']);\n\n\t\t\t\tif(isset($val['paranthesis']) && isset($val['paranthesis']['close']))\n\t\t\t\t\t$string .= ')';\n\t\t\t}\n\t\t\t$this->_query .= $string . ' ';\n\t\t\treturn $this->_returnObject ? $this : $string;\n\t\t}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "public function join($table, $on, $field = null, $comparitor = null);", "public function rawAndWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings);\n\t}", "public function resolveConditionData($params)\n {\n $dataWhere = \"\";\n\n $lowerKeyd = array_change_key_case($params, CASE_LOWER);\n $glue = strtoupper(isset($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) && strtolower($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) == \"or\" ? \"OR\" : \"AND\");\n unset($lowerKeyd);\n\n foreach ($params as $k => $v) {\n if (strpos($k, self::OPERATOR_PREFIX) === 0) {\n continue;\n }\n if (is_numeric($k)) {\n if (is_array($v)) {\n $dataWhere .= ($dataWhere ? \" {$glue} (\" : \"(\") . $this->resolveConditionData($v) . \")\";\n }\n else { // raw\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $v;\n }\n }\n else {\n $expl = explode(\" \", $k, 2);\n $operator = count($expl) > 1 ? $expl[1] : \"=\";\n if ($operator == \"=\" && (is_array($v))) {\n $operator = \"IN\";\n }\n if ($operator == \"!=\" && (is_array($v))) {\n $operator = \"NOT IN\";\n }\n if ($operator == \"=\" && ($v === NULL)) {\n $operator = \"IS\";\n }\n if ($operator == \"!=\" && ($v === NULL)) {\n $operator = \"IS NOT\";\n }\n $dontQuote = false;\n if ($v === NULL) {\n $v = \"NULL\";\n $dontQuote = true;\n }\n if ($v === TRUE) {\n $v = 1;\n }\n if ($v === FALSE) {\n $v = 0;\n }\n $column = $expl[0];\n if (strpos($column, self::DONT_QUOTE_VALUE_PREFIX) === 0) {\n $column = substr($column, 1);\n $dontQuote = true;\n }\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $this->quoteColumn($column) . \" {$operator} \" . $this->_quoteVal($v, $dontQuote);\n }\n }\n\n return $dataWhere;\n }", "public function leftJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::LEFT, $table, $where, false);\n \n return $this;\n }", "private function _set_where($params) {\n if (count($params) == 1) {\n if (!is_array($params[0]) && !strstr($params[0], \"'\")) {\n $this->db->where($this->primary_key, $params[0]); // 1.\n } else {\n $this->db->where($params[0]); // 2.\n }\n } elseif (count($params) == 2) {\n if (is_array($params[1])) {\n $this->db->where_in($params[0], $params[1]); // 4.\n } else {\n $this->db->where($params[0], $params[1]); // 3.\n }\n }\n }", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "public function findOne($condition = [], $params = [], $mode = PDO::FETCH_ASSOC){\n\t\t$this->beforeFind();\n\t\t$tableName = $this->tableName();\n\t\t$tables = $tableName;\n\t\t$sql = '';\n\t\t$bindValues = [];\n\n\t\tif(is_array($condition)){\n\t\t\tforeach($condition as $key => $value){\n\t\t\t\tif(is_array($value)){\n\t\t\t\t\t$sql .= $tableName . '.' . $key . ' IN (';\n\t\t\t\t\tforeach($value as $inKey => $inValue){\n\t\t\t\t\t\t$sql .= ':' . $key . $inKey;\n\t\t\t\t\t\tif($inKey !== array_key_last($value)) $sql .= ', ';\n\t\t\t\t\t\t$bindValues[':' . $key . $inKey] = $inValue;\n\t\t\t\t\t}\n\t\t\t\t\t$sql .= ') ';\n\t\t\t\t} else {\n\t\t\t\t\t$sql .= $tableName . '.' . $key . ' = :' . $key . ' ';\n\t\t\t\t\t$bindValues[':' . $key] = $value;\n\t\t\t\t}\n\t\t\t\tif($key !== array_key_last($condition)) $sql .= 'AND ';\n\t\t\t}\n\t\t} else {\n\t\t\t$primary = $this->getPrimaryKey();\n\t\t\t$sql = $tableName . '.' . $primary . ' = :' . $primary . ' ';\n\t\t\t$bindValues[':' . $primary] = $condition;\n\t\t}\n\n\t\t// If there is orderBy param. Note: column name strings cannot be set as placeholders (column order numbers could though)\n\t\t// so model column names are used as a filter check to permit the passing of a string value to the statement.\n\t\tif(array_key_exists('orderBy', $params)){\n\t\t\t// Make sure the column name exists in model and direction is ASC or DESC\n\t\t\tif(property_exists($this, $params['orderBy'][0]) ){\n\t\t\t\t$sql .= ' ORDER BY ' . $params['orderBy'][0];\n\t\t\t\tif(strtolower($params['orderBy'][1]) === 'asc') $sql .= ' ASC';\n\t\t\t\telse if(strtolower($params['orderBy'][1]) === 'desc') $sql .= ' DESC';\n\t\t\t}\n\t\t}\n\n\t\t// Join related table.\n\t\tif(array_key_exists('join', $params)){\n\t\t\t$relation = $this->relations()[$params['join']];\n\t\t\t// Many-to-many relation between tables.\n\t\t\tif($relation[0] == 'manyToMany'){\n\t\t\t\t// Get relation table models and instantiate.\n\t\t\t\trequire_once(APPROOT . 'models/' . $relation[1] . '.php');\n\t\t\t\t$relatedTable = new $relation[1];\n\t\t\t\trequire_once(APPROOT . 'models/' . $relation[2] . '.php');\n\t\t\t\t// Get tale names and build inner joins.\n\t\t\t\t$joinTable = new $relation[2];\n\t\t\t\t$joinTableName = $joinTable->tableName();\n\t\t\t\t$relatedTableName = $relatedTable->tableName();\n\t\t\t\t$tables .= ' INNER JOIN ' . $joinTableName . ' ON ' . $tableName . '.' . $relation[3] . ' = ' . $joinTableName . '.' . $relation[3];\n\t\t\t\t$tables .= ' INNER JOIN ' . $relatedTableName . ' ON ' . $joinTableName . '.' . $relation[4] . ' = ' . $relatedTableName . '.' . $relation[4];\n\t\t\t}\n\t\t}\n\n\t\t$statement = $this->db->prepare('SELECT * FROM ' . $tables . ' WHERE ' . $sql . ' LIMIT 1');\n\t\tforeach($bindValues as $key => $value){\n\t\t\t$this->binder($statement, $key, $value);\n\t\t}\n\t\ttry {\n\t\t\t$statement->execute();\n\t\t} catch (Exception $e){\n\t\t\techo $e->getMessage();\n\t\t}\n\t\t$result = $statement->fetch($mode);\n\t\t$this->afterFind($result);\n\t\treturn $result;\n\t}", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function addOuterJoinOn($table, $where)\n {\n //argument test\n Argument::i()\n //Argument 1 must be a string\n ->test(1, 'string')\n //Argument 2 must be a string\n ->test(2, 'string');\n \n $where = func_get_args();\n $table = array_shift($where);\n \n $this->join[] = array(self::OUTER, $table, $where, false);\n \n return $this;\n }" ]
[ "0.64103115", "0.63773274", "0.6247565", "0.6137387", "0.609356", "0.6028849", "0.6018295", "0.60128963", "0.59937614", "0.59906906", "0.5977416", "0.5935582", "0.5852484", "0.5849529", "0.5820011", "0.58146423", "0.5781572", "0.5767845", "0.57545954", "0.5751849", "0.5714854", "0.5714735", "0.57123333", "0.5704839", "0.5689476", "0.5680417", "0.5671614", "0.5666231", "0.56535023", "0.5650061", "0.5629944", "0.5609889", "0.5606889", "0.5603324", "0.5596231", "0.55943114", "0.5575101", "0.557442", "0.55701876", "0.5566533", "0.5564094", "0.55595833", "0.5539944", "0.55324167", "0.5532186", "0.5512087", "0.5497352", "0.5494933", "0.54916555", "0.54702413", "0.5467364", "0.5464592", "0.54438174", "0.54396874", "0.54372424", "0.54312396", "0.5410705", "0.54092973", "0.54081863", "0.5405726", "0.5402019", "0.5401735", "0.53927445", "0.53773224", "0.5372865", "0.5358081", "0.5357399", "0.53516257", "0.534987", "0.53466403", "0.534471", "0.53380275", "0.5327096", "0.5326447", "0.532241", "0.53219706", "0.53047645", "0.53013873", "0.5286316", "0.52712023", "0.527079", "0.52645874", "0.52614933", "0.52590644", "0.52582824", "0.525774", "0.5250586", "0.52501255", "0.5232617", "0.52322197", "0.52293843", "0.5222773", "0.52162224", "0.52132016", "0.521103", "0.52097297", "0.52062535", "0.52043283", "0.51990587", "0.51914567" ]
0.53193945
76
Simple AND ON WHERE condition with various set of arguments. You can use parametric values in such methods.
public function andOnWhere($joined, $variousA = null, $variousB = null, $variousC = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->whereWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "public function andWhere($conditions);", "public function andWhere($field, $operator, $value);", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function where(...$args)\n {\n $this->addCondition('and', $args, $this->conditions);\n return $this;\n }", "public function andWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'where'), func_get_args());\r\n\t\treturn $this;\r\n\t}", "public function andWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_AND) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_AND, $args);\n }\n\n return $this->add('where', $where, true);\n }", "function where_and($conditions = array())\n {\n return $this->object->_where($conditions, 'AND');\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function andWhere($identifier, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken('AND', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function whereAcf(...$args)\n {\n $this->addAcfCondition('and', $args, $this->conditions);\n return $this;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function wAnd()\n {\n $this->setDefaultOperator(PredicateSet::OP_AND);\n \n if (func_num_args()) {\n call_user_func_array([$this, 'condition'], func_get_args());\n $this->endAnd();\n }\n \n return $this;\n }", "public function andWhere($field, $predicate): self;", "protected function user_where_clause() {}", "public function and(string $key, ...$arguments) : Api\n {\n return $this->where($key, ...$arguments);\n }", "abstract public function where(array $where);", "public function whereAndObject($objects) {\r\n\t\t$this->addWhereObject('AND', $objects);\r\n\t}", "public function andWhere($where, $params = array()) {\n parent::andWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "final public static function and($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' AND ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' AND ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function where($identifier, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken('AND', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function andWhere($where): QueryBuilderInterface;", "public function andClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'AND', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "function where($sql, $params = []) {\n\t\tif (gettype($sql) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($sql as $col => $val) {\n\t\t\t\t$cols[] = \"`$col` = ?\";\n\t\t\t\t$params[] = $val;\n\t\t\t}\n\t\t\t$sql = implode($cols, \" AND \");\n\t\t}\n\t\t\n\t\tisset($this->stmts['where']) ? $sql = \"AND $sql\" : $sql = \"WHERE $sql\";\n\t\treturn $this->appendStmt('where', $sql, $params);\n\t}", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function andWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->andWhere($where, $params);\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "private function sql_whereAnd_enableFields()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n $andWhere = $this->pObj->cObj->enableFields( $table );\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "public function rawAndWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings);\n\t}", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function testBuildWhereWithTwoArguments()\n {\n $query = $this->getQuery()\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE param1 = 'value1' AND param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "function query($args, $operator = 'AND')\n {\n }", "public function testBuildWhereWithTwoArgumentsAndAlias()\n {\n $query = $this->getQuery()\n ->alias('alias')\n ->where('param1', 'value1')\n ->where('param2', 'in', ['value2', 'value3'])\n ;\n\n $this->assertSame(\n \"WHERE alias.param1 = 'value1' AND alias.param2 IN ('value2', 'value3')\",\n $query->buildWhere()\n );\n }", "public function andWhere($condition) {\n return $this->where($condition, 'AND');\n }", "public function whereAndQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('AND', $subQuery);\r\n\t}", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "public function joinOnAndQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('AND', $other, $whereQuery);\r\n\t}", "public function and_where ( $mFields, $mValue = null )\n {\n /*\n Return for method chaining.\n */\n return $this->where($mFields, $mValue, 'AND');\n }", "public function where($clause, array $params);", "public function andWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value);\n\t}", "function where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'AND ', $escape);\r\n\t}", "public function andWhere($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Where expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->where = $this->where ? '(' . $this->where . ') AND (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('where', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function onWhere($joined, $variousA = null, $variousB = null, $variousC = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->whereWrapper()\n );\n\n return $this;\n }", "public function and_where(array $conditions): self\n\t{\n\t\tif (isset($conditions) && !empty($conditions))\n\t\t{\n\t\t\t$this->create_where_field('$and');\n\t\t\t\n\t\t\tforeach ($conditions as $field => $value)\n\t\t\t{\n\t\t\t\tif (is_string($field) && $field != '')\n\t\t\t\t{\n\t\t\t\t\t$this->wheres['$and'][] = [$field => $value];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Each field name in list must not be an empty string', __METHOD__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function andOn(array|string $column, string $op = null, array|string $value = null): void\n {\n call_user_func_array([$this, 'on'], func_get_args());\n }", "public function andSql($fieldCondition, $value) {\r\n $this->where($fieldCondition, $value);\r\n return $this;\r\n }", "public function where()\n {\n $bindings = func_get_args();\n $sql = array_shift($bindings);\n\n $this->addToBindings($bindings);\n $this->wheres[] = $sql;\n\n return $this;\n }", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "function addConditionalsToQuery($query, $filledFormFields) {\n\t// Testing if we have to fill the conditional of our SQL statement\n\tif(count($filledFormFields) > 0) {\n\t\t$query .= \" WHERE \";\n\n\n\t\t// Adding the conditionals to the query\n\t\t$i = 0;\n\t\tforeach($filledFormFields as $fieldKey => $fieldValue) {\n\t\t\t// Appending the new conditional\n\t\t\t$queryAppendage = $fieldKey . \" LIKE :\" . $fieldKey . \" \";\n\n\t\t\t$query .= $queryAppendage;\n\t\t\t\n\t\t\t// If there's more conditionals after this, append an \"AND\" as well.\n\t\t\tif($i < count($filledFormFields) - 1) \n\t\t\t\t$query .= \" AND \";\n\n\t\t\t$i++;\n\t\t}\n\t}\n\n\treturn $query;\n}", "public function where($column, $operator = null, $value = null, $boolean = 'and');", "public function where(string ...$condition): self\n {\n $this->where = array_merge($this->where, $condition);\n return $this;\n }", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function and_where_open()\n {\n $this->_where[] = array('AND' => '(');\n return $this;\n }", "protected abstract function getWhereClause(array $conditions);", "public function joinOnAnd(Query $other, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$this->addJoinOn('AND', $other, $fieldOrExpr, $operator, $valueOrExpr);\r\n\t}", "public function testBuildWhereWithOneArgument()\n {\n $query = $this->getQuery()\n ->where('param', 'value')\n ;\n\n $this->assertSame(\n \"WHERE param = 'value'\",\n $query->buildWhere()\n );\n }", "public function where($conditions)\n {\n if(!$this->query)\n {\n return false;\n }\n \n // Were multiple arguments passed?\n if(func_num_args() > 1)\n {\n $conditions = func_get_args();\n }\n \n $conditions = stripslashes($this->san($conditions));\n $this->query .= \"WHERE {$conditions} \";\n \n // Return a ref. to this object for chainability\n return $this;\n }", "public function andWhere($condition)\n {\n $this->appendWhereString(\" AND \")->where($condition);\n return $this;\n }", "public function where($column, $operator = null, $value = null, $boolean = 'and')\n {\n return parent::where(...Factory::resolve(func_get_args()));\n }", "protected function where($data, $conditional = false) {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\t$this->_where = ' WHERE ';\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\tif ( $fields == 1) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\t\tif ( $i+1 == $fields) {\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cond = ($conditional) ? $conditional[$i] : 'AND';\n\t\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' ' . $cond . ' ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t }", "public static function where(array $where);", "public function and( string $options )\n\t{\n\t\t$query_part = 'AND ' . $options;\n\t\t$this->and = $query_part;\n\n\t\treturn $this;\n\t}", "protected function getGeneralWhereClause() {}", "protected function addCondition($condition, $one)\n {\n // query by primary key\n if($one && !empty($condition) && !is_array($condition))\n {\n $this->andWhere(static::primaryKey() . '=:id', [':id'=>$condition]);\n }\n elseif(!empty($condition))\n {\n foreach($condition as $key => $value)\n {\n if(is_array($value))\n $this->andWhere(['in', $key, $value]);\n else\n $this->andWhere($key . \"=:value$key\", [\":value$key\" => $value]);\n }\n }\n }", "static function add_condition($where=array(),$cond='',$key=NULL,$value=NULL) {\n\tif ($cond) $where['cond'][]=$cond;\n\t$args=func_get_args();\n\tfor ($i=2; $i<count($args); $i=$i+2) {\n\t\tif (isset($args[$i])) $where['value'][$args[$i]]=isset($args[$i+1])?$args[$i+1]:NULL;\n\t}\n\treturn $where;\n}", "function clause_mode() {\n return 'AND';\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public static function static_logicalAnd($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function variant_and($left, $right) {}", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "public function where($predicates)\n {\n if ( ! (func_num_args() == 1 && $predicates instanceof Composite) ) {\n $predicates = new Composite(Composite::TYPE_AND, func_get_args());\n }\n\n return $this->add('where', $predicates);\n }", "public function andOn($joined = null, $operator = null, $outer = null)\n {\n $this->whereToken(\n 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'],\n $this->onWrapper()\n );\n\n return $this;\n }", "protected function getWhereClauseForEnabledFields() {}", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "public function whereAnd($fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$this->addWhere('AND', $fieldOrExpr, $operator, $valueOrExpr);\r\n\t}", "public function havingAnd()\n {\n $this->having .= \" AND \";\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "public function where($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_where', $key, $value, 'AND ', $escape);\n\t}", "public function where($fieldCondition, $value = null, $joiner = 'AND', $quotes = true) {\r\n if( $value === null ) {\r\n $this->sqlTmpField = $fieldCondition;\r\n } else {\r\n $joiner = strtoupper($joiner);\r\n if( $value === false ) {\r\n $value = $fieldCondition;\r\n $fieldCondition = ' ';\r\n }\r\n if( $quotes ) {\r\n $value = $this->addQuotes($value);\r\n }\r\n if( count($this->sqlConditions) ) {\r\n $this->sqlConditions[] = sprintf('%s %s %s', $joiner, $fieldCondition, $value);\r\n } else {\r\n $this->sqlConditions[] = sprintf('%s %s', $fieldCondition, $value);\r\n }\r\n }\r\n return $this;\r\n }", "public static function buildAnd(array $criteria)\n {\n return new LogicalAnd($criteria);\n }", "public function where($sql)\n {\n $this->where[] = call_user_func_array('self::clause', func_get_args());\n return $this;\n }", "function _where($conditions = array(), $operator)\n {\n $where_clauses = array();\n // If conditions is not an array, make it one\n if (!is_array($conditions)) {\n $conditions = array($conditions);\n } elseif (!empty($conditions) && !is_array($conditions[0])) {\n // Just a single condition was passed, but with a bind\n $conditions = array($conditions);\n }\n // Iterate through each condition\n foreach ($conditions as $condition) {\n if (is_string($condition)) {\n $clause = $this->object->_parse_where_clause($condition);\n if ($clause) {\n $where_clauses[] = $clause;\n }\n } else {\n $clause = array_shift($condition);\n $clause = $this->object->_parse_where_clause($clause, $condition);\n if ($clause) {\n $where_clauses[] = $clause;\n }\n }\n }\n // Add where clause to query\n if ($where_clauses) {\n $this->object->_add_where_clause($where_clauses, $operator);\n }\n return $this->object;\n }", "public function andWhereArray(array $where)\n\t{\n\t\treturn $this->whereArray($where, 'and');\n\t}", "public function andWhereEq($name,$value)\r\n {\r\n $qb = $this;\r\n \r\n // Handle array\r\n if (is_array($value))\r\n {\r\n // Filter empty\r\n if (!count($value)) return;\r\n \r\n // Use IN, assume for now array contains scaler values\r\n if (count($value) > 1)\r\n {\r\n return $qb->andWhere($qb->expr()->in($name, $value));\r\n }\r\n $value = array_shift($value); //$value[0];\r\n }\r\n // Just a plain old scaler\r\n if (is_object($value)) $value = $value->getId();\r\n \r\n return $qb->andWhere($qb->expr()->eq($name,$qb->expr()->literal($value)));\r\n }", "public static function logicalAnd(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalAnd(func_get_args());\n }", "public function getAndWhereStatement($separator='AND') \n {\n $andWhere_array = [];\n foreach ($this->andWhere as $key => $column) {\n if( !isset($_GET[$key]) || empty($_GET[$key]) ) continue;\n switch ($key) {\n case 's':\n $keywords = explode(\" \", mysql_real_escape_string(htmlspecialchars($_GET[$key])));\n $parts = array();\n for ($i = 0; $i < count($keywords); $i++) {\n $parts[] = \"(o.Name LIKE '%\". $keywords[$i] .\"%' OR o.Details LIKE '%\". $keywords[$i] .\"%' OR o.Profil LIKE '%\". $keywords[$i] .\"%')\";\n }\n $andWhere_array[] = '('. implode(' AND ', $parts) .')';\n break;\n default:\n if(is_array($_GET[$key])) {\n $andWhere_array[] = key($column) .\".\". reset($column) .\" IN('\". implode(\"','\", $_GET[$key]) .\"')\";\n } else {\n $andWhere_array[] = key($column) .\".\". reset($column) .\"='{$_GET[$key]}'\";\n }\n break;\n }\n }\n $andWhere_array[] = (Route::getRoute() == 'offres/stage') ? \"o.id_tpost='4'\" : \"o.id_tpost!='4'\";\n\n // Afficher les offres expirées au candidats dans la page des offres.\n if (get_setting('front_show_expired_offers_on_frentend') != 1) {\n $andWhere_array[] = \"o.status='En cours'\";\n $andWhere_array[] = \"DATE(o.date_expiration) >= CURDATE()\";\n }\n\n return (!empty($andWhere_array)) ? \" {$separator} \". implode(' AND ', $andWhere_array) : '';\n }", "public function addAcfCondition($chain, $arguments, &$array)\n {\n $table_pm = $this->addAcfJoint();\n $condition = $this->addComplexCondition($chain, $array)->where($table_pm->alias . '.meta_key', $arguments[0]);\n $arguments[0] = $table_pm->alias . '.meta_value';\n call_user_func_array([$condition, 'where'], $arguments);\n }", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }" ]
[ "0.75843495", "0.7573578", "0.7350388", "0.73310894", "0.72500384", "0.724184", "0.7013795", "0.69916445", "0.6983285", "0.6950905", "0.6928973", "0.68072873", "0.6709135", "0.66775686", "0.6546578", "0.6536436", "0.64954984", "0.6472122", "0.6408446", "0.6403547", "0.6394007", "0.63818663", "0.6349993", "0.63496757", "0.63495743", "0.63417214", "0.6341361", "0.6302808", "0.62897515", "0.62818784", "0.6265922", "0.6261821", "0.6248518", "0.6246924", "0.62124467", "0.62052625", "0.6193921", "0.6173096", "0.6168066", "0.6162383", "0.6156359", "0.61230665", "0.6117897", "0.60933894", "0.60846704", "0.60842615", "0.60790193", "0.60679287", "0.6063252", "0.604292", "0.60396945", "0.5999905", "0.5999022", "0.5995462", "0.5956235", "0.59198767", "0.5913781", "0.5898929", "0.5880039", "0.58701", "0.58688295", "0.58657473", "0.5831726", "0.58294773", "0.5827222", "0.582615", "0.5825093", "0.5822287", "0.5818794", "0.5808065", "0.58053464", "0.58015865", "0.5798699", "0.5787118", "0.5783456", "0.57750195", "0.5757406", "0.5754902", "0.5751644", "0.5744939", "0.5741294", "0.5720797", "0.57146734", "0.57128346", "0.57114506", "0.5689384", "0.5688505", "0.5675855", "0.5675489", "0.5673752", "0.5668982", "0.5666003", "0.56644565", "0.56574714", "0.56574523", "0.5656382", "0.565497", "0.5652873", "0.5646626", "0.5642254" ]
0.61776865
37
Simple OR ON WHERE condition with various set of arguments. You can use parametric values in such methods.
public function orOnWhere($joined, $variousA = null, $variousB = null, $variousC = null) { $this->whereToken( 'AND', func_get_args(), $this->joinTokens[$this->activeJoin]['on'], $this->whereWrapper() ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orWhere() {\r\n\t\t$args = func_get_args();\r\n\t\tif (count($this->_wheres)) {\r\n\t\t\t$criteria = call_user_func_array(array($this->_wheres[count($this->_wheres)- 1], 'orWhere'), $args);\r\n\t\t} else {\r\n\t\t\t$statement = array_shift($args);\r\n\t\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t\t$this->_wheres[] = $criteria;\r\n\t\t}\r\n\t\treturn $criteria;\r\n\t}", "protected static function logicalOR(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('OR', $values);\n\t}", "public function orWhere()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => $value]);\n }", "public function orWhere()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('or', $column, $comparison, $value);\r\n \r\n return $this;\r\n }", "public function orWhere($table,$column,$data = \"\");", "public function orWhere()\n {\n if ( func_num_args() == 2 )\n {\n list($field, $value) = func_get_args();\n $op = '=';\n }\n else\n {\n list($field, $op, $value) = func_get_args();\n }\n $this->appendWhere('OR', $field, $op, $value); \n return $this;\n }", "public function orWhere($column, $operator = null, $value = null);", "public function orWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function orWhere(...$args)\n {\n $this->addCondition('or', $args, $this->conditions);\n return $this;\n }", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "function or_where($key, $value = NULL, $escape = TRUE)\r\n\t{\r\n\t\treturn $this->_where($key, $value, 'OR ', $escape);\r\n\t}", "public function whereOR()\n {\n $this->where_clause .= \" OR \";\n }", "public function orWhere($operand, $operatorOrValue=null, $value=null);", "public function orWhere($field, $operator, $value);", "public function orWhereComplex()\n {\n return $this->addComplexCondition('or', $this->conditions);\n }", "public function orWhereRaw(/*# string */ $rawString, array $params = []);", "public function orWhereAcf(...$args)\n {\n $this->addAcfCondition('or', $args, $this->conditions);\n return $this;\n }", "public function orWhere($where)\n {\n $where = $this->getQueryPart('where');\n $args = func_get_args();\n\n if ($where instanceof Composite && $where->getType() === Composite::TYPE_OR) {\n $where->addMultiple($args);\n } else {\n array_unshift($args, $where);\n $where = new Composite(Composite::TYPE_OR, $args);\n }\n\n return $this->add('where', $where, true);\n }", "public function orWhere(){\r\n\t\t$tb = call_user_func_array(array($this->mask(), 'orWhere'), func_get_args());\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function testBuildWhereOnlyOr()\n {\n $query = $this->getQuery()\n ->whereOr(\n $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->where('is_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE (table1.id = '100' OR table1.is_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function testBuildWhereWithOr()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where('is_super_admin', 1)\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR is_super_admin = '1')\",\n $query->buildWhere()\n );\n }", "public function addWhereOr($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'OR ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function whereOr($value) {\n\t$this->parseQuery->where('$or', $value);\n }", "public function or_where($key, $value = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_wh('qb_where', $key, $value, 'OR ', $escape);\n\t}", "public function useOr()\n {\n $this->imploder = ' OR ';\n }", "public function rawOrWhere($where, $bindings = array())\n\t{\n\t\treturn $this->rawWhere($where, $bindings, 'OR');\n\t}", "static function _OR($params1, $params2){\n /* del parametro 1 separa el campo del valor */\n $params_1 = explode('=', $params1);\n $campo1 = trim($params_1[0]);\n $var1 = trim($params_1[1]);\n\n /* del parametro 2 separa el campo del valor */\n $params_2 = explode('=', $params2);\n $campo2 = trim($params_2[0]);\n $var2 = trim($params_2[1]);\n\n if($campo1 != $campo2)\n throw new \\Exception('Unexpected error creating OR clause. The fields involved should be the same.');\n\n /* busca si existe el campo en el modelo en cuestion */\n if(aModels::findFieldModel($campo1) == 'STRING'){\n return \"(\". $campo1 . \"= '\" .(strip_tags($var1)). \"' {or} \". $campo2 . \"= '\" .(strip_tags($var2)) .\"')\";\n }else\n return '('. $params1 . ' {or} '. $params2 .')';\n }", "public function orWhere($data, $conditional = 'AND') {\n\n\t \t$fields = count($data);\n\t\t\t$i = 0;\n\n\t\t\tif(is_null($this->_where)) {\n\t\t\t\t$this->_where = ' WHERE ';\n\t\t\t} else {\n\t\t\t\t$this->_where .= \" $conditional \";\n\t\t\t}\n\n\t\t\tif($fields < 2) {\n\t\t\t\tthrow new Exception('Para utlizar o metodo orWhere é necessário pelo menos 2 clausulas');\n\t\t\t}\n\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$newKey = ':'.$key;\n\t\t\t\t$this->_params[$newKey] = $value;\n\t\t\t\tif($i == 0) {\n\t\t\t\t\t$this->_where .= '(' . $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t} else if ( $i+1 == $fields) {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ')';\n\t\t\t\t} else {\n\t\t\t\t\t$this->_where .= $key . ' = ' . $newKey . ' OR ';\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\treturn $this;\n\t }", "public function whereOrObject($objects) {\r\n\t\t$this->addWhereObject('OR', $objects);\r\n\t}", "public function orWhere(...$conditions)\n {\n $this->where(...$conditions);\n return $this;\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\treturn call_user_func_array(array($this, 'andWhere'), $args);\r\n\t}", "public function orWhere($where, $params = array()) {\n parent::orWhere($where, $params);\n $where = $this->_dqlParts['where'];\n array_splice($where, count($where)-1, 0, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n \n return $this;\n }", "public function orOn(array|string $column, string $op = null, array|string $value = null): void\n {\n if (func_num_args() === 2) {\n $value = $op;\n $op = '=';\n }\n\n $this->on[] = [$column, $op, $value, 'OR'];\n }", "public function orWhere($column, $value = false, $operator = '=')\n {\n\t\treturn $this->condition($column, $value, $operator, 'OR', 'where');\n\t}", "public function testBuildWhereWithOrComplex()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->where('id', 100)\n ->whereOr(\n $this->getQuery()\n ->where('is_admin', 1)\n ->where(\n $this->getQuery()\n ->where('is_super_admin', 1)\n ->where('can_be_super_admin', 1)\n )\n )\n ;\n\n $this->assertSame(\n \"WHERE table1.id = '100' AND (is_admin = '1' OR (is_super_admin = '1' AND can_be_super_admin = '1'))\",\n $query->buildWhere()\n );\n }", "function orB($lhs = null, $rhs = null)\n{\n return call_user_func_array(__PRIVATE__::$instance[orB], func_get_args());\n}", "public function orWhere($where): QueryBuilderInterface;", "public function or_where($column, $op = null, $value = null)\n {\n if (is_array($column))\n {\n foreach ($column as $key => $val)\n {\n if (is_array($val))\n {\n $this->or_where($val[0], $val[1], $val[2]);\n }\n else\n {\n $this->or_where($key, '=', $val);\n }\n }\n }\n else\n {\n if(func_num_args() === 2)\n {\n $value = $op;\n $op = '=';\n }\n $this->_where[] = array('OR' => array($column, $op, $value));\n }\n\n return $this;\n }", "public function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return $this->where($prop,$value,$operator,'OR');\r\n }", "function or_where_in($key = NULL, $values = NULL)\r\n\t{\r\n\t \treturn $this->_where_in($key, $values, FALSE, 'OR ');\r\n\t}", "public function orWhereIf($where, $params = array()) {\n return empty($where)\n ? $this\n : $this->orWhere($where, $params);\n }", "public function orClause()\n {\n if ($this->_hasDqlQueryPart('where')) {\n $this->_addDqlQueryPart('where', 'OR', true);\n }\n\n $this->_addDqlQueryPart('where', '(', true);\n\n $this->_startClause = true;\n\n return $this;\n }", "public function or_where($clause, $join = \"AND\")\n\t{\n\t\t$this->_where .= \" OR \";\n\t\t$this->where($clause, $join);\n\t}", "public function orWhere($identifier, $variousA = [], $variousB = null, $variousC = null)\n {\n $this->whereToken('OR', func_get_args(), $this->whereTokens, $this->whereWrapper());\n\n return $this;\n }", "public function or_where_in($key = NULL, $values = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_where_in($key, $values, FALSE, 'OR ', $escape);\n\t}", "public function orwhere($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where($column, $sign, $value, 'or');\n else\n return $this->where($column, $sign, $value, 'where');\n }", "public function orWhere($column, $operator = null, $value = null)\n\t{\n\t\treturn $this->where($column, $operator, $value, 'OR');\n\t}", "public function or_where($key, $char = NULL)\r\n {\r\n return $this->_where($key, $char, 'OR ');\r\n }", "private function mergeOrWhere(){\n $wheres = $this->orWheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" OR \";\n }\n return rtrim($whereString, \" OR \");\n }", "public function or_where(array $conditions): self\n\t{\n\t\tif (isset($conditions) && !empty($conditions))\n\t\t{\n\t\t\t$this->create_where_field('$or');\n\t\t\t\n\t\t\tforeach ($conditions as $field => $value)\n\t\t\t{\n\t\t\t\tif (is_string($field) && $field != '')\n\t\t\t\t{\n\t\t\t\t\t$this->wheres['$or'][] = [$field => $value];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->error('Each field name in list must not be an empty string', __METHOD__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('One required non empty array argument should be passed to method', __METHOD__);\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function orWhere($prop, $value = PDODBNULL, $operator = '='){\r\n return self::$PDO->orWhere($prop,$value,$operator);\r\n }", "final public static function or($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' OR ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' OR ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public static function logicalOr(Matcher $matcher /*...*/)\n {\n return new Matcher\\LogicalOr(func_get_args());\n }", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function orWhere($field, $value = null, $escape = null)\n {\n return $this->prepareWhereStatement($field, $value, 'OR ', $escape, 'where');\n }", "protected function user_where_clause() {}", "public function orWhere($column, $operator = null, $value = null)\n {\n return $this->where($column, $operator, $value, 'or');\n }", "public function where_or($pairs)\n {\n $tmp = $this->where;\n $this->where = array();\n foreach ($pairs as $key => $val)\n {\n if (is_array($val)) $this->where_in($key, $val);\n else $this->where($key, $val);\n }\n $tmp[] = sprintf('(%s)', join(' or ', $this->where));\n $this->where = $tmp;\n return $this;\n }", "public static function static_logicalOr($a = null, $b = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function orWhere($expression)\n\t{\n\t\tif (!is_string($expression)) {\n\t\t\tthrow new InvalidArgumentException('Where expression has to be a string.');\n\t\t}\n\t\t$this->dirty();\n\t\t$this->where = $this->where ? '(' . $this->where . ') OR (' . $expression . ')' : $expression;\n\t\t$this->pushArgs('where', array_slice(func_get_args(), 1));\n\t\treturn $this;\n\t}", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "public function orWhere($column, $op = null, $value = null)\n\t{\n\t\tif($column instanceof \\Closure)\n\t\t{\n\t\t\t$this->orWhereOpen();\n\t\t\t$column($this);\n\t\t\t$this->whereClose();\n\n\t\t\treturn $this;\n\t\t}\n\n\t\tif (func_num_args() === 2)\n\t\t{\n\t\t\t$value = $op;\n\t\t\t$op = is_array($value) ? 'in' : '=';\n\t\t}\n\n\t\treturn $this->addCondition('where', 'or', $column, $op, $value);\n\t}", "public function orSql($fieldCondition, $value) {\r\n $this->where($fieldCondition, $value, 'OR');\r\n return $this;\r\n }", "public function orWhere(Array $restraints){\r\n $subclause = $this->where->addClause(\"or\");\r\n foreach($restraints as $rest){\r\n $this->__where_restraint($rest, $subclause);\r\n }\r\n return $this;\r\n }", "public function orWhereTpl(/*# string */ $template, $col, array $params = []);", "public function orWhere($key, $val=[]): QueryBuilderInterface\n\t{\n\t\treturn $this->_whereString($key, $val, 'OR');\n\t}", "public function or_where($query, $params = array(), $not = false)\r\n {\r\n return $this->where($query, $params, 'or', $not);\r\n }", "function variant_or($left, $right) {}", "public function orIn($column,$val);", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function orWhere($condition) {\n return $this->where($condition, 'OR');\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function orWhereArray(array $where)\n\t{\n\t\treturn $this->whereArray($where, 'or');\n\t}", "abstract public function where(array $where);", "protected static function logicalAND(){\n\t\t$values = func_get_args();\n\t\tif(is_array($values[0])){\n\t\t\t$values = $values[0];\n\t\t}\n\t\treturn self::junction('AND', $values);\n\t}", "public function getOrWhere($name = null)\n {\n return $this->_get('_orWhere', $name);\n }", "public function orwhere_str($column, $sign = null, $value = null)\n {\n if ($this->initwhereclause)\n return $this->where_str($column, $sign, $value, 'or');\n else\n return $this->where_str($column, $sign, $value, 'where');\n }", "public function orConditions($data = array()) {\r\n $filter = $data['filter'];\r\n $condition = array(\r\n 'OR' => array(\r\n $this->alias . '.title LIKE' => '%' . $filter . '%',\r\n $this->alias . '.body LIKE' => '%' . $filter . '%',\r\n )\r\n );\r\n return $condition;\r\n }", "public function orWhere($column, string $operator = null, $value = null) : self\n {\n return $this->where($column, $operator, $value, 'or');\n }", "public function isOr();", "public function whereLessThanOrEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHERELTE][$field] = [self::OPERATORS['lte'] => $value];\n return $this;\n }", "function or_like($field, $match = '', $side = 'both')\r\n\t{\r\n\t\treturn $this->_like($field, $match, 'OR ', $side);\r\n\t}", "public function orWhere($key = null, $condition = null, $value = null)\n {\n $this->_orConditions [] = [\n 'key' => $key,\n 'condition' => $condition,\n 'value' => $value,\n ];\n\n return $this;\n }", "public function whereOr($mainInput, string $comparisonOperator = null, $valueToFind = null) : QueryBuilder\n {\n if (is_array($mainInput)) {\n $this->setWhereClauses($mainInput, 'whereOr', 'OR');\n return $this;\n }\n\n // then set array\n $this->setWhereClauses([[$mainInput, $comparisonOperator, $valueToFind]], 'whereOr', 'OR');\n return $this;\n }", "public function or_on($c1, $op, $c2)\n {\n $joins = $this->_join;\n // 将内部指针指向数组中的最后一个元素\n end($joins);\n // 返回数组内部指针当前指向元素的键名\n $key = key($joins);\n\n $this->_on[$key][] = array($c1, $op, $c2, 'OR');\n return $this;\n }", "public function orCondition($first, $operator, $second)\n\t{\n\t\t$this->_query['orCondition'] = (object)array(\n\t\t\t'first' => $first,\n\t\t\t'operator' => $operator,\n\t\t\t'second' => $second\n\t\t);\n\n\t\treturn $this;\n\t}", "public function whereOrQuery(Query $subQuery) {\r\n\t\t$this->addWhereQuery('OR', $subQuery);\r\n\t}", "public function orWhere($field, $op = null, $value = null) {\n return $this->_modifyPredicate($this->_where, Predicate::EITHER, $field, $op, $value);\n }", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public function or_where ( $mFields, $mValue = null )\n {\n /*\n Return for method chaining.\n */\n return $this->where($mFields, $mValue, 'OR');\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function or_where($col, $val, $opp = '=') \n {\n // Check for an array\n if(is_array($col))\n {\n // Combine arrays, set our array pointer to 1\n $array = array_combine($col, $val);\n $i = 0;\n \n // Loop through and add each if we have any\n if(count($array) > 0)\n {\n foreach($array as $key => $value)\n {\n // Some light cleaning\n $this->or_where($key, $value, $opp[$i]);\n ++$i;\n }\n }\n }\n else\n {\n // Some light cleaning\n $col = $this->clean($col);\n $val = $this->clean($val);\n \n // Add quotes on non-numeric values\n if(!is_numeric($val))\n {\n $val = \"'\". $val .\"'\";\n }\n $this->sql .= \" OR \". $col . $opp . $val;\n }\n return $this;\n }", "public function orWhereNotEq()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n return $this->addOrWhereStack([$field => [self::OPERATORS['ne'] => $value]]);\n }", "public function joinOnOrQuery(Query $other, Query $whereQuery) {\r\n\t\t$this->addJoinOnQuery('OR', $other, $whereQuery);\r\n\t}", "public static function or_() {\n $result = new qti_variable('single', 'boolean', array('value' => false));\r\n $params = func_get_args();\n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\r\n foreach($params as $param) {\r\n if ($param->value) {\r\n $result->value = true;\r\n return $result;\r\n }\r\n }\r\n return $result;\n }", "public function whereOr(array $parameters): Selection\n {\n $this->selection->whereOr($parameters);\n return $this;\n }" ]
[ "0.7623725", "0.76085687", "0.75495446", "0.74845964", "0.73583275", "0.7328685", "0.73284024", "0.71745545", "0.7143103", "0.713291", "0.71285325", "0.71018136", "0.70872205", "0.7068401", "0.6976912", "0.6925852", "0.6902818", "0.6867711", "0.6844337", "0.6831796", "0.6798971", "0.6785248", "0.6743476", "0.6676762", "0.6674788", "0.6637262", "0.66258466", "0.66136736", "0.6568151", "0.65566444", "0.653802", "0.65273213", "0.65211457", "0.65108067", "0.64994186", "0.6489958", "0.6468418", "0.64615846", "0.6447264", "0.64417803", "0.642294", "0.64045393", "0.6396721", "0.6383421", "0.6365541", "0.6307313", "0.62906927", "0.62816113", "0.6274376", "0.62704533", "0.6241322", "0.6224024", "0.62238985", "0.6219934", "0.6216096", "0.6203129", "0.61967486", "0.61881125", "0.618765", "0.6170977", "0.6162716", "0.61537045", "0.6145951", "0.61313164", "0.61311144", "0.6118787", "0.6111024", "0.61004496", "0.6094112", "0.6077814", "0.6073199", "0.606273", "0.6060885", "0.6049759", "0.6048151", "0.60332", "0.60285455", "0.60186017", "0.60177463", "0.60151166", "0.60055816", "0.5995662", "0.5985004", "0.5976953", "0.5962562", "0.59504956", "0.59480894", "0.59448683", "0.59354144", "0.5934453", "0.5926897", "0.59207666", "0.5920441", "0.5919825", "0.5909512", "0.58988106", "0.58789843", "0.5877828", "0.58575845", "0.58568037" ]
0.61038417
67
Convert various amount of where function arguments into valid where token.
abstract protected function whereToken( $joiner, array $parameters, &$tokens = [], callable $wrapper );
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processedWhereClause($where) {\n\t$x = explode(\" \", $where);\n\t$temp_where = \"\";\n\tforeach($x as $value) {\n\t\t$temp_where .= \" \";\n\t\tif(strpos($value, \"=\")) {\n\t\t\t$kv = explode(\"=\", $value);\n\t\t\t$temp_where .= $kv[0] . \"='\" . $kv[1] . \"'\";\n\t\t} else {\n\t\t\t$temp_where .= $value;\n\t\t}\n\t} \n\t$where = $temp_where;\n\treturn $where;\n}", "private function genSqlWhereArray($where){\n //input: $where is array of arguments or conditionals\n //output: $outWhere is array of each word split up, or null if anything is invalid\n //ex input: \n // $where[0] => luminosity=3\n // $where[1] => AND\n // $where[2] => temperature = '2'\n //output:\n // $outWhere[0] => luminosity\n // $outWhere[1] => 3\n // $outWhere[2] => AND\n // $outWhere[3] => temperature\n // $outWhere[4] => 2\n if(debug){ \"sqlInteract.php/genSqlWhereArray(): \". $where . PHP_EOL;}\n if($where == 1){\n return true;\n }else {\n $point = 0;\n $outWhere = [];\n foreach($where as $ptr => $val){\n foreach(explode('=', $val) as $substr){\n switch($point%3) {\n case 0://dict check word\n $word = trim($substr, \" \\t\\n\\r\\0\\x0B`\\\"\");\n if($this->checkWord($word)){\n array_push($outWhere, $word);\n }\n else{\n return null;\n }\n break;\n case 1://= val\n array_push($outWhere,trim($substr, \" \\t\\n\\r\\0\\x0B\"));\n break;\n case 2://conditional\n $word = trim($substr, \" \\t\\n\\r\\0\\x0B\");\n if(preg_match('/(AND|OR|NOT)/i', $word)){\n array_push($outWhere, $word);\n }\n else{\n return null;\n }\n break;\n }\n $point++;\n }\n }\n return $outWhere;\n }\n \n }", "protected static function whereFormat($where){\n $whereArray = array();\n\n $operate = ' AND ';\n\n foreach ($where as $key => $set){\n if(is_string($set)){\n if(count($where) == 2){\n list($filed,$value) = $where;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($where) == 3){\n list($filed,$exp,$value) = $where;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n break;\n }elseif(is_array($set)){\n if(count($set) == 2){\n list($filed,$value) = $set;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($set) == 3){\n list($filed,$exp,$value) = $set;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n }\n\n }\n return implode($operate, $whereArray);\n }", "protected function parseWhere($where) {\n\t\t$parser = new Parser();\n\t\t$expr = str_replace(array(' and ', ' AND ', ' or ', ' OR '), array(' && ', ' && ', ' || ', ' || '), $where);\n\t\t$expr = $parser->parse($expr);\n\t\t$tokens = $expr->get();\n\t\t$conditions = array();\n\t\t$expression = array();\n\t\t$npar = 0;\n\t\t$condition = (object)array(\n\t\t\t'operand' => '',\n\t\t\t'operator' => '',\n\t\t\t'value' => '',\n\t\t\t'inoperand' => false,\n\t\t\t'invalue' => false,\n\t\t\t'infunction' => false\n\t\t);\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($condition->infunction) {\n\t\t\t\tif ($token->type == Token::T_POPEN) {\n\t\t\t\t\t$npar++;\n\t\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\t\t$npar--;\n\t\t\t\t\tif ($npar == 0) {\n\t\t\t\t\t\t$condition->infunction = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->type == Token::T_FUNCTION) {\n\t\t\t\t$condition->infunction = true;\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->isComparator()) {\n\t\t\t\t$condition->operator = $token->value;\n\t\t\t\t$condition->inoperand = false;\n\t\t\t\t$condition->invalue = true;\n\t\t\t} else if ($token->type == Token::T_POPEN) {\n\t\t\t\tif ($condition->inoperand) {\n\t\t\t\t\t$condition->operand .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else if ($condition->invalue) {\n\t\t\t\t\t$condition->value .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$expression[] = $token->value;\n\t\t\t\t}\n\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->value;\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else if ($token->type == Token::T_LOGICAL_AND || $token->type == Token::T_LOGICAL_OR) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->type == Token::T_LOGICAL_AND ? 'and' : 'or';\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else {\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t}\n\t\t}\n\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t}\n\t\treturn (object)array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'expression' => $expression\n\t\t);\n\t}", "public function parseWhere($where){\n $whereStr = '';\n if(is_string($where)){\n $whereStr = $where;\n }else{\n $str = array();\n foreach($where as $key => $val){\n\t$str[] = \"`$key` = \".Model::parseValue($val);\n }\n $whereStr = \"where \".implode(\" AND \", $str);\n }\n return $whereStr;\n }", "private function _process_where_single($where){\n\t\tif((!isset($where['field'])&&!isset($where['name']))||!isset($where['operator'])){\n\t\t\t$return = '';\n\t\t}else{\n\t\t\tif(!isset($where['value'])){\n\t\t\t\t$where['value'] = '';\n\t\t\t}\n\t\t\t$field\t\t = isset($where['field'])?$where['field']:$where['name'];\n\t\t\t$operator\t = strtoupper($where['operator']);\n\t\t\t$value\t\t = $where['value'];\n\t\t\t$extra\t\t = isset($where['extra'])?$where['extra']:'';\n\t\t\t$escape\t\t = isset($where['escape'])?$where['escape']:'auto'; //this can be : auto (filter/value chooses if escape or not), true (always escapes), false (never escapes)\n\t\t\t$return\t\t = '';\n\n\t\t\t//let's create some backwards compatibility\n\t\t\tswitch($operator){\n\t\t\t\tcase 'F=':\n\t\t\t\tcase 'F>':\n\t\t\t\tcase 'F<':\n\t\t\t\tcase 'F!=':\n\t\t\t\tcase 'F>=':\n\t\t\t\tcase 'F<=':\n\t\t\t\t\t//field base\n\t\t\t\t\t$operator\t = substr($operator, 1);\n\t\t\t\t\t$escape\t\t = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//fixing some non standard operators\n\t\t\tswitch($operator){\n\t\t\t\tcase '!=':\n\t\t\t\t\t$operator = '<>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//let's prepare the $where['value']\n\t\t\tswitch($operator){\n\t\t\t\tcase 'AGAINST':\n\t\t\t\t\t$value = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'][0], $escape);\n\t\t\t\t\t\t$value .= ' '.$where['value'][1];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BETWEEN':\n\t\t\t\t\tif(!is_array($where['value'])){\n\t\t\t\t\t\t$where['value'] = array(0, 0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!isset($where['value'][0])) $where['value'][0]\t = 0;\n\t\t\t\t\t\tif(!isset($where['value'][1])) $where['value'][1]\t = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'][0], $escape).' AND '.$this->_escape_field($where['value'][1], $escape);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NOT IN':\n\t\t\t\tcase 'IN':\n\t\t\t\t\t$value\t = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\tforeach($where['value'] as $k => $v){\n\t\t\t\t\t\t\t$where['value'][$k] = $this->_escape_field($where['value'][$k], $escape);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value .= implode(',', $where['value']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'IS':\n\t\t\t\tcase 'IS NOT':\n\t\t\t\t\t//exception to _escape_field because the \"NULL\" will not need to be escaped\n\t\t\t\t\t//so the default behavior is to NOT escape\n\t\t\t\t\tif($escape===false||$escape==='auto'){\n\t\t\t\t\t\t$value = $where['value'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'FIND_IN_SET':\n\t\t\t\tcase 'NOT FIND_IN_SET':\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n//\t\t\t\tif($escape === false){\n//\t\t\t\t\t$value = $where['value'];\n//\t\t\t\t}else{\n//\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n//\t\t\t\t}\n\t\t\t\t\t$return\t = $operator.'('.$value.','.$field.')';\n\t\t\t\t\tbreak;\n\t\t\t\t//all of those are falling into the default\n\t\t\t\t/*\n\t\t\t\t case 'REGEXP':\n\t\t\t\t case 'LIKE':\n\t\t\t\t case '=':\n\t\t\t\t case '!=':\n\t\t\t\t case '>':\n\t\t\t\t case '<':\n\t\t\t\t case '=>':\n\t\t\t\t case '=<':\n\t\t\t\t */\n\t\t\t\tdefault:\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($return==''){\n\t\t\t\t$return = $field.' '.$operator.' '.$value.' '.$extra;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "function replaceVarsInWhere($where) {\n // or popooon parameter with type \"structure2xml\"\n // %VAR with an sql_regcase ( hello gets to [Hh][Ee][Ll][Ll][Oo] ) and\n // +VAR with +VAR (\"hello world\" gets to \"+hello +world\" this is useful for fulltext search in mysql)\n $regs = array();\n $repl = array();\n if (is_array($this->getParameter(\"structure2xml\"))) {\n $requests = array_merge($_REQUEST,$this->getParameter(\"structure2xml\"));\n } else {\n $requests = $_REQUEST;\n }\n return self::replaceVarsInWhereStatic($where,$requests);\n \n }", "protected function genWhere(array $where): string\n {\n $outWhere = [];\n foreach ($where as $k => $v) {\n if (is_int($k)) {\n $outWhere[] = $v;\n } elseif (is_null($v)) {\n $outWhere[] = $k . ' is null';\n } else {\n $outWhere[] = $k . ' = ?';\n }\n }\n return !empty($outWhere) ? implode(' AND ', $outWhere) : '1 = 1';\n }", "function whereCheck($where){\n\tif ($where==null){\n\t\treturn $where;\n\t} else {\n\t\t// append the where postfix\n\t\t$where = \"WHERE $where\";\n\t\treturn $where;\n\t}\n}", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "protected function _compile_wh($where) {\n\t\tif (is_array($where) && count($where) > 0) {\n\t\t\t$statements = array();\n\t\t\tforeach ($where as $key => $val) {\n\t\t\t\t// Get Operator\n\t\t\t\tif ($this->_has_operator($key)) {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' ' . $this->_get_operator($key) . ' ' . $this->escape($val);\n\t\t\t\t} else {\n\t\t\t\t\t$statements[] = $this->escape_identifiers($this->_clear_operator($key)) . ' = ' . $this->escape($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$query = ' WHERE ' . implode(' AND ', $statements);\n\n\t\t\treturn $query;\n\t\t} elseif (is_string($where)) {\n\t\t\treturn ' WHERE ' . $where;\n\t\t}\n\n\t\treturn '';\n\t}", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function build_where( $where = array() ) {\n global $wpdb;\n\n $sql = ' WHERE 1=1 ';\n\n foreach ( $where as $key => $value ) {\n $type = ( array_key_exists( $key, $this->field_types ) ) ? $this->field_types[ $key ] : '%s';\n if ( $type === 'date' ) {\n $date_query = new WP_Date_Query( $value, $this->get_row_suffix() . $key );\n $sql .= $date_query->get_sql();\n } else {\n $sql .= ' AND ' . $this->get_row_suffix() . $key . ' = ' . $wpdb->prepare( $type, $value ) . ' ';\n }\n }\n\n return $sql;\n }", "protected function _parseWhere($where, $args)\n {\n if (!is_array($args)) {\n $args = (array) $args;\n }\n //---$adapter = $this->getAdapter()->getClient();\n $i = 0;\n while (false !== ($pos = strpos($where, '?'))) {\n\n $args[$i] = \"'\" . str_replace(\"'\", \"''\", $args[$i]) . \"'\"; // quote\n //$where = substr_replace($where, $adapter->quote($args[$i]), $pos);\n\n $where = substr_replace($where, $args[$i], $pos, 1);\n\n ++$i;\n }\n if (('(' != $where[0]) || (')' != $where[strlen($where) - 1])) {\n $where = '(' . $where . ')';\n }\n return $where;\n }", "public static function buildWhereClause($where)\n{\n\t// Form WHERE clause\n\t$clause = ' WHERE ' . (is_array($where)\n\t\t? implode(' = ? AND ', array_keys($where)) . ' = ?'\n\t\t: strval($where));\n\n\t// Return clause\n\treturn $clause;\n}", "abstract public function where(array $where);", "protected function parseWhere($where = false)\n {\n\n if (is_array($where)) {\n if (array_key_exists('expressions', $where)) {\n $where = $this->parseComplexWhere($where);\n } else {\n $where = $this->parseSimpleWhere($where);\n }\n } else if (!is_string($where)) {\n $where = false;\n }\n\n return $where;\n }", "function parseToWhere($vars,$bool,$selx,$etype) {\n $arVars=explode(';',$vars);\n $arBool=explode(';',$bool);\n $arSelx=explode(';',$selx);\n $arEtype=explode(';',$etype);\n \n $i=0;\n //$iMax=0;\n $whereClause='';\n //$chosenOnes=array();\n \n foreach($arVars AS $varName) {\n if ($whereClause) {$whereClause.=$arBool[$i];}\n if (substr($arSelx[$i],0,2)=='__') {\n $op=substr($arSelx[$i],2,2);\n $val=substr($arSelx[$i],4);\n if ($op=='lt') {$whereClause.=' ('.$varName.\"<'\".$val.\"') \";}\n elseif ($op=='eq') {$whereClause.=' ('.$varName.\"='\".$val.\"') \";}\n elseif ($op=='gt') {$whereClause.=' ('.$varName.\">'\".$val.\"') \";}\n elseif ($op=='rg') {\n $v0=substr($val,0,strpos($val,'_'));\n $v1=substr($val,strpos($val,'_')+1);\n $whereClause.=\" ($varName>='$v0' AND $varName<='$v1') \";\n }\n else {$nought=0;}\n } elseif ($arEtype[$i]=='text') {\n $whereClause.=' ('.$varName.\" LIKE '%\".$arSelx[$i].\"%') \";\n } else {\n $whereClause.=' ('.$varName.\"='\".$arSelx[$i].\"') \";\n }\n $i++;\n }\n return $whereClause;\n}", "protected function getGeneralWhereClause() {}", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "public static function where(array $where);", "function map_wheres($where){\n //\n //return field to str\n return $where->to_str();\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "protected function getWhereClause() {}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "public function get_where_condition($where = []) {\n\t\t\t// Init bindings params\n\t\t\t$this->bindings = [];\n\n\t\t\t// If $where is not empty\n\t\t\tif (count($where) > 0) {\n\t\t\t\t// Loop through conditions\n\t\t\t\tforeach ($where as $col => $val) {\n\t\t\t\t\t// Transform [col => val] to \"col = ?\"\n\t\t\t\t\t$where[] = \"$col = ?\";\n\t\t\t\t\t// Add the value to the bindings params\n\t\t\t\t\t$this->bindings[] = $val;\n\t\t\t\t\t// Remove the array of [col => val]\n\t\t\t\t\tunset($where[$col]);\n\t\t\t\t}\n\t\t\t\t// Transfome [\"col1 = ?\", \"col2 = ?\"] to \"col1 = ? AND col2 = ?\"\n\t\t\t\t$where = implode(' AND ', $where);\n\t\t\t\t// Add WHERE satatement before\n\t\t\t\t$where = \"WHERE $where\";\n\t\t\t\t// Return the where conditions string\n\t\t\t\treturn $where;\n\t\t\t}\n\n\t\t\t// Else\n\t\t\t// Return empty string\n\t\t\treturn '';\n\t\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "private function getWhereClause($conn, $where){\n\t\tif (!is_array($where)){\n\t\t\treturn \"\";\n\t\t}\n\t\t$sql_where=\"\";\n\t\tforeach($where as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif ($sql_where!=\"\"){\n\t\t\t\t$sql_where = $sql_where . \" AND \";\n\t\t\t}\n\t\t\tif (is_array($val) ) {\n\t\t\t\tif (count($val) > 0) {\n\t\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` IN (\";\n\t\t\t\t\t$quoted_values = array();\n\t\t\t\t\tforeach ($val as $v) {\n\t\t\t\t\t\t$quoted_values[] = $this->quote($conn, $v, $field_info[\"type\"]);\n\t\t\t\t\t}\n\t\t\t\t\t$sql_where = $sql_where . implode(', ', $quoted_values).')';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sql_where = $sql_where . \"`\" . $field . \"` = \";\n\t\t\t\t$sql_where = $sql_where . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t\t}\n\t\t}\n\t\treturn $sql_where;\n\t}", "private function where($where, &$params) {\n if (!isset($where)) {\n return false;\n }\n $rwhere = '';\n if (is_array($where)) {\n $rwhere = 'WHERE ';\n foreach ($where as $k => $v) {\n $v = trim($v);\n if (substr($v, 0, 1) == '\"' || substr($v, 0, 1) == \"'\" || substr($v, 0, 2) == 'fn') {\n $s = $v;\n } else {\n $va = ':w_' . $k;\n $params[$va] = empty($v) ? null : $v;\n $s = $va;\n }\n $rwhere .= \" `\" . $k . \"` = \" . $s . \" AND\";\n }\n $rwhere = substr($rwhere, 0, -4);\n } else {\n $rwhere = $where;\n }\n\n return $rwhere;\n }", "protected function user_where_clause() {}", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function IsolateWhereClause($strSQL)\n{\n\tset_time_limit(10);\n\t$strBeingSought=\"where\";\n\t$strEndKeywords=\"limit group having order procedure into\";\n\t$strLcaseSQL=strtolower($strSQL);\n\t$intSoughtPos=strpos($strLcaseSQL, $strBeingSought);\n\t$strPossibleWhereClause=substr($strSQL, $intSoughtPos + strlen($strBeingSought));\n\t$intPostEndWhere=strlen($intPostEndWhere);\n\twhile($intPostEndWhere>-1)\n\t{\n\t\t$intPostEndWhere=PosInList($strBeingSought, $strPossibleWhereClause, \" \", true, $quotechar=\"'\");\n\t\t//echo $intPostEndWhere . \"=poswhere<br>\";\n\t\t$strPossibleWhereClause=substr($strPossibleWhereClause, 0, $intPostEndWhere);\n\t}\n\treturn $strPossibleWhereClause;\n}", "public function genWhere($whereArr)\n {\n $where = '';\n $where = implode(' AND ', $whereArr);\n return $where;\n }", "public function whereWrap()\n {\n $where = $this->_dqlParts['where'];\n\n if (count($where) > 0)\n {\n array_unshift($where, '(');\n array_push($where, ')');\n\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "public function parseWhere($where, $org_logic = '', $link) {\n if (!$where) return '';\n\n if (is_string($where)) {\n return $where;\n }\n\n if (array_key_exists('sql', $where)) {\n if (is_string($where['key'])) {\n $where['key'] = trim($where['key']);\n if (($oper = $this->hasOperator($where['key'])) == '') {\n return $this->protectKey($where['key'], $where['escape']) . '=(' . $where['sql'] . ')';\n } else {\n return $this->protectKey(trim(substr($where['key'], 0, -strlen($oper))), $where['escape']) . $oper . ' (' . $where['sql'] . ')';\n }\n } else {\n return $this->parseWhere($where['key'], $org_logic, $link);\n }\n } elseif (array_key_exists('value', $where)) {\n if (is_string($where['key'])) {\n $where['key'] = trim($where['key']);\n if (($oper = $this->hasOperator($where['key'])) == '') {\n return $this->protectKey($where['key'], $where['escape']) . '=' . $this->protectValue($where['value'], $where['escape'], $link);\n } else {\n if ($oper == ' LIKE' || $oper == ' NOT LIKE' || $oper == ' IS' || $oper == ' IS NOT' || $oper == ' IN' || $oper == ' NOT IN') {\n return $this->protectKey(trim(substr($where['key'], 0, -strlen($oper))), $where['escape']) . $oper . ' ' . $this->protectValue($where['value'], $where['escape'], $link);\n }\n\n return $this->protectKey(trim(substr($where['key'], 0, -strlen($oper))), $where['escape']) . $oper . $this->protectValue($where['value'], $where['escape'], $link);\n }\n } else {\n return $this->parseWhere($where['key'], $org_logic, $link);\n }\n } elseif (array_key_exists('params', $where)) {\n $str = '';\n $str = substr($where['psql'], 0, $pos = strpos($where['psql'], '?'));\n foreach ($where['params'] as $param) {\n $pos1 = strpos($where['psql'], '?', $pos);\n $str .= substr($where['psql'], $pos, $pos1 - $pos - 1);\n $pos = $pos1 + 1;\n }\n\n return $str;\n }\n\n $str = '';\n if (!$org_logic) {\n $org_logic = 'AND';\n }\n\n // only \"AND\" or \"OR\"\n $wheres = array();\n if ($where['AND']) {\n foreach ($where['AND'] as $w) {\n $wheres[] = $this->parseWhere($w, 'AND', $link);\n }\n\n $str .= ($str == '' ? '' : ' ' . $org_logic . ' ') . (count($wheres) > 1 ? '(' : '') . implode(' AND ', $wheres) . (count($wheres) > 1 ? ')' : '');\n }\n\n $wheres = array();\n if ($where['OR']) {\n foreach ($where['OR'] as $w) {\n $wheres[] = $this->parseWhere($w, 'AND', $link);\n }\n\n $str .= ($str == '' ? '' : ' ' . $org_logic . ' ') . (count($wheres) > 1 ? '(' : '') . implode(' OR ', $wheres) . (count($wheres) > 1 ? ')' : '');\n }\n\n return $str;\n }", "public function _generateWhereClause($where, $cols)\n {\n /* Make sure that $where is an array */\n if (!is_array($where) || empty($where)) {\n return $this->_error(E_USER_NOTICE, 'Where clause must be an array');\n }\n\n /* Create some variables */\n $query = '( ';\n\n /* Start gluing together parts of the query */\n foreach ($where as $key => $value) {\n /* This $value is supposed to be a logical operator */\n if ($key % 2 == 1) {\n $and = (strtolower($value) == 'and');\n $or = (strtolower($value) == 'or');\n $xor = (strtolower($value) == 'xor');\n\n /* Check if we have a valid logical operator */\n if (($and === false) && ($or === false) && ($xor === false)) {\n return $this->_error(E_USER_NOTICE, 'Only boolean seperators AND, and OR are allowed');\n }\n\n /* Add the PHP version of the logical operator */\n $query .= ($and === true) ? ' && ' : (($xor === true) ? ' XOR ' : ' || ');\n continue;\n }\n\n /* Generate PHP code for this part */\n if (($query .= $this->_generatePhpIf($value, $cols)) === false) {\n return false;\n }\n }\n\n /* Return our query */\n return $query . ' )';\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "protected function parseWhere(Request $request)\n {\n $clauses = array(\n 'is' => 'is',\n 'eq' => '=',\n 'gt' => '>',\n 'gte' => '>=',\n 'lt' => '<',\n 'lte' => '<=',\n 'neq' => '!=',\n 'between' => 'between',\n 'like' => 'like',\n 'regex' => 'regexp',\n );\n\n $where = $request->getQuery('where', array());\n\n // loop through and sanitize the where statement\n foreach ($where as $field => &$value) {\n if (is_array($value)) {\n if (isset($value['value']) && is_string($value['value']) && strlen($value['value'])) {\n if (isset($value['operator']) && isset($clauses[$value['operator']])) {\n $value['operator'] = $clauses[$value['operator']];\n } else {\n $value['operator'] = '=';\n }\n }\n } else if (is_string($value) && strlen($value)){\n $value = array(\n 'operator' => '=',\n 'value' => $value\n );\n }\n }\n\n return $where;\n }", "public static function parseWhere($where, &$where_str, &$parameters)\n {\n $where_str = 'WHERE ';\n $parameters = [ ];\n\n foreach ($where as $key => $item):\n self::getWhereString($item, $key, $where_str, $parameters);\n endforeach;\n }", "protected function getWhereParam(array $where): array\n {\n $outWhereParams = [];\n foreach ($where as $k => $v) {\n if (!is_int($k) && !is_null($v)) {\n $outWhereParams[] = $v;\n }\n }\n return $outWhereParams;\n }", "protected function whereBasic(Builder $builder, $where): string\n {\n $operator = str_replace('?', '??', $where['operator']);\n $value = $this->parameter($where['value']);\n \n return $this->wrap($where['column']).' '.$operator.' '.$value;\n }", "function where( ...$getwherekeys) { \n $whereorhaving = ($this->iswhere) ? 'WHERE' : 'HAVING';\n $this->iswhere = true;\n \n\t\tif (!empty($getwherekeys)){\n\t\t\tif (is_string($getwherekeys[0])) {\n\t\t\t\tforeach ($getwherekeys as $makearray) \n\t\t\t\t\t$wherekeys[] = explode(' ',$makearray);\t\n\t\t\t} else \n\t\t\t\t$wherekeys = $getwherekeys;\t\t\t\n\t\t} else \n\t\t\treturn '';\n\t\t\n\t\tforeach ($wherekeys as $values) {\n\t\t\t$operator[] = (isset($values[1])) ? $values[1]: '';\n\t\t\tif (!empty($values[1])){\n\t\t\t\tif (strtoupper($values[1]) == 'IN') {\n\t\t\t\t\t$wherekey[ $values[0] ] = array_slice($values,2);\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t$wherekey[ (isset($values[0])) ? $values[0] : '1' ] = (isset($values[2])) ? $values[2] : '' ;\n\t\t\t\t\t$combiner[] = (isset($values[3])) ? $values[3]: _AND;\n\t\t\t\t\t$extra[] = (isset($values[4])) ? $values[4]: null;\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n $this->setParamaters();\n\t\t\t\treturn false;\n } \n\t\t}\n \n $where='1'; \n if (! isset($wherekey['1'])) {\n $where='';\n $i=0;\n $needtoskip=false;\n foreach($wherekey as $key=>$val) {\n $iscondition = strtoupper($operator[$i]);\n\t\t\t\t$combine = $combiner[$i];\n\t\t\t\tif ( in_array(strtoupper($combine), array( 'AND', 'OR', 'NOT', 'AND NOT' )) || isset($extra[$i])) \n\t\t\t\t\t$combinewith = (isset($extra[$i])) ? $combine : strtoupper($combine);\n\t\t\t\telse \n\t\t\t\t\t$combinewith = _AND;\n if (! in_array( $iscondition, array( '<', '>', '=', '!=', '>=', '<=', '<>', 'IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS', 'IS NOT' ) )) {\n $this->setParamaters();\n return false;\n } else {\n if (($iscondition=='BETWEEN') || ($iscondition=='NOT BETWEEN')) {\n\t\t\t\t\t\t$value = $this->escape($combinewith);\n\t\t\t\t\t\tif (in_array(strtoupper($extra[$i]), array( 'AND', 'OR', 'NOT', 'AND NOT' ))) \n\t\t\t\t\t\t\t$mycombinewith = strtoupper($extra[$i]);\n\t\t\t\t\t\telse \n $mycombinewith = _AND;\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" AND \"._TAG.\" $mycombinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t\t$this->setParamaters($combinewith);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' AND '\".$value.\"' $mycombinewith \";\n\t\t\t\t\t\t$combinewith = $mycombinewith;\n\t\t\t\t\t} elseif ($iscondition=='IN') {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t\tforeach ($val as $invalues) {\n\t\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t\t$value .= _TAG.', ';\n\t\t\t\t\t\t\t\t$this->setParamaters($invalues);\n\t\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t\t$value .= \"'\".$this->escape($invalues).\"', \";\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" ( \".rtrim($value, ', ').\" ) $combinewith \";\n\t\t\t\t\t} elseif(((strtolower($val)=='null') || ($iscondition=='IS') || ($iscondition=='IS NOT'))) {\n $iscondition = (($iscondition=='IS') || ($iscondition=='IS NOT')) ? $iscondition : 'IS';\n $where.= \"$key \".$iscondition.\" NULL $combinewith \";\n } elseif((($iscondition=='LIKE') || ($iscondition=='NOT LIKE')) && ! preg_match('/[_%?]/',$val)) return false;\n else {\n\t\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.' '._TAG.\" $combinewith \";\n\t\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t\t} else \n\t\t\t\t\t\t\t$where.= \"$key \".$iscondition.\" '\".$this->escape($val).\"' $combinewith \";\n\t\t\t\t\t}\n $i++;\n }\n }\n $where = rtrim($where, \" $combinewith \");\n }\n\t\t\n if (($this->getPrepare()) && !empty($this->getParamaters()) && ($where!='1'))\n\t\t\treturn \" $whereorhaving \".$where.' ';\n\t\telse\n\t\t\treturn ($where!='1') ? \" $whereorhaving \".$where.' ' : ' ' ;\n }", "public function makeSearchWhere($where)\n {\n global $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 $where .= \" AND ($wpdb->posts.post_type = '\" . $this->post_type . \"') \";\n\n if (!is_user_logged_in()) {\n $where .= 'NOT IN ( \n ( ' . $wpdb->postmeta . '.meta_key = \"title\" ) \n OR ( ' . $wpdb->postmeta . '.meta_key = \"country\" )\n ) ';\n }\n\n //Filters\n foreach ($this->getAvailableMetaKeysForFilters() as $values) {\n if (isset($_GET[$values]) && !empty($_GET[$values])) {\n $where .= \" AND $values.meta_key='\" . $values . \"'\";\n $where .= \" AND $values.meta_value LIKE '%\" . strip_tags($_GET[$values]) . \"%'\";\n }\n }\n }\n return $where;\n }", "protected function getWhereClause(array $where)\n {\n if (empty($where)) {\n return '';\n }\n\n $conditions = [];\n foreach ($where as $field => $value) {\n if (is_null($value)) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"$field = '$value'\";\n }\n\n return 'WHERE ' . implode(' AND ', $conditions);\n }", "protected function whereToken($joiner, array $parameters, &$tokens = [], callable $wrapper)\n {\n list($identifier, $valueA, $valueB, $valueC) = $parameters + array_fill(0, 5, null);\n\n if (empty($identifier)) {\n //Nothing to do\n return;\n }\n\n //Where conditions specified in array form\n if (is_array($identifier)) {\n if (count($identifier) == 1) {\n $this->arrayWhere(\n $joiner == 'AND' ? self::TOKEN_AND : self::TOKEN_OR,\n $identifier,\n $tokens,\n $wrapper\n );\n\n return;\n }\n\n $tokens[] = [$joiner, '('];\n $this->arrayWhere(self::TOKEN_AND, $identifier, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof \\Closure) {\n $tokens[] = [$joiner, '('];\n call_user_func($identifier, $this, $joiner, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof QueryBuilder) {\n //Will copy every parameter from QueryBuilder\n $wrapper($identifier);\n }\n\n switch (count($parameters)) {\n case 1:\n //AND|OR [identifier: sub-query]\n $tokens[] = [$joiner, $identifier];\n break;\n case 2:\n //AND|OR [identifier] = [valueA]\n $tokens[] = [$joiner, [$identifier, '=', $wrapper($valueA)]];\n break;\n case 3:\n //AND|OR [identifier] [valueA: OPERATION] [valueA]\n $tokens[] = [$joiner, [$identifier, strtoupper($valueA), $wrapper($valueB)]];\n break;\n case 4:\n //BETWEEN or NOT BETWEEN\n $valueA = strtoupper($valueA);\n if (!in_array($valueA, ['BETWEEN', 'NOT BETWEEN'])) {\n throw new BuilderException(\n 'Only \"BETWEEN\" or \"NOT BETWEEN\" can define second comparasions value.'\n );\n }\n\n //AND|OR [identifier] [valueA: BETWEEN|NOT BETWEEN] [valueB] [valueC]\n $tokens[] = [$joiner, [$identifier, $valueA, $wrapper($valueB), $wrapper($valueC)]];\n }\n }", "protected function constructWhere($where)\n {\n if (is_array($where)) {\n $equals = array();\n \n foreach ($where as $column => $value) {\n $equals[] = new Equal($column, $value);\n }\n\n $this->where = new Where(new AndOperator($equals));\n } else {\n $this->where = new Where($where);\n }\n }", "function _where ($identifier_array, $o = TRUE) {\n\t\t$statement = '';\n\t\tif ( !isset($identifier_array) || !$identifier_array ) {\n\t\t\treturn $statement;\n\t\t}\n\t\t$statement .= $o ? ' WHERE ' : ' ';\n\t\tforeach ($identifier_array as $query_array) {\n\t\t\t$sub_stmt = '(';\n\t\t\tif ( isset($query_array['name']) && ! is_array($query_array['value']) ) {\n\t\t\t\t$regex = isset($query_array['regex']) ? $query_array['regex'] : '@';\n\t\t\t\t$sub_stmt .= '`' . $query_array['name'] . '` ';\n\t\t\t\t$sub_stmt .= (isset($query_array['ctype']) ? $query_array['ctype'] : '=') . ' ';\n\t\t\t\t$sub_stmt .= $this->escape($query_array['value'], $regex, FALSE);\n\t\t\t} else {\n\t\t\t\t// Incoming value is an array.\n\t\t\t\t$sub_stmt .= $this->_where($query_array['value'], FALSE);\n\t\t\t}\n\t\t\t$sub_stmt .= ')';\n\t\t\t$sub_stmt .= (isset($query_array['atype']) ? (' ' . $query_array['atype']).' ' : '');\n\t\t\t$statement .= $sub_stmt;\n\t\t}\n\t\treturn $statement; \n\t}", "protected function formatWhereData(array $where) : array {\n foreach ($where as $column => $value) {\n if (is_numeric($column) && is_array($value)) {\n $where_data['where_' . $value[0]] = $value[2];\n\n next($where);\n continue;\n }\n\n if (is_numeric($column)) {\n next($where);\n continue;\n }\n\n $where_data['where_' . $column] = $value;\n }\n\n return $where_data;\n }", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "public function buildWhere(array $where = null, array &$values = [])\n {\n if ($where === null) {\n return '';\n }\n\n return 'WHERE ' . $this->buildCondition($where, $values);\n }", "function get_sql_where(){\r\n\t\t$where_str='';\r\n\t\t$multiple_search_str='';\r\n\r\n\t\tif(stripos($this->sql_query,' WHERE ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' ORDER BY ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' ORDER BY ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telseif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7,stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' WHERE ')-7).')';\r\n\t\t\telse\r\n\t\t\t\t$where_str_ini='('.substr($this->sql_query,stripos($this->sql_query,' WHERE ')+7).')';\r\n\t\t}else{\r\n\t\t\t$where_str_ini='';\r\n\t\t}\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++)\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\r\n\t\tfor($i=0; $i<count($arr_sql_fields); $i++){\r\n\r\n\t\t\tif(empty($this->multiple_search[$i]))\r\n\t\t\t\t$this->multiple_search[$i]='';\r\n\r\n\t\t\tif($this->search!='' and $this->search_init[$i]!='f')\r\n\t\t\t\t$where_str.=(($i==0 and $where_str_ini) ? ' AND ' : '').($where_str ? ' OR ' : '(').$arr_sql_fields[$i].\" LIKE '%\".$this->search.\"%'\";\r\n\r\n\t\t\tif(count($this->multiple_search)>0 and $this->multiple_search[$i]!='' and $this->multiple_search_init[$i]!='f')\r\n\t\t\t\t$multiple_search_str.=(($where_str_ini or $where_str or $multiple_search_str) ? ' AND ' : '').$arr_sql_fields[$i].\" LIKE '%\".$this->multiple_search[$i].\"%'\";\r\n\r\n\t\t}\r\n\r\n\t\tif($where_str!='')\r\n\t\t\t$where_str.=')';\r\n\r\n\t\treturn (($where_str_ini or $where_str or $multiple_search_str) ? ' WHERE ' : '').$where_str_ini.$where_str.$multiple_search_str;\r\n\t}", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "function paramWhere($aIn, &$sOut, &$aOut) {\r\n\t$sType = \"\";\r\n\tif (array_key_exists(\"type\", $aIn))\r\n\t $sType = $aIn[\"type\"];\r\n\r\n\t//echo \"Type is: \" . $sType;\r\n\t//basic key=>value pairs\r\n\tif ($sType == \"\" || $sType == \"basic\") {\r\n\t //echo \"Basic type.\";\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" = (?) \";\r\n\t\t $aOut[] = $value;\r\n\t\t //echo \"<br/>sOut = \" . $sOut . \"<br/>\";\r\n\t\t}\r\n\t }\r\n\t}\r\n\t//logical operator types\r\n\telseif ($sType == \"operator\") {\r\n\t $sOperator = strtoupper($aIn['operator']);\r\n\r\n\t $sOut .= \"(\";\r\n\r\n\t foreach ($aIn as $key => $value) {\r\n\t\t//echo \"Key is: \" . $key . \"<br/>\";\r\n\t\tif (($key !== \"type\" && $key !== 'operator') || $key === 0) {\r\n\t\t //echo \"Calling paramWhere with value: \";\r\n\t\t //print_r($value);\r\n\t\t //echo \"<br/>\";\r\n\t\t $this->paramWhere($value, $sOut, $aOut);\r\n\t\t $sOut .= \" \" . $sOperator . \" \";\r\n\t\t}\r\n\t }\r\n\r\n\t // Strip out last \"operator\"\r\n\t $iPos = strrpos($sOut, \" \" . $sOperator . \" \");\r\n\t if ($iPos !== false) {\r\n\t\t$sOut = substr($sOut, 0, $iPos - 1);\r\n\t }\r\n\r\n\t $sOut .= \")\";\r\n\t}\r\n\t//special types\r\n\telseif ($sType == \"like\") {\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" like (?) \";\r\n\t\t $aOut[] = $value;\r\n\t\t}\r\n\t }\r\n\t} elseif ($sType == \"special\") {\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" \";\r\n\t\t}\r\n\t }\r\n\t}\r\n }", "public function parseWhere(&$arguments)\n {\n /* Initiate some variables */\n $clause = '';\n $Where = array();\n\n /* Go through each word of the query until we need to stop */\n while ($word = $this->getNextWord(true)) {\n if (strtolower(substr($word, 0, 3)) == 'set') {\n $this->c -= strlen($word) + 1;\n break;\n }\n\n switch (strtolower($word)) {\n /* Back up if we find these keywords */\n case 'from':\n {\n $this->c -= 5;\n\n break 2;\n }\n\n case 'limit':\n {\n $this->c -= 6;\n\n break 2;\n }\n\n case 'orderby':\n {\n $this->c -= 8;\n\n break 2;\n }\n\n /* Look for logical operators */\n case 'and':\n case 'or':\n case 'xor':\n {\n $Where[] = $clause;\n $Where[] = $word;\n $clause = '';\n\n break;\n }\n\n /* Append the current value to the clause */\n default:\n {\n $this->c -= strlen($word) + 1;\n $clause .= $this->getNextWord(true) . ' ';\n }\n }\n }\n\n /* Add the the last element onto the $Where array */\n $Where[] = substr($clause, 0, strlen($clause) - 1);\n $arguments['where'] = $Where;\n\n foreach ($arguments['where'] as $key => $value) {\n if ($key <= count($arguments['where']) - 1) {\n $arguments['where'][$key] = rtrim($value);\n }\n }\n\n return true;\n }", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "private function arrayWhere($grouper, array $where, &$tokens, callable $wrapper)\n {\n $joiner = ($grouper == self::TOKEN_AND ? 'AND' : 'OR');\n\n foreach ($where as $key => $value) {\n $token = strtoupper($key);\n\n //Grouping identifier (@OR, @AND), MongoDB like style\n if ($token == self::TOKEN_AND || $token == self::TOKEN_OR) {\n $tokens[] = [$joiner, '('];\n\n foreach ($value as $nested) {\n if (count($nested) == 1) {\n $this->arrayWhere($token, $nested, $tokens, $wrapper);\n continue;\n }\n\n $tokens[] = [$token == self::TOKEN_AND ? 'AND' : 'OR', '('];\n $this->arrayWhere(self::TOKEN_AND, $nested, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n }\n\n $tokens[] = ['', ')'];\n\n continue;\n }\n\n //AND|OR [name] = [value]\n if (!is_array($value)) {\n $tokens[] = [$joiner, [$key, '=', $wrapper($value)]];\n continue;\n }\n\n if (count($value) > 1) {\n //Multiple values to be joined by AND condition (x = 1, x != 5)\n $tokens[] = [$joiner, '('];\n $this->builtConditions('AND', $key, $value, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n } else {\n $this->builtConditions($joiner, $key, $value, $tokens, $wrapper);\n }\n }\n\n return;\n }", "function AddWhere($sql,$where)\n{\n\tif(!strlen($where))\n\t\treturn $sql;\n\t$sql=str_replace(array(\"\\r\\n\",\"\\n\",\"\\t\"),\" \",$sql);\n\t$tsql = strtolower($sql);\n\t$n = my_strrpos($tsql,\" where \");\n\t$n1 = my_strrpos($tsql,\" group by \");\n\t$n2 = my_strrpos($tsql,\" order by \");\n\tif($n1===false)\n\t\t$n1=strlen($tsql);\n\tif($n2===false)\n\t\t$n2=strlen($tsql);\n\tif ($n1>$n2)\n\t\t$n1=$n2;\n\tif($n===false)\n\t\treturn substr($sql,0,$n1).\" where \".$where.substr($sql,$n1);\n\telse\n\t\treturn substr($sql,0,$n+strlen(\" where \")).\"(\".substr($sql,$n+strlen(\" where \"),$n1-$n-strlen(\" where \")).\") and (\".$where.\")\".substr($sql,$n1);\n}", "private function sql_whereWiHitsLL( $where )\n {\n // Short var\n $table = $this->pObj->localTable;\n\n // Store current localisation mode\n $curr_int_localisation_mode = $this->pObj->objLocalise->get_localisationMode();\n // Set localisation mode to default language\n //$this->pObj->objLocalise->int_localisation_mode = PI1_DEFAULT_LANGUAGE;\n $this->pObj->objLocalise->setLocalisationMode( PI1_DEFAULT_LANGUAGE );\n\n // Get where localisation\n $llWhere = $this->pObj->objLocalise->localisationFields_where( $table );\n if ( $llWhere )\n {\n $where = $where . \" AND \" . $llWhere;\n }\n // Get where localisation\n // Reset localisation mode\n //$this->pObj->objLocalise->int_localisation_mode = $curr_int_localisation_mode;\n $this->pObj->objLocalise->setLocalisationMode( $curr_int_localisation_mode );\n\n // RETURN\n return $where;\n }", "function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }", "private function sql_whereWiHits()\n {\n // Get WHERE statement\n $where = $this->pObj->objSqlInit->statements[ 'listView' ][ 'where' ] .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS();\n // Localise the WHERE statement\n $where = $this->sql_whereWiHitsLL( $where );\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "public function whereParenWrap() {\n $where = $this->_dqlParts['where'];\n if (count($where) > 0) {\n array_unshift($where, '(');\n array_push($where, ')');\n $this->_dqlParts['where'] = $where;\n }\n\n return $this;\n }", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "protected static function buildWhere( array $where, $conjunction = 'AND' ) {\n\t\tif ( $where ) {\n\t\t\treturn 'WHERE (' . implode( \") {$conjunction} (\", $where ) . ') ';\n\t\t}\n\t\treturn '';\n\t}", "function _parse_where_clause($condition)\n {\n $column = '';\n $operator = '';\n $value = '';\n $numeric = TRUE;\n // Substitute any placeholders\n global $wpdb;\n $binds = func_get_args();\n $binds = isset($binds[1]) ? $binds[1] : array();\n // first argument is the condition\n foreach ($binds as &$bind) {\n // A bind could be an array, used for the 'IN' operator\n // or a simple scalar value. We need to convert arrays\n // into scalar values\n if (is_object($bind)) {\n $bind = (array) $bind;\n }\n if (is_array($bind) && !empty($bind)) {\n foreach ($bind as &$val) {\n if (!is_numeric($val)) {\n $val = '\"' . addslashes($val) . '\"';\n $numeric = FALSE;\n }\n }\n $bind = implode(',', $bind);\n } else {\n if (is_array($bind) && empty($bind)) {\n $bind = 'NULL';\n } else {\n if (!is_numeric($bind)) {\n $numeric = FALSE;\n }\n }\n }\n }\n if ($binds) {\n $condition = $wpdb->prepare($condition, $binds);\n }\n // Parse the where clause\n if (preg_match(\"/^[^\\\\s]+/\", $condition, $match)) {\n $column = trim(array_shift($match));\n $condition = str_replace($column, '', $condition);\n }\n if (preg_match(\"/(NOT )?IN|(NOT )?LIKE|(NOT )?BETWEEN|[=!<>]+/i\", $condition, $match)) {\n $operator = trim(array_shift($match));\n $condition = str_replace($operator, '', $condition);\n $operator = strtolower($operator);\n $value = trim($condition);\n }\n // Values will automatically be quoted, so remove them\n // If the value is part of an IN clause or BETWEEN clause and\n // has multiple values, we attempt to split the values apart into an\n // array and iterate over them individually\n if ($operator == 'in') {\n $values = preg_split(\"/'?\\\\s?(,)\\\\s?'?/i\", $value);\n } elseif ($operator == 'between') {\n $values = preg_split(\"/'?\\\\s?(AND)\\\\s?'?/i\", $value);\n }\n // If there's a single value, treat it as an array so that we\n // can still iterate\n if (empty($values)) {\n $values = array($value);\n }\n foreach ($values as $index => $value) {\n $value = preg_replace(\"/^(\\\\()?'/\", '', $value);\n $value = preg_replace(\"/'(\\\\))?\\$/\", '', $value);\n $values[$index] = $value;\n }\n if (count($values) > 1) {\n $value = $values;\n }\n // Return the WP Query meta query parameters\n $retval = array('column' => $column, 'value' => $value, 'compare' => strtoupper($operator), 'type' => $numeric ? 'numeric' : 'string');\n return $retval;\n }", "function posts_where($where, $wp_query)\n {\n }", "private function sql_whereAnd_fromTS()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS value\n $andWhere = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'sql.' ][ 'andWhere' ];\n\n if ( !empty( $andWhere ) )\n {\n $andWhere = \" AND \" . $andWhere;\n }\n\n // RETURN AND WHERE statement\n return $andWhere;\n }", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "function where(array $data, array $whereOptions) : array\n{\n if (count($whereOptions) !== 3) {\n return $data;\n }\n\n $columnData = array_column($data, $whereOptions['coloana']);\n\n if ($whereOptions['semn'] === '<>') {\n foreach ($columnData as $key => $value) {\n if ($value == $whereOptions['valoare']) {\n unset($data[$key]);\n }\n\n }\n }\n if ($whereOptions['semn'] === '=') {\n foreach ($columnData as $key => $value) {\n if ($value <> $whereOptions['valoare']) {\n unset($data[$key]);\n }\n\n }\n }\n if ($whereOptions['semn'] === '>') {\n foreach ($columnData as $key => $value) {\n if ($value < $whereOptions['valoare']) {\n unset($data[$key]);\n }\n\n }\n }\n if ($whereOptions['semn'] === '<') {\n foreach ($columnData as $key => $value) {\n if ($value > $whereOptions['valoare']) {\n unset($data[$key]);\n }\n\n }\n }\n\n return array_values($data);\n}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public function where($where=array())\n\t\t{\n\t\t\tif( is_array($where) && !empty($where)){\n\n\t\t\t\tforeach( $where as $k => $val ){\n\n\t\t\t\t\t// name = 'jack'\n\t\t\t\t\t// id > 1\n\t\t\t\t\t if( is_array($val) ){\n\n\t\t\t\t\t \t$type = $val[0];\n\n\t\t\t\t\t \tswitch($type){\n\t\t\t\t\t \t\tcase 'lt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} < {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t\tcase 'gt':\n\t\t\t\t\t \t\t\t$result[] = \"{$k} > {$val[1]} \";\n\t\t\t\t\t \t\t\tbreak;\n\t\t\t\t\t \t}\n\t\t\t\t\t \t\n\t\t\t\t\t }else{\n\n\t\t\t\t\t \t$result[] = \"{$k} = '{$val}'\";\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$this->where = 'where '.implode(' and ', $result);\n\t\t\t}\n\t\t\t\n\t\t\treturn $this;\n\t\t}", "function wpfc_temp_filter_where( $where = '' ) {\n\t \t$where .= \" AND post_date >= '\".date(\"Y-m-d\", $_REQUEST['start']).\"' AND post_date < '\".date(\"Y-m-d\", $_REQUEST['end']).\"'\";\n\t \treturn $where;\n\t }", "private function formatWheres()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->wheres as $val)\n\t\t{\n\t\t\tif ($value != '')\n\t\t\t\t$value .= ' AND ';\n\t\t\t$value .= $val;\n\t\t}\n\t\treturn $value;\n\t}", "public function where($whereData,$optionalData = null)\n {\n \t if (is_array($whereData)) {\n $dt = $whereData;\n \t }else if (is_string($whereData)){\n if ($optionalData != null) {\n $dt[$this->clean($whereData)] = $this->clean($optionalData);\n }\n }\n \n foreach ($dt as $key => $val) {\n if(!in_array($key, $this->_where)){\n $this->_where[$this->clean($key)] = $this->clean($val);\n }\n }\n \n \t return $this;\n }", "function whereAdd($where,$clause)\n{\n\tif(!strlen($clause))\n\t\treturn $where;\n\tif(!strlen($where))\n\t\treturn $clause;\n\treturn \"(\".$where.\") and (\".$clause.\")\";\n}", "private function whereWrapper()\n {\n return function ($parameter) {\n if ($parameter instanceof FragmentInterface) {\n //We are only not creating bindings for plan fragments\n if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) {\n return $parameter;\n }\n }\n\n if (is_array($parameter)) {\n throw new BuilderException(\"Arrays must be wrapped with Parameter instance.\");\n }\n\n //Wrapping all values with ParameterInterface\n if (!$parameter instanceof ParameterInterface) {\n $parameter = new Parameter($parameter, Parameter::DETECT_TYPE);\n };\n\n //Let's store to sent to driver when needed\n $this->whereParameters[] = $parameter;\n\n return $parameter;\n };\n }", "function get_where_clause_from_url () {\r\n\t\t$url_params = array();\r\n\t\t$where = array();\r\n\t\t$where_clause = '';\r\n\r\n\t\t$url = $_SERVER['REQUEST_URI'];\r\n\t\t$url_arr = parse_url($url);\r\n\t\tif (!array_key_exists(\"query\", $url_arr)) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\t\r\n\t\tparse_str($url_arr[\"query\"], $url_params);\r\n\t\t\r\n\r\n\t\tif (array_key_exists('id', $url_params)) {\r\n\t\t\tif (is_numeric($url_params['id'])) {\r\n\t\t\t\t$where[] = 'id = ' . $url_params['id'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('first_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['first_name'])) {\r\n\t\t\t\t$where[] = 'first_name = ' . \"'\" . $url_params['first_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('last_name', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['last_name'])) {\r\n\t\t\t\t$where[] = 'last_name = ' . \"'\" . $url_params['last_name'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (array_key_exists('email', $url_params)) {\r\n\t\t\tif (filter_var($url_params['email'], FILTER_VALIDATE_EMAIL)) {\r\n\t\t\t\t$where[] = 'email = ' . \"'\" . $url_params['email'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('gender', $url_params)) {\r\n\t\t\tif (ctype_alpha($url_params['gender'])) {\r\n\t\t\t\t$where[] = 'gender = ' . \"'\" . $url_params['gender'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('title', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['title'])) {\r\n\t\t\t\t$where[] = 'title = ' . \"'\" . $url_params['title'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (array_key_exists('dept', $url_params)) {\r\n\t\t\tif (preg_match(\"/\\\\w|\\\\s+/\", $url_params['dept'])) {\r\n\t\t\t\t$where[] = 'dept = ' . \"'\" . $url_params['dept'] . \"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($where)) {\r\n\t\t\t$where_clause = \"WHERE \" . implode(\" AND \", $where);\r\n\t\t}\r\n\r\n\t\treturn $where_clause;\r\n\r\n\t}", "private function builtConditions($innerJoiner, $key, $where, &$tokens, callable $wrapper)\n {\n foreach ($where as $operation => $value) {\n if (is_numeric($operation)) {\n throw new BuilderException(\"Nested conditions should have defined operator.\");\n }\n\n $operation = strtoupper($operation);\n if (!in_array($operation, ['BETWEEN', 'NOT BETWEEN'])) {\n //AND|OR [name] [OPERATION] [nestedValue]\n $tokens[] = [$innerJoiner, [$key, $operation, $wrapper($value)]];\n continue;\n }\n\n /**\n * Between and not between condition described using array of [left, right] syntax.\n */\n\n if (!is_array($value) || count($value) != 2) {\n throw new BuilderException(\n \"Exactly 2 array values are required for between statement.\"\n );\n }\n\n $tokens[] = [\n //AND|OR [name] [BETWEEN|NOT BETWEEN] [value 1] [value 2]\n $innerJoiner,\n [$key, $operation, $wrapper($value[0]), $wrapper($value[1])]\n ];\n }\n\n return $tokens;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "function generate_where($field,$array)\n{\n\tfor ($i=0;$i<sizeof($array);$i++)\n\t{\n\t\t$where=$where.\" \".$field.\" like \".$array[$i];\n\t\tif ($i<sizeof($array)-1)\n\t\t\t$where=$where.\" or\";\n\t}\n\tif (!isset($where))\n\t{\n\t\t$where = 0;\n\t}\n\tif (!isset($where))\n\t{\n\t\t$where=\"'0'\";\n\t}\n\treturn $where;\n}", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "private function buildWhere ($array) {\n\n // Only do anything if the array contains anything\n if($array){ \n\n // Loop through the array where $key is the column name and $value are the \n // array containing the operator [0] and values [1]\n foreach($array as $key => $value){ \n\n // We set each element of the where clause to $this->where before setting it to\n // $this->show_where. If it already exists we must have already have something\n // in the where clause so set $preSql to ' AND ' otherwise set it to ' WHERE '\n $preSql = (isset($this->where)) ? ' AND ' : ' WHERE ';\n\n // As we need different ways of building the where clause elements, depending on\n // the operator ($value[0]), we run a switch statement to call the function to\n // build the correct type of element, passing in the field name ($key) and the\n // operator and criteria ($value array)\n switch($value[0]) {\n case '>':\n case '<':\n case '=':\n case '<=':\n case '>=':\n case '!=':\n case '<>':\n case 'LIKE':\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n\n case 'IN':\n $this->where = $this->whereElementIn ($key, $value); \n break;\n\n case 'BETWEEN':\n $this->where = $this->whereElementBetween ($key, $value); \n break;\n case 'NULL':\n case 'NOT NULL':\n $this->where = $this->whereElementNull ($key, $value); \n break;\n\n default:\n $this->where = $this->whereElementStandard ($key, $value);\n break;\n } // End switch\n\n \n // Add the created where clause elements to $this->show_where\n $this->show_where .= $preSql.$this->where;\n } // End foreach\n } // End if $array\n }", "protected function whereColumn(Builder $builder, $where): string\n {\n return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "function BasicSearchWhere() {\n\t\tglobal $Security, $tbl_slide;\n\t\t$sSearchStr = \"\";\n\t\t$sSearchKeyword = $tbl_slide->BasicSearchKeyword;\n\t\t$sSearchType = $tbl_slide->BasicSearchType;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t}\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$tbl_slide->setSessionBasicSearchKeyword($sSearchKeyword);\n\t\t\t$tbl_slide->setSessionBasicSearchType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "private function buildWhereString(array $whereFields = [])\n {\n $where = [];\n foreach ($whereFields as $field => $value) {\n $where[] = $field . Operators::EQUALS . $this->getConnection()->quote($value);\n }\n\n return implode(' AND ', $where);\n }", "public function sanitize_input_fields(array $where_args)\n {\n }", "protected function whereColumn(Builder $query, array $where)\n {\n return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']);\n }", "public function get_where()\n {\n }", "public function get_where()\n {\n }", "public function getWhereClause() {\n\n\tif (isset($this->filters) && !empty($this->filters)) {\n\t\t// $aClause = array();\n\t\t// $aOperators = array();\n\t\t$sClause = '';\n\t switch ($this->type) {\n\t\tcase 0:\n\t\tcase 4:\n\t\tdefault:\n\t\t \n\t\t $aWhere = $this->getFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where($key, $value);\n\t\t\t\t $sClause .= $key . ' = ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 1:\n\t\t $aWhere = $this->getLikeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_like($key, $value);\n\t\t\t\t $sClause .= $key . ' LIKE ' . $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 2:\n\t\t $aWhere = $this->getRangeFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 3:\n\t\t $aWhere = $this->getInFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t\t$sClause .= $key . ' IN (' . implode(',',$value) . ')' . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t // $this->model->where_in($key, $value);\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 5:\n\t\t $aWhere = $this->getInRawFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($key, $value);\n\t\t\t\t\t$sClause .= vsprintf(str_replace('?','%s',$key),$value) . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t\tcase 6:\n\t\t $aWhere = $this->getDependendFilter($this->filters);\n\t\t if ($aWhere) {\n\t\t \t$i = 1;\n\t\t\t\tforeach ($aWhere as $key => $value) {\n\t\t\t\t // $this->model->where_raw($value, array());\n\t\t\t\t $sClause .= $value . (count($aWhere) == $i++ ? '' : ' OR ');\n\t\t\t\t}\n\t\t }\n\t\t break;\n\t }\n\t}\n\treturn $sClause;\n\t// return $this->model;\n }", "protected function constructWhereClausePart($queryPart, $values) {\n \n $parameters = array(); \n \n// $where = 'WHERE $X{IN,hs_hr_employee.emp_firstname,firstName} AND $X{IN,hs_hr_employee.emp_lastname,lastName}';\n $pattern = '/\\$X\\{(.*?)\\}/';\n\n $callback = function($matches) use ($values, &$parameters) {\n $val = explode(\",\", $matches[1]);\n \n // $X{VAR,name}\n \n if ((count($val) == 2 && $val[0] == 'VAR')) {\n \n $operator = $val[0];\n $name = $val[1]; \n } else {\n \n if (count($val) < 3) { \n throw new ReportException('Invalid filter definition: ' . $matches[0]);\n }\n \n $operator = $val[0];\n $field = $val[1];\n $name = $val[2]; \n }\n \n // If no value defined for this filter, ignore it (filter is set to true)\n if (!isset($values[$name]) || is_null($values[$name])) {\n return \"true\";\n }\n if ($operator == 'IN') {\n \n $valueArray = $values[$name];\n \n if (!is_array($valueArray) && is_string($valueArray)) {\n $valueArray = explode(',', $valueArray);\n }\n if (!is_array($valueArray) || count($valueArray) == 0) {\n return \"true\";\n } \n\n $placeHolders = rtrim(str_repeat('?,', count($valueArray)), ',');\n $clause = $field . \" IN (\" . $placeHolders . \")\";\n \n $parameters = array_merge($parameters, $valueArray);\n\n } else if ($operator == '=') {\n $clause = $field . ' = ?';\n $parameters[] = $values[$name];\n \n } else if ($operator == 'BETWEEN') {\n $clause = $field . ' BETWEEN ? AND ?';\n $parameters[] = $values[$name]['from'];\n $parameters[] = $values[$name]['to'];\n } else if ($operator == '>') {\n $clause = $field . ' > ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<') {\n $clause = $field . ' < ?';\n $parameters[] = $values[$name];\n } else if ($operator == '>=') {\n $clause = $field . ' >= ?';\n $parameters[] = $values[$name];\n } else if ($operator == '<=') {\n $clause = $field . ' <= ?';\n $parameters[] = $values[$name];\n } else if ($operator == 'IS NOT NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NOT NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'IS NULL') {\n if ($values[$name] == 'TRUE') {\n $clause = $field . ' IS NULL';\n } else {\n $clause = 'true';\n }\n } else if ($operator == 'VAR') {\n $clause = $values[$name];\n } \n\n return $clause;\n };\n\n $str = preg_replace_callback($pattern, $callback, $queryPart);\n\n return array($str, $parameters);\n }", "public function custom_where( $where = '' ){\n\n\n\t// make sure to change your meta_key to whatever you saved your user_id as here mine is _restricted_to\n\n\t\tglobal $wpdb;\n\t\t$user_id = get_current_user_id();\n\n\t\t$where .= \" OR (( $wpdb->postmeta.meta_key = '_bcit_wpd_show_product' and $wpdb->postmeta.meta_value = $user_id ))\";\n\n\t\tremove_filter( 'posts_where', array( $this, 'custom_where' ) );\n\n\t\treturn $where;\n\n\t}", "public static function where($where, &$query)\n {\n remove_filter('posts_where', array('piklist_wordpress', 'where'), 10);\n remove_filter('posts_where_request', array('piklist_wordpress', 'where'), 10);\n\n if (!empty(self::$meta_orderby) && (!isset($query->query_vars['orderby']) || (in_array($query->query_vars['orderby'], array('meta_value', 'meta_value_num')))))\n {\n $where = str_replace(self::$meta_orderby, '', $where);\n }\n\n return $where;\n }", "public function posts_where( $where ) {\n\t\tglobal $wpdb;\n\t\tif ( did_action( 'wp' ) && ( bbp_is_single_forum() || bbp_is_single_topic() ) ) {\n\t\t\tif (\n\t\t\t\tstrpos( $where, $wpdb->prepare( \"$wpdb->posts.post_type = %s\", bbp_get_topic_post_type() ) ) !== false\n\t\t\t||\n\t\t\t\tstrpos( $where, $wpdb->prepare( \"$wpdb->posts.post_type = %s\", bbp_get_reply_post_type() ) ) !== false\n\t\t\t) {\n\t\t\t\t$original = $wpdb->prepare( \"$wpdb->posts.post_status = %s OR \", bbp_get_public_status_id() );\n\t\t\t\t$replacement = $wpdb->prepare( \" ( $wpdb->posts.post_status IN ( %s, %s ) AND $wpdb->posts.post_author = '%d' ) OR \",\n\t\t\t\t\tbbp_get_pending_status_id(),\n\t\t\t\t\tbbp_get_spam_status_id(),\n\t\t\t\t\tget_current_user_id()\n\t\t\t\t);\n\t\t\t\t$where = str_replace( $original, $original . $replacement, $where );\n\t\t\t}\n\t\t}\n\t\treturn $where;\n\t}", "public function getValueAsWhereClause(): ?array;", "protected function whereBasic(Builder $query, array $where)\n {\n $value = $this->parameter($where['value']);\n\n return $this->wrap($where['column']) . ' ' . $where['operator'] . ' ' . $value;\n }" ]
[ "0.69939864", "0.6761625", "0.656423", "0.65481263", "0.65106976", "0.63381374", "0.63313335", "0.6329169", "0.62272376", "0.6218739", "0.6154451", "0.61227334", "0.6104862", "0.6083068", "0.6053338", "0.5975394", "0.5925017", "0.59222424", "0.5916025", "0.59108937", "0.58707356", "0.5845717", "0.5813512", "0.5808932", "0.57998925", "0.5787288", "0.57664645", "0.5705404", "0.5697701", "0.56967384", "0.56773823", "0.56750697", "0.5661412", "0.5651679", "0.560653", "0.5603931", "0.55895245", "0.55822235", "0.55758804", "0.5566634", "0.55466783", "0.55407274", "0.55342275", "0.55238223", "0.5522571", "0.55123675", "0.5502023", "0.5472232", "0.54693216", "0.54253834", "0.5414787", "0.5409689", "0.53962344", "0.53955936", "0.5377744", "0.53467906", "0.53421354", "0.53349674", "0.5327875", "0.5291222", "0.5281474", "0.52734816", "0.5271036", "0.5264625", "0.52639", "0.5259991", "0.5257829", "0.5240929", "0.52408737", "0.522242", "0.5219019", "0.51977473", "0.5181924", "0.518137", "0.51766974", "0.5174446", "0.5172801", "0.51677257", "0.5159936", "0.5154991", "0.51305085", "0.5130413", "0.5120803", "0.5104864", "0.5097727", "0.50944245", "0.5086264", "0.50734144", "0.5066744", "0.5066328", "0.50597703", "0.5052886", "0.5052886", "0.50475484", "0.5046924", "0.5035004", "0.50328696", "0.50326777", "0.50323546", "0.5028472" ]
0.5606135
35
Convert parameters used in JOIN ON statements into sql expressions.
private function onWrapper() { return function ($parameter) { if ($parameter instanceof FragmentInterface) { return $parameter; } return new Expression($parameter); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildJoinClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_joins)>0) {\r\n\t\t\tforeach($this->_salt_joins as $alias => $join) {\r\n\t\t\t\t$sql.=' '.$join['type'].' JOIN '.$join['table'].' ON '.implode(' ', $join['on']);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "private static function sqlJoining() : string {\n $relations = self::getsRelationsHasOne();\n\n $baseTable = static::tableName();\n $baseProperties = self::getProperties();\n foreach ($baseProperties as &$property) {\n $property = $baseTable . '.' . $property;\n }\n $colsFromBaseTabel = implode(', ', $baseProperties);\n $colsFromJoinedTables = '';\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $modelProperties = $modelNamespace::getProperties();\n foreach ($modelProperties as $key => &$value) {\n $value = $modelTableName . '.' . $value . ' AS ' . $modelTableName . '_' . $value;\n }\n $colsFromJoinedTables .= ', ' . implode(', ', $modelProperties);\n\n }\n $sql = 'SELECT ' . $colsFromBaseTabel . ' ' . $colsFromJoinedTables . ' FROM ' . $baseTable;\n\n foreach ($relations as $relation) {\n $modelNamespace = '\\\\' . $relation['model'];\n $modelTableName = $modelNamespace::tableName();\n $sql .= ' INNER JOIN ' . $modelTableName . ' ON ' . $baseTable . '.' . $relation['column'] . ' = ' . $modelTableName . '.' . $relation['joined-table-column'];\n }\n\n return $sql . ' WHERE ' . $baseTable . '.';\n }", "public function compile()\n {\n if (null !== $this->type) {\n $sql = strtoupper($this->type).' JOIN';\n } else {\n $sql = 'JOIN';\n }\n\n $sql .= ' '.$this->quoter->quoteTable($this->table);\n\n if (!empty($this->using)) {\n $sql .= ' USING ('.implode(', ', array_map(array($this->quoter, 'quoteColumn'), $this->using)).')';\n } else {\n $conditions = array();\n\n foreach ($this->on as $condition) {\n list($c1, $op, $c2) = $condition;\n\n if ($op) {\n $op = ' '.strtoupper($op);\n }\n\n $conditions[] = $this->quoter->quoteColumn($c1).$op.' '.$this->quoter->quoteColumn($c2);\n }\n\n $sql .= ' ON ('.implode(' AND ', $conditions).')';\n }\n\n return $sql;\n }", "function build_sql_part($params, $op=' AND ', $schema=null) {\n\t$parts = array();\n\tforeach($params as $k=>$v){\n\t if(!isset($v)) continue;\n if(preg_match('/^[._]/',$k)) continue;\n if(!preg_match('/^`.+`$/',$v)){\n $v = \"'\".$this->escape($v).\"'\";\n\t }\n if(preg_match('/^(\\w+)\\.(\\w+)$/',$k,$matches)){\n $tbl = $matches[1]; $col = $matches[2];\n $parts[] = \"`$tbl`.`$col`=$v\";\n }else{\n $parts[] = \"`$k`=$v\";\n }\n\t}\n\n\treturn implode($op,$parts);\n }", "function buildJoin()\n\t{\n\t\tif ($this->table_obj_reference)\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_reference.\" ON \".$this->table_tree.\".child=\".$this->table_obj_reference.\".\".$this->ref_pk.\" \".\n\t\t\t\t \"JOIN \".$this->table_obj_data.\" ON \".$this->table_obj_reference.\".\".$this->obj_pk.\"=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Use inner join instead of left join to improve performance\n\t\t\treturn \"JOIN \".$this->table_obj_data.\" ON \".$this->table_tree.\".child=\".$this->table_obj_data.\".\".$this->obj_pk.\" \";\n\t\t}\n\t}", "function get_ons(){\n //\n //Map for each and return an on clause \n $col_str=array_map(array($this, 'map'), $this->foreigns); //\n //\n //Return on joined on \n return implode(\"AND \\t\",$col_str);\n }", "public function makeJoinBy(array $conditions) {\n if (0 == sizeof($conditions)) {\n throw new \\lang\\IllegalArgumentException('Conditions can not be empty');\n }\n\n $tableString= current($conditions)->getSource()->toSqlString();\n $conditionString= '';\n foreach ($conditions as $link) {\n $tableString.= ', '.$link->getTarget()->toSqlString();\n foreach ($link->getConditions() as $condition) $conditionString.= str_replace('=', '*=', $condition).' and ';\n }\n return $tableString.' where '.$conditionString;\n }", "function to_str(){\n //\n //Get the name of the entity \n $ename= $this->entity->name;\n //\n //The type of the join eg inner join, outer join\n $join_str=\"$this->type\"\n //\n //The on clause\n . \"\\t `$ename` \\tON \\t{$this->get_ons()}\";\n return $join_str;\n }", "function build_sql(string $sql, array $bindings = []): string\n{\n if (! Arr::isAssoc($bindings)) {\n $position = 0;\n foreach ($bindings as $value) {\n $position = strpos($sql, '?', $position);\n if ($position === false) {\n break;\n }\n\n $value = (string) match (gettype($value)) {\n 'integer', 'double' => $value,\n 'boolean' => (int) $value,\n default => sprintf(\"'%s'\", $value),\n };\n $sql = substr_replace($sql, $value, $position, 1);\n $position += strlen($value);\n }\n }\n\n return $sql;\n}", "protected function toBaseSQL() {\r\n\t\t$sql=' FROM '.$this->resolveTable();\r\n\r\n\t\t$sql.=$this->buildJoinClause();\r\n\t\t$sql.=$this->buildWhereClause();\r\n\r\n\t\t$sql.=$this->buildGroupClause();\r\n\r\n\t\treturn $sql;\r\n\t}", "protected abstract function getJoinClause(array $joins);", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "public function getJoinExpression();", "public function toInterpolatedSql() {\n $query = $this->toSql();\n $params = $this->values;\n\n $keys = array();\n $values = $params;\n\n # build a regular expression for each parameter\n foreach ($params as $key => $value) {\n if (is_string($key)) {\n $keys[] = '/:'.$key.'/';\n } else {\n $keys[] = '/[?]/';\n }\n\n if (is_string($value))\n $values[$key] = \"'\" . self::quoteValue($value) . \"'\";\n\n if (is_array($value))\n $values[$key] = \"'\" . implode(\"','\", self::quoteValue($value)) . \"'\";\n\n if (is_null($value))\n $values[$key] = 'NULL';\n }\n\n $query = preg_replace($keys, $values, $query, 1, $count);\n\n return $query;\n }", "function cond_to_sqladd($cond) {\n\t$s = '';\n\tif(!empty($cond)) {\n\t\t$s = ' WHERE ';\n\t\tforeach($cond as $k=>$v) {\n\t\t\tif(!is_array($v)) {\n\t\t\t\t$v = addslashes($v);\n\t\t\t\t$s .= \"$k = '$v' AND \";\n\t\t\t} else {\n\t\t\t\tforeach($v as $k1=>$v1) {\n\t\t\t\t\t$v1 = addslashes($v1);\n\t\t\t\t\t$k1 == 'LIKE' AND $v1 = \"%$v1%\";\n\t\t\t\t\t$s .= \"$k $k1 '$v1' AND \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$s = substr($s, 0, -4);\n\t}\n\treturn $s;\n}", "private function formatJoins()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->joins as $join)\n\t\t{\n\t\t\t$value .= ' ' . $join['type'];\n\t\t\t$value .= ' ' . $join['table'];\n\t\t\tif ($join['alias'] != '') $value .= ' AS ' . $join['alias'];\n\t\t\tif ($join['use_index'] != '') $value .= ' USE INDEX ' . $join['use_index'];\n\t\t\tif ($join['ignore_index'] != '') $value .= ' IGNORE INDEX ' . $join['ignore_index'];\n\t\t\tif ($join['on_statement'] != '') $value .= ' ON ' . $join['on_statement'];\n\t\t\tif ($join['using_statement'] != '') $value .= ' USING ' . $join['using_statement'];\n\t\t}\n\t\treturn $value;\n\t}", "protected function genSelectsJoins ($map)\n\t{\n\t\t$joins = array_reverse($map[GlobalSystem::ExpJoin]);\n\t\t$from = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpModel];\n\t\t$matcher = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatcher];\n\t\t$matchValue = $map[GlobalSystem::ExpFrom][GlobalSystem::ExpMatchValue];\n\t\n\t\t$target = $joins[0][GlobalSystem::ExpModel];\n\t\t$sqlBase = \"SELECT {$target}.* FROM {$target} {join} WHERE {$from}.{$matcher} = {$matchValue}\";\n\n\t\t$joinBase = '';\n\t\tforeach($joins as $join) {\n\t\t\t$joinBase .= \"INNER JOIN {$join[GlobalSystem::ExpForeignKey][0]} ON {$join[GlobalSystem::ExpForeignKey][0]}.{$join[GlobalSystem::ExpForeignKey][1]} = {$join[GlobalSystem::ExpModel]}.`{$join[GlobalSystem::ExpProperty]}` \";\n\t\t}\n\n\t\treturn str_replace('{join}', $joinBase, $sqlBase);\n\t}", "protected function _compile_join(array $joins)\n {\n foreach ($joins as $key=>$join) \n {\n $conditions = array();\n\n foreach ($this->_on[$key] as $condition)\n {\n // Split the condition\n list($c1, $op, $c2, $chaining) = $condition;\n\n // Add chain type\n $conditions[] = ' '.$chaining.' ';\n\n if ($op)\n {\n // Make the operator uppercase and spaced\n $op = ' '.strtoupper($op);\n }\n\n // Quote each of the identifiers used for the condition\n $c1 = $this->quote_identifier($c1);\n $c2 = $this->quote_identifier($c2);\n $conditions[] = $c1.$op.' '.(is_null($c2) ? 'NULL' : $c2);\n }\n\n // remove the first chain type\n array_shift($conditions);\n\n // if there are conditions, concat the conditions \"... AND ...\" and glue them on...\n empty($conditions) or $joins[$key] .= ' ON ('.implode('', $conditions).')';\n\n }\n\n $sql = implode(' ', $joins);\n return $sql;\n }", "public function buildSqlString()\n {\n $param = array();\n\n $join = '';\n $filter = '';\n $order = '';\n $limit = '';\n\n // Create the fieldprefix. If given as alias use this, otherwise we use the tablename\n $field_prefifx = !empty($this->alias) ? $this->alias : '{db_prefix}' . $this->tbl;\n\n // Biuld joins\n if (!empty($this->join))\n {\n $tmp = array();\n\n foreach ( $this->join as $def )\n $tmp[] = ' ' . $def['by'] . ' JOIN ' . '{db_prefix}' . (isset($def['as']) ? $def['tbl'] . ' AS ' . $def['as'] : $def['join']) . ' ON (' . $def['cond'] . ')';\n }\n\n $join = isset($tmp) ? implode(' ', $tmp) : '';\n\n // Create fieldlist\n if (!empty($this->fields))\n {\n // Add `` to some field names as reaction to those stupid developers who chose systemnames as fieldnames\n foreach ( $this->fields as $key_field => $field )\n {\n if (in_array($field, array('date', 'time')))\n $field = '`' . $field . '`';\n\n // Extend fieldname either by table alias or name when no dot as alias/table indicator is found.\n #if (strpos($field, '.') === false)\n # $field .= (!empty($this->alias) ? $this->alias : $this->tbl) . '.' . $field;\n\n $this->fields[$key_field] = $field;\n }\n\n $fieldlist = implode(', ', $this->fields);\n } else\n {\n $fieldlist = '*';\n }\n\n // Create filterstatement\n $filter = !empty($this->filter) ? ' WHERE ' . $this->filter : null;\n\n // Create group by statement\n $group_by = !empty($this->group_by) ? ' GROUP BY ' . $this->group_by : null;\n\n // Create having statement\n $having = !empty($this->having) ? ' HAVING ' . $this->having : null;\n\n // Create order statement\n $order = !empty($this->order) ? ' ORDER BY ' . $this->order : null;\n\n // Create limit statement\n if (!empty($this->limit))\n {\n $limit = ' LIMIT ';\n\n if (isset($this->limit['lower']))\n $limit .= $this->limit['lower'];\n\n if (isset($this->limit['lower']) && isset($this->limit['upper']))\n $limit .= ',' . $this->limit['upper'];\n }\n\n // We need a string for the table. if there is an alias, we have to set it\n $tbl = !empty($this->alias) ? $this->tbl . ' AS ' . $this->alias : $this->tbl;\n\n // Is this an distinct query?\n $distinct = $this->distinct ? 'DISTINCT ' : '';\n\n // Create sql statement by joining all parts from above\n $this->sql = 'SELECT ' . $distinct . $fieldlist . ' FROM {db_prefix}' . $tbl . $join . $filter . $group_by . $having . $order . $limit;\n\n return $this->sql;\n }", "protected function build_join_on( $join, $table ) {\n\n $field_1 = $table . '.' . $join['on']['field'];\n $compare = $join['on']['compare'];\n $field_2 = ( $this->table_short !== '' ) ? $this->table_short : $this->table;\n $field_2 .= '.' . $join['on']['join_field'];\n\n return ' ON ' . $field_1 . ' ' . $compare . ' ' . $field_2;\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "function getSQL(?GrammarInterface $grammar): string {\n if($grammar !== null) {\n $table = $grammar->quoteTable($this->table->getTable());\n \n $alias = $this->table->getAlias();\n if(!empty($alias)) {\n $table .= ' AS '.$alias;\n }\n } else {\n $table = $this->table;\n }\n \n $ons = (\n !empty($this->ons) ?\n ' ON '.\\implode(' AND ', $this->ons) :\n ''\n );\n \n return ($this->type ? $this->type.' ' : '').'JOIN '.$table.$ons;\n }", "function join($table, &$query) {\r\n $left = $query->get_table_info($this->left_table);\r\n $output = \" $this->type JOIN {\" . $this->table . \"} $table[alias] ON ($this->left_query) = $table[alias].$this->field\";\r\n\r\n // Tack on the extra.\r\n if (isset($this->extra)) {\r\n if (is_array($this->extra)) {\r\n $extras = array();\r\n foreach ($this->extra as $info) {\r\n $extra = '';\r\n // Figure out the table name. Remember, only use aliases provided\r\n // if at all possible.\r\n $join_table = '';\r\n if (!array_key_exists('table', $info)) {\r\n $join_table = $table['alias'] . '.';\r\n }\r\n elseif (isset($info['table'])) {\r\n $join_table = $info['table'] . '.';\r\n }\r\n\r\n // And now deal with the value and the operator. Set $q to\r\n // a single-quote for non-numeric values and the\r\n // empty-string for numeric values, then wrap all values in $q.\r\n $raw_value = $this->db_safe($info['value']);\r\n $q = (empty($info['numeric']) ? \"'\" : '');\r\n\r\n if (is_array($raw_value)) {\r\n $operator = !empty($info['operator']) ? $info['operator'] : 'IN';\r\n // Transform from IN() notation to = notation if just one value.\r\n if (count($raw_value) == 1) {\r\n $value = $q . array_shift($raw_value) . $q;\r\n $operator = $operator == 'NOT IN' ? '!=' : '=';\r\n }\r\n else {\r\n $value = \"($q\" . implode(\"$q, $q\", $raw_value) . \"$q)\";\r\n }\r\n }\r\n else {\r\n $operator = !empty($info['operator']) ? $info['operator'] : '=';\r\n $value = \"$q$raw_value$q\";\r\n }\r\n $extras[] = \"$join_table$info[field] $operator $value\";\r\n }\r\n\r\n if ($extras) {\r\n if (count($extras) == 1) {\r\n $output .= ' AND ' . array_shift($extras);\r\n }\r\n else {\r\n $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';\r\n }\r\n }\r\n }\r\n else if ($this->extra && is_string($this->extra)) {\r\n $output .= \" AND ($this->extra)\";\r\n }\r\n }\r\n return $output;\r\n }", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n JOIN \".$this->_getPedido()->getModel()->getTableName().\" pedido ON ( cv_pagto_pedido.id_pedido = pedido.id ) \n LEFT JOIN \".$this->_getFormaPagamento()->getModel()->getTableName().\" forma_pagto ON ( cv_pagto_pedido.id_forma_pagto = forma_pagto.id ) \n LEFT JOIN \".$this->_getParcela()->getModel()->getTableName().\" parcela ON ( cv_pagto_pedido.id_parcela = parcela.id ) \"; \n return $sql;\n }", "private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }", "function db_where($where, $join_and = true) {\n $where_clause = array();\n\n if (is_array($where)) {\n foreach ($where as $key => $value) {\n if (is_numeric($key)) {\n $where_clause[] = $value;\n } else {\n if (db_where_key_has_condition($key)) {\n // if has condition with it?\n // i.e array('name =' => $var) or array('age >' => $int)\n $where_clause[] = \" {$key} \\\"\".mres($value).\"\\\" \";\n } else {\n $where_clause[] = \" {$key} = \\\"\".mres($value).\"\\\" \";\n }\n }\n }\n } else {\n $where_clause[] = $where;\n }\n\n return '('.join($join_and ? ' AND ' : ' OR ', $where_clause).')';\n}", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n LEFT JOIN \".$this->_getPagamento()->getModel()->getTableName().\" pagto_pedido ON ( cv_pagto_lanc.id_pagto_pedido = pagto_pedido.id ) \n LEFT JOIN \".$this->_getLancamento()->getModel()->getTableName().\" lancamento ON ( cv_pagto_lanc.id_lancamento = lancamento.id ) \"; \n return $sql;\n }", "protected function _getFetchJoins() {\n\t\treturn 'LEFT JOIN series se ON se.series_id = s.series_id\n\t\t\tLEFT JOIN series_settings stpl ON (se.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)\n\t\t\tLEFT JOIN series_settings stl ON (se.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)\n\t\t\tLEFT JOIN series_settings sapl ON (se.series_id = sapl.series_id AND sapl.setting_name = ? AND sapl.locale = ?)\n\t\t\tLEFT JOIN series_settings sal ON (se.series_id = sal.series_id AND sal.setting_name = ? AND sal.locale = ?)';\n\t}", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getAlias() .\" \n JOIN \".$this->_getPedido()->getModel()->getTableName().\" pedido ON ( cv_item_pedido.id_pedido = pedido.id ) \n JOIN \".$this->_getProduto()->getModel()->getTableName().\" produto ON ( cv_item_pedido.id_produto = produto.id ) \n JOIN \".$this->_getConta()->getModel()->getTableName().\" usu_inc ON ( cv_item_pedido.id_usu_inc = usu_inc.id ) \n JOIN \".$this->_getConta()->getModel()->getTableName().\" usu_alt ON ( cv_item_pedido.id_usu_alt = usu_alt.id ) \"; \n return $sql;\n }", "private static function genFetchByParamsQuery($param_map) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $query = \"SELECT * FROM {$fully_qualified_table_name} WHERE \";\n foreach ($param_map as $p_name => $p_value) {\n $transformed_key_name = self::transformForPreparedStatement($p_name);\n $query .= $p_name .'=' . $transformed_key_name;\n $query .= ' AND ';\n }\n \n $query = substr($query, 0, -5);\n return $query;\n }", "final public static function toSQL()\n {\n $select = false;\n foreach (self::$starts as $reserved) {\n if (strpos(self::$query, $reserved . ' ') === 0) {\n $select = true;\n break;\n }\n }\n\n if (!$select) {\n self::$query = \"SELECT * FROM \" . self::tableName() . self::$query;\n }\n\n\n $values = [];\n for ($i = 0; $i < sizeof(self::$bindParams); $i++) {\n foreach (self::$bindParams[$i] as $item) {\n $values[] = $item;\n }\n }\n\n if (sizeof($values) > 0) {\n $query = self::$query;\n self::$query = \"\";\n self::$where = false;\n self::$bindParams = array();\n $query = str_replace(\"?\", \"#%s#\", $query);\n $query = sprintf($query, ...$values);\n $query = str_replace(\"#\", \"'\", $query);\n return sprintf($query, ...$values);\n }\n return self::$query;\n }", "abstract protected function buildSQL(): string;", "public function getJoinSql($data, $link) {\n $str = ' ';\n if ($data->joins) {\n foreach ($data->joins as $join) {\n $join['type'] = strtoupper($join['type']);\n if (strncmp('NATURAL', $join['type'], 7) === 0) {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']);\n } else {\n $str .= $join['type'] . ' JOIN ' . $this->formatTable($join['table']) . $this->parseIndexHint($join['index_hint']) . ($join['cond'] ? ' ON ' . $this->parseWhere($join['cond'], '', $link) : '');\n }\n }\n }\n\n return $str;\n }", "public function getJoins() {\n\t\t$sql = \"\";\n\t\tif (count($this->join) > 0) {\n\t\t\tforeach ($this->join as $j) {\n\t\t\t\t$sj = $j[2];\n\t\t\t\t$sql .= \" \".$j[0].\" JOIN \".$sj->getFrom().\" ON \".$sj->getTable().\".`\".$j[3].\"`=\".$this->getTable().\".`\".$j[1].\"`\";\n\t\t\t\t$sql .= $sj->getJoins();\n\t\t\t}\n\n\n\t\t}\n\t\treturn $sql;\n\t}", "function to_str(){\n //\n $op1 = $this->operand1->to_str();\n $op2 = $this->operand2->to_str();\n \n //return a valid where clause\n return \"$op1 $this->operator $op2\";\n }", "public function joinOn($tableJoin, $columnJoin, $tableOn, $columnOn);", "function createWhere($sql) {\n $where = $this->where;\n if(!empty($where)) {\n $sql .= \" WHERE \";\n for($i = 0; $i < count($where); $i++) {\n $sql .= $where[$i]->key . \" \" . $where[$i]->operator . \" \" . $where[$i]->placeholder;\n $afterCon = $where[$i]->afterCondition;\n if(!is_null($afterCon)) {\n $sql .= \" \" . $afterCon . \" \";\n }\n }\n }\n\n return $sql;\n }", "protected function _getSqlBase() {\n $sql = $this->getModel()->getTableName().' '.$this->getModel()->getName() .\" \n JOIN \".$this->_getPessoa()->getModel()->getTableName().\" cliente ON ( ca_cliente_contrato.id_cliente = cliente.id ) \n JOIN \".$this->_getContrato()->getModel()->getTableName().\" contrato ON ( ca_cliente_contrato.id_contrato = contrato.id ) \"; \n return $sql;\n }", "public function resolveConditionData($params)\n {\n $dataWhere = \"\";\n\n $lowerKeyd = array_change_key_case($params, CASE_LOWER);\n $glue = strtoupper(isset($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) && strtolower($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) == \"or\" ? \"OR\" : \"AND\");\n unset($lowerKeyd);\n\n foreach ($params as $k => $v) {\n if (strpos($k, self::OPERATOR_PREFIX) === 0) {\n continue;\n }\n if (is_numeric($k)) {\n if (is_array($v)) {\n $dataWhere .= ($dataWhere ? \" {$glue} (\" : \"(\") . $this->resolveConditionData($v) . \")\";\n }\n else { // raw\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $v;\n }\n }\n else {\n $expl = explode(\" \", $k, 2);\n $operator = count($expl) > 1 ? $expl[1] : \"=\";\n if ($operator == \"=\" && (is_array($v))) {\n $operator = \"IN\";\n }\n if ($operator == \"!=\" && (is_array($v))) {\n $operator = \"NOT IN\";\n }\n if ($operator == \"=\" && ($v === NULL)) {\n $operator = \"IS\";\n }\n if ($operator == \"!=\" && ($v === NULL)) {\n $operator = \"IS NOT\";\n }\n $dontQuote = false;\n if ($v === NULL) {\n $v = \"NULL\";\n $dontQuote = true;\n }\n if ($v === TRUE) {\n $v = 1;\n }\n if ($v === FALSE) {\n $v = 0;\n }\n $column = $expl[0];\n if (strpos($column, self::DONT_QUOTE_VALUE_PREFIX) === 0) {\n $column = substr($column, 1);\n $dontQuote = true;\n }\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $this->quoteColumn($column) . \" {$operator} \" . $this->_quoteVal($v, $dontQuote);\n }\n }\n\n return $dataWhere;\n }", "public function join($table, $alias = NULL, $condition = NULL, $arguments = []);", "public function whereClause(&$args, &$joins)\n\t{\n\t\t$key = self::getNewKey($this->column);\n\t\t$addendum = '';\n\n\t\t/* check if we have to do some parsing*/\n\t\tif (self::$columns[$this->column]['type'] === 'date') {\n\t\t\t$args[$key] = strtotime($this->argument);\n\t\t\tif ($this->operator === '=' || $this->operator === '!=') {\n\t\t\t\t$key2 = self::getNewKey($this->column);\n\t\t\t\t$args[$key2] = strtotime(' +1 day', $args[$key]);\n\t\t\t\treturn ($this->operator === '=' ? '' : 'NOT ') . 'm.' . $this->column . \" BETWEEN :$key AND :$key2\";\n\t\t\t}\n\t\t\tif ($this->operator === '>') {\n\t\t\t\t$args[$key] = strtotime('+1 day', $args[$key]);\n\t\t\t} elseif ($this->operator === '<') {\n\t\t\t\t$args[$key] = strtotime('-1 day', $args[$key]);\n\t\t\t}\n\t\t} else {\n\t\t\t$args[$key] = $this->argument;\n\t\t\tif ($this->operator === '~' || $this->operator === '!~') {\n\t\t\t\t$args[$key] = str_replace(array('=', '_', '%', '*', '?'), array('==', '=_', '=%', '%', '_'), $args[$key]);\n\t\t\t\t$addendum = \" ESCAPE '='\";\n\t\t\t}\n\t\t}\n\n\t\t$op = $this->operator;\n\t\tif ($this->operator == '~') {\n\t\t\t$op = 'LIKE';\n\t\t} elseif ($this->operator == '!~') {\n\t\t\t$op = 'NOT LIKE';\n\t\t}\n\n\t\treturn 'm.' . $this->column . ' ' . $op . ' :' . $key . $addendum;\n\t}", "private static function buildNameParametersSQL() {\n $namedParams = '';\n foreach (static::$tableSchema as $columnName => $type) {\n $namedParams .= $columnName . ' = :' . $columnName . ', ';\n }\n return trim($namedParams, ', ');\n }", "function compile_sql_query(string $sql, array $bindings = []): string\n {\n $string = function ($string) {\n return '\"'.str_replace('\\\\', '\\\\\\\\\\\\', (string) $string).'\"';\n };\n\n foreach ($bindings as $binding) {\n // TODO: need to review all cases.\n switch (gettype($binding)) {\n case 'boolean':\n case 'integer':\n $binding = (int) $binding;\n break;\n case 'float':\n case 'double':\n $binding = (double) $binding;\n break;\n case 'array':\n foreach ($binding as $key => $value) {\n $binding[$key] = $string($value);\n }\n $binding = implode(',', $binding);\n break;\n case 'NULL':\n break;\n case 'string':\n default:\n $binding = $string($binding);\n break;\n }\n $sql = preg_replace('/\\?/', $binding, $sql, 1);\n }\n\n return $sql;\n }", "public function getSQL()\n\t{\n\t\t// build the SELECT FROM part\n\t\t$sql = sprintf('SELECT * FROM `%s`', $this->from);\n\t\t// build the JOIN part\n\t\tforeach ($this->joins as $join) {\n\t\t\t$sql .= sprintf(' %s JOIN `%s` ON (%s)',\n\t\t\t\t$join['type'],\n\t\t\t\t$join['foreignTable'],\n\t\t\t\t$join['clause']\n\t\t\t);\n\t\t}\n\t\t// build the WHERE part\n\t\tif ($this->wheres) {\n\t\t\t$whereClauses = array();\n\t\t\tforeach ($this->wheres as $key => $where) {\n\t\t\t\t$whereClauses []= $where['clause'];\n\t\t\t}\n\t\t\t$sql .= ' WHERE ' . implode(' AND ', $whereClauses);\n\t\t}\n\t\t// build the LIMIT part\n\t\tif ($this->limit) {\n\t\t\t$sql .= ' LIMIT ' . $this->limit;\n\t\t}\n\t\treturn $sql;\n\t}", "public function toSQL()\n {\n $sql = '`' . $this->fieldName . '` ' . $this->getOperator() . ' ' . $this->getSearchValue();\n if (null != $this->tableName) {\n $sql = '`' . $this->tableName . '`.' . $sql;\n }\n \n return $sql;\n }", "function sql_inner_join_where_clause(int $count, array $keys)\n {\n $sql = \" WHERE \";\n for($i = 0; $i < $count; $i++ ) {\n\n $t_index = $i + 1;\n $t_name = \"T$t_index\";\n\n $sql .= \"$t_name.field = '\" . $keys[$i];\n $sql .= ($i != $count - 1) ? \"' AND \" : \"'\";\n }\n $sql .= \") TmpTable\";\n return $sql;\n }", "function to_str() {\n //\n //Test if this sql has an elias \n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //the update statement \n $smt=\"\"\n //This is an update statement \n .\"UPDATE \\n\"\n //\n //Get the root from expression as the source table of this update \n //statement \n . \"{$this->root->fromexp()} \\n\"\n . \"SET \\n\"\n //\n //get the values as key values pairs \n .\"{$this->str_values()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\"\n //\n //include an ellias if any \n .\"$alias\";\n //\n //Return the sql statement\n return $smt;\n }", "public function extra_columns_joins($params, $fields = []) {\n $sqljoins = \"\";\n\n if (isset($params->extra_columns) and $params->extra_columns) {\n $extra_columns = explode(\",\", $params->extra_columns);\n\n foreach ($extra_columns as $index) {\n if (class_exists('\\local_intelliboard\\extra_columns\\column' . $index)) {\n $classname = '\\local_intelliboard\\extra_columns\\column' . $index;\n /** @var \\local_intelliboard\\extra_columns\\base_column $columnbuilder */\n $columnbuilder = new $classname($params, $fields);\n list($sql, $params) = $columnbuilder->get_join();\n $sqljoins .= \" {$sql}\";\n $this->params = array_merge($this->params, $params);\n } else {\n if ($index == 11) {\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n\n $sqljoins .= \" LEFT JOIN (SELECT lg.objectid,\n CASE WHEN u.id IS NOT NULL THEN CONCAT(u.firstname, ' ', u.lastname) ELSE '' END AS name\n FROM {logstore_standard_log} lg\n JOIN {user} u ON u.id = lg.userid\n WHERE lg.component = 'core' AND lg.action = 'created' AND lg.target = 'user'\n ) creator ON creator.objectid = {$usertablealias}\";\n }else if ($index == 12){\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n $coursetablealias = isset($fields[1]) ? $fields[1] : \"c.id\";\n $roles = get_operator('GROUP_CONCAT', \"DISTINCT(CASE WHEN r.name='' THEN r.shortname ELSE r.name END)\", ['separator' => ', ']);\n $course_filter = $this->get_filter_in_sql($params->courseid, \"c.instanceid\");\n\n $sqljoins .= \" LEFT JOIN (SELECT\n c.instanceid, ra.userid,\n $roles AS roles\n FROM {context} c\n LEFT JOIN {role_assignments} ra ON ra.contextid=c.id\n LEFT JOIN {role} r ON r.id=ra.roleid\n WHERE c.contextlevel=50\n {$course_filter}\n GROUP BY c.instanceid, ra.userid) course_roles ON course_roles.instanceid={$coursetablealias} AND course_roles.userid={$usertablealias}\";\n }else if ($index == 13){\n $usertablealias = isset($fields[0]) ? $fields[0] : \"u.id\";\n $roles = get_operator('GROUP_CONCAT', \"DISTINCT(CASE WHEN r.name='' THEN r.shortname ELSE r.name END)\", ['separator' => ', ']);\n $contextid = (defined('SYSCONTEXTID')) ? SYSCONTEXTID : 0;\n\n $sqljoins .= \" LEFT JOIN (SELECT\n ra.userid,\n $roles AS roles\n FROM {role_assignments} ra\n LEFT JOIN {role} r ON r.id=ra.roleid\n WHERE ra.contextid={$contextid}\n GROUP BY ra.userid) system_roles ON system_roles.userid={$usertablealias} \";\n } elseif ($index == 14) {\n $userEnrolTableAlias = isset($fields[2]) ? $fields[2] : \"ue.modifierid\";\n\n $sqljoins .= \" LEFT JOIN {user} enrol_by ON enrol_by.id={$userEnrolTableAlias} \";\n }\n }\n }\n }\n\n return $sqljoins;\n }", "function toSql($compiler, $model, $rhs) {\n // MySQL doesn't support LIMIT or OFFSET in subqueries. Instead, add\n // the query as a JOIN and add the join constraint into the WHERE\n // clause.\n if ($rhs instanceof Model\\QuerySet\n && ($rhs->isWindowed() || $rhs->countSelectFields() > 1 || $rhs->chain)\n ) {\n if (count($rhs->values) < 1)\n throw new Exception\\OrmError('Did you forget to specify a column with ->values()?');\n $f1 = array_values($rhs->values)[0];\n $view = $rhs->asView();\n $lhs = $this->buildLhs($compiler, $model);\n $alias = $compiler->pushJoin(spl_object_hash($view), $lhs, $view, array('constraint'=>array()));\n return sprintf('%s = %s.%s', $lhs, $alias, $compiler->quote($f1));\n }\n return parent::toSql($compiler, $model, $rhs);\n }", "function makeTargetSQL($condition_ix)\n{\n $targetSQLs = array();\n $joins = array();\ntrace($this->targets, 'makeTargetSQL targets');\n foreach($this->targets as $tgt_ix => $target){\n $defSnips = array();\n $def = $target->getDef();\n $defSnips[] = $def['snippet'];\n if(isset($def['joins'])){\n $joins = array_merge($joins, $def['joins']);\n }\n\n $SQL = \"CASE WHEN \";\n $SQL .= join(' AND ', $defSnips);\n $SQL .= \" THEN 1 ELSE NULL END\";\n //$SQL .= \" AS Target_$tgt_ix\";\n $SQL .= \" AS C{$condition_ix}Ta{$tgt_ix}\";\n $targetSQLs[$tgt_ix] = $SQL;\n }\n\n return array('selects' => $targetSQLs, 'joins' => $joins);\n}", "public function build_join( $joins ) {\n $sql = '';\n\n if ( empty( $joins ) ) {\n return $sql;\n }\n\n foreach ( $joins as $index => $join ) {\n if ( ! is_array( $join ) ) {\n continue;\n }\n\n $table = $join['table'] . '_' . $index;\n\n $sql .= ' ' . strtoupper( $join['type'] ) . ' JOIN ' . $join['table'] . ' AS ' . $table;\n $sql .= $this->build_join_on( $join, $table );\n\n $this->query_args['fields'] = wp_parse_args(\n $this->query_args['fields'],\n $this->build_join_fields( $join, $table )\n );\n }\n\n return $sql;\n }", "public function testBuildWhereWithJoin()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->alias('table1_alias')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->alias('table2_alias')\n ->joinOn('id', 'id')\n ->where('is_admin', 1)\n )\n ->where('id', 100)\n ;\n\n $this->assertSame(\n \"WHERE table1_alias.id = '100' AND table2_alias.is_admin = '1'\",\n $query->buildWhere()\n );\n }", "function _add_where_clause($where_clauses, $join)\n {\n $clauses = array();\n foreach ($where_clauses as $clause) {\n extract($clause);\n if ($this->object->has_column($column)) {\n $column = \"`{$column}`\";\n }\n if (!is_array($value)) {\n $value = array($value);\n }\n foreach ($value as $index => $v) {\n $v = $clause['type'] == 'numeric' ? $v : \"'{$v}'\";\n $value[$index] = $v;\n }\n if ($compare == 'BETWEEN') {\n $value = \"{$value[0]} AND {$value[1]}\";\n } else {\n $value = implode(', ', $value);\n if (strpos($compare, 'IN') !== FALSE) {\n $value = \"({$value})\";\n }\n }\n $clauses[] = \"{$column} {$compare} {$value}\";\n }\n $this->object->_where_clauses[] = implode(\" {$join} \", $clauses);\n }", "protected function compileJoins(Builder $builder, $joins): string\n {\n $sql = [];\n\n foreach ((array) $joins as $join) {\n $table = $this->wrapTable($join->table);\n\n $clauses = [];\n\n foreach ($join->clauses as $clause) {\n $clauses[] = $this->compileJoinContraint($clause);\n }\n\n foreach ($join->bindings as $binding) {\n $builder->addBinding($binding, 'join');\n }\n\n $clauses[0] = $this->removeStatementBoolean($clauses[0]);\n\n $clauses = implode(' ', $clauses);\n\n $sql[] = \"{$join->type} join {$table} on {$clauses}\";\n }\n\n return implode(' ', $sql);\n }", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "public function __toString()\n {\n if (!isset($this->_from[0]['table']) || !$this->_from[0]['table']) {\n //sanity check\n return '';\n }\n\n $sql = \"SELECT \";\n\n $column_parts = array();\n $from_parts = array();\n\n foreach ($this->_from as $from) {\n $table_key = (is_array($from['table'])) ? key($from['table']) : $from['table'];\n\n foreach ($from['columns'] as $column_key => $column_name) {\n if (strpos($column_name, '(') === false && strpos($column_name, '.') === false) {\n //This is NOT an expression and does not yet have \".\", add tbl name\n $column_name = $table_key . '.' . $column_name;\n }\n\n if (!geoString::isInt($column_key)) {\n $column_name .= ' AS ' . $column_key;\n }\n $column_parts[] = $column_name;\n }\n\n //figure out from\n switch ($from['join_type']) {\n case 'primary':\n //special case, this is first table, don't need to add join type\n $from_str = '';\n break;\n\n case self::JOIN_LEFT:\n $from_str = 'LEFT JOIN ';\n break;\n\n case self::JOIN_INNER:\n //break ommitted on purpose\n default:\n $from_str = 'INNER JOIN ';\n break;\n }\n\n if (is_array($from['table'])) {\n //using array(table_alias => table_name)\n $table = $from['table'];\n reset($table);\n $from_str .= current($table) . ' AS ' . key($table);\n } else {\n //simple string for table\n $from_str .= $from['table'];\n }\n if ($from['on'] && is_array($from['on'])) {\n $from_str .= ' ON ' . implode(' AND ', $from['on']);\n } elseif ($from['on']) {\n $from_str .= ' ON ' . $from['on'];\n }\n $from_parts [] = $from_str;\n }\n $sql .= implode(', ', $column_parts) . \"\\n\\tFROM \" . implode(\"\\n\\t\\t\", $from_parts);\n\n $where = $this->_where;\n\n if ($this->_orWhere) {\n //add all the OR's to the thingy\n foreach ($this->_orWhere as $name => $orWhere) {\n $where[$name] = \"(\" . implode(' OR ', $orWhere) . \")\";\n }\n }\n\n if ($where) {\n $sql .= \"\\n\\tWHERE \" . implode(' AND ', $where);\n }\n\n if ($this->_group) {\n $sql .= \"\\n\\tGROUP BY \" . implode(', ', $this->_group);\n }\n\n if ($this->_order) {\n $sql .= \"\\n\\tORDER BY \" . implode(', ', $this->_order);\n }\n\n if ($this->_count || $this->_offset) {\n $sql .= \"\\n\\tLIMIT {$this->_count}\";\n if ($this->_offset) {\n $sql .= \", {$this->_offset}\";\n }\n }\n\n return $sql;\n }", "private function generateSql($sql, $params, $types)\n {\n if (!count($params)) {\n return $sql;\n }\n\n $converted = $this->getConvertedParams($params, $types);\n\n if (is_int(key($params))) {\n $index = key($converted);\n $sql = preg_replace_callback('@\\?@sm', function ($match) use (&$index, $converted) {\n return $converted[$index++];\n }, $sql);\n } else {\n foreach ($converted as $key => $value) {\n $sql = str_replace(':' . $key, $value, $sql);\n }\n }\n\n return $sql;\n }", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "function map_joins($join){\n //\n //return field to str\n return $join->to_str();\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "private function createJoinQueriesPart($composite): array {\n\n $join = '';\n $select = '';\n\n $join .= $composite->queryProperty->getJoin() . ' ';\n $join .= $composite->queryProperty->getTable() . ' ';\n $join .= 'ON ' . $composite->queryProperty->getJoinOn() . ' ';\n\n $select .= $composite->queryProperty->getSelect();\n\n if($composite->queryProperty->getComposite() instanceof DBManager) {\n $queryPart = $composite->createJoinQueriesPart($composite->queryProperty->getComposite());\n\t\t\t$join .= ' ' . $queryPart['join'];\n\t\t\t$select .= ', ' . $queryPart['select'];\n }\n\n return ['join' => $join, 'select' => $select];\n }", "public function join($tbl_name, array $condition, $type = Operator::JOIN_INNTER)\n {\n $output = array();\n $func = function ($value) use (&$output)\n {\n $value = $this->escapeString($value);\n $output[] = \"`{$value}`\";\n };\n $temp = explode('.', $tbl_name);\n $output = array();\n array_walk($temp, $func);\n $tbl_name = implode('.', $output);\n $target_str = $tbl_name;\n $on_str_list = array();\n foreach ($condition as $item) {\n $temp = explode('.', $item);\n $output = array();\n array_walk($temp, $func);\n $on_str_list[] = implode('.', $output);\n }\n $type = ltrim($type, '$');\n $on_str = implode(' = ', $on_str_list);\n $join_str = \"{$type} {$target_str} ON {$on_str}\";\n $this->join_str_list[] = $join_str;\n return $this;\n }", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "protected function buildSql() {\r\n if( !$this->sql ) {\r\n $this->sql = $this->sqlAction;\r\n if( count($this->sqlFields) === 0 ) {\r\n $this->sqlFields[] = '*';\r\n }\r\n $this->sqlStrTables = join(', ', $this->sqlTables);\r\n $this->sqlStrFields = join(', ', $this->sqlFields);\r\n $this->sqlStrConditions = join(' ', $this->sqlConditions);\r\n switch ($this->sqlAction) {\r\n case 'SELECT': $this->buildSelectSql();\r\n break;\r\n case 'UPDATE': $this->buildUpdateSql();\r\n break;\r\n case 'INSERT': $this->buildInsertSql();\r\n break;\r\n case 'DELETE': $this->buildDeleteSql();\r\n break;\r\n }\r\n }\r\n }", "function getSql()\n{\n\textract($this->query, EXTR_SKIP);\n\t\n\tif (!$select or !$from) return '';\n\t\n\t$sql = 'SELECT '.implode(',', $select).' FROM '.$from;\n\tif ($where) $sql .= ' WHERE '.implode(' AND ', array_unique($where));\n\tif ($whereJoin) $sql .= ($where? ' AND ':' WHERE ').implode(' AND ', array_unique($whereJoin));\n\tif ($group) $sql .= ' GROUP BY '.$group;\n\tif ($having) $sql .= ' HAVING '.implode(' AND ', array_unique($having));\n\tif ($order) $sql .= ' ORDER BY '.implode(',', $order);\n\tif ($limit) $sql .= ' LIMIT '.$limit[0].' OFFSET '.$limit[1];\n\treturn $sql;\n}", "private function GeneraSelectQuery($fields,$where)\r\n\t{\r\n\t\t$sql=\"select \r\n\t\t\t\".$fields.\" \r\n\t\t\tfrom Tabla\r\n\t\t\tinner join Tabla1 on Tabla1.id=Tabla.idTabla1\r\n\t\t\t\".(($where)?\" WHERE \".$where:\"\");\r\n\t\treturn $sql;\r\n\t}", "function _add_where_clause($where_clauses, $join)\n {\n foreach ($where_clauses as $clause) {\n // $clause => array(\n // 'column' => 'ID',\n // 'value' =>\t1210,\n // 'compare' => '='\n // )\n // Determine where what the where clause is comparing\n switch ($clause['column']) {\n case 'author':\n case 'author_id':\n $this->object->_query_args['author'] = $clause['value'];\n break;\n case 'author_name':\n $this->object->_query_args['author_name'] = $clause['value'];\n break;\n case 'cat':\n case 'cat_id':\n case 'category_id':\n switch ($clause['compare']) {\n case '=':\n case 'BETWEEN':\n case 'IN':\n if (!isset($this->object->_query_args['category__in'])) {\n $this->object->_query_args['category__in'] = array();\n }\n $this->object->_query_args['category__in'][] = $clause['value'];\n break;\n case '!=':\n case 'NOT BETWEEN':\n case 'NOT IN':\n if (!isset($this->object->_query_args['category__not_in'])) {\n $this->object->_query_args['category__not_in'] = array();\n }\n $this->object->_query_args['category__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'category_name':\n $this->object->_query_args['category_name'] = $clause['value'];\n break;\n case 'post_id':\n case $this->object->get_primary_key_column():\n switch ($clause['compare']) {\n case '=':\n case 'IN':\n case 'BETWEEN':\n if (!isset($this->object->_query_args['post__in'])) {\n $this->object->_query_args['post__in'] = array();\n }\n $this->object->_query_args['post__in'][] = $clause['value'];\n break;\n default:\n if (!isset($this->object->_query_args['post__not_in'])) {\n $this->object->_query_args['post__not_in'] = array();\n }\n $this->object->_query_args['post__not_in'][] = $clause['value'];\n break;\n }\n break;\n case 'pagename':\n case 'postname':\n case 'page_name':\n case 'post_name':\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['page_name__like'] = $clause['value'];\n } elseif ($clause['compare'] == '=') {\n $this->object->_query_args['pagename'] = $clause['value'];\n } elseif ($clause['compare'] == 'IN') {\n $this->object->_query_args['page_name__in'] = $clause['value'];\n }\n break;\n case 'post_title':\n // Post title uses custom WHERE clause\n if ($clause['compare'] == 'LIKE') {\n $this->object->_query_args['post_title__like'] = $clause['value'];\n } else {\n $this->object->_query_args['post_title'] = $clause['value'];\n }\n break;\n default:\n // Must be metadata\n $clause['key'] = $clause['column'];\n unset($clause['column']);\n // Convert values to array, when required\n if (in_array($clause['compare'], array('IN', 'BETWEEN'))) {\n $clause['value'] = explode(',', $clause['value']);\n foreach ($clause['value'] as &$val) {\n if (!is_numeric($val)) {\n // In the _parse_where_clause() method, we\n // quote the strings and add slashes\n $val = stripslashes($val);\n $val = substr($val, 1, strlen($val) - 2);\n }\n }\n }\n if (!isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query'] = array();\n }\n $this->object->_query_args['meta_query'][] = $clause;\n break;\n }\n }\n // If any where clauses have been added, specify how the conditions\n // will be conbined/joined\n if (isset($this->object->_query_args['meta_query'])) {\n $this->object->_query_args['meta_query']['relation'] = $join;\n }\n }", "function joinClause( $join ) {\n\t global $wpdb;\n\t $join .= \" INNER JOIN $wpdb->postmeta dm ON (dm.post_id = $wpdb->posts.ID AND dm.meta_key = '$this->orderby') \";\n\t return $join;\n\t}", "protected function getSqlFromConditions($sql, array $conditions)\n\t{\n\t\t$sqlWhere = array();\n\t\t$defaultColOperators = array(0 => '', 1 => '=');\n\t\t$ci = 0;\n\t\tforeach($conditions as $column => $value) {\n\t\t\t// Column name with comparison operator\n\t\t\t$colData = explode(' ', $column);\n\t\t\t$col = $colData[0];\n\t\t\t\n\t\t\t// Array of values, assume IN clause\n\t\t\tif(is_array($value)) {\n\t\t\t\t$sqlWhere[] = $col . \" IN('\" . implode(\"', '\", $value) . \"')\";\n\t\t\t\n\t\t\t// NULL value\n\t\t\t} elseif(is_null($value)) {\n\t\t\t\t$sqlWhere[] = $col . \" IS NULL\";\n\t\t\t\n\t\t\t// Standard string value\n\t\t\t} else {\n\t\t\t\t$colComparison = isset($colData[1]) ? $colData[1] : '=';\n\t\t\t\t$columnSql = $col . ' ' . $colComparison;\n\t\t\t\t\n\t\t\t\t// Add to binds array and add to WHERE clause\n\t\t\t\t$colParam = str_replace('.', '_', $col) . $ci;\n\t\t\t\t$sqlWhere[] = $columnSql . \" :\" . $colParam . \"\";\n\t\t\t}\n\t\t\t\n\t\t\t// Increment ensures column name distinction\n\t\t\t$ci++;\n\t\t}\n\t\t\n\t\t$sql .= empty($sqlWhere) ? \"\" : \" WHERE \" . implode(' AND ', $sqlWhere);\n\t\treturn $sql;\n\t}", "function makeTriggerSQL($condition_ix)\n{\n $triggerSQLs = array();\n $joins = array();\n foreach($this->triggers as $trg_ix => $triggerFields){\n $defSnips = array();\n foreach($triggerFields as $triggerField){\n $def = $triggerField->getDef();\n $defSnips[] = $def['snippet'];\n $joins = array_merge($joins, $def['joins']);\n }\n $SQL = \"CASE WHEN \";\n $SQL .= join(' AND ', $defSnips);\n //$SQL .= \" THEN 1 ELSE NULL END\";\n $SQL .= \" THEN 'C{$condition_ix}Tr{$trg_ix}' ELSE NULL END\";\n $triggerSQLs[] = $SQL;\n }\n\n if(count($this->triggers) > 1){\n //$SQL = \"COALESCE(\".join(',', $triggerSQLs).\")\";\n $SQL = \"CONCAT_WS(',', \".join(',', $triggerSQLs).\")\";\n }\n $SQL .= \" AS Condition_$condition_ix\";\n return array('triggerExpr' => $SQL, 'joins' => $joins);\n}", "function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}", "public function sql(){\n $str = \"\";\n foreach($this->params as $key => $val){\n if($val != false){\n $str .= \"$key $val \";\n }\n }\n return $str;\n }", "private function getJoinStr($joins=array()){\n\t\t$str = array();\n\t\tforeach($joins ?: $this->joins as $j){\n\t\t\tlist($table, $on, $type) = $j;\n\t\t\tswitch($type){\n\t\t\t\tcase self::LEFT_JOIN:\n\t\t\t\t\t$str[] = 'LEFT JOIN';\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::RIGHT_JOIN:\n\t\t\t\t\t$str[] = 'RIGHT JOIN';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::INNER_JOIN:\n\t\t\t\tdefault:\n\t\t\t\t\t$str[] = 'INNER JOIN';\n\t\t\t}\n\n\t\t\t$str[] = self::escapeKey($table);\n\t\t\tif($on){\n\t\t\t\t$str[] = \"ON $on\";\n\t\t\t}\n\t\t}\n\t\treturn join(\"\", $str);\n\t}", "public function getSql()\n {\n $operators['='] = '=';\n $operators['like'] = 'like';\n $operators['>='] = '>=';\n $operators['<='] = '<=';\n\n $select = 'SELECT ';\n foreach ($this->columns as $key => $value)\n {\n $alias = '';\n //bairros::nome|bairro\n if(preg_match('/\\|/',$key) && !preg_match('/like/',$key)) \n {\n $explode_values = explode('|',$key);\n $table_field = str_replace('::', '.', $explode_values[0]);\n $alias = $explode_values[1]; \n $alias = \" as {$alias}\"; \n }\n // elseif(preg_match('/like/',$key))\n // {\n \n // $explode_values = explode('|',$key);\n // $exKey = explode('::',$explode_values[0]);\n // $alias = $explode_values[1]; \n // $alias = \" as {$alias}\";\n \n // $table_field = \"{$exKey[0]}.{$exKey[1]}\"; \n // }\n else\n {\n\n $table_field = str_replace('::', '.', $key); \n }\n \n $select.= \" {$table_field}{$alias},\";\n $table = explode('.', $table_field);\n $from[$table[0]] = $table[0];\n\n if ($value->relation)\n {\n $where.= ' ' . $value->relation . ' AND';\n }\n }\n\n if ($this->filter)\n {\n foreach ($this->filter as $key_filter => $filter)\n {\n if ($filter)\n {\n \n\n if(preg_match('/\\|/',$key_filter))\n {\n $key_filter = explode('::', $key_filter);\n $operator = $key_filter[2];\n $explode_values = explode('|',$key_filter[1]);\n $key_filter = $this->model->getTable() . '.' . $explode_values[0]; \n\n }\n else\n {\n $key_filter = explode('::', $key_filter);\n $operator = $key_filter[2];\n $key_filter = $this->model->getTable() . '.' . $key_filter[1]; \n }\n\n if ($operator)\n {\n if ($operator == 'like')\n {\n $where.= \" {$key_filter} like '%{$filter}%' AND\";\n }\n elseif ($operators[$operator])\n {\n $where.= \" {$key_filter} {$operators[$operator]} '{$filter}' AND\";\n }\n }\n else\n {\n $where.= \" {$key_filter} like '%{$filter}%' AND\";\n }\n }\n }\n }\n if ($where)\n {\n $where = ' WHERE ' . $where;\n }\n $where = substr($where, 0, -3);\n $select = substr($select, 0, -1);\n $from = implode(',', $from);\n \n return $select . ' from ' . $from . $where . ' limit 20';\n }", "function _where ($identifier_array, $o = TRUE) {\n\t\t$statement = '';\n\t\tif ( !isset($identifier_array) || !$identifier_array ) {\n\t\t\treturn $statement;\n\t\t}\n\t\t$statement .= $o ? ' WHERE ' : ' ';\n\t\tforeach ($identifier_array as $query_array) {\n\t\t\t$sub_stmt = '(';\n\t\t\tif ( isset($query_array['name']) && ! is_array($query_array['value']) ) {\n\t\t\t\t$regex = isset($query_array['regex']) ? $query_array['regex'] : '@';\n\t\t\t\t$sub_stmt .= '`' . $query_array['name'] . '` ';\n\t\t\t\t$sub_stmt .= (isset($query_array['ctype']) ? $query_array['ctype'] : '=') . ' ';\n\t\t\t\t$sub_stmt .= $this->escape($query_array['value'], $regex, FALSE);\n\t\t\t} else {\n\t\t\t\t// Incoming value is an array.\n\t\t\t\t$sub_stmt .= $this->_where($query_array['value'], FALSE);\n\t\t\t}\n\t\t\t$sub_stmt .= ')';\n\t\t\t$sub_stmt .= (isset($query_array['atype']) ? (' ' . $query_array['atype']).' ' : '');\n\t\t\t$statement .= $sub_stmt;\n\t\t}\n\t\treturn $statement; \n\t}", "private function constructJoinString($tables)\n {\n $joinStrings = array();\n foreach ($tables as $table) {\n // Don't join with current table\n if ($table == $this->tableName) {\n continue;\n }\n\n $thisTableJoinColumns = (array)$this->joinColumns[$table][0];\n $otherTableJoinColumns = (array)$this->joinColumns[$table][1];\n\n foreach ($thisTableJoinColumns as $key => $columns) {\n $otherColumns = $otherTableJoinColumns[$key];\n\n $columnStrings = array();\n if (!is_array($columns) || count($columns) == 1) {\n // One-to-many relationship or one-to-one relationship\n foreach ((array)$otherColumns as $otherColumn) {\n $columnStrings[] = $this->tableName . '.' . $this->connObj->escapeIdent($columns) .\n ' = ' . $table . '.' . $this->connObj->escapeIdent($otherColumn);\n }\n } elseif (!is_array($columns) || count($otherColumns) == 1) {\n // Many-to-one relationship\n foreach ((array)$columns as $column) {\n $columnStrings[] = $this->tableName . '.' . $this->connObj->escapeIdent($column) .\n ' = ' . $table . '.' . $this->connObj->escapeIdent($otherColumns);\n }\n }\n\n $joinStrings[] = '(' . implode(' OR ', $columnStrings) . ')';\n }\n }\n\n return $joinStrings;\n }", "public function resolveJoins($joins)\n {\n $all = \"\";\n if (is_array($joins)) {\n foreach ($joins as $join => $on) {\n $all .= \" \" . $join . \" ON (\" . $this->resolveConditionData($on) . \")\";\n }\n }\n return $all;\n }", "public function join($table, $cond, $type = '', $escape = NULL)\n\t{\n\t\tif ($type !== '')\n\t\t{\n\t\t\t$type = strtoupper(trim($type));\n\n\t\t\tif ( ! in_array($type, array('LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER'), TRUE))\n\t\t\t{\n\t\t\t\t$type = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$type .= ' ';\n\t\t\t}\n\t\t}\n\n\t\t// Extract any aliases that might exist. We use this information\n\t\t// in the protect_identifiers to know whether to add a table prefix\n\t\t$this->_track_aliases($table);\n\n\t\tis_bool($escape) OR $escape = $this->_protect_identifiers;\n\n\t\tif ( ! $this->_has_operator($cond))\n\t\t{\n\t\t\t$cond = ' USING ('.($escape ? $this->escape_identifiers($cond) : $cond).')';\n\t\t}\n\t\telseif ($escape === FALSE)\n\t\t{\n\t\t\t$cond = ' ON '.$cond;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Split multiple conditions\n\t\t\tif (preg_match_all('/\\sAND\\s|\\sOR\\s/i', $cond, $joints, PREG_OFFSET_CAPTURE))\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\t$joints = $joints[0];\n\t\t\t\tarray_unshift($joints, array('', 0));\n\n\t\t\t\tfor ($i = count($joints) - 1, $pos = strlen($cond); $i >= 0; $i--)\n\t\t\t\t{\n\t\t\t\t\t$joints[$i][1] += strlen($joints[$i][0]); // offset\n\t\t\t\t\t$conditions[$i] = substr($cond, $joints[$i][1], $pos - $joints[$i][1]);\n\t\t\t\t\t$pos = $joints[$i][1] - strlen($joints[$i][0]);\n\t\t\t\t\t$joints[$i] = $joints[$i][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$conditions = array($cond);\n\t\t\t\t$joints = array('');\n\t\t\t}\n\n\t\t\t$cond = ' ON ';\n\t\t\tfor ($i = 0, $c = count($conditions); $i < $c; $i++)\n\t\t\t{\n\t\t\t\t$operator = $this->_get_operator($conditions[$i]);\n\t\t\t\t$cond .= $joints[$i];\n\t\t\t\t$cond .= preg_match(\"/(\\(*)?([\\[\\]\\w\\.'-]+)\".preg_quote($operator).\"(.*)/i\", $conditions[$i], $match)\n\t\t\t\t\t? $match[1].$this->protect_identifiers($match[2]).$operator.$this->protect_identifiers($match[3])\n\t\t\t\t\t: $conditions[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Do we want to escape the table name?\n\t\tif ($escape === TRUE)\n\t\t{\n\t\t\t$table = $this->protect_identifiers($table, TRUE, NULL, FALSE);\n\t\t}\n\n\t\t// Assemble the JOIN statement\n\t\t$this->qb_join[] = $join = $type.'JOIN '.$table.$cond;\n\n\t\tif ($this->qb_caching === TRUE)\n\t\t{\n\t\t\t$this->qb_cache_join[] = $join;\n\t\t\t$this->qb_cache_exists[] = 'join';\n\t\t}\n\n\t\treturn $this;\n\t}", "public function toSql()\n {\n if ($this->isEmpty()) {\n return '';\n }\n\n $params = $this->getParams();\n\n $sql = array('SET');\n $set = array();\n\n foreach ($params as $column => $value) {\n $set[] = implode(' = ', array(\n $column, $this->getBuilder()->getHelper()->toDbValue($value)\n ));\n }\n\n $sql[] = implode(', ', $set);\n\n return implode(' ', $sql);\n }", "function getAstroFilterJoin () {\n // Since the Object table doesn't have a filterID field, this will\n // never select the Object table to filter with.\n $filterTable;\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getTableColumns( $table );\n $checkColumns = self::getCheckTableColumns( $table );\n if ( $table != self::JOIN_TABLE && in_array( 'filterID', $columns ) && !empty($checkColumns)) {\n $filterTable = $table;\n break;\n }\n }\n }\n\n // In MSSQL it is *much* faster to use: filterID IN (1, 2, 3)\n // than: (filterID = 1 OR filterID = 2 OR filterID = 3)\n if (!empty ($this->checkAstroFilterIDs) && !empty ($filterTable)) {\n return sprintf (\" AND %s.filterID IN (%s) \",\n self::getTableAlias ($filterTable),\n join (', ', $this->checkAstroFilterIDs));\n }\n return;\n }", "public function quoteInto($sql) {\n\t\t$args = func_get_args();\n\n\t\tif (count($args) < 2 || (count($args) == 2 && !is_array($args[1]))) {\n\t\t\t// Nothing special happening here, pass it through to the default method.\n\t\t\t// We do this instead of calling $this->_zendDb->quoteInto($sql, $args[1])\n\t\t\t// because we're not sure if args[1] is there or not.\n\t\t\treturn call_user_func_array(array($this->_db, 'quoteInto'), $args);\n\t\t}\n\n\t\t// We are going to run our own replacement method.\n\t\t$replacements = $args;\n\t\tarray_shift($replacements);\n\n\t\tif (is_array($replacements[0])) {\n\t\t\t// Here, we are passed an array of replacements with key/value combos\n\t\t\t// that correspond to \":key\" => \"sqlValueToBeEscaped\".\n\t\t\t$replacements = $replacements[0];\n\t\t}\n\n\t\t// If we are using \"?\" placeholders, we need to change them over to indexed-placeholders.\n\t\t$pieces = explode('?', $sql);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $i => $piece) {\n\t\t\t$sql .= $piece;\n\n\t\t\tif ($i == count($pieces) -1) {\n\t\t\t\t// We are on the last one, skip.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sql .= ':'.$i;\n\t\t}\n\n\t\t// At this point, we are using \":key\" placeholders.\n\t\t$pieces = preg_split('/:(\\w+)\\b/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $key => $piece) {\n\t\t\tif ($key % 2 == 0) {\n\t\t\t\t// We are on a piece of the query.\n\t\t\t\t$sql .= $piece;\n\t\t\t} else {\n\t\t\t\t// We are on a placeholder.\n\t\t\t\t$sql .= $this->_db->quote($replacements[$piece]);\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function where($column, $operator = null, $value = null, $link = \"where\")\n {\n $this->endquery = \"\";\n// if(is_array($critere)){\n// \n// }\n// $this->columns = is_array($columns) ? $columns : func_get_args();\n\n if (is_object($column)) {\n\n if ($this->defaultjoinsetted) {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '.id';\n } else {\n $this->query .= \" \" . $link . \" \" . strtolower(get_class($column)) . '_id';\n }\n\n if ($column->getId()) {\n if ($operator == \"not\") {\n $this->query .= \" != ? \";\n } else {\n $this->query .= \" = ? \";\n }\n $this->parameters[] = $column->getId();\n } else {\n $this->query .= \" is null \";\n }\n } elseif (is_array($column)) {\n if (is_array($operator)) {\n for ($index = 0; $index < count($column); $index++) {\n $this->andwhere($column[$index], \"=\", $operator[$index]);\n }\n } elseif (is_array($column[0])) {\n foreach ($column as $value) {\n $this->andwhere($value[0], $value[1], $value[2]);\n }\n } else {\n foreach ($column as $key => $value) {\n $this->andwhere($key, \"=\", $value);\n }\n }\n } else {\n $keymap = explode(\".\", $column);\n if(count($keymap) == 2){\n $this->query .= \" \" . $link . \" \" . $column;\n }else{\n $keymapattr = explode(\" \", $column);\n if(count($keymapattr) >= 2){\n $column = $keymapattr[0];\n unset($keymapattr[0]);\n $extra = implode(\" \", $keymapattr);\n $this->query .= \" \" . $link .' `'.$column.\"` \".$extra;\n }else\n $this->query .= \" \" . $link .' `'.$column.\"` \";\n }\n //$this->query .= \" \" . $link . \" \" . $column;\n if ($operator) {\n if (in_array($operator, $this->operators)) {\n $this->query .= \" \" . $operator . \" ? \";\n $this->parameters[] = $value;\n } elseif (strtolower($operator) == \"like\") {\n $this->query .= \" LIKE '%\" . $operator . \"%' \";\n } else {\n $this->query .= \" = ? \";\n $this->parameters[] = $operator;\n }\n }\n }\n\n $this->initwhereclause = true;\n\n return $this;\n }", "public function toSql()\n {\n if (0 === count($this->getParams())) {\n return 'SELECT *';\n } else {\n return 'SELECT ' . implode(', ', $this->getParams());\n }\n }", "protected function buildSql()\n {\n $this->selectSQL = ''; // reset query string\n\n $this->appendSql(\"SELECT \" . $this->buildFieldsList() . \" FROM \" . $this->fromTable)\n ->appendSql(!empty($this->joinsString) ? \" \" . $this->joinsString : \"\")\n ->appendSql(\" WHERE \" . (!empty($this->whereString) ? \" \" . $this->whereString : \" 1\"))\n ->appendSql(!empty($this->groupbyString) ? \" GROUP BY \" . $this->groupbyString : \"\")\n ->appendSql(!empty($this->orderbyString) ? \" ORDER BY \" . $this->orderbyString : \"\")\n ->appendSql(!empty($this->limitString) ? \" \" . $this->limitString : \"\");\n }", "function _create_add_sql($params) {\n\t\t$tables_shorts\t= array_flip($this->_user_tables);\n\t\t$add_sql = \" \";\n\t\tif (empty($params)) {\n\t\t\treturn \"\";\n\t\t}\n\t\tforeach ((array)$params as $mod => $val) {\n\t\t\t$mod = strtoupper($mod);\n\t\t\tif (!in_array($mod, $this->_allowed_sql_params)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (in_array($mod, array(\"LIMIT\", \"OFFSET\"))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($mod == \"WHERE\") {\n\t\t\t\t$add_sql .= \"AND \";\n\t\t\t} else {\n\t\t\t\t$add_sql .= $mod.\" \";\n\t\t\t}\n\t\t\tif ($this->MODE != \"SIMPLE\") {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$table_names = $this->_arrange_fields(array_keys($val), $this->_user_tables);\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\t\tif (in_array($fld, $fields)) {\n\t\t\t\t\t\t\t\t$table = $_table_name;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$table_names = $this->_arrange_fields($val, $this->_user_tables);\n\t\t\t\t\tforeach ((array)$table_names as $_table_name => $fields) {\n\t\t\t\t\t\tif (in_array($val, $fields)) {\n\t\t\t\t\t\t\t$table = $_table_name;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$add_sql .= \" \".$tables_shorts[$table].\".\".$val.\" \";\n\t\t\t\t}\t\n\t\t\t} else {\n\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t$i = count($val);\n\t\t\t\t\tforeach ((array)$val as $fld => $v) {\n\t\t\t\t\t\tif (strpos($v, \" \")) {\n\t\t\t\t\t\t// $v is a statement (\"LIKE value%\")\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\" \".$v.\" \"; \n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t// $v is the value\n\t\t\t\t\t\t\t$add_sql .= \" \".$fld.\"='\".$v.\"' \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (--$i) {\n\t\t\t\t\t\t\t$add_sql .= \"AND\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} elseif (!$val) {\n\t\t\t\t\t$add_sql .= \"\";\n\t\t\t\t} else {\n\t\t\t\t// for constructions like \"ORDER BY field\"\n\t\t\t\t\t$add_sql .= \" \".$val.\" \";\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $add_sql;\n\t}", "static function expr2Query($expr,$definition,$lastTable,$joinType=\" INNER\", $mode=0)\n {\n $usedTables=array();\n $parts=explode(\"/\",$expr);\n $q=\"\";\n for($k=1;$k<count($parts);$k++)\n {\n $p2=explode(\"|\",$parts[$k]);\n \n if(count($p2)==2)\n {\n $model=\\lib\\reflection\\ReflectorFactory::getModel($p2[0]);\n $p2[0]=$model->getTableName();\n if($usedTables[$p2[0]])\n {\n $lastTable=$p2[0];\n continue;\n }\n\n if($mode==1 && $k==1)\n {\n $q=$lastTable.\".\".$definition[\"keys\"][$lastTable].\" IN ( SELECT \".$p2[0].\".\".$p2[1].\" FROM \".$p2[0];\n }\n else\n $q.=$joinType.\" JOIN \".$p2[0].\" ON \".$p2[0].\".\".$p2[1].\"=\".$lastTable.\".\".$definition[\"keys\"][$lastTable]; \n\n $lastTable=$p2[0];\n }\n else\n {\n $p2=explode(\"[\",$parts[$k]); \n $model=\\lib\\reflection\\ReflectorFactory::getModel($p2[0]);\n $p2[0]=$model->getTableName();\n\n if($usedTables[$p2[0]])\n {\n $lastTable=$p2[0];\n continue;\n } \n if($mode==1 && $k==1)\n {\n $q=$lastTable.\".\".$p2[1].\" IN ( SELECT \".$p2[0].\".\".$definition[\"keys\"][$p2[0]].\" FROM \".$p2[0];\n }\n else \n $q.=$joinType.\" JOIN \".$p2[0].\" ON \".$lastTable.\".\".$p2[1].\"=\".$p2[0].\".\".$definition[\"keys\"][$p2[0]];\n $lastTable=$p2[0]; \n }\n $usedTables[$p2[0]]=1;\n $joinType=\" INNER\";\n }\n return array(\"query\"=>$q,\"used\"=>$usedTables);\n }", "function _buildAttributeQuery($glue, $criteria, $join = false)\n {\n /* Initialize the clause that we're building. */\n $clause = '';\n\n /* Get the table alias to use for this set of criteria. */\n if ($join) {\n $alias = $this->_getAlias(true);\n } else {\n $alias = $this->_getAlias();\n }\n\n foreach ($criteria as $key => $vals) {\n if (!empty($vals['OR']) || !empty($vals['AND'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= '(' . $this->_buildAttributeQuery($glue, $vals) . ')';\n } elseif (!empty($vals['JOIN'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= $this->_buildAttributeQuery($glue, $vals['JOIN'], true);\n } else {\n if (isset($vals['field'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $vals['field'], $vals['op'], $vals['test']);\n } else {\n foreach ($vals as $test) {\n if (!empty($clause)) {\n $clause .= ' ' . $key . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $test['field'], $test['op'], $test['test']);\n }\n }\n }\n }\n\n return $clause;\n }", "public function createWhere() {\n\t\tlist($where, $joins) = parent::createWhere();\n\t\tif (!($this->parent->parent instanceof QuerySet))\n\t\t\t$where = \" WHERE \" . $where;\n\t\telse\n\t\t\t$where = \" AND \" . $where;\n\t \n\t\treturn array($where, $joins);\n\t}", "private function addJoinOnClause($other, $type, $onClause) {\r\n\t\tif (is_array($onClause)) {\r\n\t\t\t$onClause=implode(' ', $onClause);\r\n\t\t}\r\n\t\tif (count($this->_salt_joins[$other->_salt_alias]['on'])>0) {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$type.' '.$onClause;\r\n\t\t} else {\r\n\t\t\t$this->_salt_joins[$other->_salt_alias]['on'][]=$onClause;\r\n\t\t}\r\n\t}", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "private function getJoinParameters($method, $params) {\n $params = $this->requireTwoParameters($method, $params);\n\n return array(\n 'type' => substr($method, 0, -4),\n 'table' => $params[0],\n 'on' => $params[1]\n );\n }", "public function buildDeleteSql() {\r\n $this->sql .= ' FROM ' . $this->sqlStrTables;\r\n $this->setConditions();\r\n $this->setLimit();\r\n }", "function array_to_where_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_where = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_where[] = \"`$k`='$v'\";\n\t}\n\t$s_where = implode(' AND ', $a_where);\n\treturn $s_where;\n}", "function getJoinCondition() ;", "public function on($column1,$column2,$operator = \"=\");", "protected function concatenateWheresClauses($builder, $sql): string\n {\n $statement = $builder instanceof JoinClause ? 'on' : 'where';\n\n return $statement.' '.$this->removeStatementBoolean(implode(' ', $sql));\n }", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "function toSqlWithBindings(Builder $query):string\n{\n $sqlQuery = Str::replaceArray(\n '?',\n collect($query->getBindings())\n ->map(function ($i) {\n if (is_object($i)) {\n $i = (string)$i;\n }\n if (is_null($i)) {\n $i = 'null';\n }\n\n if ($i === false) {\n $i = 'false';\n }\n\n if ($i === true) {\n $i = 'true';\n }\n return (is_string($i)) ? \"'$i'\" : $i;\n })->all(),\n $query->toSql());\n\n return $sqlQuery;\n}", "public function sql(): string\n {\n $columnsNames = array();\n $columnsValues = array();\n\n foreach ($this->parameters as $key => $val) {\n $arg = $this->getArgName($key);\n $columnsNames[] = $this->escape($key); \n $columnsValues[] = ':' . $arg;\n } \n return trim(sprintf(\n 'INSERT INTO %s (%s) VALUES (%s)',\n $this->escape($this->tableName),\n implode(', ', $columnsNames),\n implode(', ', $columnsValues)\n ));\n }", "function joinQuery()\n {\n }" ]
[ "0.67143553", "0.6678323", "0.6659047", "0.6504775", "0.63145536", "0.62844163", "0.62645155", "0.6199933", "0.6198333", "0.6152015", "0.6110812", "0.60860515", "0.6075788", "0.60554844", "0.6030637", "0.60255474", "0.6021137", "0.59971225", "0.5988982", "0.59823924", "0.5978325", "0.59523016", "0.59317046", "0.59265184", "0.58773774", "0.5874865", "0.5873969", "0.5858188", "0.58570087", "0.580441", "0.57972807", "0.578948", "0.5741561", "0.5739343", "0.57361543", "0.57235247", "0.57103246", "0.56855595", "0.5671689", "0.5657019", "0.5646004", "0.5634147", "0.56335133", "0.563307", "0.5621296", "0.5619651", "0.5617539", "0.5604975", "0.56021714", "0.55998456", "0.5594625", "0.55874753", "0.5585682", "0.5563356", "0.5562748", "0.5555582", "0.55500305", "0.5548934", "0.55473906", "0.55472344", "0.55385566", "0.553335", "0.552588", "0.54929894", "0.54912436", "0.5470913", "0.54685956", "0.5464972", "0.5460476", "0.54599947", "0.545381", "0.54496574", "0.5444462", "0.5437155", "0.54291373", "0.5425081", "0.5424419", "0.5421096", "0.54204917", "0.5418629", "0.5417946", "0.5414842", "0.5413451", "0.53968924", "0.5390944", "0.53899616", "0.5389542", "0.53810734", "0.53784215", "0.5378393", "0.53741324", "0.5369032", "0.53669786", "0.5365191", "0.5352269", "0.53408647", "0.5339651", "0.5338983", "0.5338253", "0.53359354", "0.53350836" ]
0.0
-1
Applied to every potential parameter while ON WHERE tokens generation.
private function whereWrapper() { return function ($parameter) { if ($parameter instanceof FragmentInterface) { //We are only not creating bindings for plan fragments if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) { return $parameter; } return $parameter; } if (is_array($parameter)) { throw new BuilderException("Arrays must be wrapped with Parameter instance."); } //Wrapping all values with ParameterInterface if (!$parameter instanceof ParameterInterface) { $parameter = new Parameter($parameter, Parameter::DETECT_TYPE); }; //Let's store to sent to driver when needed $this->onParameters[] = $parameter; return $parameter; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseFilterParams(): void\n {\n\n $this->parseFilters();\n\n $where = $this->uriParser->whereParameters();\n\n if (empty($where)) {\n return;\n }\n\n /** @scrutinizer ignore-call */\n $tableColumns = $this->getTableColumns();\n $table = $this->getModel()->getTable();\n\n foreach ($where as $whr) {\n if (strpos($whr['key'], '.') > 0) {\n $this->/** @scrutinizer ignore-call */setWhereHasClause($whr);\n continue;\n } elseif (! in_array($whr['key'], $tableColumns)) {\n continue;\n }\n $this->/** @scrutinizer ignore-call */setQueryBuilderWhereStatement($this->getBuilder(), $table . '.' . $whr['key'], $whr);\n }\n }", "function processedWhereClause($where) {\n\t$x = explode(\" \", $where);\n\t$temp_where = \"\";\n\tforeach($x as $value) {\n\t\t$temp_where .= \" \";\n\t\tif(strpos($value, \"=\")) {\n\t\t\t$kv = explode(\"=\", $value);\n\t\t\t$temp_where .= $kv[0] . \"='\" . $kv[1] . \"'\";\n\t\t} else {\n\t\t\t$temp_where .= $value;\n\t\t}\n\t} \n\t$where = $temp_where;\n\treturn $where;\n}", "function mWHERE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$WHERE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:156:3: ( 'where' ) \n // Tokenizer11.g:157:3: 'where' \n {\n $this->matchString(\"where\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function replaceVarsInWhere($where) {\n // or popooon parameter with type \"structure2xml\"\n // %VAR with an sql_regcase ( hello gets to [Hh][Ee][Ll][Ll][Oo] ) and\n // +VAR with +VAR (\"hello world\" gets to \"+hello +world\" this is useful for fulltext search in mysql)\n $regs = array();\n $repl = array();\n if (is_array($this->getParameter(\"structure2xml\"))) {\n $requests = array_merge($_REQUEST,$this->getParameter(\"structure2xml\"));\n } else {\n $requests = $_REQUEST;\n }\n return self::replaceVarsInWhereStatic($where,$requests);\n \n }", "protected function generateParameterWrapToken() {}", "protected function getGeneralWhereClause() {}", "protected function filterParams()\n {\n }", "protected function getWhereClause() {}", "protected function _compile_parameters()\r\n\t{\r\n\t\t// Return the column's parameters\r\n\t\treturn $this->parameters;\r\n\t}", "protected function user_where_clause() {}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "private function setWhereFilters($where, $params, $hashTodiscard = null) {\r\n \r\n for ($i = count($where); $i--;) {\r\n \r\n /*\r\n * Only one toponym is supported (the last one) \r\n */\r\n if (isset($where[$i]['geo:lon'])) {\r\n $params['geo:lon'] = $where[$i]['geo:lon'];\r\n $params['geo:lat'] = $where[$i]['geo:lat'];\r\n }\r\n /*\r\n * Searching for hash/keywords is faster than geometry\r\n */\r\n else if (isset($where[$i]['searchTerms'])) {\r\n $params['searchTerms'][] = $where[$i]['searchTerms'];\r\n }\r\n else if (isset($where[$i]['hash'])) {\r\n if (!isset($hashTodiscard) || $where[$i]['hash'] !== $hashTodiscard) {\r\n $params['searchTerms'][] = 'geohash:' . $where[$i]['hash'];\r\n }\r\n }\r\n /*\r\n * Geometry\r\n */\r\n else {\r\n $params['geo:geometry'] = $where[$i]['geo:geometry'];\r\n }\r\n }\r\n if (count($params['searchTerms']) > 0) {\r\n $params['searchTerms'] = join(' ', $params['searchTerms']);\r\n }\r\n else {\r\n unset($params['searchTerms']);\r\n }\r\n return $params;\r\n }", "private function buildDynamicParameters(): void\n {\n $this->dynamicParameters ??= $this->definition->getDynamicParameters($this);\n }", "private function XML_getSQLInjectionVulnerableParams() {\n\t\t$vulnerableParamsEntity = $this->xmlHandler->createElement('vulnerableparams');\n\n\t\tforeach($this->SQLInjectionReport->getVulnerableDataInfo() as $paramDataSet) {\n\t\t\t$vulnerableParamEntity = $this->xmlHandler->createElement('vulnerableparam');\n\n\t\t\t$paramNameEntity = $this->xmlHandler->createElement('paramname');\n\t\t\t$paramNameEntity->appendChild($this->xmlHandler->createTextNode($this->filtrateData($paramDataSet->getParamName()) ));\n\n\t\t\t$vulnerableParamEntity->appendChild($paramNameEntity);\n\n\t\t\t// check values = vulnerable requests with this params ($vulnerableRequestsEntity)\n\t\t\t// inject values = exploits ($exploitsEntity)\n\t\t\tif(count($paramDataSet->vulnerableParamValues['check']) !== 0) {\n\t\t\t\t$vulnerableRequestsEntity = $this->xmlHandler->createElement('vulnerablerequests');\n\n\t\t\t\tforeach($paramDataSet->vulnerableParamValues['check'] as $techniqueName => $paramValues) {\n\n\t\t\t\t\t$techniqueEntity = $this->xmlHandler->createElement('checktechnique');\n\t\t\t\t\t$techniqueNameAttrEntity = $this->xmlHandler->createAttribute('technique_name');\n\t\t\t\t\t$techniqueNameAttrEntity->appendChild($this->xmlHandler->createTextNode($techniqueName));\n\t\t\t\t\t$techniqueEntity->appendChild($techniqueNameAttrEntity);\n\n\t\t\t\t\tforeach($paramValues as $paramValueSet) {\n\n\t\t\t\t\t\t$requestEntity = $this->xmlHandler->createElement('request');\n\t\t\t\t\t\t$requestEntity->appendChild($this->xmlHandler->createTextNode($this->filtrateData($paramValueSet['vulnerableRequest'])));\n\n\t\t\t\t\t\t$techniqueEntity->appendChild($requestEntity);\n\t\t\t\t\t}\n\n\t\t\t\t\t$vulnerableRequestsEntity->appendChild($techniqueEntity);\n\n\t\t\t\t}\n\n\t\t\t\t$vulnerableParamEntity->appendChild($vulnerableRequestsEntity);\n\t\t\t}\n\n\t\t\tif(count($paramDataSet->vulnerableParamValues['inject']) !== 0) {\n\t\t\t\t$exploitsEntity = $this->xmlHandler->createElement('exploits');\n\n\t\t\t\tforeach($paramDataSet->vulnerableParamValues['inject'] as $techniqueName => $exploits) {\n\t\t\t\t\t//foreach($paramValues as $paramValueSet) {\n\n\t\t\t\t\t\t$techniqueEntity = $this->xmlHandler->createElement('exploittechnique');\n\t\t\t\t\t\t$techniqueNameAttrEntity = $this->xmlHandler->createAttribute('technique_name');\n\t\t\t\t\t\t$techniqueNameAttrEntity->appendChild($this->xmlHandler->createTextNode($techniqueName));\n\t\t\t\t\t\t$techniqueEntity->appendChild($techniqueNameAttrEntity);\n\n\t\t\t\t\t\tforeach($exploits as $exploitValueSet) {\n\t\t\t\t\t\t\t//'resultQueue' => array stepID -> value\n\t\t\t\t\t\t\t//'resultData'\t => string\n\t\t\t\t\t\t\t$techniqueExploitKindEntity = $this->xmlHandler->createElement('exploitkind');\n\n\t\t\t\t\t\t\t$techniqueValueQueueEntity = $this->xmlHandler->createElement('resultqueue');\n\t\t\t\t\t\t\t$techniqueValueQueueEntity->appendChild($this->xmlHandler->createTextNode(implode(' ->-> ', $this->filtrateData($exploitValueSet['resultQueue']) )));\n\n\t\t\t\t\t\t\t$techniqueDataEntity = $this->xmlHandler->createElement('exploitdata');\n\t\t\t\t\t\t\t$techniqueDataEntity->appendChild($this->xmlHandler->createTextNode($this->filtrateData($exploitValueSet['resultData']) ));\n\n\t\t\t\t\t\t\t$techniqueExploitKindEntity->appendChild($techniqueValueQueueEntity);\n\t\t\t\t\t\t\t$techniqueExploitKindEntity->appendChild($techniqueDataEntity);\n\n\t\t\t\t\t\t\t$techniqueEntity->appendChild($techniqueExploitKindEntity);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$exploitsEntity->appendChild($techniqueEntity);\n\t\t\t\t\t//}\n\t\t\t\t}\n\n\t\t\t\t$vulnerableParamEntity->appendChild($exploitsEntity);\n\t\t\t}\n\n\t\t\t$vulnerableParamsEntity->appendChild($vulnerableParamEntity);\n\t\t}\n\n\t\treturn $vulnerableParamsEntity;\n\t}", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }", "abstract protected function whereToken(\n $joiner,\n array $parameters,\n &$tokens = [],\n callable $wrapper\n );", "public function process() {\n if ($this->skip()) {\n return;\n }\n $values = explode($this->config('delimiter'), $this->value());\n\n $conditions = [];\n foreach ($this->fields() as $field) {\n $left = $field . ' ' . $this->config('comparison');\n\n foreach ($values as $value) {\n $right = $this->_wildCards($value);\n $conditions[] = [$left => $right];\n }\n }\n $this->query()->andWhere([$this->config('mode') => $conditions]);\n }", "private function whereWrapper()\n {\n return function ($parameter) {\n if ($parameter instanceof FragmentInterface) {\n //We are only not creating bindings for plan fragments\n if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) {\n return $parameter;\n }\n }\n\n if (is_array($parameter)) {\n throw new BuilderException(\"Arrays must be wrapped with Parameter instance.\");\n }\n\n //Wrapping all values with ParameterInterface\n if (!$parameter instanceof ParameterInterface) {\n $parameter = new Parameter($parameter, Parameter::DETECT_TYPE);\n };\n\n //Let's store to sent to driver when needed\n $this->whereParameters[] = $parameter;\n\n return $parameter;\n };\n }", "public static function prepareSomExpression($som) {}", "private function setWhereFilters($where, $params, $hashTodiscard = null)\n {\n for ($i = count($where); $i--;) {\n /*\n * Geometry\n */\n if (isset($where[$i]['wkt'])) {\n $params['geo:geometry'] = $where[$i]['wkt'];\n }\n /*\n * Only one toponym is supported (the last one)\n */\n elseif (isset($where[$i]['coordinates'])) {\n $coordinates = array_map('trim', explode(',', $where[$i]['coordinates']));\n $params['geo:lon'] = floatval($coordinates[1]);\n $params['geo:lat'] = floatval($coordinates[0]);\n }\n /*\n * Searching for hash/keywords is faster than geometry\n */\n elseif (isset($where[$i]['searchTerms'])) {\n $params['searchTerms'][] = $where[$i]['searchTerms'];\n } elseif (isset($where[$i]['geouid'])) {\n if (!isset($hashTodiscard) || $where[$i]['hash'] !== $hashTodiscard) {\n $params['searchTerms'][] = 'geouid' . RestoConstants::TAG_SEPARATOR . $where[$i]['geonameid'];\n }\n }\n }\n if (count($params['searchTerms']) > 0) {\n $params['searchTerms'] = join(' ', $params['searchTerms']);\n } else {\n unset($params['searchTerms']);\n }\n return $params;\n }", "private function prepareWhereCondition($where)\n {\n list($attribute, $value, $boost) = array_pad($where, 3, null);\n $subFilter = new Term();\n $subFilter->setTerm($attribute, $value, $boost);\n $this->filter->addMust($subFilter);\n }", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "function dbWhereVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->where($this->model.'.'.$f,$this->$f);\n }\n\n }", "function OrWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "private function genSqlWhereArray($where){\n //input: $where is array of arguments or conditionals\n //output: $outWhere is array of each word split up, or null if anything is invalid\n //ex input: \n // $where[0] => luminosity=3\n // $where[1] => AND\n // $where[2] => temperature = '2'\n //output:\n // $outWhere[0] => luminosity\n // $outWhere[1] => 3\n // $outWhere[2] => AND\n // $outWhere[3] => temperature\n // $outWhere[4] => 2\n if(debug){ \"sqlInteract.php/genSqlWhereArray(): \". $where . PHP_EOL;}\n if($where == 1){\n return true;\n }else {\n $point = 0;\n $outWhere = [];\n foreach($where as $ptr => $val){\n foreach(explode('=', $val) as $substr){\n switch($point%3) {\n case 0://dict check word\n $word = trim($substr, \" \\t\\n\\r\\0\\x0B`\\\"\");\n if($this->checkWord($word)){\n array_push($outWhere, $word);\n }\n else{\n return null;\n }\n break;\n case 1://= val\n array_push($outWhere,trim($substr, \" \\t\\n\\r\\0\\x0B\"));\n break;\n case 2://conditional\n $word = trim($substr, \" \\t\\n\\r\\0\\x0B\");\n if(preg_match('/(AND|OR|NOT)/i', $word)){\n array_push($outWhere, $word);\n }\n else{\n return null;\n }\n break;\n }\n $point++;\n }\n }\n return $outWhere;\n }\n \n }", "protected function parseWhere($where) {\n\t\t$parser = new Parser();\n\t\t$expr = str_replace(array(' and ', ' AND ', ' or ', ' OR '), array(' && ', ' && ', ' || ', ' || '), $where);\n\t\t$expr = $parser->parse($expr);\n\t\t$tokens = $expr->get();\n\t\t$conditions = array();\n\t\t$expression = array();\n\t\t$npar = 0;\n\t\t$condition = (object)array(\n\t\t\t'operand' => '',\n\t\t\t'operator' => '',\n\t\t\t'value' => '',\n\t\t\t'inoperand' => false,\n\t\t\t'invalue' => false,\n\t\t\t'infunction' => false\n\t\t);\n\t\tforeach ($tokens as $token) {\n\t\t\tif ($condition->infunction) {\n\t\t\t\tif ($token->type == Token::T_POPEN) {\n\t\t\t\t\t$npar++;\n\t\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\t\t$npar--;\n\t\t\t\t\tif ($npar == 0) {\n\t\t\t\t\t\t$condition->infunction = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->type == Token::T_FUNCTION) {\n\t\t\t\t$condition->infunction = true;\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t} else if ($token->isComparator()) {\n\t\t\t\t$condition->operator = $token->value;\n\t\t\t\t$condition->inoperand = false;\n\t\t\t\t$condition->invalue = true;\n\t\t\t} else if ($token->type == Token::T_POPEN) {\n\t\t\t\tif ($condition->inoperand) {\n\t\t\t\t\t$condition->operand .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else if ($condition->invalue) {\n\t\t\t\t\t$condition->value .= $token->value;\n\t\t\t\t\t$condition->infunction = true;\n\t\t\t\t\t$npar = 1;\n\t\t\t\t} else {\n\t\t\t\t\t$expression[] = $token->value;\n\t\t\t\t}\n\t\t\t} else if ($token->type == Token::T_PCLOSE) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->value;\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else if ($token->type == Token::T_LOGICAL_AND || $token->type == Token::T_LOGICAL_OR) {\n\t\t\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t\t\t}\n\t\t\t\t$expression[] = $token->type == Token::T_LOGICAL_AND ? 'and' : 'or';\n\t\t\t\t$this->resetCondition($condition);\n\t\t\t} else {\n\t\t\t\t$this->addTokenInCondition($condition, $token);\n\t\t\t}\n\t\t}\n\t\tif ($condition->inoperand || $condition->invalue) {\n\t\t\t$expression[] = $this->insertCondition($conditions, $condition);\n\t\t}\n\t\treturn (object)array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'expression' => $expression\n\t\t);\n\t}", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "function MyMod_Search_Vars_Pre_Where()\n {\n $searchvars=array();\n foreach ($this->MyMod_Search_Vars() as $data)\n {\n $wheres=array();\n if ($this->MyMod_Data_Access($data)>=1)\n {\n $rdata=$this->MyMod_Search_CGI_Name($data);\n $value=$this->MyMod_Search_CGI_Value($data);\n\n if (!empty($value))\n {\n $where=$this->MyMod_Search_Var_Where($data,$value);\n if (!empty($where))\n {\n array_push($wheres,$where);\n }\n\n $searchjoined=$this->ItemData($data,\"Search_Joined\");\n\n if (is_array($searchjoined))\n {\n foreach ($searchjoined as $rdata)\n {\n if (!empty($this->ItemData[ $rdata ]))\n {\n array_push\n (\n $wheres,\n $this->MyMod_Search_Var_Where($data,$value,$rdata)\n );\n }\n }\n }\n\n $searchvars[ $data ]=\"(\".join(\" OR \",$wheres).\")\";\n }\n }\n \n }\n\n return $searchvars;\n }", "private function processQueryParameters(): void\n {\n // Check if a collection alias was defined\n $matches = [];\n preg_match_all('~(IN @\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $matches = array_pop($matches);\n\n if (count($matches)) {\n // Stores if found.\n $collection = [];\n $match = array_pop($matches);\n preg_match_all('~(@\\w+)~', $match, $collection, PREG_PATTERN_ORDER);\n $occurrence = array_shift($collection);\n $this->collectionAlias = array_pop($occurrence);\n }\n\n $matches = [];\n preg_match_all('~(@\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $this->queryParameters = array_pop($matches);\n }", "public function whereClause(){\n try {\n // Sparql11query.g:117:3: ( ( WHERE )? groupGraphPattern ) \n // Sparql11query.g:118:3: ( WHERE )? groupGraphPattern \n {\n // Sparql11query.g:118:3: ( WHERE )? \n $alt15=2;\n $LA15_0 = $this->input->LA(1);\n\n if ( ($LA15_0==$this->getToken('WHERE')) ) {\n $alt15=1;\n }\n switch ($alt15) {\n case 1 :\n // Sparql11query.g:118:3: WHERE \n {\n $this->match($this->input,$this->getToken('WHERE'),self::$FOLLOW_WHERE_in_whereClause412); \n\n }\n break;\n\n }\n\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_whereClause415);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function tck_admin_list_where($where) {\n if ( isset($_GET['custom_filter']) ) {\n $mode = $_GET['custom_filter'];\n \n if ( $mode == 1 ) $where .= ' AND `' . TCK_COLUMN . '` = 0';\n if ( $mode == 2 ) $where .= ' AND `' . TCK_COLUMN . '` = 1';\n }\n \n return $where;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "protected function getWhereClauseForEnabledFields() {}", "protected function whereToken($joiner, array $parameters, &$tokens = [], callable $wrapper)\n {\n list($identifier, $valueA, $valueB, $valueC) = $parameters + array_fill(0, 5, null);\n\n if (empty($identifier)) {\n //Nothing to do\n return;\n }\n\n //Where conditions specified in array form\n if (is_array($identifier)) {\n if (count($identifier) == 1) {\n $this->arrayWhere(\n $joiner == 'AND' ? self::TOKEN_AND : self::TOKEN_OR,\n $identifier,\n $tokens,\n $wrapper\n );\n\n return;\n }\n\n $tokens[] = [$joiner, '('];\n $this->arrayWhere(self::TOKEN_AND, $identifier, $tokens, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof \\Closure) {\n $tokens[] = [$joiner, '('];\n call_user_func($identifier, $this, $joiner, $wrapper);\n $tokens[] = ['', ')'];\n\n return;\n }\n\n if ($identifier instanceof QueryBuilder) {\n //Will copy every parameter from QueryBuilder\n $wrapper($identifier);\n }\n\n switch (count($parameters)) {\n case 1:\n //AND|OR [identifier: sub-query]\n $tokens[] = [$joiner, $identifier];\n break;\n case 2:\n //AND|OR [identifier] = [valueA]\n $tokens[] = [$joiner, [$identifier, '=', $wrapper($valueA)]];\n break;\n case 3:\n //AND|OR [identifier] [valueA: OPERATION] [valueA]\n $tokens[] = [$joiner, [$identifier, strtoupper($valueA), $wrapper($valueB)]];\n break;\n case 4:\n //BETWEEN or NOT BETWEEN\n $valueA = strtoupper($valueA);\n if (!in_array($valueA, ['BETWEEN', 'NOT BETWEEN'])) {\n throw new BuilderException(\n 'Only \"BETWEEN\" or \"NOT BETWEEN\" can define second comparasions value.'\n );\n }\n\n //AND|OR [identifier] [valueA: BETWEEN|NOT BETWEEN] [valueB] [valueC]\n $tokens[] = [$joiner, [$identifier, $valueA, $wrapper($valueB), $wrapper($valueC)]];\n }\n }", "public function getDefinedParameters();", "function paramWhere($aIn, &$sOut, &$aOut) {\r\n\t$sType = \"\";\r\n\tif (array_key_exists(\"type\", $aIn))\r\n\t $sType = $aIn[\"type\"];\r\n\r\n\t//echo \"Type is: \" . $sType;\r\n\t//basic key=>value pairs\r\n\tif ($sType == \"\" || $sType == \"basic\") {\r\n\t //echo \"Basic type.\";\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" = (?) \";\r\n\t\t $aOut[] = $value;\r\n\t\t //echo \"<br/>sOut = \" . $sOut . \"<br/>\";\r\n\t\t}\r\n\t }\r\n\t}\r\n\t//logical operator types\r\n\telseif ($sType == \"operator\") {\r\n\t $sOperator = strtoupper($aIn['operator']);\r\n\r\n\t $sOut .= \"(\";\r\n\r\n\t foreach ($aIn as $key => $value) {\r\n\t\t//echo \"Key is: \" . $key . \"<br/>\";\r\n\t\tif (($key !== \"type\" && $key !== 'operator') || $key === 0) {\r\n\t\t //echo \"Calling paramWhere with value: \";\r\n\t\t //print_r($value);\r\n\t\t //echo \"<br/>\";\r\n\t\t $this->paramWhere($value, $sOut, $aOut);\r\n\t\t $sOut .= \" \" . $sOperator . \" \";\r\n\t\t}\r\n\t }\r\n\r\n\t // Strip out last \"operator\"\r\n\t $iPos = strrpos($sOut, \" \" . $sOperator . \" \");\r\n\t if ($iPos !== false) {\r\n\t\t$sOut = substr($sOut, 0, $iPos - 1);\r\n\t }\r\n\r\n\t $sOut .= \")\";\r\n\t}\r\n\t//special types\r\n\telseif ($sType == \"like\") {\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" like (?) \";\r\n\t\t $aOut[] = $value;\r\n\t\t}\r\n\t }\r\n\t} elseif ($sType == \"special\") {\r\n\t foreach ($aIn as $key => $value) {\r\n\t\tif ($key !== \"type\") {\r\n\t\t $sOut .= $key . \" \";\r\n\t\t}\r\n\t }\r\n\t}\r\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "public function getWhereParams()\n {\n return (isset($this->whereBuilder))? $this->whereBuilder->getConditionParameters() : [];\n }", "public function extractParameters()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n if (preg_match(self::$routePattern, $request->get('_route'), $routeMatches)) {\n $searchEngine = $this->container->get('search.engine');\n\n $this->routePrefix = reset($routeMatches);\n $this->originalRouteParameterCount = (int)end($routeMatches);\n\n $activeModules = $searchEngine->getActiveModules();\n\n $dateFormatString = $this->container->get('languagehandler')->getDateFormat();\n $dateFormat = preg_replace(\"/[^\\w]/\", '-', $dateFormatString);\n\n for ($i = 0; $i < $this->originalRouteParameterCount; $i++) {\n $rawInput = strtolower($request->get(\"a{$i}\"));\n $parameterInformation = Utility::convertStringToArray($rawInput);\n\n if (!$this->hasKeywords() && $rawKeyword = $searchEngine->convertFromKeywordFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawKeyword);\n foreach ($parameterInformation as $parameter) {\n $this->addKeyword($parameter);\n }\n continue;\n }\n\n if (!$this->hasWheres() && $rawWhere = $searchEngine->convertFromWhereFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawWhere);\n foreach ($parameterInformation as $parameter) {\n $this->addWhere($parameter);\n }\n continue;\n }\n\n if (!$this->hasModules() && $modules = array_intersect($activeModules, $parameterInformation)) {\n foreach ($modules as $key => $value) {\n $this->addModule($key);\n }\n continue;\n }\n\n if (!$this->hasStartDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setStartDate($date);\n continue;\n }\n\n if (!$this->hasEndDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setEndDate($date);\n continue;\n }\n\n if (($elasticType = $searchEngine->getFriendlyUrlType($parameterInformation)) && (!$this->hasCategories() || !$this->hasLocations())) {\n switch ($elasticType) {\n case CategoryConfiguration::$elasticType:\n if (!$this->hasCategories()) {\n $categories = $searchEngine->categoryFriendlyURLSearch($parameterInformation);\n $this->setCategories($categories);\n !$this->hasModules() and array_map(function($category) {\n $this->addModule($category->getModule());\n }, $categories);\n }\n break;\n case LocationConfiguration::$elasticType:\n if (!$this->hasLocations()) {\n $this->setLocations($searchEngine->locationFriendlyURLSearch($parameterInformation));\n }\n break;\n }\n\n continue;\n }\n\n if (self::$exception) {\n throw new NotFoundHttpException();\n }\n }\n }\n\n foreach ($request->query->all() as $key => $value) {\n $this->queryParameters[$key] = Utility::convertStringToArray($value, '-');\n }\n }", "public function makeWhere($where){// method makeWhere body start\n\t\t\n\t\t$count \t\t\t\t= 0;\n\t\t$returnWhere \t\t= \"\";\n\t\tforeach($where as $key => $val){\n\t\t\t\n\t\t\tif($count < 1){\n\t\t\t\t$returnWhere .= \"WHERE $key = '$val' \";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$returnWhere .= \"AND $key = '$val' \";\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\treturn $returnWhere;\n\t}", "private function _set_where($params) {\n if (count($params) == 1) {\n if (!is_array($params[0]) && !strstr($params[0], \"'\")) {\n $this->db->where($this->primary_key, $params[0]); // 1.\n } else {\n $this->db->where($params[0]); // 2.\n }\n } elseif (count($params) == 2) {\n if (is_array($params[1])) {\n $this->db->where_in($params[0], $params[1]); // 4.\n } else {\n $this->db->where($params[0], $params[1]); // 3.\n }\n }\n }", "protected function inject_custom_parameters()\n\t{\n\t\tforeach ($this->custom_parameters as $key => $value)\n\t\t{\n\t\t\t$this->container->setParameter($key, $value);\n\t\t}\n\t}", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "public function add_where( $where ) {\r\n\t\t$this->where .= $where;\r\n\t}", "public function resetWhere()\n\t{\n\t\t$this->wheres = array();\n\t\t$this->bindings = array();\n\t}", "public function compile()\n {\n // set every condition in the query array\n $this->query['body']['query'] = [];\n foreach ($this->constraints as $constraint) {\n $this->query['body']['query'] = array_merge($this->query['body']['query'], $this->compileConstraint($constraint));\n }\n\n foreach ($this->bools as $bool) {\n if (array_key_exists('constraint', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $this->compileConstraint($bool['constraint']);\n }\n if (array_key_exists('query_string', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['query_string'];\n }\n if (array_key_exists('script', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['script'];\n }\n if (array_key_exists('bool', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = array('bool' => $bool['bool']);\n }\n }\n if (!empty($this->aggs)) {\n $this->query['body']['aggs'] = $this->aggs;\n }\n if ($this->sort) {\n $this->query['body']['sort'] = $this->sort;\n }\n if ($this->scroll_param) {\n $this->query['scroll'] = $this->scroll_param;\n }\n if ($this->highlight) {\n $this->query['body']['highlight'] = $this->highlight;\n }\n if ($this->filter) {\n $this->query['body']['query']['bool']['filter'] = $this->filter;\n }\n if ($this->query_string) {\n $this->query['body']['query']['query_string'] = $this->query_string;\n }\n if ($this->script) {\n $this->query['body']['query']['script']['script'] = $this->script;\n }\n if ($this->fromType) {\n $this->query['type'] = $this->fromType;\n }\n if ($this->fromIndex) {\n $this->query['index'] = $this->fromIndex;\n } elseif (isset($this->model) && $this->model) {\n $this->query[\"index\"] = $this->model->getIndex();\n }\n return $this->query;\n }", "protected static function whereFormat($where){\n $whereArray = array();\n\n $operate = ' AND ';\n\n foreach ($where as $key => $set){\n if(is_string($set)){\n if(count($where) == 2){\n list($filed,$value) = $where;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($where) == 3){\n list($filed,$exp,$value) = $where;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n break;\n }elseif(is_array($set)){\n if(count($set) == 2){\n list($filed,$value) = $set;\n $whereArray[] = $filed . ' = ' . $value;\n }\n if(count($set) == 3){\n list($filed,$exp,$value) = $set;\n if(in_array($exp, array('=','<=','<>','>=')) && $value){\n $whereArray[] = $filed . \" $exp \" . $value;\n }\n if(in_array($exp, array('in','not in')) && $value){\n $value = implode(',', $value);\n $whereArray[] = $filed . \" $exp \" . \" ($value)\";\n }\n }\n }\n\n }\n return implode($operate, $whereArray);\n }", "protected function compileWheres() {\n // The wheres to compile.\n $wheres = $this->wheres ? : array();\n\n // We will add all compiled wheres to this array.\n $compiled = array();\n\n foreach ($wheres as $i => &$where) {\n // Make sure the operator is in lowercase.\n if (isset($where['operator'])) {\n $where['operator'] = strtolower($where['operator']);\n\n // Operator conversions\n $convert = array(\n 'regexp' => 'regex',\n 'elemmatch' => 'elemMatch',\n 'geointersects' => 'geoIntersects',\n 'geowithin' => 'geoWithin',\n 'nearsphere' => 'nearSphere',\n 'maxdistance' => 'maxDistance',\n 'centersphere' => 'centerSphere',\n 'uniquedocs' => 'uniqueDocs',\n );\n\n if (array_key_exists($where['operator'], $convert)) {\n $where['operator'] = $convert[$where['operator']];\n }\n }\n\n // Convert id's.\n if (isset($where['column']) and ($where['column'] == '_id' or ends_with($where['column'], '._id'))) {\n // Multiple values.\n if (isset($where['values'])) {\n foreach ($where['values'] as &$value) {\n $value = $this->convertKey($value);\n }\n }\n\n // Single value.\n else if (isset($where['value'])) {\n $where['value'] = $this->convertKey($where['value']);\n }\n }\n\n // Convert DateTime values to MongoDate.\n if (isset($where['value']) and $where['value'] instanceof DateTime) {\n $where['value'] = new MongoDate($where['value']->getTimestamp());\n }\n\n // The next item in a \"chain\" of wheres devices the boolean of the\n // first item. So if we see that there are multiple wheres, we will\n // use the operator of the next where.\n if ($i == 0 and count($wheres) > 1 and $where['boolean'] == 'and') {\n $where['boolean'] = $wheres[$i + 1]['boolean'];\n }\n\n // We use different methods to compile different wheres.\n $method = \"compileWhere{$where['type']}\";\n $result = $this->{$method}($where);\n\n // Wrap the where with an $or operator.\n if ($where['boolean'] == 'or') {\n $result = array('$or' => array($result));\n }\n\n // If there are multiple wheres, we will wrap it with $and. This is needed\n // to make nested wheres work.\n else if (count($wheres) > 1) {\n $result = array('$and' => array($result));\n }\n\n // Merge the compiled where with the others.\n $compiled = array_merge_recursive($compiled, $result);\n }\n\n return $compiled;\n }", "public function parameters();", "public function parameters();", "private function setParams($statement, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) { ///percorrer as linhas rows\n\t\t\t$this->setParam($key,$value);///percorer as colunas ID\n\t\t}\n\t}", "public function getWhereParameters()\n {\n $params = [];\n foreach ($this->filters as $filter) {\n $params = array_merge($params, $filter->getParameters());\n }\n\n return $params;\n }", "private function mergeWhere(){\n $wheres = $this->wheres;\n if (count($wheres) == 1)\n return $wheres[0];\n $whereString = \"\";\n foreach ($wheres as $where){\n $whereString .= $where.\" AND \";\n }\n return rtrim($whereString, \" AND \");\n }", "private function setWhere(QueryBuilder $qb)\n {\n // global filtering\n if (isset($this->requestParams['search']) && '' != $this->requestParams['search']['value']) {\n $globalSearch = $this->requestParams['search']['value'];\n\n $orExpr = $qb->expr()->orX();\n $globalSearchType = $this->options->getGlobalSearchType();\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n $searchType = $globalSearchType;\n $searchField = $this->searchColumns[$key];\n // Subqueries and arithmetics fields can't be search with LIKE\n if ($column->isCustomDql() && ('string' != $column->getTypeOfField()) || preg_match('/SELECT .+ FROM .+/', $searchField)) {\n if (!is_numeric($globalSearch)) {\n continue;\n }\n $globalSearch = floatval($globalSearch);\n switch ($searchType) {\n case 'like':\n $searchType = 'eq';\n break;\n case 'notLike':\n $searchType = 'neq';\n break;\n }\n }\n $this->setOrExpression($orExpr, $qb, $searchType, $searchField, $globalSearch, $key);\n }\n }\n\n if ($orExpr->count() > 0) {\n $qb->andWhere($orExpr);\n }\n }\n\n // individual filtering\n if (true === $this->accessor->getValue($this->options, 'individualFiltering')) {\n $andExpr = $qb->expr()->andX();\n\n $parameterCounter = DatatableQueryBuilder::INIT_PARAMETER_COUNTER;\n\n foreach ($this->columns as $key => $column) {\n if (true === $this->isSearchableColumn($column)) {\n if (false === array_key_exists($key, $this->requestParams['columns'])) {\n continue;\n }\n\n $searchValue = $this->requestParams['columns'][$key]['search']['value'];\n\n if ('' != $searchValue && 'null' != $searchValue) {\n /** @var FilterInterface $filter */\n $filter = $this->accessor->getValue($column, 'filter');\n $searchField = $this->searchColumns[$key];\n $andExpr = $filter->addAndExpression($andExpr, $qb, $searchField, $searchValue, $parameterCounter);\n }\n }\n }\n\n if ($andExpr->count() > 0) {\n $qb->andWhere($andExpr);\n }\n }\n\n return $this;\n }", "private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }", "private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "function generateParametrizedQuery( $stm)\r\n\t{\r\n\t\treturn $stm->generateQuery($this);\r\n\t}", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "public function applyParameters(&$parameterArray)\n {\n $this->addSearchParameters($parameterArray);\n }", "protected function compileWheres()\n {\n // The wheres to compile.\n $wheres = $this->wheres ?: [];\n\n // We will add all compiled wheres to this array.\n $compiled = [];\n\n foreach ($wheres as $i => &$where) {\n // Make sure the operator is in lowercase.\n if (isset($where['operator'])) {\n $where['operator'] = strtolower($where['operator']);\n\n // Operator conversions\n $convert = [\n 'regexp' => 'regex',\n 'elemmatch' => 'elemMatch',\n 'geointersects' => 'geoIntersects',\n 'geowithin' => 'geoWithin',\n 'nearsphere' => 'nearSphere',\n 'maxdistance' => 'maxDistance',\n 'centersphere' => 'centerSphere',\n 'uniquedocs' => 'uniqueDocs',\n ];\n\n if (array_key_exists($where['operator'], $convert)) {\n $where['operator'] = $convert[$where['operator']];\n }\n }\n\n // Convert id's.\n if (isset($where['column']) and ($where['column'] == '_id' or ends_with($where['column'], '._id'))) {\n // Multiple values.\n if (isset($where['values'])) {\n foreach ($where['values'] as &$value) {\n $value = $this->convertKey($value);\n }\n }\n\n // Single value.\n elseif (isset($where['value'])) {\n $where['value'] = $this->convertKey($where['value']);\n }\n }\n\n // Convert DateTime values to MongoDate.\n if (isset($where['value']) and $where['value'] instanceof DateTime) {\n $where['value'] = new MongoDate($where['value']->getTimestamp());\n }\n\n // The next item in a \"chain\" of wheres devices the boolean of the\n // first item. So if we see that there are multiple wheres, we will\n // use the operator of the next where.\n if ($i == 0 and count($wheres) > 1 and $where['boolean'] == 'and') {\n $where['boolean'] = $wheres[$i + 1]['boolean'];\n }\n\n // We use different methods to compile different wheres.\n $method = \"compileWhere{$where['type']}\";\n $result = $this->{$method}($where);\n\n // Wrap the where with an $or operator.\n if ($where['boolean'] == 'or') {\n $result = ['$or' => [$result]];\n }\n\n // If there are multiple wheres, we will wrap it with $and. This is needed\n // to make nested wheres work.\n elseif (count($wheres) > 1) {\n $result = ['$and' => [$result]];\n }\n\n // Merge the compiled where with the others.\n $compiled = array_merge_recursive($compiled, $result);\n }\n\n return $compiled;\n }", "private static function compileParam($endToken, array &$tokens){\n $tok = current($tokens);\n $param = ''; \n $nesting = 0;\n do {\n list($id,$text) = is_string($tok) ? array(null,$tok) : $tok;\n if ($text == '(') ++$nesting;\n if ($text == ')') --$nesting;\n $param .= $text;\n\n $atEnd = (bool) preg_match(\"/$endToken/\",$text);\n if ($nesting || (!empty($endToken) && !$atEnd))\n $tok = next($tokens);\n } while (\n $tok && $endToken && ($nesting > 0 || !$atEnd)\n );\n $param = rtrim($param, ',');\n return $param;\n }", "private function processWhere($fromSentence) {\n if (isset($this->whereProcessor)) {\n $fromSentence ? $this->processSentence('where') : $this->processWords('where');\n }\n }", "public function GetMatchedParams ();", "private function setWhatFilters($what, $params) {\r\n $params['searchTerms'] = array();\r\n foreach($what as $key => $value) {\r\n if ($key === 'searchTerms') {\r\n for ($i = count($value); $i--;) {\r\n $params['searchTerms'][] = $value[$i];\r\n }\r\n }\r\n else {\r\n $params[$key] = $value;\r\n }\r\n }\r\n return $params;\r\n }", "function getParameters() {\n $params = $this->docParser->getParamAnnotations();\n $extParams = array();\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n $apiParams = $this->reflectionSource->getParameters();\n } else {\n $apiParams = parent::getParameters();\n }\n foreach ($apiParams as $param) {\n $type = null;\n foreach ($params as $annotation) {\n if (\n $annotation instanceof ezcReflectionAnnotationParam\n and $annotation->getParamName() == $param->getName()\n ) {\n $type = $annotation->getTypeName();\n break;\n }\n }\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n $extParams[] = new ezcReflectionParameter(\n null,\n $param,\n $type\n );\n } else {\n // slightly increase performance and save some memory\n $extParams[] = new ezcReflectionParameter(\n $this->getName(),\n $param->getPosition(),\n $type\n );\n }\n }\n return $extParams;\n }", "protected function genWhere(array $where): string\n {\n $outWhere = [];\n foreach ($where as $k => $v) {\n if (is_int($k)) {\n $outWhere[] = $v;\n } elseif (is_null($v)) {\n $outWhere[] = $k . ' is null';\n } else {\n $outWhere[] = $k . ' = ?';\n }\n }\n return !empty($outWhere) ? implode(' AND ', $outWhere) : '1 = 1';\n }", "private function _process_where_single($where){\n\t\tif((!isset($where['field'])&&!isset($where['name']))||!isset($where['operator'])){\n\t\t\t$return = '';\n\t\t}else{\n\t\t\tif(!isset($where['value'])){\n\t\t\t\t$where['value'] = '';\n\t\t\t}\n\t\t\t$field\t\t = isset($where['field'])?$where['field']:$where['name'];\n\t\t\t$operator\t = strtoupper($where['operator']);\n\t\t\t$value\t\t = $where['value'];\n\t\t\t$extra\t\t = isset($where['extra'])?$where['extra']:'';\n\t\t\t$escape\t\t = isset($where['escape'])?$where['escape']:'auto'; //this can be : auto (filter/value chooses if escape or not), true (always escapes), false (never escapes)\n\t\t\t$return\t\t = '';\n\n\t\t\t//let's create some backwards compatibility\n\t\t\tswitch($operator){\n\t\t\t\tcase 'F=':\n\t\t\t\tcase 'F>':\n\t\t\t\tcase 'F<':\n\t\t\t\tcase 'F!=':\n\t\t\t\tcase 'F>=':\n\t\t\t\tcase 'F<=':\n\t\t\t\t\t//field base\n\t\t\t\t\t$operator\t = substr($operator, 1);\n\t\t\t\t\t$escape\t\t = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//fixing some non standard operators\n\t\t\tswitch($operator){\n\t\t\t\tcase '!=':\n\t\t\t\t\t$operator = '<>';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//let's prepare the $where['value']\n\t\t\tswitch($operator){\n\t\t\t\tcase 'AGAINST':\n\t\t\t\t\t$value = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'][0], $escape);\n\t\t\t\t\t\t$value .= ' '.$where['value'][1];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BETWEEN':\n\t\t\t\t\tif(!is_array($where['value'])){\n\t\t\t\t\t\t$where['value'] = array(0, 0);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!isset($where['value'][0])) $where['value'][0]\t = 0;\n\t\t\t\t\t\tif(!isset($where['value'][1])) $where['value'][1]\t = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'][0], $escape).' AND '.$this->_escape_field($where['value'][1], $escape);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'NOT IN':\n\t\t\t\tcase 'IN':\n\t\t\t\t\t$value\t = '(';\n\t\t\t\t\tif(is_array($where['value'])){\n\t\t\t\t\t\tforeach($where['value'] as $k => $v){\n\t\t\t\t\t\t\t$where['value'][$k] = $this->_escape_field($where['value'][$k], $escape);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$value .= implode(',', $where['value']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value .= $this->_escape_field($where['value'], $escape);\n\t\t\t\t\t}\n\t\t\t\t\t$value .= ')';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'IS':\n\t\t\t\tcase 'IS NOT':\n\t\t\t\t\t//exception to _escape_field because the \"NULL\" will not need to be escaped\n\t\t\t\t\t//so the default behavior is to NOT escape\n\t\t\t\t\tif($escape===false||$escape==='auto'){\n\t\t\t\t\t\t$value = $where['value'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'FIND_IN_SET':\n\t\t\t\tcase 'NOT FIND_IN_SET':\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n//\t\t\t\tif($escape === false){\n//\t\t\t\t\t$value = $where['value'];\n//\t\t\t\t}else{\n//\t\t\t\t\t$value = '\"'.$this->db->real_escape_string($where['value']).'\"';\n//\t\t\t\t}\n\t\t\t\t\t$return\t = $operator.'('.$value.','.$field.')';\n\t\t\t\t\tbreak;\n\t\t\t\t//all of those are falling into the default\n\t\t\t\t/*\n\t\t\t\t case 'REGEXP':\n\t\t\t\t case 'LIKE':\n\t\t\t\t case '=':\n\t\t\t\t case '!=':\n\t\t\t\t case '>':\n\t\t\t\t case '<':\n\t\t\t\t case '=>':\n\t\t\t\t case '=<':\n\t\t\t\t */\n\t\t\t\tdefault:\n\t\t\t\t\t$value\t = $this->_escape_field($where['value'], $escape);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($return==''){\n\t\t\t\t$return = $field.' '.$operator.' '.$value.' '.$extra;\n\t\t\t}\n\t\t}\n\t\treturn $return;\n\t}", "abstract protected function locateStructuralParameters(Queries\\IQuery $query);", "public function namedParameterPerOperator() {\n return true;\n }", "public function provideParameterNormalization () : iterable\n\t{\n\t\tyield [[\"a\" => 1], [\"a\" => 1]];\n\t\tyield [[\"a\" => 1, \"b\" => 2], [\"a\" => 1, \"b\" => 2]];\n\t\tyield [[\"a\" => 1, \"b\" => 123], [\"a\" => 1, \"b\" => new ExampleEntity(123)]];\n\t}", "function namedParameterPerOperator()\r\n {\r\n return true;\r\n }", "private function formatWheres()\n\t{\n\t\t$value = '';\n\t\tforeach ($this->wheres as $val)\n\t\t{\n\t\t\tif ($value != '')\n\t\t\t\t$value .= ' AND ';\n\t\t\t$value .= $val;\n\t\t}\n\t\treturn $value;\n\t}", "function getWhereClause($local = array()) {\n global $whereFilter;\n\n $where = array_merge($local, $whereFilter);\n if (count($where) > 0) {\n $output = \" where \" . implode(\" and \", $where) . \" \";\n return $output;\n } else {\n return \"\";\n }\n}", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "function parseToWhere($vars,$bool,$selx,$etype) {\n $arVars=explode(';',$vars);\n $arBool=explode(';',$bool);\n $arSelx=explode(';',$selx);\n $arEtype=explode(';',$etype);\n \n $i=0;\n //$iMax=0;\n $whereClause='';\n //$chosenOnes=array();\n \n foreach($arVars AS $varName) {\n if ($whereClause) {$whereClause.=$arBool[$i];}\n if (substr($arSelx[$i],0,2)=='__') {\n $op=substr($arSelx[$i],2,2);\n $val=substr($arSelx[$i],4);\n if ($op=='lt') {$whereClause.=' ('.$varName.\"<'\".$val.\"') \";}\n elseif ($op=='eq') {$whereClause.=' ('.$varName.\"='\".$val.\"') \";}\n elseif ($op=='gt') {$whereClause.=' ('.$varName.\">'\".$val.\"') \";}\n elseif ($op=='rg') {\n $v0=substr($val,0,strpos($val,'_'));\n $v1=substr($val,strpos($val,'_')+1);\n $whereClause.=\" ($varName>='$v0' AND $varName<='$v1') \";\n }\n else {$nought=0;}\n } elseif ($arEtype[$i]=='text') {\n $whereClause.=' ('.$varName.\" LIKE '%\".$arSelx[$i].\"%') \";\n } else {\n $whereClause.=' ('.$varName.\"='\".$arSelx[$i].\"') \";\n }\n $i++;\n }\n return $whereClause;\n}", "function smarty_function_find_special_param($params, &$smarty)\n{\n\t//$params['id_product'] $params['id_product_group'] $params['param_tag']\n $GLOBALS['GCMS']->assign('findSpecialParam', RelProParam::get(array(\"id_product\" => $params['id_product'],\"id_product_group\" =>$params['id_product_group'],\"param_tag\"=>$params['param_tag']), false, null, \"param\" ));\n}", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "protected function compileParameterNames()\n {\n preg_match_all('/\\{(.*?)\\}/', $this->getDomain() . $this->uri, $matches);\n\n return array_map(function ($m) {\n return trim($m, '?');\n }, $matches[1]);\n }", "protected function getParametrosWhere(){\n\t\t\t$parametros = array();\n\t\t\t$parametros[\":pkusuario\"] = $this->pkUsuario;\n\t\t\treturn $parametros;\n\t}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "public function compileWheres()\n {\n\n // We will add all compiled wheres to this array.\n $filter = array(\n 'bool' => array(\n 'must' => array(),\n 'should' => array(),\n 'must_not' => array()\n )\n );\n\n // The wheres to compile.\n $wheres = $this->wheres ?: array();\n\n foreach ($wheres as $i => &$where)\n {\n // Make sure the operator is in lowercase.\n if (isset($where['operator']))\n {\n $where['operator'] = strtolower($where['operator']);\n\n // Operator conversions\n $convert = array(\n null => 'term',\n '=' => 'term',\n '<>' => 'not term',\n '!=' => 'not term',\n 'regex' => 'regexp',\n 'rlike' => 'regexp',\n 'ilike' => 'regexp',\n 'geowithin' => 'geoWithin',\n 'geometry' => 'geoIntersects',\n 'geointersects' => 'geoIntersects'\n );\n\n if (array_key_exists($where['operator'], $convert))\n {\n $where['operator'] = $convert[$where['operator']];\n }\n }\n\n // The next item in a \"chain\" of wheres devices the boolean of the\n // first item. So if we see that there are multiple wheres, we will\n // use the operator of the next where.\n if ($i == 0 and count($wheres) > 1 and $where['boolean'] == 'and')\n {\n $where['boolean'] = $wheres[$i+1]['boolean'];\n }\n\n // We use different methods to compile different wheres.\n $method = \"compileWhere{$where['type']}\";\n $result = $this->{$method}($where);\n\n // Wrap the where with an $or operator.\n if ($where['boolean'] == 'or')\n {\n $filter['bool']['should'][] = $result;\n }\n else\n {\n $filter['bool']['must'][] = $result;\n }\n\n }\n\n return $filter;\n }", "function bindAllValues($statement, $params){\n\n\t\tforeach($params as $param => $value) {\n\n if (startsWith($value, 'C')) {\n $aux = explode(\" \", $value);\n $result = \"\";\n foreach($aux as $value){\n if ($value == \"C\") {\n $result .= \"C/\";\n } else {\n $result.= \" \".$value;\n }\n }\n $value = $result;\n }\n\t\t\t$statement->bindValue(':'.$param, $value);\n }\n \n\t\treturn $statement;\n }", "abstract public function processParameters ($params);", "public function findByParameterAnalysis($analyse)\n {\n return $this->getEntityManager()\n ->createQuery(\n 'SELECT o FROM CKM\\AppBundle\\Entity\\Parameter o WHERE o.analyse = :analyse and o.isInput=1'\n )\n ->setParameters(array(\n 'analyse' => $analyse,\n )\n )\n ->getResult();\n }", "private static function buildNameParametersSQL() {\n $namedParams = '';\n foreach (static::$tableSchema as $columnName => $type) {\n $namedParams .= $columnName . ' = :' . $columnName . ', ';\n }\n return trim($namedParams, ', ');\n }", "protected function get_parameter_order()\n {\n }", "function setParams($sql, $params)\n{\n\t$has_params = false;\n\t\n\t$pat = $this->SQL_PARAM_PATTERN;\n\tif (strpos($sql, '{')) $has_params = true;\n\tif ($this->config['pclib.compatibility']['sql_syntax'] and strpos($sql, '[')) {\n\t\t$has_params = true;\n\t\t$pat = \"/\\[([#\\?\\!]?)([a-z0-9_]+)\\]/i\";\n\t}\n\tif (!$has_params) return $sql;\n\t\n\tpreg_match_all($pat, $sql, $found);\n\tif (!$found[0]) return $sql;\n\t$from = $to = array();\n\t$empty = false;\n\tforeach($found[2] as $i => $key) {\n\t\t$from[] = $found[0][$i];\n\t\tif (strlen(array_get($params, $key)) == 0) {\n\t\t\t$empty = true;\n\t\t\tif ($found[1][$i] == '#') $to[] = '__PCL_EMPTY0__';\n\t\t\telse $to[] = '__PCL_EMPTYS__';\n\t\t}\n\t\telseif ($found[1][$i] == '#')\n\t\t\t$to[] = (int)$params[$key];\n\t\telseif($found[1][$i] == '?')\n\t\t\t$to[] = '';\n\t\telseif($found[1][$i] == '!')\n\t\t\t$to[] = $params[$key];\n\t\telse\n\t\t\t$to[] = $this->escape($params[$key]);\n\t}\n\t\n\t$sql = str_replace($from, $to, $sql);\n\tif (!strpos($sql, \"\\n\") and !$empty) return $sql;\n\t\n\t$from = array(\"/^\\s*~ .+__PCL_EMPTY.__.*$/m\", \"/^\\s*~ /m\", \"/__PCL_EMPTYS__/\", \"/__PCL_EMPTY0__/\");\n\t$to = array('',' ','', '0');\n\treturn preg_replace($from, $to, $sql);\n}", "private function setWhatFilters($what, $params)\n {\n $params['searchTerms'] = array();\n foreach ($what as $key => $value) {\n if ($key === 'searchTerms') {\n for ($i = count($value); $i--;) {\n $params['searchTerms'][] = $value[$i];\n }\n } else {\n $params[$key] = $value;\n }\n }\n return $params;\n }", "private function setParams()\n\t\t{\n\t\t\t/**\n\t\t\t* Remove do $this->_separetor os dois primeiros valores\n\t\t\t* referentes ao controller e action, deixando os demais valores\n\t\t\t* que serão usados para formarem os parametros, indices e valores\n\t\t\t*/\n\t\t\tunset($this->_separetor[1], $this->_separetor[2]);\n\t\t\t\n\t\t\t/**\n\t\t\t* Caso o ultimo item do $this->_separetor seja vazio\n\t\t\t* o mesmo é removido\n\t\t\t*/\n\t\t\tif ( end($this->_separetor) == null ) {\n\t\t\t\tarray_pop($this->_separetor);\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t* Se a $this->_separetor estivar vazia,\n\t\t\t* então os parametros serão definidos como vazios\n\t\t\t*/\n\t\t\tif ( !empty($this->_separetor) ) {\n\t\t\t\t/**\n\t\t\t\t* Percorre o array $this->_separetor, verificando os indices\n\t\t\t\t* se for impar, então seu valor será o indice do parametro.\n\t\t\t\t* Se for par, seu valor será o valor do paremetro\n\t\t\t\t*/\n\t\t\t\tforeach ($this->_separetor as $key => $value) {\n\t\t\t\t\tif ($key % 2 == 0) {\n\t\t\t\t\t\t$param_value[] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$param_indice[] = $value;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$param_value = array();\n\t\t\t\t$param_indice = array();\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t* Verifica se os indices e valores dos parametros\n\t\t\t* não são vazios e possuem a mesma quantidade\n\t\t\t* Então vaz um \"array_combine\" para juntar os dois arrays\n\t\t\t* formando um indice->valor para o parametro\n\t\t\t*/\n\t\t\tif ( !empty($param_indice) \n\t\t\t\t&& !empty($param_value)\n\t\t\t\t&& count($param_indice)\n\t\t\t\t== count($param_value)\n\t\t\t) {\n\t\t\t\t$this->_params = array_combine($param_indice, $param_value);\n\t\t\t} else {\n\t\t\t\t$this->_params = array();\n\t\t\t}\n\t\t}", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "public function rewriteMinkParameter(&$context = NULL) {\n\t}", "public function setWhere(QueryBuilder $qb)\n {\n // Global filtering\n if (!empty($this->search)) {\n // search Text is splitted so each word can be searched\n $searchArray = array_filter(explode(' ', $this->search));\n $andExpr = $qb->expr()->andX();\n foreach ($searchArray as $index => $searchField) {\n $orExpr = $qb->expr()->orX();\n foreach (array_keys($this->parameters) as $key) {\n if ((bool)$this->datatablesModel->getColumns()[$key]['searchable'] === true) {\n $qbParam = \"sSearch_global_{$this->associations[$key]['entityName']}_{$this->associations[$key]['fieldName']}_{$index}\";\n $orExpr->add($qb->expr()->like(\n $this->associations[$key]['fullName'],\n \":$qbParam\"\n ));\n $qb->setParameter($qbParam, \"%\" . $searchField . \"%\");\n }\n }\n $andExpr->add($orExpr);\n }\n $qb->andWhere($andExpr);\n }\n\n // Individual column filtering\n $andExpr = $qb->expr()->andX();\n foreach (array_keys($this->parameters) as $key) {\n if ((bool)$this->datatablesModel->getColumns()[$key]['searchable'] === true && !empty($this->datatablesModel->getColumns()[$key]['search']['value'])) {\n $qbParam = \"sSearch_single_{$this->associations[$key]['entityName']}_{$this->associations[$key]['fieldName']}\";\n $andExpr->add($qb->expr()->like(\n $this->associations[$key]['fullName'],\n \":$qbParam\"\n ));\n $qb->setParameter($qbParam, \"%\" . $this->datatablesModel->getSearch()[$key]['search']['value'] . \"%\");\n }\n }\n if ($andExpr->count() > 0) {\n $qb->andWhere($andExpr);\n }\n\n if (!empty($this->callbacks['WhereBuilder'])) {\n foreach ($this->callbacks['WhereBuilder'] as $callback) {\n $callback($qb);\n }\n }\n }", "public function getParameterConditions(): array\n {\n return $this->parameterConditions;\n }", "public function resolveConditionData($params)\n {\n $dataWhere = \"\";\n\n $lowerKeyd = array_change_key_case($params, CASE_LOWER);\n $glue = strtoupper(isset($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) && strtolower($lowerKeyd[self::OPERATOR_PREFIX . 'operator']) == \"or\" ? \"OR\" : \"AND\");\n unset($lowerKeyd);\n\n foreach ($params as $k => $v) {\n if (strpos($k, self::OPERATOR_PREFIX) === 0) {\n continue;\n }\n if (is_numeric($k)) {\n if (is_array($v)) {\n $dataWhere .= ($dataWhere ? \" {$glue} (\" : \"(\") . $this->resolveConditionData($v) . \")\";\n }\n else { // raw\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $v;\n }\n }\n else {\n $expl = explode(\" \", $k, 2);\n $operator = count($expl) > 1 ? $expl[1] : \"=\";\n if ($operator == \"=\" && (is_array($v))) {\n $operator = \"IN\";\n }\n if ($operator == \"!=\" && (is_array($v))) {\n $operator = \"NOT IN\";\n }\n if ($operator == \"=\" && ($v === NULL)) {\n $operator = \"IS\";\n }\n if ($operator == \"!=\" && ($v === NULL)) {\n $operator = \"IS NOT\";\n }\n $dontQuote = false;\n if ($v === NULL) {\n $v = \"NULL\";\n $dontQuote = true;\n }\n if ($v === TRUE) {\n $v = 1;\n }\n if ($v === FALSE) {\n $v = 0;\n }\n $column = $expl[0];\n if (strpos($column, self::DONT_QUOTE_VALUE_PREFIX) === 0) {\n $column = substr($column, 1);\n $dontQuote = true;\n }\n $dataWhere .= ($dataWhere ? \" {$glue} \" : \"\") . $this->quoteColumn($column) . \" {$operator} \" . $this->_quoteVal($v, $dontQuote);\n }\n }\n\n return $dataWhere;\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "function ResetSearchParms() {\n\n\t\t// Clear search WHERE clause\n\t\t$this->SearchWhere = \"\";\n\t\t$this->setSearchWhere($this->SearchWhere);\n\n\t\t// Clear advanced search parameters\n\t\t$this->ResetAdvancedSearchParms();\n\t}", "private static function genPrimaryKeyWhereClause() {\n return \"WHERE \" . self::ID_KEY . \"=\" . self::transformForPreparedStatement(self::ID_KEY);\n }" ]
[ "0.5914309", "0.58888423", "0.58709806", "0.5749924", "0.5709801", "0.56760097", "0.54962164", "0.54638326", "0.54273283", "0.5359981", "0.53272694", "0.5295493", "0.5293256", "0.52760583", "0.52301604", "0.52241963", "0.5219512", "0.51979536", "0.5194947", "0.51721907", "0.51544744", "0.5150599", "0.51111245", "0.5093723", "0.508181", "0.50751257", "0.5061308", "0.50589883", "0.505521", "0.5051373", "0.5039222", "0.5022385", "0.5019451", "0.5015652", "0.4997416", "0.4995238", "0.49924338", "0.49275762", "0.49074504", "0.4884162", "0.48676673", "0.4845206", "0.4820779", "0.4810235", "0.4806186", "0.4804741", "0.48013535", "0.4801203", "0.47650832", "0.4751409", "0.4736995", "0.4736995", "0.47290495", "0.47262695", "0.47217098", "0.47199136", "0.47166577", "0.47166577", "0.47152048", "0.4713974", "0.46938622", "0.46938622", "0.4688756", "0.4688702", "0.46775234", "0.4671872", "0.46661615", "0.46638316", "0.4658619", "0.46525207", "0.4650524", "0.4647825", "0.46451935", "0.46378365", "0.46348038", "0.4633792", "0.46332622", "0.46312496", "0.4630559", "0.46267706", "0.46080178", "0.4605568", "0.45884162", "0.4588201", "0.4586764", "0.45854014", "0.45825812", "0.4576847", "0.45750147", "0.45696336", "0.4553235", "0.4551367", "0.4550339", "0.4546812", "0.45358965", "0.45284975", "0.452842", "0.45252785", "0.45250797", "0.4524271" ]
0.5227745
15
Find a region by ID.
public static function find($id) { $regionDb = Yadda_Db_Table::getInstance('region'); $select = $regionDb ->select() ->from('region') ->where('status = ?', 'active') ->where('id = ?', $id); $region = $regionDb->fetchRow($select); if ($region === null) { throw new Yadda_Model_Exception('There is no region with the supplied ID.'); } return self::toArray($region); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function find($id) {\n\t\treturn Doctrine::getTable ( 'Regions' )->findOneBy ( 'region_id', $id );\n\t}", "public function getRegionById($id)\n\t{\n\t\tif($id === null)\n\t\t\treturn null;\n\t\t$this->ensureRegionsLoaded(array($id));\n\t\tif(!isset($this->_regions[$id]))\n\t\t\treturn null;\n\t\treturn new GmthBridgeRegion($this, $this->_regions[$id]);\n\t}", "function get( $id=\"\" )\n {\n $db =& eZDB::globalDatabase();\n if ( $id != \"\" )\n {\n $db->array_query( $region_array, \"SELECT * FROM eZAddress_Region WHERE ID='$id'\" );\n\t\t\t\n if ( count( $region_array ) == 1 )\n {\n $this->fill( $region_array[0] );\n }\n }\n }", "public static function find($id);", "public static function findById($id);", "function eZRegion( $id = \"\" )\n {\n if ( is_array( $id ) )\n {\n $this->fill( $id );\n }\n else if ( $id != \"\" )\n {\n $this->ID = $id;\n\t\t\t$this->get( $this->ID );\n }\n }", "public function find($id)\r\n {\r\n if (!is_array($id)) {\r\n return $this->location->where('id', $id)->first();\r\n }\r\n \r\n return $this->location->whereIn('id', $id)->get();\r\n }", "public static function findById($id)\n {\n }", "public static function findById($id)\n\t{\n\t\n\t}", "public function show($id)\n {\n $region = Region::find($id);\n if($region != null){\n if($region->softDelete != True)return response()->json($region);\n return response()->json([\"message\"=>\"La región está eliminada.\"]);\n }\n return response()->json([\"message\"=>\"El id no existe\"]);\n }", "function getId_region()\n {\n if (!isset($this->iid_region) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_region;\n }", "static public function find($id) {\n return static::getMapper()->find($id);\n }", "public function show($id)\n {\n $region = Region::findOrFail($id);\n\n return view('regions.show', compact('region'));\n }", "public function show($id)\n {\n $region = $this->regionRepository->findWithoutFail($id);\n\n if (empty($region)) {\n Flash::error('Region not found');\n\n return redirect(route('regions.index'));\n }\n\n return view('admin.regions.show')->with('region', $region);\n }", "public function getPlaceByID( $id );", "public function getRegiones($id){ //id del pais\n return Region::where('codPais','=',$id)->get();\n \n }", "public static function findIdentity($id);", "public function edit($id)\n {\n try\n {\n \n $region = Region::findOrFail($id);\n\n $params = [\n 'title' => 'Edit Region',\n \n 'region' => $region\n \n ];\n\n return view('admin.regions.regions_edit')->with($params);\n }\n catch (ModelNotFoundException $ex) \n {\n if ($ex instanceof ModelNotFoundException)\n {\n return response()->view('errors.'.'404');\n }\n }\n }", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id)\n {\n return $this->repo->find($id);\n }", "public function find($id)\n {\n return $this->repo->find($id);\n }", "public function packingFind($id);", "public function find($id)\n\t{\n\t\t// TODO: Implement find() method.\n\t}", "public function edit($id)\n {\n $region = Region::findOrFail($id);\n \n\n return view('regions.edit', compact('region'));\n }", "public function find($id)\r\n {\r\n return $this->repository->find($id);\r\n }", "public function find($id)\r\n {\r\n return $this->scopeRepository->find($id);\r\n }", "function findById($id)\n {\n }", "public function find($id)\n {\n return $this->service->find($id);\n }", "public function show($id)\n {\n //\n try\n {\n $region = Region::findOrFail($id);\n\n $params = [\n 'title' => 'Delete region',\n 'region' => $region,\n ];\n\n return view('admin.regions.regions_delete')->with($params);\n }\n catch (ModelNotFoundException $ex) \n {\n if ($ex instanceof ModelNotFoundException)\n {\n return response()->view('errors.'.'404');\n }\n }\n }", "abstract public function find($id);", "public function find( $id );", "public function show($id)\n {\n $region = $this->model->show($id);\n\n return response($region->load(['provinces']));\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public function find($id)\n {\n return $this->getRepository()->find($id);\n }", "public static function getRegion($region_id)\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT region_id, region_name FROM region WHERE region_id = :region_id LIMIT 1\";\n $query = $database->prepare($sql);\n $query->execute(array(':region_id' => $region_id));\n\n // fetch() is the PDO method that gets a single result\n return $query->fetch();\n }", "function findById($id);", "protected function findModel($id)\n {\n if (($model = Region::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find($id) {\n\t\treturn self::find_by('id', $id);\n\t}", "public function show($id)\n {\n // Laravel Eloquent\n $regionsRepository = new RegionsRepository();\n $region = $regionsRepository->find($id);\n if (!$region) {\n return response()\n ->json($this->_getResponseDataMessageEntityDoesNotExistError('Region', $id))\n ->setStatusCode(Response::HTTP_NOT_FOUND);\n }\n\n // Fractal\n $resource = new FractalResource\\Item($region, new GenericTransformer());\n\n return response()\n ->json($this->_getResponseData($resource))\n ->setStatusCode(Response::HTTP_OK);\n }", "public function find($id)\n {\n return $this->repository->find($id);\n }", "function find($id);", "function getRegion($region_id,$db_handle){\n $result=$db_handle->runQuery('select region_name from global_region where region_id=\\''.$region_id.'\\'');//returns null if empty resultset\n if (is_null($result)){\n \treturn 'region_name not found.';\n }else{\n \t// var_dump($result[0]);\n \treturn $result[0]['region_name'];\n }\n}", "public function findById ( $id )\n\t{\n\t\treturn $this->abstractFindById(self::RETURNTYPE,$id);\n\t}", "public function find( $id )\n {\n return $this->getMapper()\n ->find( $id );\n }", "public function find( $id )\n {\n return $this->getMapper()\n ->find( $id );\n }", "public function find( $id )\n {\n return $this->getMapper()\n ->find( $id );\n }", "public function show($id)\n\t{\n\t\t//\n\t\t$http_status = 200;\n\t\t$data = array();\n\n\t\t$recurso = BitacoraCargaEPRegion::find($id);\n\n\t\tif(is_null($recurso)){\n\t\t\t$http_status = 404;\n\t\t\t$data = array(\"data\"=>\"No existe el recurso que quiere solicitar.\",'code'=>'U06');\n\t\t}else{\n\t\t\t$data = array(\"data\"=>$recurso->toArray());\n\t\t}\n\n\t\treturn Response::json($data,$http_status);\n\t}", "public function edit($id)\n {\n $region = $this->regionRepository->findWithoutFail($id);\n $city = city::latest()->pluck('display_name_en','id');\n\n if (empty($region)) {\n Flash::error('Region not found');\n\n return redirect(route('regions.index'));\n }\n\n return view('admin.regions.edit')->with('region', $region)->with('city', $city);\n }", "public function getRegion(): RegionInterface;", "public static function locatedAt($id)\n {\n return static::where(compact('id'))->firstOrFail();\n }", "public static function find($id) {\n return parent::find(__CLASS__, $id);\n }", "public function find($id)\n {\n return parent::find($id);\n }", "public function find($id)\n {\n return parent::find($id);\n }", "public function find($id)\n {\n return parent::find($id);\n }", "static function find($id) {\n return self::findBy(\"id\", $id);\n }", "public static function LocatedAtID($id) {\n return static::where(compact('id'))->firstOrFail();\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function find($id)\n {\n }", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function find($id)\n {\n return $this->mainRepository->find($id);\n }", "public function findById ($id);", "public function find(int $id) ;", "public static function find($id = null)\n {\n return self::doSearch($id);\n }", "public function loadLocation($id): LocationInterface;", "public function findForCode($id) {\n\t\treturn $this->queryCode($id)->find();\n\t}", "function lookupRegionByCity($city){\n\t$data = M('georegion');\n\tif(strlen($city)>0){\n\t\t$condition = Array('citylist' => Array('like', '%'.$city.'%'));\n\t\tif($region = $data->where($condition)->find()){\n\t\t\treturn $region['id'];\n\t\t}\n\t\telse\n\t\t\treturn '0';\n\t}\n\treturn false;\n}", "public function testFindForId() {\n\t\t$id = 1;\n\n\t\t$result = $this->ItemsTable->findForId($id);\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$result,\n\t\t\t'The result should always be an array.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$id,\n\t\t\t$result['id'],\n\t\t\t'The id key/value of the result for id should be equal to the id.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Candy',\n\t\t\t$result['firstName'],\n\t\t\t'The id key/value of the result for firstName should be equal to `Candy`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Crush',\n\t\t\t$result['lastName'],\n\t\t\t'The id key/value of the result for lastName should be equal to `Crush`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'Stripper',\n\t\t\t$result['occupation'],\n\t\t\t'The id key/value of the result for occupation should be equal to `Stripper`.'\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t'1924 Sucka Drive',\n\t\t\t$result['address'],\n\t\t\t'The id key/value of the result for address should be equal to `1924 Sucka Drive`.'\n\t\t);\n\t\t\n\t}", "public function find($identifier);", "public function findById($id) {\n \treturn $this->find($id)->current();\n }", "public function planFind($id);", "public function getMainRegion($regionID) {\n\t if($regionID>0){\n\t foreach ($this->arRegions as $val){\n\t if($regionID==$val[\"GeoRegionId\"]){\n\t if( $val[\"GeoRegionType\"]==\"City\" || $val[\"GeoRegionType\"]==\"Village\" ) return $val[\"GeoRegionId\"];\n\t else {\n\t $cityReg=$this->getCityByRegion($val[\"GeoRegionId\"]);\n\t if($cityReg>0) return $cityReg;\n\t else return $val[\"GeoRegionId\"];\n\t }\n\t }\n\t }\n\t }\n\t else return 0;\n\t}", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public static function findById($id){\n \t$data = self::find($id);\n \tif (!$data) {\n \t\tabort(404);\n \t}\n \treturn $data;\n }", "public function getRegion()\n {\n return $this->hasOne(Regions::class, ['id' => 'region_id']);\n }", "public function find($id)\n\t{\n\t\treturn $this->fetchRow(array(\n\t\t\t$this->getAdapter()->quoteIdentifier($this->getPrimaryName()) . ' = ?' => $id\n\t\t));\n\t}" ]
[ "0.8358393", "0.66860247", "0.66278726", "0.64072245", "0.6303355", "0.62986165", "0.6257389", "0.62041575", "0.61952657", "0.6162741", "0.6153608", "0.61195225", "0.6116599", "0.6092943", "0.6081218", "0.6079749", "0.6052687", "0.60417145", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.60000944", "0.59961134", "0.59961134", "0.59953785", "0.59902436", "0.59840983", "0.59705216", "0.5970138", "0.59606117", "0.5953992", "0.5947341", "0.59446466", "0.5935342", "0.5930801", "0.59222615", "0.59222615", "0.59222615", "0.5917109", "0.5902474", "0.58981335", "0.5897132", "0.587761", "0.5867144", "0.5848754", "0.5843855", "0.58379674", "0.5825468", "0.5825468", "0.5825468", "0.58152723", "0.5814883", "0.5803202", "0.5799159", "0.5792463", "0.57913715", "0.57913715", "0.57913715", "0.5788077", "0.5786964", "0.5781787", "0.5781787", "0.5781787", "0.5777294", "0.5772178", "0.57555544", "0.57478005", "0.57459277", "0.5735248", "0.5710149", "0.5683686", "0.56748676", "0.56707406", "0.5663156", "0.5661084", "0.5653231", "0.56488967", "0.56488967", "0.56488967", "0.5644984", "0.5640894" ]
0.7944306
1
Returns a paginated list of regions matching the given parameters.
public static function search(array $params) { // build query $regionDb = Yadda_Db_Table::getInstance('region'); $select = $regionDb ->select() ->from('region') ->where('status = ?', 'active') ->order('name'); // fetch $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select)); $paginator->setCurrentPageNumber(isset($params['page']) ? (int) $params['page'] : 1); $paginator->setItemCountPerPage(isset($params['count']) ? (int) $params['count'] : 10); $return = array( 'params' => $params, 'total' => $paginator->getTotalItemCount(), 'page' => $paginator->getCurrentPageNumber(), 'pages' => $paginator->count(), 'results' => array() ); $regions = new Zend_Db_Table_Rowset(array( 'table' => $regionDb, 'data' => (array) $paginator->getCurrentItems() )); foreach ($regions as $region) { $return['results'][] = self::toArray($region); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function regions(Request $request): RegionCollection\n {\n return RegionCollection::make(Region::query()->with('translates')->paginate($request->get('perPage') ?? 50));\n }", "public static function all(array $params = array()) {\n\t\t// build query\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region')\n\t\t\t->where('status = ?', 'active')\n\t\t\t->order('name');\n\t\t\n\t\t// fetch\n\t\t$regions = $regionDb->fetchAll($select);\n\t\t$return = array();\n\t\tforeach ($regions as $region) {\n\t\t\t$return[] = self::toArray($region);\n\t\t}\n\t\treturn $return;\n\t}", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }", "public function index(Request $request)\n {\n $list = QueryBuilder::for(\\Blegrator\\Region::class)\n ->allowedFilters([\n AllowedFilter::exact('id'),\n AllowedFilter::exact('name')\n ])\n ->defaultSort('id') //ASC\n ->allowedSorts('id')\n ->paginate(($request->has('per_page') ?: 50))\n ->appends(request()->query());\n\n return $this->respondWithPagination($list, new RegionTransformer());\n }", "function regionList($where = '')\n {\n $arrClms = array(\n 'pkRegionID',\n 'RegionName',\n );\n $varOrderBy = 'RegionName ASC ';\n $arrRes = $this->select(TABLE_REGION, $arrClms, $where);\n //pre($arrRes);\n return $arrRes;\n }", "public function callRegions(array $params = array())\n {\n return $this->call('objekt/regionen', $params);\n }", "function &getAll( $as_object = true, $search = \"\", $offset = 0, $max = -1 )\n {\n $db =& eZDB::globalDatabase();\n\n $region_array = 0;\n $return_array = array();\n \n if ( $max >= 0 && is_numeric( $offset ) && is_numeric( $max ) )\n {\n $limit = array( \"Limit\" => $max,\n \"Offset\" => $offset );\n }\n\n if ( !empty( $search ) )\n {\n $query = new eZQuery( array( \"Name\", \"Abbreviation\" ), $search );\n $search_arg = \"AND \" . $query->buildQuery();\n// $search_arg = \"WHERE Name like '%$search%'\";\n }\n\n if ( $as_object )\n $select = \"*\";\n else\n $select = \"ID\";\n\n $db->array_query( $region_array, \"SELECT $select FROM eZAddress_Region\n WHERE Removed=0 $search_arg\n ORDER BY Name\", $limit );\n\t\t\n if ( $as_object )\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = new eZRegion( $region[ $db->fieldName( \"ID\" ) ] );\n }\n }\n else\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = $region[ $db->fieldName( \"ID\" ) ];\n }\n }\n\t\t\n return $return_array;\n\n }", "private function getRegions(): array\n {\n try {\n /** @var Regions[] $regions */\n $regions = $this->getDoctrine()\n ->getRepository(Regions::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $regions;\n }", "public function get_regions()\n\t{\n\t\t$this->load->model('promo_model');\n\t\t$region= $this->promo_model->regions();\n\t\t\n\t\techo json_encode($region);\n\t}", "public function regions(Request $request)\n {\n $langcode = $request->query->get('lang', 'fi');\n $cities = explode(' ', $request->query->get('q'));\n $data = $this->getCityBoundaries($cities, $langcode);\n return new JsonResponse($data);\n }", "public function index()\n {\n return view('backend.region.index')->withRegions($this->region->getForDataTable()->paginate(10));\n }", "public function getRegions()\n {\n\n $regions = array(\n \"\" => \"Default (empty)\",\n \"us-east-2\"\t\t\t=> \"US East (Ohio)\",\n \"us-east-1\"\t\t\t=> \"US East (N. Virginia)\",\n \"us-west-1\"\t\t\t=> \"US West (N. California)\",\n \"us-west-2\"\t\t\t=> \"US West (Oregon)\",\n //\"ap-east-1\" => \"Asia Pacific (Hong Kong)***\",\n \"ap-south-1\"\t\t=> \"Asia Pacific (Mumbai)\",\n //\"ap-northeast-3\"\t=> \"Asia Pacific (Osaka-Local)****\",\n \"ap-northeast-2\"\t=> \"Asia Pacific (Seoul)\",\n \"ap-southeast-1\"\t=> \"Asia Pacific (Singapore)\",\n \"ap-southeast-2\"\t=> \"Asia Pacific (Sydney)\",\n \"ap-northeast-1\"\t=> \"Asia Pacific (Tokyo)\",\n \"ca-central-1\"\t\t=> \"Canada (Central)\",\n \"cn-north-1\"\t => \"China (Beijing)\",\n \"cn-northwest-1\"\t=> \"China (Ningxia)\",\n \"eu-central-1\"\t\t=> \"EU (Frankfurt)\",\n \"eu-west-1\"\t\t => \"EU (Ireland)\",\n \"eu-west-2\"\t\t => \"EU (London)\",\n \"eu-west-3\"\t\t => \"EU (Paris)\",\n \"eu-north-1\"\t\t=> \"EU (Stockholm)\",\n \"sa-east-1\"\t\t => \"South America (São Paulo)\",\n \"me-south-1\"\t\t=> \"Middle East (Bahrain)\",\n );\n // ***You must enable this Region before you can use it.\n // ****You can use the Asia Pacific (Osaka-Local) Region only in conjunction with the Asia Pacific\n // (Tokyo) Region. To request access to the Asia Pacific (Osaka-Local) Region, contact your sales representative.\n\n return $regions;\n }", "public function index()\n {\n $regions = Region::paginate(25);\n\n return view('regions.index', compact('regions'));\n }", "public function regionlist(){\n if($this->request->all()){\n $id = array_flatten($this->request->all());\n $sorted = $this->region->select('id','region')->whereIn('id',$id)->where('status',1)->get()->sortBy('region');\n }else{\n $sorted = $this->region->select('id','region')->where('status',1)->get()->sortBy('region');\n }\n return $sorted->values()->all();\n }", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function regionList(): Response\n {\n $player = $this->getPlayer();\n $regions = $player->getWorldRegions();\n\n // GameUnitType 1 = Buildings\n $gameUnitType = $this->gameUnitTypeRepository->find(1);\n\n foreach ($regions as $region) {\n $region->buildingsInConstruction = $this->constructionActionService->getCountGameUnitsInConstruction($region, $gameUnitType);\n $region->buildings = $this->constructionActionService->getCountGameUnitsInWorldRegion($region, $gameUnitType);\n }\n\n return $this->render('game/regionList.html.twig', [\n 'regions' => $regions,\n 'player' => $player,\n 'mapUrl' => $this->getMapUrl(),\n ]);\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function GetRegions($flags=null, $excludeFlags=null, $start=0, $count=10, $sortRegionName=null, $sortLocX=null, $sortLocY=null, $asArray=false){\n\t\t\tif(isset($flags) === false){\n\t\t\t\t$flags = RegionFlags::RegionOnline;\n\t\t\t}\n\t\t\tif(isset($excludeFlags) === false){\n\t\t\t\t$excludeFlags = 0;\n\t\t\t}\n\t\t\tif(is_string($flags) === true && ctype_digit($flags) === true){\n\t\t\t\t$flags = (integer)$flags;\n\t\t\t}\n\t\t\tif(is_string($excludeFlags) === true && ctype_digit($excludeFlags) === true){\n\t\t\t\t$excludeFlags = (integer)$excludeFlags;\n\t\t\t}\n\t\t\tif(is_string($start) === true && ctype_digit($start) === true){\n\t\t\t\t$start = (integer)$start;\n\t\t\t}\n\t\t\tif(is_string($count) === true && ctype_digit($count) === true){\n\t\t\t\t$count = (integer)$count;\n\t\t\t}\n\n\t\t\tif(is_bool($asArray) === false){\n\t\t\t\tthrow new InvalidArgumentException('asArray flag must be a boolean.');\n\t\t\t}else if(is_integer($flags) === false){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags argument should be supplied as integer.');\n\t\t\t}else if($flags < 0){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags cannot be less than zero');\n\t\t\t}else if(RegionFlags::isValid($flags) === false){ // Aurora::Framework::RegionFlags::isValid() does do a check for integerness, but we want to throw a different exception message if it is an integer.\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags value is invalid, aborting call to API');\n\t\t\t}else if($excludeFlags < 0){\n\t\t\t\tthrow new InvalidArgumentException('Region ExcludeFlags cannot be less than zero');\n\t\t\t}else if(RegionFlags::isValid($excludeFlags) === false){ // Aurora::Framework::RegionFlags::isValid() does do a check for integerness, but we want to throw a different exception message if it is an integer.\n\t\t\t\tthrow new InvalidArgumentException('Region ExcludeFlags value is invalid, aborting call to API');\n\t\t\t}else if(is_integer($start) === false){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be an integer.');\n\t\t\t}else if(isset($count) === true){\n\t\t\t\tif(is_integer($count) === false){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be an integer.');\n\t\t\t\t}else if($count < 1){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be greater than zero.');\n\t\t\t\t}\n\t\t\t}else if(isset($sortRegionName) === true && is_bool($sortRegionName) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by region name flag must be a boolean.');\n\t\t\t}else if(isset($sortLocX) === true && is_bool($sortLocX) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by x-axis flag must be a boolean.');\n\t\t\t}else if(isset($sortLocY) === true && is_bool($sortLocY) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by y-axis flag must be a boolean.');\n\t\t\t}\n\t\t\t$response = array();\n\t\t\t$input = array(\n\t\t\t\t'RegionFlags' => $flags,\n\t\t\t\t'ExcludeRegionFlags' => $excludeFlags,\n\t\t\t\t'Start' => $start,\n\t\t\t\t'Count' => $count\n\t\t\t);\n\t\t\tif(isset($sortRegionName) === true){\n\t\t\t\t$input['SortRegionName'] = $sortRegionName;\n\t\t\t}\n\t\t\tif(isset($sortLocX) === true){\n\t\t\t\t$input['SortLocX'] = $sortLocX;\n\t\t\t}\n\t\t\tif(isset($sortLocY) === true){\n\t\t\t\t$input['SortLocY'] = $sortLocY;\n\t\t\t}\n\t\t\t$has = WebUI\\GetRegions::hasInstance($this, $flags, $excludeFlags, $sortRegionName, $sortLocX, $sortLocY);\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegions', true, $input, array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegions::r($this, $flags, $excludeFlags, $start, $has ? null : $result->Total, $sortRegionName, $sortLocX, $sortLocY, $response);\n\t\t}", "public function getRegionsIterator()\n {\n return $this->data->getRegions()->getIterator();\n }", "public function GetRegionsInArea($startX, $startY, $endX, $endY, $scopeID='00000000-0000-0000-0000-000000000000', $asArray=false){\n\t\t\t$has = WebUI\\GetRegionsInArea::hasInstance($this, $startX, $startY, $endX, $endY, $scopeID);\n\t\t\t$response = array();\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegionsInArea', true, array(\n\t\t\t\t\t'StartX' => $startX,\n\t\t\t\t\t'StartY' => $startY,\n\t\t\t\t\t'EndX' => $endX,\n\t\t\t\t\t'EndY' => $endY,\n\t\t\t\t\t'ScopeID' => $scopeID\n\t\t\t\t), array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegionsInArea::r($this, $startX, $startY, $endX, $endY, $scopeID, 0, $result->Total, $response);\n\t\t}", "function getRegions() {\n global $myPDODB, $whereFilter;\n $output = array();\n\n $whereLocal = array();\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT r.name AS 'name', r.id AS 'id', COUNT( s.id ) AS 'number', 'region' AS 'type'\nFROM regions AS r\nJOIN countries AS c ON r.id = c.region_id\nJOIN students AS s ON c.id = s.destination_country \n$whereClause\nGROUP BY r.name\nORDER BY r.name;\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n if ($result) {\n $regions = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($regions as $region) {\n // get the country details for each region\n $countries = getCountries($region['id']);\n array_push($output, array(\"item_id\" => $region['id'] * 100000, \"fixed\" => true, \"name\" => $region['name'], \"number\" => $region['number'], \"type\" => $region['type'], \"children\" => $countries));\n }\n }\n\n // add the regions to the output array\n return $output;\n}", "public function getRegions()\n\t{\n\t\t$this->ensureRegionsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_regions),\n\t\t\t$this, '\\PhpExtended\\Gmth\\GmthBridgeRegion');\n\t}", "public function by_region_multi($region_list, array $order_by=null, $offset=null, $limit=null) {\n $keys = [];\n if ($region_list instanceof \\neoform\\region\\collection) {\n foreach ($region_list as $k => $region) {\n $keys[$k] = [\n 'region_id' => (int) $region->id,\n ];\n }\n } else {\n foreach ($region_list as $k => $region) {\n $keys[$k] = [\n 'region_id' => (int) $region,\n ];\n }\n }\n return parent::_by_fields_multi(\n self::BY_REGION,\n $keys,\n $order_by,\n $offset,\n $limit\n );\n }", "public static function getAll()\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT region_id, region_name FROM region\";\n $query = $database->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows\n return $query->fetchAll();\n }", "public function paginatedSearch($params) {\n // get items page\n $search_params = [];\n $qb = $this->db->createQueryBuilder();\n $qb->select('contacto_id', 'obra_id', 'cargo', 'intervencion');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n $search = '%'.$params['search_fields']['search'].'%';\n for ($i = 0; $i < 4; $i++) {\n $search_params[] = $search;\n }\n }\n $qb->orderBy($params['sort_field'], $params['sort_dir']);\n $qb->setFirstResult($params['page_size'] * ($params['page'] - 1));\n $qb->setMaxResults($params['page_size']);\n\n $items = [];\n $items = $this->db->fetchAll($qb->getSql(), $search_params); \n\n\n // get total count\n $qb = $this->db->createQueryBuilder();\n $qb->select('count(*) AS total');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n }\n $total = [['total' => 0]];\n $total = $this->db->fetchAll($qb->getSql(), $search_params);\n \n\n // return result\n return [\n 'total' => $total[0]['total'], \n 'items' => $items\n ];\n }", "public function GetParcelsByRegion($start=0, $count=10, WebUI\\GridRegion $region, $owner='00000000-0000-0000-0000-000000000000', $scopeID='00000000-0000-0000-0000-000000000000', $asArray=false){\n\t\t\tif(is_string($start) === true && ctype_digit($start) === true){\n\t\t\t\t$start = (integer)$start;\n\t\t\t}\n\t\t\tif(is_string($count) === true && ctype_digit($count) === true){\n\t\t\t\t$count = (integer)$count;\n\t\t\t}\n\n\t\t\tif(is_integer($start) === false){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be specified as integer.');\n\t\t\t}else if($start < 0){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be greater than or equal to zero.');\n\t\t\t}else if(is_integer($count) === false){\n\t\t\t\tthrow new InvalidArgumentException('Count must be specified as integer.');\n\t\t\t}else if($count < 0){\n\t\t\t\tthrow new InvalidArgumentException('Count must be greater than or equal to zero.');\n\t\t\t}else if(is_string($owner) === false){\n\t\t\t\tthrow new InvalidArgumentException('Owner must be specified as string.');\n\t\t\t}else if(preg_match(self::regex_UUID, $owner) != 1){\n\t\t\t\tthrow new InvalidArgumentException('Owner must be valid UUID.');\n\t\t\t}else if(is_string($scopeID) === false){\n\t\t\t\tthrow new InvalidArgumentException('scopeID must be specified as string.');\n\t\t\t}else if(preg_match(self::regex_UUID, $scopeID) != 1){\n\t\t\t\tthrow new InvalidArgumentException('scopeID must be valid UUID.');\n\t\t\t}\n\n\t\t\t$result = $this->makeCallToAPI('GetParcelsByRegion', true, array(\n\t\t\t\t'Start' => $start,\n\t\t\t\t'Count' => $count,\n\t\t\t\t'Region' => $region->RegionID(),\n\t\t\t\t'Owner' => $owner,\n\t\t\t\t'ScopeID' => $scopeID,\n\t\t\t), array(\n\t\t\t\t'Parcels' => array(\n\t\t\t\t\t'array' => array(self::ParcelResultValidatorArray())\n\t\t\t\t),\n\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t));\n\t\t\tforeach($result->Parcels as $k=>$v){\n\t\t\t\t$result->Parcels[$k] = self::ParcelResult2LandData($v);\n\t\t\t}\n\t\t\treturn $asArray ? $result->Parcels : WebUI\\GetParcelsByRegion::r($this, $start, $result->Total, $region, $owner, $scopeID, $result->Parcels);\n\t\t}", "public function getPaginated();", "public function paginate()\n {\n return $this->configurationRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "public function index()\n {\n /*\n * filter[attribute]\n * limit=100\n * sort[attribute]=desc\n * include[]=property_name\n */\n\n // Laravel Eloquent\n list($regions, $paginator) = $this->_getCollectionAndPaginator(new RegionsRepository());\n\n // Fractal\n $resource = new FractalResource\\Collection($regions, new GenericTransformer());\n $resource->setPaginator(new FractalPaginatorAdapter($paginator));\n\n return response()\n ->json($this->_getResponseData($resource))\n ->setStatusCode(Response::HTTP_OK);\n }", "public function getRegions($criteria = null, PropelPDO $con = null)\n {\n if (null === $this->collRegions || null !== $criteria) {\n if ($this->isNew() && null === $this->collRegions) {\n // return empty collection\n $this->initRegions();\n } else {\n $collRegions = RegionQuery::create(null, $criteria)\n ->filterByEvent($this)\n ->find($con);\n if (null !== $criteria) {\n return $collRegions;\n }\n $this->collRegions = $collRegions;\n }\n }\n\n return $this->collRegions;\n }", "public function listRegions($merchantId, $optParams = [])\n {\n $params = ['merchantId' => $merchantId];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], ListRegionsResponse::class);\n }", "public function index()\n {\n $listAdministrativeRegions = AdministrativeRegion::paginate(5);\n return view('admin.administrative-regions.index', \\compact('listAdministrativeRegions'));\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM (SELECT ROWNUM MY_ROWNUM, MY_TABLE.*\n FROM (SELECT TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max}\n ) WHERE MY_ROWNUM > {$min}\n \";\n \n $sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n \n $result['count'] = $this->_db->fetchOne($sql);\n $rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n \n if (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n $result['rows'][] = $row;\n }\n }\n return $result;\n }", "public function getSelectedRegions()\n\t{\n\t\tif (!$this->hasSelectedRegions()) {\n\t\t\t$regions = array();\n\t\t\tforeach ($this->getSelectedRegionsCollection() as $region) {\n\t\t\t\t$regions[] = $region;\n\t\t\t}\n\t\t\t$this->setSelectedRegions($regions);\n\t\t}\n\t\treturn $this->getData('selected_regions');\n\t}", "public function actionIndex() {\n $searchModel = new RegionSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n $dataFilterCountry = \\common\\models\\address\\Country::getNameArr();\n \n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n 'dataFilterCountry' => $dataFilterCountry,\n ]);\n }", "public function paginatedList($parameters = [], $decodeResponse = true) {\n $response = $this->sendRequest(\n self::METHOD_GET, \n self::$endPoints['list'] . '?' . http_build_query($parameters)\n );\n return ($decodeResponse) ? self::decodeResponse($response) : $response;\n }", "function commonListRelatedRegion() {\n\t\t\t\n\t\t\t$this->gen_contents[\"tot_num_related_region\"] = $this->admin_career_event_model->dbGetCountTonitesClasslist($this->gen_contents['dated']);\n\t\t\t\n\t\t\t$this->gen_contents[\"next_active\"] \t= 0; //1 for enable and 0 for disable\t\t\t\n\t\t\t$this->gen_contents[\"prev_active\"] \t= 0; //1 for enable and 0 for disable\n \n\t\t\t$num_pages = ceil($this->gen_contents[\"tot_num_related_region\"] / $this->gen_contents[\"num_hidden\"])-1;\n\t\t\t$cur_page \t\t\t\t= ceil(($this->gen_contents[\"offset_hidden\"]/$this->gen_contents[\"num_hidden\"]));\n\t\t\tif($cur_page < $num_pages) {\n\t\t\t\t$this->gen_contents[\"next_active\"] = 1;\n\t\t\t} \n\t\t\tif($cur_page > 0) {\n\t\t\t\t$this->gen_contents[\"prev_active\"] = 1;\n\t\t\t}\t\t\t\n\t\t\t$this->gen_contents['image_path'] \t= $this->config->item('image_upload_url').'thumbs/';\n \n\t\t\t$this->gen_contents[\"arr_result\"] \t= $this->admin_career_event_model->dbGetTonitesClasslist($this->gen_contents['dated'],$this->gen_contents[\"num_hidden\"],$this->gen_contents[\"offset_hidden\"]);\n \n\t\t}", "public function rangeToPaginate()\n {\n $pages = array();\n\n if ( $this->lastPage <= $this->maxPagesToList) {\n for ($i = 1; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else if ($this->currentPage <= floor($this->maxPagesToList/2)+1) {\n for ($i = 1; $i <= $this->maxPagesToList; $i++) {\n $pages[] = $i;\n }\n } else if ($this->lastPage <= floor($this->maxPagesToList/2)+$this->currentPage) {\n $begin = $this->lastPage - $this->maxPagesToList + 1;\n for ($i = $begin; $i <= $this->lastPage; $i++) {\n $pages[] = $i;\n }\n } else {\n $begin = $this->currentPage - floor($this->maxPagesToList/2);\n $end = $this->currentPage + floor($this->maxPagesToList/2);\n for ($i = $begin; $i <= $end; $i++) {\n $pages[] = $i;\n }\n }\n return $pages;\n\n }", "public function listRegionAction()\n {\n // init toolbar controls here, because we need to show the panel.\n $this->initToolbarControls();\n $region = $this->createListInnerRegion($_REQUEST);\n $this->assign('listInnerRegion', $region);\n\n // please note that we will get all items in list region since we don't have constraint\n $collection = $this->getCollection();\n\n $this->assignCRUDVars([\n // so here is the number of total items\n 'NumberOfTotalItems' => $collection->queryCount(),\n ]);\n\n // If reactApp (CRUDListApp) is defined, render a template to initialize the React App\n if ($this->reactListApp) {\n return $this->render($this->findTemplatePath('react/list.html'), [\n 'ReactElementId' => uniqid($this->reactListApp),\n 'ReactAppName' => $this->reactListApp,\n 'ReactAppConfig' => $this->buildReactListAppConfig(),\n ]);\n }\n return $this->render($this->findTemplatePath('list.html'), []);\n }", "public function provider_get_region() {\n\t\t$array_provide = array();\n\t\tforeach ( self::ARRAY_REGION as $region ) {\n\t\t\t$expected = str_replace( '_', '-', strtolower( $region ) );\n\t\t\t$array_provide[] = array( $region, $expected );\n\t\t}\n\t\treturn $array_provide;\n\t}", "public static function findAll( $countryid ) {\n\t\t\n \treturn Doctrine_Query::create ()->from ( 'Regions s' )\n ->where('s.country_id = ?', array($countryid))\n \t\t\t\t\t\t\t\t->orderBy('s.name')\n \t\t\t\t\t\t\t\t->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\t\t\n\t}", "public function findAllWithPagination(): LengthAwarePaginator;", "public function findAllWithPagination(): LengthAwarePaginator;", "public function getAllPaginated($params)\n {\n $perPage = isset($params['per_page']) ? $params['per_page'] : self::PER_PAGE;\n $query = $this->model->whereNotNull('id');\n\n $this->attachFilters($params, $query);\n\n return $query->paginate($perPage);\n }", "public function paginate($params)\n {\n $sort_by = isset($params['sort_by']) ? $params['sort_by'] : 'created_at';\n $order = isset($params['order']) ? $params['order'] : 'desc';\n $page_length = isset($params['page_length']) ? $params['page_length'] : config('config.page_length');\n $name = isset($params['name']) ? $params['name'] : '';\n\n return $this->contractor->filterByName($name)->orderBy($sort_by, $order)->paginate($page_length);\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM (SELECT ROWNUM MY_ROWNUM, MY_TABLE.*\n FROM (SELECT TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max}\n ) WHERE MY_ROWNUM > {$min}\n \";\t\n\t\t\n $sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n $result['count'] = $this->_db->fetchOne($sql);\n\n $rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n\t\t\n\t\tif (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n $result['rows'][] = $row;\n }\n }\n\n return $result;\n }", "public function getList($params = array())\n {\n $result = array();\n\n $begin = \"\n SELECT * FROM ( SELECT MY_TABLE.*\n FROM (\n SELECT ROWNUM MY_ROWNUM, TEMP.*\n FROM (\n \";\n $min = (intval($params['page_num']) - 1) * intval($params['page_rows']);\n $max = $min + intval($params['page_rows']);\n $end = \"\n ) TEMP\n ) MY_TABLE\n WHERE ROWNUM <= {$max} \n ) WHERE MY_ROWNUM > {$min}\n \";\n \n\t\t$sql = \"SELECT COUNT(*) FROM ({$this->getData($params)})\";\n $result['count'] = $this->_db->fetchOne($sql);\n\t\t\n\t\t$rows = $this->_db->fetchAll(\"{$begin} {$this->getData($params)} {$end}\");\n\t\t\n\t\tif (!empty($rows)) {\n foreach ($rows as $idx => $row) {\n\t\t\t\t$result['rows'][] = $row;\n }\n }\n\n return $result;\n }", "public function getRegionsByCountryAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $countryId = $request->get('countryId');\n $type = $request->get('type');\n $typeClass = $request->get('typeClass');\n\n $regions = $em->getRepository('AppBundle:Region')->getByCountry($countryId);\n\n $response = $this->render('AppBundle:Location/ajax:regions.html.twig', array(\n 'regions' => $regions,\n 'type' => $type,\n 'typeClass'=> $typeClass\n ))->getContent();\n\n return new Response(json_encode($response));\n }", "public function GetByPaginated($offset, $limit);", "public function reservationsList(Request $request)\n {\n $id = $request->get('id');\n $search = $request->get('search');\n\n $placeReservations = $this->repository->scopeQuery(function ($query) use ($id) {\n return $query->where(['place_id' => $id, 'is_pre_reservation' => false])->orderBy('date', 'ASC');\n })->with('client')->whereHas('client', function($q) use ($search){\n $q->where('name', 'LIKE', '%'.$search.'%');\n $q->orWhere('last_name', 'LIKE', '%'.$search.'%');\n })->paginate(10);\n\n if (request()->wantsJson()) {\n\n return response()->json($placeReservations);\n }\n }", "public function getPaginatedList($offset, $limit, $criteria = array());", "public function index()\n {\n //\n $params=[\n 'title'=>' Regions list',\n 'regions'=>Region::orderBy('id','ASC')->get()];\n\n return view('admin.regions.regions_list')->with($params);\n }", "function getCustomerEngRegion($customer_id)\n {\n /* @changes: intersect of region\n * @author: Sagar Jogi dt: 09/08/2017\n */\n $user=DB::query(\"SELECT r.region FROM \" . CFG::$tblPrefix . \"user AS r WHERE active='1' and r.id=%d\",$_SESSION['user_login']['id']);\n $cust=DB::query(\" SELECT c.region_id as cregion FROM \" . CFG::$tblPrefix . \"user_region AS c WHERE c.user_id=%d\",$customer_id);\n foreach($cust as $k=>$v){\n $abc.=$cust[$k]['cregion'].',';\n }\n $check=DB::query(\"SELECT all_region FROM \" . CFG::$tblPrefix . \"user WHERE id=%d\",$_SESSION['user_login']['id']);\n if($check[0]['all_region']=='1') {\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region r WHERE status='1' and FIND_IN_SET( r.id, '$abc') order by name asc\");\n } else {\n \n \n// pre($abc);exit;\n $userexp= explode(',',$user[0]['region']);\n $custexp= explode(',',$abc);\n \n// pre($cust);exit;\n $result=array_intersect($userexp,$custexp);\n $resimp= implode(',', $result);\n// pre($cust);exit;\n return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r WHERE FIND_IN_SET( r.id, '$resimp')\"); \n }\n /*return DB::query(\"SELECT r.id,r.name FROM \" . CFG::$tblPrefix . \"region AS r LEFT JOIN \" . CFG::$tblPrefix . \"user AS u ON FIND_IN_SET( r.id, u.region ) >0\nWHERE u.id =%d and u.active='1' and r.status='1'\",$customer_id); */\n \n }", "function _get_regions_subregions(){\n $this->gen_contents['regions'] = $this->admin_career_event_model->dbSelectAllRegions();\n $arr_data = $this->admin_career_event_model->dbSelectAllSubRegions();\n $this->gen_contents['raw_subregion']= $arr_data;\n $id \t\t\t\t\t= 0;\n $arr_subregion\t\t\t\t= array();\n\n foreach ($arr_data as $value){\n if($id != $value->regionid){\n $id = $value->regionid;\n $arr_subregion['R'][$id] = array();\n }\n $arr_subregion['R'][$id][] = array('id' =>$value->id,'name'=>$value->sub_name);\n }\n //gets all the region and subregion for the purpose of displaying filter\n //used to diaply subregion using jason array \t\t\t\t\n $this->gen_contents['json_array'] \t= json_encode($arr_subregion);\n\t\t\t\n\t\t}", "public function regions()\n {\n return $this->hasMany('App\\SelectedRegion');\n }", "public function index(Request $request)\n {\n $result = [];\n\n if ($request->has('type') && in_array($request->type, ['province', 'district', 'subdistrict', 'village'])) {\n $result = $this->regionService->list($request->type, $request->parent_id);\n }\n\n return $result;\n }", "public function organizationList(){\n if($this->request->all()){\n $regionIds = array_flatten($this->request->all());\n $sorted = $this->organization->select('id','name')->whereIn('region_id',$regionIds)->get()->sortBy('name');\n return $sorted->values()->all();\n }else{\n $sorted = $this->organization->select('id','name')->get()->sortBy('name');\n return $sorted->values()->all();\n }\n }", "function getRegionsNew() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions WHERE ID LIKE 'WebSite%'\";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->getData($params)->paginate($page_length);\n\t}", "public function paginate($params) {\n\t\t$page_length = gv($params, 'page_length', config('config.page_length'));\n\n\t\treturn $this->getData($params)->paginate($page_length);\n\t}", "public function getRegiones()\n\t{\n\t\t$regiones = $this->Model_Region->getRegiones();\n\t\techo json_encode($regiones);\n\t}", "public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }", "public function getSubegionsByRegionAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $regionId = $request->get('regionId');\n $type = $request->get('type');\n $typeClass = $request->get('typeClass');\n\n $subregions = $em->getRepository('AppBundle:Subregion')->getByRegion($regionId);\n\n $response = $this->render('AppBundle:Location/ajax:subregions.html.twig', array(\n 'subregions' => $subregions,\n 'type' => $type,\n 'typeClass'=> $typeClass\n ))->getContent();\n\n return new Response(json_encode($response));\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "function get_all_pagina_web($params = array())\r\n {\r\n $limit_condition = \"\";\r\n if(isset($params) && !empty($params))\r\n $limit_condition = \" LIMIT \" . $params['offset'] . \",\" . $params['limit'];\r\n \r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n *\r\n\r\n FROM\r\n pagina_web p, idioma i, estado_pagina e, empresa em\r\n\r\n WHERE\r\n p.idioma_id = i.idioma_id\r\n and p.estadopag_id = e.estadopag_id\r\n and p.empresa_id = em.empresa_id\r\n\r\n ORDER BY `pagina_id` DESC\r\n\r\n \" . $limit_condition . \"\r\n \")->result_array();\r\n\r\n return $pagina_web;\r\n }", "static function get_treaties_enabled_regions_in_use() {\n global $wpdb;\n return $wpdb->get_results('SELECT a.* FROM ai_region a INNER JOIN ai_treaty_region b ON a.id = b.id_region GROUP BY a.id ORDER BY a.id');\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_ComputeEngine_Regions_ListRegions_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function regions(): EstatesRegions\n {\n if (is_null($this->regionsEndpoint)) {\n $this->regionsEndpoint = new EstatesRegions($this->api);\n }\n return $this->regionsEndpoint;\n }", "public function GetRegionsInEstate(WebUI\\EstateSettings $Estate, $flags=null, $start=0, $count=null, $sortRegionName=null, $sortLocX=null, $sortLocY=null, $asArray=false){\n\t\t\tif(isset($flags) === false){\n\t\t\t\t$flags = RegionFlags::RegionOnline;\n\t\t\t}\n\t\t\tif(is_bool($asArray) === false){\n\t\t\t\tthrow new InvalidArgumentException('asArray flag must be a boolean.');\n\t\t\t}else if(is_integer($flags) === false){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags argument should be supplied as integer.');\n\t\t\t}else if($flags < 0){\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags cannot be less than zero');\n\t\t\t}else if(RegionFlags::isValid($flags) === false){ // Aurora::Framework::RegionFlags::isValid() does do a check for integerness, but we want to throw a different exception message if it is an integer.\n\t\t\t\tthrow new InvalidArgumentException('RegionFlags value is invalid, aborting call to API');\n\t\t\t}else if(is_integer($start) === false){\n\t\t\t\tthrow new InvalidArgumentException('Start point must be an integer.');\n\t\t\t}else if(isset($count) === true){\n\t\t\t\tif(is_integer($count) === false){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be an integer.');\n\t\t\t\t}else if($count < 1){\n\t\t\t\t\tthrow new InvalidArgumentException('Count must be greater than zero.');\n\t\t\t\t}\n\t\t\t}else if(isset($sortRegionName) === true && is_bool($sortRegionName) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by region name flag must be a boolean.');\n\t\t\t}else if(isset($sortLocX) === true && is_bool($sortLocX) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by x-axis flag must be a boolean.');\n\t\t\t}else if(isset($sortLocY) === true && is_bool($sortLocY) === false){\n\t\t\t\tthrow new InvalidArgumentException('If set, the sort by y-axis flag must be a boolean.');\n\t\t\t}\n\t\t\t$response = array();\n\t\t\t$input = array(\n\t\t\t\t'Estate' => $Estate->EstateID(),\n\t\t\t\t'RegionFlags' => $flags,\n\t\t\t\t'Start' => $start,\n\t\t\t\t'Count' => $count\n\t\t\t);\n\n\t\t\tif(isset($sortRegionName) === true || isset($sortRegionName) === true || isset($sortLocY) === true){\n\t\t\t\t$input['Sort'] = array();\n\t\t\t\tif(isset($sortRegionName) === true){\n\t\t\t\t\t$input['Sort']['RegionName'] = $sortRegionName;\n\t\t\t\t}\n\t\t\t\tif(isset($sortLocX) === true){\n\t\t\t\t\t$input['Sort']['LocX'] = $sortLocX;\n\t\t\t\t}\n\t\t\t\tif(isset($sortLocY) === true){\n\t\t\t\t\t$input['Sort']['LocY'] = $sortLocY;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$has = WebUI\\GetRegions::hasInstance($this, $Estate, $flags, $sortRegionName, $sortLocX, $sortLocY);\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegions', true, $input, array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegionsInEstate::r($this, $Estate, $flags, 0, $start, $has ? null : $result->Total, $sortRegionName, $sortLocX, $sortLocY, $response);\n\t\t}", "public function index()\n {\n $regions = OperatingRegion::paginate(25);\n\n return View::make('admin.operating-regions.index')\n ->with('regions', $regions);\n }", "public function getList($page);", "public function getAll($nbrPages, $parameters)\n {\n return $this->model->with ('ingoing')\n ->orderBy ($parameters['order'], $parameters['direction'])\n ->when ($parameters['active'], function ($query) {\n $query->whereActive (true);\n })->when ($parameters['new'], function ($query) {\n $query->has ('ingoing');\n })->when (auth()->user()->role === 'redac', function ($query) {\n $query->whereHas('user', function ($query) {\n $query->where('users.id', auth()->id());\n });\n })->paginate ($nbrPages);\n }", "function get_all_page_ids()\n {\n }", "public function getCountriesPerRegion();", "public function queryAllSharedPaginated(int $start, int $end)\n {\n $offsetPlaceholder = \":startResult\";\n $limitPlaceholder = \":endResult\";\n $statement = sprintf(\"SELECT %s, %s, %s, %s FROM %s WHERE %s = 1 AND deleted = 0 LIMIT %s OFFSET %s\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[2], static::FIELDS[4], static::TABLE, static::FIELDS[3],\n $limitPlaceholder, $offsetPlaceholder);\n $req = $this->db->prepare($statement);\n\n $req->bindValue($offsetPlaceholder, $start, PDO::PARAM_INT);\n $req->bindValue($limitPlaceholder, $end, PDO::PARAM_INT);\n $req->execute();\n\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "public function index(Request $request)\n {\n $this->regionRepository->pushCriteria(new RequestCriteria($request));\n $regions = $this->regionRepository->all();\n\n return view('admin.regions.index')\n ->with('regions', $regions);\n }", "public function getSearchRootPageIdList() {}", "public function getSearchRootPageIdList() {}", "function getRegionsStub($country)\n{\n return array(\"Kentriki Makedonia\", \"Thraki\", \"Peloponisos\", \"Kriti\");\n}", "public function getRegions($countryIdent = NULL, $subdivisionIdent = NULL) {\n\t\t$params = '';\n\n\t\tif (NULL !== $countryIdent) {\n\t\t\t$params = '?land=' . $countryIdent;\n\t\t}\n\n\t\tif (NULL !== $subdivisionIdent) {\n\t\t\t$params = '?bundesland=' . $subdivisionIdent;\n\t\t}\n\n\t\treturn $this->getData('/objekt/regionen' . $params);\n\t}", "public function getGeoList($params = [])\n {\n $this->sendRequest(\n [\n 'methodName' => 'geo.list',\n 'parameters' => [\n 'limit' => $params['limit'] ?? 10,\n 'regionType' => $params['regionType'] ?? 'all',\n 'lang' => strtoupper(LANGUAGE_ID),\n 'name' => $params['name'] ? ucfirst($params['name']) : ''\n ]\n ]\n );\n\n return $this->result;\n }", "public function countryRegionAction()\n {\n $arrRes = array();\n\n $countryId = $this->getRequest()->getParam('parent');\n $colRegions = Mage::getResourceModel('directory/region_collection')\n ->addCountryFilter($countryId)\n ->load();\n \n\t$arrRegions = $this->_toOptionArray($colRegions);\n if (!empty($arrRegions)) {\n foreach ($arrRegions as $region) {\n $arrRes[] = $region;\n }\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($arrRes));\n }", "public function queryAllPaginated(int $start, int $end)\n {\n $offsetPlaceholder = \":startResult\";\n $limitPlaceholder = \":endResult\";\n $statement = sprintf(\"SELECT %s, %s, %s, %s, %s FROM %s WHERE deleted = 0 LIMIT %s OFFSET %s\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[2], static::FIELDS[3], static::FIELDS[4], static::TABLE,\n $limitPlaceholder, $offsetPlaceholder);\n $req = $this->db->prepare($statement);\n\n $req->bindValue($offsetPlaceholder, ($start - 1), PDO::PARAM_INT);\n $req->bindValue($limitPlaceholder, ($end - $start + 1), PDO::PARAM_INT);\n\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "public function getPaginate ($p_rowsPerPage, $p_currentPage);", "public function getSearch($parameters = array());", "public function listItems($param = null){\n $query = $this->orderBy('id', 'ASC')->paginate(5);\n return $query;\n }", "public function all($param)\n {\n $result = $this->model->newQuery();\n return $result->paginate($param);\n }", "public function search($params)\n {\n $maxPerPage = isset($params['limit']) && in_array($params['limit'], [12, 24, 36]) ? $params['limit'] : 12; // Products per page\n $currentPage = isset($params['p']) ? $params['p'] : 1;\n\n // Build search query\n $boolQuery = new \\Elastica\\Query\\BoolQuery();\n $this->applyQuery($boolQuery, $params);\n $this->applyCategory($boolQuery, $params);\n $this->applyStatus($boolQuery);\n $this->applyPrice($boolQuery, $params);\n $this->applyAttributes($boolQuery, $params);\n $this->applyUser($boolQuery, $params);\n\n $query = new \\Elastica\\Query($boolQuery);\n $this->applyLocation($query, $params);\n $this->applySortAndOrder($query, $params);\n\n $results = $this->finder->findPaginated($query);\n $results->setMaxPerPage($maxPerPage);\n $results->setCurrentPage($currentPage);\n\n return $results;\n }", "public function locations($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'locations', $_query);\r\n }", "public function GetRegionNeighbours($region, $range=128, $scopeID='00000000-0000-0000-0000-000000000000', $start=0, $asArray=false){\n\t\t\tif(is_string($range) === true && ctype_digit($range) === true){\n\t\t\t\t$range = (integer)$range;\n\t\t\t}\n\n\t\t\tif(is_string($region) === false){\n\t\t\t\tthrow new InvalidArgumentException('Region ID must be specified as a string.');\n\t\t\t}else if(preg_match(self::regex_UUID, $region) != 1){\n\t\t\t\tthrow new InvalidArgumentException('Region ID must be a valid UUID.');\n\t\t\t}else if(is_string($scopeID) === false){\n\t\t\t\tthrow new InvalidArgumentException('ScopeID must be specified as a string.');\n\t\t\t}else if(preg_match(self::regex_UUID, $scopeID) != 1){\n\t\t\t\tthrow new InvalidArgumentException('ScopeID must be a valid UUID.');\n\t\t\t}else if(is_integer($range) === false){\n\t\t\t\tthrow new InvalidArgumentException('Range must be specified as integer.');\n\t\t\t}else if($range < 8){\n\t\t\t\tthrow new InvalidArgumentException('Range must be greater than or equal to 8');\n\t\t\t}\n\n\t\t\t$response = array();\n\t\t\t$has = WebUI\\GetRegionNeighbours::hasInstance($this, $region, $range=128, $scopeID='00000000-0000-0000-0000-000000000000');\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegionNeighbours', true, array(\n\t\t\t\t\t\t'RegionID' => $region,\n\t\t\t\t\t\t'ScopeID' => $scopeID,\n\t\t\t\t\t\t'Range' => $range\n\t\t\t\t\t), array(\n\t\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $asArray ? $response : WebUI\\GetRegionNeighbours::r($this, $region, $range=128, $scopeID='00000000-0000-0000-0000-000000000000', $start, $has ? null : $result->Total, $response);\n\t\t}", "function ams_get_amazon_regions() {\n $regions = array(\n 'com.au' => array( 'RegionName' => 'Australia', 'Host' => 'webservices.amazon.com.au', 'RegionCode' => 'us-west-2' ),\n 'com.br' => array( 'RegionName' => 'Brazil', 'Host' => 'webservices.amazon.com.br', 'RegionCode' => 'us-east-1' ),\n 'ca' => array( 'RegionName' => 'Canada', 'Host' => 'webservices.amazon.ca', 'RegionCode' => 'us-east-1' ),\n 'cn' => array( 'RegionName' => 'China', 'Host' => 'webservices.amazon.cn', 'RegionCode' => 'us-west-2' ),\n 'fr' => array( 'RegionName' => 'France', 'Host' => 'webservices.amazon.fr', 'RegionCode' => 'eu-west-1' ),\n 'de' => array( 'RegionName' => 'Germany', 'Host' => 'webservices.amazon.de', 'RegionCode' => 'eu-west-1' ),\n 'in' => array( 'RegionName' => 'India', 'Host' => 'webservices.amazon.in', 'RegionCode' => 'eu-west-1' ),\n 'it' => array( 'RegionName' => 'Italy', 'Host' => 'webservices.amazon.it', 'RegionCode' => 'eu-west-1' ),\n 'jp' => array( 'RegionName' => 'Japan', 'Host' => 'webservices.amazon.co.jp', 'RegionCode' => 'us-west-2' ),\n 'mx' => array( 'RegionName' => 'Mexico', 'Host' => 'webservices.amazon.com.mx', 'RegionCode' => 'us-east-1' ),\n 'nl' => array( 'RegionName' => 'Netherlands', 'Host' => 'webservices.amazon.nl', 'RegionCode' => 'eu-west-1' ),\n 'sa' => array( 'RegionName' => 'Saudi Arabia', 'Host' => 'webservices.amazon.sa', 'RegionCode' => 'eu-west-1' ),\n 'sg' => array( 'RegionName' => 'Singapore', 'Host' => 'webservices.amazon.sg', 'RegionCode' => 'us-west-2' ),\n 'es' => array( 'RegionName' => 'Spain', 'Host' => 'webservices.amazon.es', 'RegionCode' => 'eu-west-1' ),\n 'com.tr' => array( 'RegionName' => 'Turkey', 'Host' => 'webservices.amazon.com.tr', 'RegionCode' => 'eu-west-1' ),\n 'ae' => array( 'RegionName' => 'United Arab Emirates', 'Host' => 'webservices.amazon.ae', 'RegionCode' => 'eu-west-1' ),\n 'co.uk' => array( 'RegionName' => 'United Kingdom', 'Host' => 'webservices.amazon.co.uk', 'RegionCode' => 'eu-west-1' ),\n 'com' => array( 'RegionName' => 'United States', 'Host' => 'webservices.amazon.com', 'RegionCode' => 'us-east-1' )\n );\n\n return $regions;\n}", "public static function obtenerPaginate()\n {\n $rs = self::builder();\n return $rs->paginate(self::$paginate) ?? [];\n }", "static function getInvoices($searchParams, &$totalResults) {\n\t\t\n\t\t\tif (!isset($searchParams['limit'])) {\n\t\t\t\t$searchParams['limit'] = 0;\n\t\t\t}\n\t\t\tif (!isset($searchParams['offset'])) {\n\t\t\t\t$searchParams['offset'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\t$whereConditions = \"\";\n\t\t\t\n\t\t\t\n\t\t\tif ((isset($searchParams['invoiceDateFrom'])) && ($searchParams['invoiceDateFrom'] != '')) {\n\t\t\t\t$whereConditions .= \" AND i.invoice_date >= '\" . DMDatabase::escape($searchParams['invoiceDateFrom']) . \"'\";\n\t\t\t}\n\t\t\tif ((isset($searchParams['invoiceDateTo'])) && ($searchParams['invoiceDateTo'] != '')) {\n\t\t\t\t$whereConditions .= \" AND i.invoice_date <= '\" . DMDatabase::escape($searchParams['invoiceDateTo']) . \"'\";\n\t\t\t}\n\t\t\tif ((isset($searchParams['invoice_archived'])) && ($searchParams['invoice_archived'] > -1)) {\n\t\t\t\t$whereConditions .= ' AND i.invoice_archived = ' . (int) $searchParams['invoice_archived'];\n\t\t\t}\n\t\t\t\n\t\t\t$myQuery = \"\n\t\t\t\tSELECT SQL_CALC_FOUND_ROWS i.*\n\t\t\t\tFROM fh_invoice AS i\n\t\t\t\tWHERE 1 = 1\n\t\t\t\t$whereConditions\n\t\t\t\tORDER BY i.invoice_date DESC, i.invoice_code DESC\n\t\t\t\";\n\t\t\t\n\t\t\t$results = DMDatabase::loadObjectList($myQuery, $searchParams['offset'], $searchParams['limit']);\n\t\t\t\n\t\t\t$totalResults = DMDatabase::loadResult(\"SELECT FOUND_ROWS();\");\n\t\t\t\n\t\t\treturn $results;\n\t\t\t\n\t\t}", "public function getVisibleBlocksPerRegion(array &$cacheable_metadata = []);", "public function indexregion()\n {\n $region=Region::all();\n foreach ($region as $r) {\n $r->pays=Pays::find($r->PAY_NUM);\n //dd($r);\n }\n return view('Region.indexregion', compact('region'));\n }", "public function getMarketplacesPaginator($params = array(), $customParams = null)\n {\n $paginator = Zend_Paginator::factory($this->getMarketplacesSelect($params, $customParams));\n if( !empty($params['page']) )\n {\n $paginator->setCurrentPageNumber($params['page']);\n }\n if( !empty($params['limit']) )\n {\n $paginator->setItemCountPerPage($params['limit']);\n }\n return $paginator;\n }", "function get_all_preferences_by_range($params) {\n $sql = \"SELECT * FROM com_preferences\n WHERE pref_id >= ? AND pref_id <= ?\n ORDER BY pref_group ASC, pref_nm ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getPaginationDataSource();" ]
[ "0.6666061", "0.65811896", "0.6450932", "0.64392364", "0.629342", "0.6120395", "0.61152184", "0.6073787", "0.59615517", "0.5918425", "0.5908692", "0.5877012", "0.5875595", "0.58669007", "0.5859056", "0.5857596", "0.5811992", "0.5809966", "0.5809694", "0.5756056", "0.5728041", "0.5716998", "0.5654972", "0.56381565", "0.5600705", "0.5503954", "0.5488831", "0.546912", "0.5451853", "0.5441716", "0.5434971", "0.53953004", "0.5389309", "0.5385244", "0.537043", "0.53573245", "0.53441626", "0.53356534", "0.53335506", "0.53229564", "0.53113896", "0.53054297", "0.53042567", "0.53042567", "0.5297806", "0.52962154", "0.5295647", "0.52924573", "0.52870536", "0.5286793", "0.52732086", "0.5271087", "0.52477235", "0.52338827", "0.5233806", "0.5224996", "0.52187836", "0.5218748", "0.5198949", "0.51989347", "0.5198083", "0.5198083", "0.51941395", "0.5180925", "0.5167083", "0.5161045", "0.51600766", "0.51560056", "0.51426095", "0.5141247", "0.5117175", "0.5102723", "0.51024234", "0.5090244", "0.5087047", "0.50859195", "0.5079152", "0.50685704", "0.5048125", "0.5048125", "0.5035318", "0.50286496", "0.50234455", "0.50137556", "0.5005755", "0.4999317", "0.49776375", "0.49744767", "0.49741128", "0.4970766", "0.49682492", "0.49566326", "0.49530125", "0.49471533", "0.49466798", "0.49453136", "0.4943686", "0.4941316", "0.49284354", "0.49276716" ]
0.6704238
0
Returns an array of all regions.
public static function all(array $params = array()) { // build query $regionDb = Yadda_Db_Table::getInstance('region'); $select = $regionDb ->select() ->from('region') ->where('status = ?', 'active') ->order('name'); // fetch $regions = $regionDb->fetchAll($select); $return = array(); foreach ($regions as $region) { $return[] = self::toArray($region); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }", "private function getRegions(): array\n {\n try {\n /** @var Regions[] $regions */\n $regions = $this->getDoctrine()\n ->getRepository(Regions::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $regions;\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function getSelectedRegions()\n\t{\n\t\tif (!$this->hasSelectedRegions()) {\n\t\t\t$regions = array();\n\t\t\tforeach ($this->getSelectedRegionsCollection() as $region) {\n\t\t\t\t$regions[] = $region;\n\t\t\t}\n\t\t\t$this->setSelectedRegions($regions);\n\t\t}\n\t\treturn $this->getData('selected_regions');\n\t}", "public function getRegionsIterator()\n {\n return $this->data->getRegions()->getIterator();\n }", "public function provider_get_region() {\n\t\t$array_provide = array();\n\t\tforeach ( self::ARRAY_REGION as $region ) {\n\t\t\t$expected = str_replace( '_', '-', strtolower( $region ) );\n\t\t\t$array_provide[] = array( $region, $expected );\n\t\t}\n\t\treturn $array_provide;\n\t}", "public function getRegions()\n {\n\n $regions = array(\n \"\" => \"Default (empty)\",\n \"us-east-2\"\t\t\t=> \"US East (Ohio)\",\n \"us-east-1\"\t\t\t=> \"US East (N. Virginia)\",\n \"us-west-1\"\t\t\t=> \"US West (N. California)\",\n \"us-west-2\"\t\t\t=> \"US West (Oregon)\",\n //\"ap-east-1\" => \"Asia Pacific (Hong Kong)***\",\n \"ap-south-1\"\t\t=> \"Asia Pacific (Mumbai)\",\n //\"ap-northeast-3\"\t=> \"Asia Pacific (Osaka-Local)****\",\n \"ap-northeast-2\"\t=> \"Asia Pacific (Seoul)\",\n \"ap-southeast-1\"\t=> \"Asia Pacific (Singapore)\",\n \"ap-southeast-2\"\t=> \"Asia Pacific (Sydney)\",\n \"ap-northeast-1\"\t=> \"Asia Pacific (Tokyo)\",\n \"ca-central-1\"\t\t=> \"Canada (Central)\",\n \"cn-north-1\"\t => \"China (Beijing)\",\n \"cn-northwest-1\"\t=> \"China (Ningxia)\",\n \"eu-central-1\"\t\t=> \"EU (Frankfurt)\",\n \"eu-west-1\"\t\t => \"EU (Ireland)\",\n \"eu-west-2\"\t\t => \"EU (London)\",\n \"eu-west-3\"\t\t => \"EU (Paris)\",\n \"eu-north-1\"\t\t=> \"EU (Stockholm)\",\n \"sa-east-1\"\t\t => \"South America (São Paulo)\",\n \"me-south-1\"\t\t=> \"Middle East (Bahrain)\",\n );\n // ***You must enable this Region before you can use it.\n // ****You can use the Asia Pacific (Osaka-Local) Region only in conjunction with the Asia Pacific\n // (Tokyo) Region. To request access to the Asia Pacific (Osaka-Local) Region, contact your sales representative.\n\n return $regions;\n }", "public function getRegions()\n\t{\n\t\t$this->ensureRegionsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_regions),\n\t\t\t$this, '\\PhpExtended\\Gmth\\GmthBridgeRegion');\n\t}", "public function getRegiones()\n\t{\n\t\t$regiones = $this->Model_Region->getRegiones();\n\t\techo json_encode($regiones);\n\t}", "public function get_regions()\n\t{\n\t\t$this->load->model('promo_model');\n\t\t$region= $this->promo_model->regions();\n\t\t\n\t\techo json_encode($region);\n\t}", "function &getAllArray( )\n {\n $db =& eZDB::globalDatabase();\n $region_array = 0;\n $return_array = array();\n \n $db->array_query( $region_array, \"SELECT * FROM eZAddress_Region\n WHERE Removed=0\n ORDER BY Name\" );\n\t\t\t\t\t\t \n foreach ( $region_array as $region )\n {\n $return_array[] = array( \"ID\" => $region[ $db->fieldName( \"ID\" ) ],\n \"CountryID\" => $region[ $db->fieldName( \"CountryID\" ) ],\n \"Abbreviation\" => $region[ $db->fieldName( \"Abbreviation\" ) ],\n\t\t \"Name\" => $region[ $db->fieldName( \"Name\" ) ],\n\t\t\t\t \"HasTax\" => $region[ $db->fieldName( \"HasTax\" ) ],\n\t\t\t\t \"Removed\" => $region[ $db->fieldName( \"Removed\" ) ] );\n\n\n }\n return $return_array;\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public static function getAll()\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT region_id, region_name FROM region\";\n $query = $database->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows\n return $query->fetchAll();\n }", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "function getTheRegionIDs(){\n\t\treturn isEmptyString($this->getRegionIDs()) ? array() : explode(\",\", trim($this->getRegionIDs())); \n\t}", "public static function excelRegionsHeadings()\n {\n return [\n 'Region',\n ];\n }", "function getRegionsNew() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions WHERE ID LIKE 'WebSite%'\";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function GetRegionsInArea($startX, $startY, $endX, $endY, $scopeID='00000000-0000-0000-0000-000000000000', $asArray=false){\n\t\t\t$has = WebUI\\GetRegionsInArea::hasInstance($this, $startX, $startY, $endX, $endY, $scopeID);\n\t\t\t$response = array();\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegionsInArea', true, array(\n\t\t\t\t\t'StartX' => $startX,\n\t\t\t\t\t'StartY' => $startY,\n\t\t\t\t\t'EndX' => $endX,\n\t\t\t\t\t'EndY' => $endY,\n\t\t\t\t\t'ScopeID' => $scopeID\n\t\t\t\t), array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegionsInArea::r($this, $startX, $startY, $endX, $endY, $scopeID, 0, $result->Total, $response);\n\t\t}", "public function getRegioni()\n\t{\n\t\t//Ritorna le regioni, tutte le regioni, TUTTE\n\t\t$query = \"SELECT * FROM regioni\";\n\t\tif($result = parent::query($query))\n\t\t{\n\t\t\t//Controlla che il risultato ottenuto non sia 0, quindi ho ottenuto un risultato\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\t//Fetch_array di tutte le righe del comune\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t//Crea un array associativo (una sorta di matrice)\n\t\t\t\t\t//Due campi, cod_regione e il nome della regione\n\t\t\t\t\t//ritorna alla funzione Ajax l'array appena creato\n\t\t\t\t\t//che conterrà il nostro array associativo delle regioni\n\t\t\t\t\t$regioni[] = array(\n\t\t\t\t\t\t'cod_regione' => $row['cod_regione'],\n\t\t\t\t\t\t'regione' => $row['regione']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn $regioni;\n\t\t\t}\n\t\t}\n\t}", "public static function get_regions_coordinates() {\r\n\r\n\t\treturn array(\r\n\t\t\tSimpleEmailService::AWS_US_EAST_1 => array(\r\n\t\t\t\t'lat' => 38.837392,\r\n\t\t\t\t'lon' => - 77.447313,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_US_WEST_2 => array(\r\n\t\t\t\t'lat' => 45.3573,\r\n\t\t\t\t'lon' => - 122.6068,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_EU_WEST1 => array(\r\n\t\t\t\t'lat' => 53.305494,\r\n\t\t\t\t'lon' => - 7.737649,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_EU_CENTRAL_1 => array(\r\n\t\t\t\t'lat' => 50.1109,\r\n\t\t\t\t'lon' => 8.6821,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_AP_SOUTH_1 => array(\r\n\t\t\t\t'lat' => 19.0760,\r\n\t\t\t\t'lon' => 72.8777,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_AP_SOUTHEAST_1 => array(\r\n\t\t\t\t'lat' => 33.8688,\r\n\t\t\t\t'lon' => 151.2093,\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function getYaCityRegions() {\n\t $arYaRegions=array();\n\t foreach ($this->arRegions as $val){\n\t if( $val[\"GeoRegionType\"]==\"City\" || $val[\"GeoRegionType\"]==\"Village\" ){\n\t $arYaRegions[$val[\"GeoRegionId\"]]=$val[\"GeoRegionName\"];\n\t }\n\t }\n\t asort($arYaRegions);\n\t return $arYaRegions;\n\t}", "public function regions()\n {\n return $this->hasMany('App\\SelectedRegion');\n }", "static function get_treaties_enabled_regions_in_use() {\n global $wpdb;\n return $wpdb->get_results('SELECT a.* FROM ai_region a INNER JOIN ai_treaty_region b ON a.id = b.id_region GROUP BY a.id ORDER BY a.id');\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public function regions()\n {\n return $this->hasMany('Region', 'lot_id');\n }", "public function getCountriesPerRegion();", "public function getTimeZones() {\n\n $regions = array(\n 'Africa' => DateTimeZone::AFRICA,\n 'America' => DateTimeZone::AMERICA,\n 'Antarctica' => DateTimeZone::ANTARCTICA,\n 'Asia' => DateTimeZone::ASIA,\n 'Atlantic' => DateTimeZone::ATLANTIC,\n 'Europe' => DateTimeZone::EUROPE,\n 'Indian' => DateTimeZone::INDIAN,\n 'Pacific' => DateTimeZone::PACIFIC\n );\n\n $tzlist = array();\n foreach ($regions as $name => $mask) {\n $tzlist = array_merge($tzlist, DateTimeZone::listIdentifiers($mask));\n }\n\n return $tzlist;\n\n }", "function getRegions() {\n global $myPDODB, $whereFilter;\n $output = array();\n\n $whereLocal = array();\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT r.name AS 'name', r.id AS 'id', COUNT( s.id ) AS 'number', 'region' AS 'type'\nFROM regions AS r\nJOIN countries AS c ON r.id = c.region_id\nJOIN students AS s ON c.id = s.destination_country \n$whereClause\nGROUP BY r.name\nORDER BY r.name;\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n if ($result) {\n $regions = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($regions as $region) {\n // get the country details for each region\n $countries = getCountries($region['id']);\n array_push($output, array(\"item_id\" => $region['id'] * 100000, \"fixed\" => true, \"name\" => $region['name'], \"number\" => $region['number'], \"type\" => $region['type'], \"children\" => $countries));\n }\n }\n\n // add the regions to the output array\n return $output;\n}", "function regionList($where = '')\n {\n $arrClms = array(\n 'pkRegionID',\n 'RegionName',\n );\n $varOrderBy = 'RegionName ASC ';\n $arrRes = $this->select(TABLE_REGION, $arrClms, $where);\n //pre($arrRes);\n return $arrRes;\n }", "public function regions(): EstatesRegions\n {\n if (is_null($this->regionsEndpoint)) {\n $this->regionsEndpoint = new EstatesRegions($this->api);\n }\n return $this->regionsEndpoint;\n }", "function _get_regions_subregions(){\n $this->gen_contents['regions'] = $this->admin_career_event_model->dbSelectAllRegions();\n $arr_data = $this->admin_career_event_model->dbSelectAllSubRegions();\n $this->gen_contents['raw_subregion']= $arr_data;\n $id \t\t\t\t\t= 0;\n $arr_subregion\t\t\t\t= array();\n\n foreach ($arr_data as $value){\n if($id != $value->regionid){\n $id = $value->regionid;\n $arr_subregion['R'][$id] = array();\n }\n $arr_subregion['R'][$id][] = array('id' =>$value->id,'name'=>$value->sub_name);\n }\n //gets all the region and subregion for the purpose of displaying filter\n //used to diaply subregion using jason array \t\t\t\t\n $this->gen_contents['json_array'] \t= json_encode($arr_subregion);\n\t\t\t\n\t\t}", "public function getRegionCases($region)\n {\n $cases = array() ;\n// $i = 1 ;\n foreach($this->cases as $case) {\n if($case->getRegion() == $region) {\n// $cases[$i] = $case ;\n $cases[] = $case ;\n// $i++ ;\n }\n }\n return $cases ;\n }", "public function ranges()\n {\n return [];\n }", "public function callRegions(array $params = array())\n {\n return $this->call('objekt/regionen', $params);\n }", "public static function getRegionOptions() {\n $file = fopen(drupal_get_path('module', 'smart_content_smart_ip') . '/data/region_codes.csv', \"r\");\n $region_codes = [];\n while (!feof($file)) {\n $regions = fgetcsv($file);\n if (!empty($regions[2])) {\n $country_name = self::getCountryNameFromCode($regions[0]);\n $region_codes[$country_name][$regions[2]] = $regions[2];\n }\n }\n ksort($region_codes);\n foreach ($region_codes as $key => $value) {\n ksort($value);\n $region_codes[$key] = $value;\n }\n return $region_codes;\n }", "public function getRegions($criteria = null, PropelPDO $con = null)\n {\n if (null === $this->collRegions || null !== $criteria) {\n if ($this->isNew() && null === $this->collRegions) {\n // return empty collection\n $this->initRegions();\n } else {\n $collRegions = RegionQuery::create(null, $criteria)\n ->filterByEvent($this)\n ->find($con);\n if (null !== $criteria) {\n return $collRegions;\n }\n $this->collRegions = $collRegions;\n }\n }\n\n return $this->collRegions;\n }", "abstract public function region();", "public function get_region_categories()\n\t{\n\t\t\n\t\treturn null;\n\t\t\t\n\t}", "public function regions()\n {\n return $this->hasManyThrough(FirmLocation::class, CandidateLocation::class, 'candidate_id', 'id', 'id' , 'location_id');\n }", "private function allCountries()\n {\n $countries = [];\n $isos = $this->countryIso();\n foreach ($isos as $iso) {\n $path = __DIR__ . '/config/geography/' . $iso . '.php';\n $countries[$iso] = require $path;\n }\n\n return $countries;\n }", "public function regionlist(){\n if($this->request->all()){\n $id = array_flatten($this->request->all());\n $sorted = $this->region->select('id','region')->whereIn('id',$id)->where('status',1)->get()->sortBy('region');\n }else{\n $sorted = $this->region->select('id','region')->where('status',1)->get()->sortBy('region');\n }\n return $sorted->values()->all();\n }", "function getAreas () {\n return $this->templateParser->getAreas();\n }", "public function Region()\n {\n $this->_Region->ClearAllOptions();\n return $this->_Region;\n }", "public static function region() {\n\t\treturn static::randomElement(static::$regionNames);\n\t}", "function getRegionsStub($country)\n{\n return array(\"Kentriki Makedonia\", \"Thraki\", \"Peloponisos\", \"Kriti\");\n}", "function getAreas()\n {\n if($this->initAdapter === false){\n $this->initAdapters();\n }\n return $this->areas;\n }", "public function test_get_regions() {\n\t\t$s3_helper = new S3_helper();\n\t\t$this->assertEquals( self::ARRAY_REGION, $s3_helper->get_regions() );\n\t}", "public function toArray(){\n $ret = array();\n foreach($this->zones as $num=>$zone){\n $ret[$num] = $zone->toArray();\n }\n return $ret;\n }", "public function getAreas(): AreasCollection;", "public static function OptAllTowns()\n {\n $data = Town::find()->orderBy('region_id')->with('region')->all();\n $region = ArrayHelper::map($data,'region_id','region.name');\n\n $allarr = [];\n foreach ($region as $key=>$val)\n {\n $arr = [];\n foreach ($data as $value)\n {\n if ($value->region_id==$key)\n {\n $arr[$value->id] = $value->name;\n }\n }\n $allarr[$val] = $arr;\n }\n return $allarr;\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "public function getAllBlocks()\n\t{\n\t\treturn $this->m_regionBlocks;\n\t}", "public function regions(Request $request): RegionCollection\n {\n return RegionCollection::make(Region::query()->with('translates')->paginate($request->get('perPage') ?? 50));\n }", "protected function updateRegions()\n {\n $regions = [\n ['_stateId' => 1, 'name' => 'Almería'],\n ['_stateId' => 1, 'name' => 'Cádiz'],\n ['_stateId' => 1, 'name' => 'Córdoba'],\n ['_stateId' => 1, 'name' => 'Granada'],\n ['_stateId' => 1, 'name' => 'Huelva'],\n ['_stateId' => 1, 'name' => 'Jaén'],\n ['_stateId' => 1, 'name' => 'Málaga'],\n ['_stateId' => 1, 'name' => 'Sevilla'],\n ['_stateId' => 2, 'name' => 'Huesca'],\n ['_stateId' => 2, 'name' => 'Teruel'],\n ['_stateId' => 2, 'name' => 'Zaragoza'],\n ['_stateId' => 3, 'name' => 'Asturias'],\n ['_stateId' => 4, 'name' => 'Islas Baleares'],\n ['_stateId' => 5, 'name' => 'Las Palmas'],\n ['_stateId' => 5, 'name' => 'Santa Cruz de Tenerife'],\n ['_stateId' => 6, 'name' => 'Cantabria'],\n ['_stateId' => 7, 'name' => 'Ávila'],\n ['_stateId' => 7, 'name' => 'Burgos'],\n ['_stateId' => 7, 'name' => 'León'],\n ['_stateId' => 7, 'name' => 'Palencia'],\n ['_stateId' => 7, 'name' => 'Salamanca'],\n ['_stateId' => 7, 'name' => 'Segovia'],\n ['_stateId' => 7, 'name' => 'Soria'],\n ['_stateId' => 7, 'name' => 'Valladolid'],\n ['_stateId' => 7, 'name' => 'Zamora'],\n ['_stateId' => 8, 'name' => 'Albacete'],\n ['_stateId' => 8, 'name' => 'Ciudad Real'],\n ['_stateId' => 8, 'name' => 'Cuenca'],\n ['_stateId' => 8, 'name' => 'Guadalajara'],\n ['_stateId' => 8, 'name' => 'Toledo'],\n ['_stateId' => 9, 'name' => 'Barcelona'],\n ['_stateId' => 9, 'name' => 'Girona'],\n ['_stateId' => 9, 'name' => 'Lleida'],\n ['_stateId' => 9, 'name' => 'Tarragona'],\n ['_stateId' => 10, 'name' => 'Alicante'],\n ['_stateId' => 10, 'name' => 'Castellón'],\n ['_stateId' => 10, 'name' => 'Valencia'],\n ['_stateId' => 11, 'name' => 'Badajoz'],\n ['_stateId' => 11, 'name' => 'Cáceres'],\n ['_stateId' => 12, 'name' => 'A Coruña'],\n ['_stateId' => 12, 'name' => 'Lugo'],\n ['_stateId' => 12, 'name' => 'Ourense'],\n ['_stateId' => 12, 'name' => 'Pontevedra'],\n ['_stateId' => 13, 'name' => 'Madrid'],\n ['_stateId' => 14, 'name' => 'Murcia'],\n ['_stateId' => 15, 'name' => 'Navarra'],\n ['_stateId' => 16, 'name' => 'Álava'],\n ['_stateId' => 16, 'name' => 'Bizkaia'],\n ['_stateId' => 16, 'name' => 'Gipuzkoa'],\n ['_stateId' => 17, 'name' => 'La Rioja'],\n ['_stateId' => 18, 'name' => 'Ceuta'],\n ['_stateId' => 19, 'name' => 'Melilla']\n ];\n\n foreach ($regions as $rData) {\n $region = Region::findOne([\n 'name' => $rData['name'],\n ]);\n $region->state_id = $rData['_stateId'];\n if ($region->save() === false) {\n throw new SaveException($region);\n }\n }\n }", "public static function get_regions_names() {\r\n\r\n\t\treturn array(\r\n\t\t\tSimpleEmailService::AWS_US_EAST_1 => esc_html__( 'US East (N. Virginia)', 'wp-mail-smtp-pro' ),\r\n\t\t\tSimpleEmailService::AWS_US_WEST_2 => esc_html__( 'US West (Oregon)', 'wp-mail-smtp-pro' ),\r\n\t\t\tSimpleEmailService::AWS_EU_WEST1 => esc_html__( 'EU (Ireland)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_EU_CENTRAL_1 => esc_html__( 'EU (Frankfurt)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_AP_SOUTH_1 => esc_html__( 'Asia Pacific (Mumbai)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_AP_SOUTHEAST_1 => esc_html__( 'Asia Pacific (Sydney)', 'wp-mail-smtp-pro' ),\r\n\t\t);\r\n\t}", "public function getRegion(): RegionInterface;", "public function regionList(): Response\n {\n $player = $this->getPlayer();\n $regions = $player->getWorldRegions();\n\n // GameUnitType 1 = Buildings\n $gameUnitType = $this->gameUnitTypeRepository->find(1);\n\n foreach ($regions as $region) {\n $region->buildingsInConstruction = $this->constructionActionService->getCountGameUnitsInConstruction($region, $gameUnitType);\n $region->buildings = $this->constructionActionService->getCountGameUnitsInWorldRegion($region, $gameUnitType);\n }\n\n return $this->render('game/regionList.html.twig', [\n 'regions' => $regions,\n 'player' => $player,\n 'mapUrl' => $this->getMapUrl(),\n ]);\n }", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function all(): array;", "public function index()\n {\n return view('backend.region.index')->withRegions($this->region->getForDataTable()->paginate(10));\n }", "public function listRegions($merchantId, $optParams = [])\n {\n $params = ['merchantId' => $merchantId];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], ListRegionsResponse::class);\n }", "function &getAll( $as_object = true, $search = \"\", $offset = 0, $max = -1 )\n {\n $db =& eZDB::globalDatabase();\n\n $region_array = 0;\n $return_array = array();\n \n if ( $max >= 0 && is_numeric( $offset ) && is_numeric( $max ) )\n {\n $limit = array( \"Limit\" => $max,\n \"Offset\" => $offset );\n }\n\n if ( !empty( $search ) )\n {\n $query = new eZQuery( array( \"Name\", \"Abbreviation\" ), $search );\n $search_arg = \"AND \" . $query->buildQuery();\n// $search_arg = \"WHERE Name like '%$search%'\";\n }\n\n if ( $as_object )\n $select = \"*\";\n else\n $select = \"ID\";\n\n $db->array_query( $region_array, \"SELECT $select FROM eZAddress_Region\n WHERE Removed=0 $search_arg\n ORDER BY Name\", $limit );\n\t\t\n if ( $as_object )\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = new eZRegion( $region[ $db->fieldName( \"ID\" ) ] );\n }\n }\n else\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = $region[ $db->fieldName( \"ID\" ) ];\n }\n }\n\t\t\n return $return_array;\n\n }", "function AllIntervals() {\r\n\r\n\t# return the complete NvP interval array\r\n\treturn $this->intervals;\r\n\r\n# end function\r\n}", "public function all() : array\n {\n return $this->container();\n }", "public function getStates() {\n $stateList = array();\n \n if (!empty($this->billing_country)) {\n /*\n * PCM\n */\n $stateList = Subregion::model()->findAll('region_id=\"' . $this->billing_country . '\"');\n\n $stateList = CHtml::listData($stateList, 'name', 'name');\n \n }\n return $stateList;\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "public static function findAll( $countryid ) {\n\t\t\n \treturn Doctrine_Query::create ()->from ( 'Regions s' )\n ->where('s.country_id = ?', array($countryid))\n \t\t\t\t\t\t\t\t->orderBy('s.name')\n \t\t\t\t\t\t\t\t->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\t\t\n\t}", "public function convertRegionsintoArray($geoData){\n $globallyAllowedRegions = array();\n array_walk_recursive($geoData, function($v, $k) use(&$globallyAllowedRegions){\n array_push($globallyAllowedRegions, $v);\n });\n return $globallyAllowedRegions;\n }", "public static function shipping_map() {\n\n\t\t$countryRegions = array();\n\t\t$regions = Region_Shipping::get();\n\t\tif ($regions && $regions->exists()) {\n\n\t\t\tforeach ($regions as $region) {\n\t\t\t\t$country = $region->Country();\n\t\t\t\t$countryRegions[$country->Code][$region->Code] = $region->Title;\n\t\t\t}\n\t\t}\n\t\treturn $countryRegions;\n\t}", "public function getRegistryArray() {\n return $this->_registryArray;\n }", "function getMap()\n {\n return array();\n }", "public function regions()\n {\n return $this->belongsToMany('Villato\\Region', 'company_region_product', 'product_id', 'region_id');\n }", "public static function getAll() : array {\n return self::$objects;\n }", "private function getOptionItems()\n {\n $region = new RegionRepository();\n return [\n 'regionItems' => ['' => __('crud.option.region_placeholder')] + $region->pluck()\n ];\n }", "public static function getAllAsArray()\n {\n return [\n self::EN_GB,\n self::DE_DE,\n self::ES_ES,\n self::FR_FR,\n self::IT_IT,\n self::PL_PL,\n self::PT_PT,\n self::RU_RU,\n self::KO_KR,\n self::EN_US,\n self::ZH_TW,\n self::PT_BR,\n self::ES_MX,\n ];\n }", "public function index()\n {\n $regions = Region::paginate(25);\n\n return view('regions.index', compact('regions'));\n }", "public static function getLocations(): array\n {\n return static::$locations;\n }", "public function all()\n\t{\n\t\treturn $this->getArray();\n\t}", "public function getBackendAreas(): AreasCollection;", "public function getTerritoryList() {\n return $this->_get(5);\n }", "public function getPopulation() : array;", "public function countryRegionAction()\n {\n $arrRes = array();\n\n $countryId = $this->getRequest()->getParam('parent');\n $colRegions = Mage::getResourceModel('directory/region_collection')\n ->addCountryFilter($countryId)\n ->load();\n \n\t$arrRegions = $this->_toOptionArray($colRegions);\n if (!empty($arrRegions)) {\n foreach ($arrRegions as $region) {\n $arrRes[] = $region;\n }\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($arrRes));\n }" ]
[ "0.83330953", "0.8279045", "0.8130707", "0.79290026", "0.7450753", "0.73934555", "0.7266118", "0.72426546", "0.7239433", "0.7148533", "0.71271944", "0.71066576", "0.70308644", "0.697075", "0.6964486", "0.68218553", "0.67834324", "0.6626281", "0.657984", "0.6563723", "0.6532492", "0.65082026", "0.65041214", "0.6444681", "0.6328969", "0.62943023", "0.6282496", "0.6250794", "0.6237052", "0.62198454", "0.6208996", "0.62028533", "0.618056", "0.6159059", "0.6155852", "0.61534", "0.6147687", "0.6103893", "0.60970396", "0.60955524", "0.60907316", "0.6082846", "0.60683984", "0.6067244", "0.6038449", "0.6034272", "0.6023366", "0.60187984", "0.59895545", "0.59733033", "0.5964707", "0.59643704", "0.5954433", "0.59533054", "0.5951542", "0.5943978", "0.5938272", "0.59019935", "0.58802575", "0.5864669", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.5847918", "0.583522", "0.58325845", "0.5826522", "0.58190465", "0.5809204", "0.5798992", "0.57903147", "0.57903147", "0.57882154", "0.5781716", "0.57761735", "0.5761579", "0.5754141", "0.57436883", "0.57374895", "0.57301253", "0.5729981", "0.5719348", "0.5709007", "0.56936157", "0.5687857", "0.5678837", "0.5676237", "0.56652266" ]
0.70869803
12
Returns an associative array (ID => name) of all regions.
public static function index($addEmpty = false) { $regionDb = Yadda_Db_Table::getInstance('region'); $regions = $regionDb->fetchAll(null, 'name'); $return = (bool) $addEmpty === true ? array('' => '') : array(); foreach ($regions as $region) { $return[$region->id] = $region->name; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function getRegions() {\n $query = <<<SQL\n SELECT\n *\n FROM\n region\nSQL;\n\t\t\n\t\treturn $this->DB->execute($query);\n }", "public static function get_all_regions() {\r\n $DB = new \\Nefuzz\\Php\\DBC();\r\n $result = ($DB)->query_to_array(\"\r\n SELECT *\r\n FROM regions;\r\n \",'',[]);\r\n $DB->quit();\r\n return $result;\r\n }", "public function getRegions()\n {\n return $this->regions;\n }", "private function getRegions(): array\n {\n try {\n /** @var Regions[] $regions */\n $regions = $this->getDoctrine()\n ->getRepository(Regions::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $regions;\n }", "public static function getAll()\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT region_id, region_name FROM region\";\n $query = $database->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows\n return $query->fetchAll();\n }", "function getRegionsNew() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions WHERE ID LIKE 'WebSite%'\";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function get_regions()\n\t{\n\t\t$this->load->model('promo_model');\n\t\t$region= $this->promo_model->regions();\n\t\t\n\t\techo json_encode($region);\n\t}", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function getRegiones()\n\t{\n\t\t$regiones = $this->Model_Region->getRegiones();\n\t\techo json_encode($regiones);\n\t}", "public function getRegions()\n {\n\n $regions = array(\n \"\" => \"Default (empty)\",\n \"us-east-2\"\t\t\t=> \"US East (Ohio)\",\n \"us-east-1\"\t\t\t=> \"US East (N. Virginia)\",\n \"us-west-1\"\t\t\t=> \"US West (N. California)\",\n \"us-west-2\"\t\t\t=> \"US West (Oregon)\",\n //\"ap-east-1\" => \"Asia Pacific (Hong Kong)***\",\n \"ap-south-1\"\t\t=> \"Asia Pacific (Mumbai)\",\n //\"ap-northeast-3\"\t=> \"Asia Pacific (Osaka-Local)****\",\n \"ap-northeast-2\"\t=> \"Asia Pacific (Seoul)\",\n \"ap-southeast-1\"\t=> \"Asia Pacific (Singapore)\",\n \"ap-southeast-2\"\t=> \"Asia Pacific (Sydney)\",\n \"ap-northeast-1\"\t=> \"Asia Pacific (Tokyo)\",\n \"ca-central-1\"\t\t=> \"Canada (Central)\",\n \"cn-north-1\"\t => \"China (Beijing)\",\n \"cn-northwest-1\"\t=> \"China (Ningxia)\",\n \"eu-central-1\"\t\t=> \"EU (Frankfurt)\",\n \"eu-west-1\"\t\t => \"EU (Ireland)\",\n \"eu-west-2\"\t\t => \"EU (London)\",\n \"eu-west-3\"\t\t => \"EU (Paris)\",\n \"eu-north-1\"\t\t=> \"EU (Stockholm)\",\n \"sa-east-1\"\t\t => \"South America (São Paulo)\",\n \"me-south-1\"\t\t=> \"Middle East (Bahrain)\",\n );\n // ***You must enable this Region before you can use it.\n // ****You can use the Asia Pacific (Osaka-Local) Region only in conjunction with the Asia Pacific\n // (Tokyo) Region. To request access to the Asia Pacific (Osaka-Local) Region, contact your sales representative.\n\n return $regions;\n }", "public function provider_get_region() {\n\t\t$array_provide = array();\n\t\tforeach ( self::ARRAY_REGION as $region ) {\n\t\t\t$expected = str_replace( '_', '-', strtolower( $region ) );\n\t\t\t$array_provide[] = array( $region, $expected );\n\t\t}\n\t\treturn $array_provide;\n\t}", "function getRegions() {\n global $myPDODB, $whereFilter;\n $output = array();\n\n $whereLocal = array();\n $whereClause = getWhereClause($whereLocal);\n\n $sql = \"SELECT r.name AS 'name', r.id AS 'id', COUNT( s.id ) AS 'number', 'region' AS 'type'\nFROM regions AS r\nJOIN countries AS c ON r.id = c.region_id\nJOIN students AS s ON c.id = s.destination_country \n$whereClause\nGROUP BY r.name\nORDER BY r.name;\";\n\n $sth = $myPDODB->prepare($sql);\n $result = $sth->execute();\n\n if ($result) {\n $regions = $sth->fetchAll(PDO::FETCH_ASSOC);\n\n foreach ($regions as $region) {\n // get the country details for each region\n $countries = getCountries($region['id']);\n array_push($output, array(\"item_id\" => $region['id'] * 100000, \"fixed\" => true, \"name\" => $region['name'], \"number\" => $region['number'], \"type\" => $region['type'], \"children\" => $countries));\n }\n }\n\n // add the regions to the output array\n return $output;\n}", "function &getAllArray( )\n {\n $db =& eZDB::globalDatabase();\n $region_array = 0;\n $return_array = array();\n \n $db->array_query( $region_array, \"SELECT * FROM eZAddress_Region\n WHERE Removed=0\n ORDER BY Name\" );\n\t\t\t\t\t\t \n foreach ( $region_array as $region )\n {\n $return_array[] = array( \"ID\" => $region[ $db->fieldName( \"ID\" ) ],\n \"CountryID\" => $region[ $db->fieldName( \"CountryID\" ) ],\n \"Abbreviation\" => $region[ $db->fieldName( \"Abbreviation\" ) ],\n\t\t \"Name\" => $region[ $db->fieldName( \"Name\" ) ],\n\t\t\t\t \"HasTax\" => $region[ $db->fieldName( \"HasTax\" ) ],\n\t\t\t\t \"Removed\" => $region[ $db->fieldName( \"Removed\" ) ] );\n\n\n }\n return $return_array;\n }", "public function getSelectedRegions()\n\t{\n\t\tif (!$this->hasSelectedRegions()) {\n\t\t\t$regions = array();\n\t\t\tforeach ($this->getSelectedRegionsCollection() as $region) {\n\t\t\t\t$regions[] = $region;\n\t\t\t}\n\t\t\t$this->setSelectedRegions($regions);\n\t\t}\n\t\treturn $this->getData('selected_regions');\n\t}", "public function getRegionsIterator()\n {\n return $this->data->getRegions()->getIterator();\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public static function get_regions_names() {\r\n\r\n\t\treturn array(\r\n\t\t\tSimpleEmailService::AWS_US_EAST_1 => esc_html__( 'US East (N. Virginia)', 'wp-mail-smtp-pro' ),\r\n\t\t\tSimpleEmailService::AWS_US_WEST_2 => esc_html__( 'US West (Oregon)', 'wp-mail-smtp-pro' ),\r\n\t\t\tSimpleEmailService::AWS_EU_WEST1 => esc_html__( 'EU (Ireland)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_EU_CENTRAL_1 => esc_html__( 'EU (Frankfurt)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_AP_SOUTH_1 => esc_html__( 'Asia Pacific (Mumbai)', 'wp-mail-smtp-pro' ),\r\n\t\t\t// SimpleEmailService::AWS_AP_SOUTHEAST_1 => esc_html__( 'Asia Pacific (Sydney)', 'wp-mail-smtp-pro' ),\r\n\t\t);\r\n\t}", "protected function updateRegions()\n {\n $regions = [\n ['_stateId' => 1, 'name' => 'Almería'],\n ['_stateId' => 1, 'name' => 'Cádiz'],\n ['_stateId' => 1, 'name' => 'Córdoba'],\n ['_stateId' => 1, 'name' => 'Granada'],\n ['_stateId' => 1, 'name' => 'Huelva'],\n ['_stateId' => 1, 'name' => 'Jaén'],\n ['_stateId' => 1, 'name' => 'Málaga'],\n ['_stateId' => 1, 'name' => 'Sevilla'],\n ['_stateId' => 2, 'name' => 'Huesca'],\n ['_stateId' => 2, 'name' => 'Teruel'],\n ['_stateId' => 2, 'name' => 'Zaragoza'],\n ['_stateId' => 3, 'name' => 'Asturias'],\n ['_stateId' => 4, 'name' => 'Islas Baleares'],\n ['_stateId' => 5, 'name' => 'Las Palmas'],\n ['_stateId' => 5, 'name' => 'Santa Cruz de Tenerife'],\n ['_stateId' => 6, 'name' => 'Cantabria'],\n ['_stateId' => 7, 'name' => 'Ávila'],\n ['_stateId' => 7, 'name' => 'Burgos'],\n ['_stateId' => 7, 'name' => 'León'],\n ['_stateId' => 7, 'name' => 'Palencia'],\n ['_stateId' => 7, 'name' => 'Salamanca'],\n ['_stateId' => 7, 'name' => 'Segovia'],\n ['_stateId' => 7, 'name' => 'Soria'],\n ['_stateId' => 7, 'name' => 'Valladolid'],\n ['_stateId' => 7, 'name' => 'Zamora'],\n ['_stateId' => 8, 'name' => 'Albacete'],\n ['_stateId' => 8, 'name' => 'Ciudad Real'],\n ['_stateId' => 8, 'name' => 'Cuenca'],\n ['_stateId' => 8, 'name' => 'Guadalajara'],\n ['_stateId' => 8, 'name' => 'Toledo'],\n ['_stateId' => 9, 'name' => 'Barcelona'],\n ['_stateId' => 9, 'name' => 'Girona'],\n ['_stateId' => 9, 'name' => 'Lleida'],\n ['_stateId' => 9, 'name' => 'Tarragona'],\n ['_stateId' => 10, 'name' => 'Alicante'],\n ['_stateId' => 10, 'name' => 'Castellón'],\n ['_stateId' => 10, 'name' => 'Valencia'],\n ['_stateId' => 11, 'name' => 'Badajoz'],\n ['_stateId' => 11, 'name' => 'Cáceres'],\n ['_stateId' => 12, 'name' => 'A Coruña'],\n ['_stateId' => 12, 'name' => 'Lugo'],\n ['_stateId' => 12, 'name' => 'Ourense'],\n ['_stateId' => 12, 'name' => 'Pontevedra'],\n ['_stateId' => 13, 'name' => 'Madrid'],\n ['_stateId' => 14, 'name' => 'Murcia'],\n ['_stateId' => 15, 'name' => 'Navarra'],\n ['_stateId' => 16, 'name' => 'Álava'],\n ['_stateId' => 16, 'name' => 'Bizkaia'],\n ['_stateId' => 16, 'name' => 'Gipuzkoa'],\n ['_stateId' => 17, 'name' => 'La Rioja'],\n ['_stateId' => 18, 'name' => 'Ceuta'],\n ['_stateId' => 19, 'name' => 'Melilla']\n ];\n\n foreach ($regions as $rData) {\n $region = Region::findOne([\n 'name' => $rData['name'],\n ]);\n $region->state_id = $rData['_stateId'];\n if ($region->save() === false) {\n throw new SaveException($region);\n }\n }\n }", "function getTheRegionIDs(){\n\t\treturn isEmptyString($this->getRegionIDs()) ? array() : explode(\",\", trim($this->getRegionIDs())); \n\t}", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FULL_NAME])\n ->distinct()\n ->where('region', '!=', \" \")\n ->orderBy(self::C_STATE)\n ->get();\n\n foreach ($values as $value) {\n $states[$value->state] = $value->stateFullName;\n }\n\n return $states;\n }", "public function regions()\n {\n return $this->hasMany('App\\SelectedRegion');\n }", "function regionList($where = '')\n {\n $arrClms = array(\n 'pkRegionID',\n 'RegionName',\n );\n $varOrderBy = 'RegionName ASC ';\n $arrRes = $this->select(TABLE_REGION, $arrClms, $where);\n //pre($arrRes);\n return $arrRes;\n }", "public static function all(array $params = array()) {\n\t\t// build query\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region')\n\t\t\t->where('status = ?', 'active')\n\t\t\t->order('name');\n\t\t\n\t\t// fetch\n\t\t$regions = $regionDb->fetchAll($select);\n\t\t$return = array();\n\t\tforeach ($regions as $region) {\n\t\t\t$return[] = self::toArray($region);\n\t\t}\n\t\treturn $return;\n\t}", "function _get_regions_subregions(){\n $this->gen_contents['regions'] = $this->admin_career_event_model->dbSelectAllRegions();\n $arr_data = $this->admin_career_event_model->dbSelectAllSubRegions();\n $this->gen_contents['raw_subregion']= $arr_data;\n $id \t\t\t\t\t= 0;\n $arr_subregion\t\t\t\t= array();\n\n foreach ($arr_data as $value){\n if($id != $value->regionid){\n $id = $value->regionid;\n $arr_subregion['R'][$id] = array();\n }\n $arr_subregion['R'][$id][] = array('id' =>$value->id,'name'=>$value->sub_name);\n }\n //gets all the region and subregion for the purpose of displaying filter\n //used to diaply subregion using jason array \t\t\t\t\n $this->gen_contents['json_array'] \t= json_encode($arr_subregion);\n\t\t\t\n\t\t}", "public static function OptAllTowns()\n {\n $data = Town::find()->orderBy('region_id')->with('region')->all();\n $region = ArrayHelper::map($data,'region_id','region.name');\n\n $allarr = [];\n foreach ($region as $key=>$val)\n {\n $arr = [];\n foreach ($data as $value)\n {\n if ($value->region_id==$key)\n {\n $arr[$value->id] = $value->name;\n }\n }\n $allarr[$val] = $arr;\n }\n return $allarr;\n }", "public function regionlist(){\n if($this->request->all()){\n $id = array_flatten($this->request->all());\n $sorted = $this->region->select('id','region')->whereIn('id',$id)->where('status',1)->get()->sortBy('region');\n }else{\n $sorted = $this->region->select('id','region')->where('status',1)->get()->sortBy('region');\n }\n return $sorted->values()->all();\n }", "public function getRegioni()\n\t{\n\t\t//Ritorna le regioni, tutte le regioni, TUTTE\n\t\t$query = \"SELECT * FROM regioni\";\n\t\tif($result = parent::query($query))\n\t\t{\n\t\t\t//Controlla che il risultato ottenuto non sia 0, quindi ho ottenuto un risultato\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\t//Fetch_array di tutte le righe del comune\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t//Crea un array associativo (una sorta di matrice)\n\t\t\t\t\t//Due campi, cod_regione e il nome della regione\n\t\t\t\t\t//ritorna alla funzione Ajax l'array appena creato\n\t\t\t\t\t//che conterrà il nostro array associativo delle regioni\n\t\t\t\t\t$regioni[] = array(\n\t\t\t\t\t\t'cod_regione' => $row['cod_regione'],\n\t\t\t\t\t\t'regione' => $row['regione']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn $regioni;\n\t\t\t}\n\t\t}\n\t}", "public function regions()\n {\n return $this->hasMany('Region', 'lot_id');\n }", "public static function findAll( $countryid ) {\n\t\t\n \treturn Doctrine_Query::create ()->from ( 'Regions s' )\n ->where('s.country_id = ?', array($countryid))\n \t\t\t\t\t\t\t\t->orderBy('s.name')\n \t\t\t\t\t\t\t\t->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\t\t\n\t}", "public static function shipping_map() {\n\n\t\t$countryRegions = array();\n\t\t$regions = Region_Shipping::get();\n\t\tif ($regions && $regions->exists()) {\n\n\t\t\tforeach ($regions as $region) {\n\t\t\t\t$country = $region->Country();\n\t\t\t\t$countryRegions[$country->Code][$region->Code] = $region->Title;\n\t\t\t}\n\t\t}\n\t\treturn $countryRegions;\n\t}", "public static function getRegionOptions() {\n $file = fopen(drupal_get_path('module', 'smart_content_smart_ip') . '/data/region_codes.csv', \"r\");\n $region_codes = [];\n while (!feof($file)) {\n $regions = fgetcsv($file);\n if (!empty($regions[2])) {\n $country_name = self::getCountryNameFromCode($regions[0]);\n $region_codes[$country_name][$regions[2]] = $regions[2];\n }\n }\n ksort($region_codes);\n foreach ($region_codes as $key => $value) {\n ksort($value);\n $region_codes[$key] = $value;\n }\n return $region_codes;\n }", "public static function excelRegionsHeadings()\n {\n return [\n 'Region',\n ];\n }", "public function getCountriesPerRegion();", "public function getYaCityRegions() {\n\t $arYaRegions=array();\n\t foreach ($this->arRegions as $val){\n\t if( $val[\"GeoRegionType\"]==\"City\" || $val[\"GeoRegionType\"]==\"Village\" ){\n\t $arYaRegions[$val[\"GeoRegionId\"]]=$val[\"GeoRegionName\"];\n\t }\n\t }\n\t asort($arYaRegions);\n\t return $arYaRegions;\n\t}", "function getNombre_region()\n {\n if (!isset($this->snombre_region) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->snombre_region;\n }", "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}", "function getId_region()\n {\n if (!isset($this->iid_region) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_region;\n }", "public function getStates() {\n $stateList = array();\n \n if (!empty($this->billing_country)) {\n /*\n * PCM\n */\n $stateList = Subregion::model()->findAll('region_id=\"' . $this->billing_country . '\"');\n\n $stateList = CHtml::listData($stateList, 'name', 'name');\n \n }\n return $stateList;\n }", "public function countryRegionAction()\n {\n $arrRes = array();\n\n $countryId = $this->getRequest()->getParam('parent');\n $colRegions = Mage::getResourceModel('directory/region_collection')\n ->addCountryFilter($countryId)\n ->load();\n \n\t$arrRegions = $this->_toOptionArray($colRegions);\n if (!empty($arrRegions)) {\n foreach ($arrRegions as $region) {\n $arrRes[] = $region;\n }\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($arrRes));\n }", "public function getRegions()\n\t{\n\t\t$this->ensureRegionsLoaded();\n\t\treturn new GmthBridgeIterator(new \\ArrayIterator($this->_regions),\n\t\t\t$this, '\\PhpExtended\\Gmth\\GmthBridgeRegion');\n\t}", "public function regions()\n {\n return $this->hasManyThrough(FirmLocation::class, CandidateLocation::class, 'candidate_id', 'id', 'id' , 'location_id');\n }", "public function get_region_categories()\n\t{\n\t\t\n\t\treturn null;\n\t\t\t\n\t}", "static function get_treaties_enabled_regions_in_use() {\n global $wpdb;\n return $wpdb->get_results('SELECT a.* FROM ai_region a INNER JOIN ai_treaty_region b ON a.id = b.id_region GROUP BY a.id ORDER BY a.id');\n }", "public static function get_regions_coordinates() {\r\n\r\n\t\treturn array(\r\n\t\t\tSimpleEmailService::AWS_US_EAST_1 => array(\r\n\t\t\t\t'lat' => 38.837392,\r\n\t\t\t\t'lon' => - 77.447313,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_US_WEST_2 => array(\r\n\t\t\t\t'lat' => 45.3573,\r\n\t\t\t\t'lon' => - 122.6068,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_EU_WEST1 => array(\r\n\t\t\t\t'lat' => 53.305494,\r\n\t\t\t\t'lon' => - 7.737649,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_EU_CENTRAL_1 => array(\r\n\t\t\t\t'lat' => 50.1109,\r\n\t\t\t\t'lon' => 8.6821,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_AP_SOUTH_1 => array(\r\n\t\t\t\t'lat' => 19.0760,\r\n\t\t\t\t'lon' => 72.8777,\r\n\t\t\t),\r\n\t\t\tSimpleEmailService::AWS_AP_SOUTHEAST_1 => array(\r\n\t\t\t\t'lat' => 33.8688,\r\n\t\t\t\t'lon' => 151.2093,\r\n\t\t\t),\r\n\t\t);\r\n\t}", "function getRegionJson2() {\n\t\t\tif (!$this->_regionJson2) {\n\t\t\t\t$cacheKey = 'CORE_DIRECTORY_REGIONS_JSON2_STORE' . Mage::app( )->getStore( )->getId( );\n\n\t\t\t\tif (Mage::app( )->useCache( 'config' )) {\n\t\t\t\t\t$json = Mage::app( )->loadCache( $cacheKey );\n\t\t\t\t}\n\n\n\t\t\t\tif (empty( $$json )) {\n\t\t\t\t\t$countryIds = array( );\n\t\t\t\t\tforeach ($this->getCountryCollection( ) as $country) {\n\t\t\t\t\t\t$countryIds[] = $country->getCountryId( );\n\t\t\t\t\t}\n\n\t\t\t\t\t$collection = Mage::getModel( 'directory/region' )->getResourceCollection( )->addCountryFilter( $countryIds )->load( );\n\t\t\t\t\t$regions = array( 'config' => array( 'show_all_regions' => true, 'regions_required' => Mage::helper( 'core' )->jsonEncode( array( ) ) ) );\n\t\t\t\t\tforeach ($collection as $region) {\n\n\t\t\t\t\t\tif (!$region->getRegionId( )) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$regions[$region->getCountryId( )][$region->getRegionId( )] = array( 'code' => $region->getCode( ), 'name' => $this->__( $region->getName( ) ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$json = Mage::helper( 'core' )->jsonEncode( $regions );\n\n\t\t\t\t\tif (Mage::app( )->useCache( 'config' )) {\n\t\t\t\t\t\tMage::app( )->saveCache( $json, $cacheKey, array( 'config' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->_regionJson2 = $json;\n\t\t\t}\n\n\t\t\treturn $this->_regionJson2;\n\t\t}", "function &getAll( $as_object = true, $search = \"\", $offset = 0, $max = -1 )\n {\n $db =& eZDB::globalDatabase();\n\n $region_array = 0;\n $return_array = array();\n \n if ( $max >= 0 && is_numeric( $offset ) && is_numeric( $max ) )\n {\n $limit = array( \"Limit\" => $max,\n \"Offset\" => $offset );\n }\n\n if ( !empty( $search ) )\n {\n $query = new eZQuery( array( \"Name\", \"Abbreviation\" ), $search );\n $search_arg = \"AND \" . $query->buildQuery();\n// $search_arg = \"WHERE Name like '%$search%'\";\n }\n\n if ( $as_object )\n $select = \"*\";\n else\n $select = \"ID\";\n\n $db->array_query( $region_array, \"SELECT $select FROM eZAddress_Region\n WHERE Removed=0 $search_arg\n ORDER BY Name\", $limit );\n\t\t\n if ( $as_object )\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = new eZRegion( $region[ $db->fieldName( \"ID\" ) ] );\n }\n }\n else\n {\n foreach ( $region_array as $region )\n {\n $return_array[] = $region[ $db->fieldName( \"ID\" ) ];\n }\n }\n\t\t\n return $return_array;\n\n }", "public static function region() {\n\t\treturn static::randomElement(static::$regionNames);\n\t}", "public function regions()\n {\n return $this->belongsToMany('Villato\\Region', 'company_region_product', 'product_id', 'region_id');\n }", "public function regionList(): Response\n {\n $player = $this->getPlayer();\n $regions = $player->getWorldRegions();\n\n // GameUnitType 1 = Buildings\n $gameUnitType = $this->gameUnitTypeRepository->find(1);\n\n foreach ($regions as $region) {\n $region->buildingsInConstruction = $this->constructionActionService->getCountGameUnitsInConstruction($region, $gameUnitType);\n $region->buildings = $this->constructionActionService->getCountGameUnitsInWorldRegion($region, $gameUnitType);\n }\n\n return $this->render('game/regionList.html.twig', [\n 'regions' => $regions,\n 'player' => $player,\n 'mapUrl' => $this->getMapUrl(),\n ]);\n }", "public function getState($countryId) {\n $data = [];\n $countries = $this->countryInformationAcquirer->getCountriesInfo();\n foreach ($countries as $country) {\n if ($country->getId() == $countryId) { \n $regions = [];\n if ($availableRegions = $country->getAvailableRegions()) {\n foreach ($availableRegions as $region) {\n $data[] = [\n 'code' => $region->getCode(),\n 'region_id' => $region->getId(),\n 'name' => $region->getName()\n ];\n }\n }\n }\n }\n\n return $data;\n }", "public function regions(): EstatesRegions\n {\n if (is_null($this->regionsEndpoint)) {\n $this->regionsEndpoint = new EstatesRegions($this->api);\n }\n return $this->regionsEndpoint;\n }", "public function getAllLocations()\n\t{\n\t\t$sCacheId = $this->cache()->set('gmap.locations');\n\t\n\t\tif (!($aRows = $this->cache()->get($sCacheId)))\n\t\t{\n\t\t\t$aRows = $this->database()->select('f.*, u.full_name, u.user_name, u.country_iso')\n\t\t\t\t->from(Phpfox::getT('gmap'), 'f')\t\t\n\t\t\t\t->join(Phpfox::getT('user'), 'u', 'u.user_id = f.user_id')\t\n\t\t\t\t->where('f.not_found = \\'0\\'')\n\t\t\t\t->execute('getSlaveRows');\n\t\t\t\t\n\t\t\t$this->cache()->save($sCacheId, $aRows);\n\t\t}\n\t\t\n\t\t$aOutput = array();\n\t\t\n\t\tif($aRows != null && is_array($aRows))\n\t\tforeach($aRows as $aRow)\n\t\t{\n\t\t\t$aOutput[$aRow['country_iso']][] = $aRow;\n\t\t}\n\t\treturn $aOutput;\n\t}", "function getRegionsStub($country)\n{\n return array(\"Kentriki Makedonia\", \"Thraki\", \"Peloponisos\", \"Kriti\");\n}", "public function getRegionName()\n {\n return $this->regionName;\n }", "public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }", "public function getRegion(): string\n {\n return $this->result->region_name;\n }", "public function listRegions($merchantId, $optParams = [])\n {\n $params = ['merchantId' => $merchantId];\n $params = array_merge($params, $optParams);\n return $this->call('list', [$params], ListRegionsResponse::class);\n }", "private function getOptionItems()\n {\n $region = new RegionRepository();\n return [\n 'regionItems' => ['' => __('crud.option.region_placeholder')] + $region->pluck()\n ];\n }", "function GetStates () {\n\t\t$this->db->order_by('name_long','ASC');\n\t\t$result = $this->db->get('states');\n\n\t\t$states = array();\n\t\tforeach ($result->result_array() as $state) {\n\t\t\t$states[] = array(\n\t\t\t\t\t\t\t'code' => $state['name_short'],\n\t\t\t\t\t\t\t'name' => $state['name_long']\n\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn $states;\n\t}", "public function index()\n {\n return view('backend.region.index')->withRegions($this->region->getForDataTable()->paginate(10));\n }", "public function getAllStates(){\n\n $states = $this->stateRepo->get();\n $states_array = array();\n if($states){\n foreach($states as $key=>$state)\n {\n $states_array[$key]['id'] = $state->getId();\n $states_array[$key]['name'] = $state->getName();\n\n }\n }\n return json_encode($states_array);\n }", "function getRegion_stgr()\n {\n if (!isset($this->sregion_stgr) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion_stgr;\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "function getRegion()\n {\n if (!isset($this->sregion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sregion;\n }", "public function getRegiones($id){ //id del pais\n return Region::where('codPais','=',$id)->get();\n \n }", "public function actionIndex() {\n $searchModel = new RegionSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n $dataFilterCountry = \\common\\models\\address\\Country::getNameArr();\n \n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n 'dataFilterCountry' => $dataFilterCountry,\n ]);\n }", "public function getStates() {\n $stateList = array();\n if (!empty($this->shipping_country)) {\n /*\n * PCM\n */\n $stateList = Subregion::model()->findAll('region_id=\"' . $this->shipping_country . '\"');\n\n $stateList = CHtml::listData($stateList, 'name', 'name');\n }\n return $stateList;\n }", "public function getRegistryNames() : array\n {\n $names = [];\n foreach ($this->getRegistry() as $registryName=>$registryValue)\n {\n $names[] = $registryName;\n }\n\n return $names;\n }", "function ams_get_amazon_regions() {\n $regions = array(\n 'com.au' => array( 'RegionName' => 'Australia', 'Host' => 'webservices.amazon.com.au', 'RegionCode' => 'us-west-2' ),\n 'com.br' => array( 'RegionName' => 'Brazil', 'Host' => 'webservices.amazon.com.br', 'RegionCode' => 'us-east-1' ),\n 'ca' => array( 'RegionName' => 'Canada', 'Host' => 'webservices.amazon.ca', 'RegionCode' => 'us-east-1' ),\n 'cn' => array( 'RegionName' => 'China', 'Host' => 'webservices.amazon.cn', 'RegionCode' => 'us-west-2' ),\n 'fr' => array( 'RegionName' => 'France', 'Host' => 'webservices.amazon.fr', 'RegionCode' => 'eu-west-1' ),\n 'de' => array( 'RegionName' => 'Germany', 'Host' => 'webservices.amazon.de', 'RegionCode' => 'eu-west-1' ),\n 'in' => array( 'RegionName' => 'India', 'Host' => 'webservices.amazon.in', 'RegionCode' => 'eu-west-1' ),\n 'it' => array( 'RegionName' => 'Italy', 'Host' => 'webservices.amazon.it', 'RegionCode' => 'eu-west-1' ),\n 'jp' => array( 'RegionName' => 'Japan', 'Host' => 'webservices.amazon.co.jp', 'RegionCode' => 'us-west-2' ),\n 'mx' => array( 'RegionName' => 'Mexico', 'Host' => 'webservices.amazon.com.mx', 'RegionCode' => 'us-east-1' ),\n 'nl' => array( 'RegionName' => 'Netherlands', 'Host' => 'webservices.amazon.nl', 'RegionCode' => 'eu-west-1' ),\n 'sa' => array( 'RegionName' => 'Saudi Arabia', 'Host' => 'webservices.amazon.sa', 'RegionCode' => 'eu-west-1' ),\n 'sg' => array( 'RegionName' => 'Singapore', 'Host' => 'webservices.amazon.sg', 'RegionCode' => 'us-west-2' ),\n 'es' => array( 'RegionName' => 'Spain', 'Host' => 'webservices.amazon.es', 'RegionCode' => 'eu-west-1' ),\n 'com.tr' => array( 'RegionName' => 'Turkey', 'Host' => 'webservices.amazon.com.tr', 'RegionCode' => 'eu-west-1' ),\n 'ae' => array( 'RegionName' => 'United Arab Emirates', 'Host' => 'webservices.amazon.ae', 'RegionCode' => 'eu-west-1' ),\n 'co.uk' => array( 'RegionName' => 'United Kingdom', 'Host' => 'webservices.amazon.co.uk', 'RegionCode' => 'eu-west-1' ),\n 'com' => array( 'RegionName' => 'United States', 'Host' => 'webservices.amazon.com', 'RegionCode' => 'us-east-1' )\n );\n\n return $regions;\n}", "public function test_get_regions() {\n\t\t$s3_helper = new S3_helper();\n\t\t$this->assertEquals( self::ARRAY_REGION, $s3_helper->get_regions() );\n\t}", "public function getTimeZones() {\n\n $regions = array(\n 'Africa' => DateTimeZone::AFRICA,\n 'America' => DateTimeZone::AMERICA,\n 'Antarctica' => DateTimeZone::ANTARCTICA,\n 'Asia' => DateTimeZone::ASIA,\n 'Atlantic' => DateTimeZone::ATLANTIC,\n 'Europe' => DateTimeZone::EUROPE,\n 'Indian' => DateTimeZone::INDIAN,\n 'Pacific' => DateTimeZone::PACIFIC\n );\n\n $tzlist = array();\n foreach ($regions as $name => $mask) {\n $tzlist = array_merge($tzlist, DateTimeZone::listIdentifiers($mask));\n }\n\n return $tzlist;\n\n }", "public function organizationList(){\n if($this->request->all()){\n $regionIds = array_flatten($this->request->all());\n $sorted = $this->organization->select('id','name')->whereIn('region_id',$regionIds)->get()->sortBy('name');\n return $sorted->values()->all();\n }else{\n $sorted = $this->organization->select('id','name')->get()->sortBy('name');\n return $sorted->values()->all();\n }\n }", "private function allCountries()\n {\n $countries = [];\n $isos = $this->countryIso();\n foreach ($isos as $iso) {\n $path = __DIR__ . '/config/geography/' . $iso . '.php';\n $countries[$iso] = require $path;\n }\n\n return $countries;\n }", "function getStatesList()\n\t\t{\n\t\t\t$sSQL\t=\t\"select abbr , name from tbl_states\";\n\t\t\t$response = $this->Execute($sSQL);\n\t\t\t\n\t\t\t$stateList = array();\n\t\t\t\n\t\t\twhile($row = $response->FetchRow())\n\t\t\t{\t\t\t\n\t\t\t\t$arr['abbr'] = $row['abbr'];\n\t\t\t\t$arr['name'] = $row['name'];\n\t\t\t\t$stateList[] = $arr;\n\t\t\t}\n\t\t\t\n\t\t\treturn $stateList;\t\t\t\n\t\t}", "public function Region()\n {\n $this->_Region->ClearAllOptions();\n return $this->_Region;\n }", "public function getAllStatesByName(){\n return array(\"Acre\" ,\"Alagoas\",\"Amazonas\",\"Amapá\",\"Bahia\",\"Ceará\",\"Distrito Federal\",\"Espírito Santo\",\"Goiás\",\"Maranhão\",\"Mato Grosso\",\"Mato Grosso do Sul\",\"Minas Gerais\",\"Pará\",\"Paraíba\",\"Paraná\",\"Pernambuco\",\"Piauí\",\"Rio de Janeiro\",\"Rio Grande do Norte\",\"Rondônia\",\"Rio Grande do Sul\",\"Roraima\",\"Santa Catarina\",\"Sergipe\",\"São Paulo\",\"Tocantins\");\n }", "public function getAllIdentifiers() {}", "public function GetRegionsInArea($startX, $startY, $endX, $endY, $scopeID='00000000-0000-0000-0000-000000000000', $asArray=false){\n\t\t\t$has = WebUI\\GetRegionsInArea::hasInstance($this, $startX, $startY, $endX, $endY, $scopeID);\n\t\t\t$response = array();\n\t\t\tif($asArray === true || $has === false){\n\t\t\t\t$result = $this->makeCallToAPI('GetRegionsInArea', true, array(\n\t\t\t\t\t'StartX' => $startX,\n\t\t\t\t\t'StartY' => $startY,\n\t\t\t\t\t'EndX' => $endX,\n\t\t\t\t\t'EndY' => $endY,\n\t\t\t\t\t'ScopeID' => $scopeID\n\t\t\t\t), array(\n\t\t\t\t\t'Regions' => array('array'=>array(static::GridRegionValidator())),\n\t\t\t\t\t'Total' => array('integer'=>array())\n\t\t\t\t));\n\t\t\t\tforeach($result->Regions as $val){\n\t\t\t\t\t$response[] = WebUI\\GridRegion::fromEndPointResult($val);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $asArray ? $response : WebUI\\GetRegionsInArea::r($this, $startX, $startY, $endX, $endY, $scopeID, 0, $result->Total, $response);\n\t\t}", "public function getRegions($criteria = null, PropelPDO $con = null)\n {\n if (null === $this->collRegions || null !== $criteria) {\n if ($this->isNew() && null === $this->collRegions) {\n // return empty collection\n $this->initRegions();\n } else {\n $collRegions = RegionQuery::create(null, $criteria)\n ->filterByEvent($this)\n ->find($con);\n if (null !== $criteria) {\n return $collRegions;\n }\n $this->collRegions = $collRegions;\n }\n }\n\n return $this->collRegions;\n }", "public function callRegions(array $params = array())\n {\n return $this->call('objekt/regionen', $params);\n }", "public function index()\n {\n $regions = Region::with(['activeAgencies:id,cities'])->withCount('activeAgencies')->get();\n\n return GeoJsonLandingCollection::make($regions);\n }", "public function index()\n {\n //\n $params=[\n 'title'=>' Regions list',\n 'regions'=>Region::orderBy('id','ASC')->get()];\n\n return view('admin.regions.regions_list')->with($params);\n }", "public function index()\n {\n $regions = Region::paginate(25);\n\n return view('regions.index', compact('regions'));\n }", "public function index()\n {\n $listAdministrativeRegions = AdministrativeRegion::paginate(5);\n return view('admin.administrative-regions.index', \\compact('listAdministrativeRegions'));\n }", "public function allNamed(): array;", "function pi_authoring_admin_group_hierarchy_form_generate_region_list($region_items, $form_elements)\n{\n\t$regions = array();\n\t$names = pi_util_get_names_from_nids(element_children($region_items));\n\t\n\tforeach($names as $region_element_id => $details)\n\t{\n\t\tswitch($region_element_id)\n\t\t{\n\t\t\tcase 'multiclass-null':\n\t\t\t\t$regions[$region_element_id]['title'] = $form_elements[$region_element_id]['#title'];\n\t\t\t\t$regions[$region_element_id]['description'] = '';\n\t\t\t\tbreak;\n\t\t\tcase 'class-null':\n\t\t\t\t$regions[$region_element_id]['title'] = $form_elements[$region_element_id]['#title'];\n\t\t\t\t$regions[$region_element_id]['description'] = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item = node_load($region_element_id);\n\t\t\t\tif($item != NULL)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$regions[$region_element_id]['title'] = $item->title;\n\t\t\t\t\t$group_users = pi_get_members_of_group($region_element_id);\n\t\t\t\t\t$regions[$region_element_id]['description'] = theme('pi_group_description', $item->og_description, $group_users);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$regions[$region_element_id]['title'] = $names[$region_element_id];\n\t\t\t\t\t$regions[$region_element_id]['description'] = '';\n\t\t\t\t}\n\t\t}\n\t}\n\treturn $regions;\n}", "public function getRegion() \n {\n return $this->region;\n }", "public function getIdentifiers();", "public function addRegions()\n {\n if (isset($this->regions) && $this->regions) { \n for ($j=count($this->regions)-1; $j>=0; $j--) {\n //clear out previous loop's selection\n $color = array();\n $title = ($this->regions[$j]['title']) ? stripslashes($this->regions[$j]['title']) : \"\";\n if ($this->regions[$j]['color']) {\n $color = explode(\" \", $this->regions[$j]['color']);\n if (count($color) != 3) {\n $color = array();\n }\n }\n\n $data = trim($this->regions[$j]['data']);\n\n if ($data) {\n $this->_legend_required = true;\n $baselayer = true;\n //grab the textarea for regions & split\n $rows = explode(\"\\n\", self::removeEmptyLines($data));\n $qry = array();\n foreach ($rows as $row) {\n $regions = preg_split(\"/[,;]+/\", $row); //split by a comma, semicolon\n foreach ($regions as $region) {\n if ($region) {\n $pos = strpos($region, '[');\n if ($pos !== false) {\n $baselayer = false;\n $split = explode(\"[\", str_replace(\"]\", \"\", trim(strtoupper($region))));\n $states = preg_split(\"/[\\s|]+/\", $split[1]);\n $statekey = array();\n foreach ($states as $state) {\n $statekey[] = \"'[code_hasc]' ~* '\\.\".$state.\"$'\";\n }\n $qry['stateprovince'][] = \"'[adm0_a3]' = '\".trim($split[0]).\"' && (\".implode(\" || \", $statekey).\")\";\n $qry['country'][] = \"'[iso_a3]' = '\".trim($split[0]).\"'\";\n } else {\n $region = addslashes(trim($region));\n $qry['stateprovince'][] = \"'[name]' ~* '\".$region.\"$'\";\n $qry['country'][] = \"'[NAME]' ~* '\".$region.\"$' || '[NAME_LONG]' ~* '\".$region.\"$' || '[GEOUNIT]' ~* '\".$region.\"$' || '[FORMAL_EN]' ~* '\".$region.\"$'\";\n }\n }\n }\n }\n\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", \"query_layer_\".$j);\n\n if ($baselayer) {\n $layer->set(\"data\", $this->shapes['countries']['shape']);\n $layer->set(\"type\", MS_LAYER_POLYGON);\n } else {\n $layer->set(\"data\", $this->shapes['stateprovinces_polygon']['shape']);\n $layer->set(\"type\", $this->shapes['stateprovinces_polygon']['type']);\n }\n\n $layer->set(\"template\", \"template.html\");\n $layer->setProjection(self::getProjection($this->default_projection));\n\n $query = ($baselayer) ? $qry['country'] : $qry['stateprovince'];\n\n $layer->setFilter(\"(\".implode(\" || \", $query).\")\");\n\n $class = ms_newClassObj($layer);\n $class->set(\"name\", $title);\n\n $style = ms_newStyleObj($class);\n if (!empty($color)) {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n }\n $style->outlinecolor->setRGB(30, 30, 30);\n $style->set(\"opacity\", 75);\n $style->set(\"width\", $this->_determineWidth());\n $layer->set(\"status\", MS_ON);\n }\n\n }\n }\n }", "public function regions(Request $request): RegionCollection\n {\n return RegionCollection::make(Region::query()->with('translates')->paginate($request->get('perPage') ?? 50));\n }", "public function getAll()\n {\n return $this->_identifiers;\n }", "public function getRegistryArray() {\n return $this->_registryArray;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getRegion()\n {\n return $this->region;\n }", "public function getCountryList() {\n $result = array();\n $collection = Mage::getModel('directory/country')->getCollection();\n foreach ($collection as $country) {\n $cid = $country->getId();\n $cname = $country->getName();\n $result[$cid] = $cname;\n }\n return $result;\n }" ]
[ "0.82735443", "0.80721676", "0.8003379", "0.7776884", "0.7760253", "0.7622808", "0.7536318", "0.7445861", "0.732338", "0.73223054", "0.7266823", "0.7157858", "0.7087895", "0.7067953", "0.6844985", "0.6808119", "0.68026084", "0.6779567", "0.67563975", "0.6744693", "0.6724499", "0.67158085", "0.66648406", "0.66517735", "0.6558159", "0.65227133", "0.6521957", "0.6507477", "0.64908826", "0.6460375", "0.6446316", "0.6440303", "0.64221895", "0.6365204", "0.6360793", "0.6328966", "0.63013107", "0.62839836", "0.62498033", "0.6241695", "0.6238958", "0.62170637", "0.6168093", "0.61516887", "0.6149425", "0.6123369", "0.61026615", "0.6094114", "0.6066073", "0.6038238", "0.6029967", "0.60029995", "0.6000638", "0.59994626", "0.5988492", "0.598428", "0.59839743", "0.5949866", "0.5938506", "0.5926752", "0.59216994", "0.59185594", "0.59118026", "0.59055126", "0.59055126", "0.5897033", "0.58799607", "0.586728", "0.5863539", "0.58340216", "0.5831072", "0.5823208", "0.58215153", "0.5810741", "0.57990193", "0.5791928", "0.57891476", "0.57844734", "0.57687336", "0.5755131", "0.57270634", "0.57262075", "0.572373", "0.57213515", "0.57203346", "0.5717433", "0.5715569", "0.57082635", "0.5702653", "0.5700995", "0.5695781", "0.56924856", "0.5692073", "0.5673284", "0.5673284", "0.5673284", "0.5673284", "0.5673284", "0.5673284", "0.5667939" ]
0.63905156
33
Creates a new region.
public static function create(array $values) { $insert = array(); // validate - id if (!isset($values['id']) || empty($values['id'])) { throw new Yadda_Model_Exception('Please provide an ID for the new region.'); } else { $id = trim(strtolower($values['id'])); $region = null; try { $region = self::find($id); } catch (Yadda_Model_Exception $e) { } if ($region !== null) { throw new Yadda_Model_Exception('There is already a region with the provided ID.'); } $insert['id'] = $id; } // validate - name if (!isset($values['name']) || empty($values['name'])) { throw new Yadda_Model_Exception('Please provide a name for the new region.'); } else { $name = trim($values['name']); $insert['name'] = $name; } // validate - lat if (isset($values['lat'])) { $lat = (float) $values['lat']; if ($lat <= -180 || $lat >= 180) { throw new Yadda_Model_Exception('Please provide a valid latitude.'); } $insert['lat'] = $lat; } // validate - long if (isset($values['long'])) { $long = (float) $values['long']; if ($long <= -180 || $long >= 180) { throw new Yadda_Model_Exception('Please provide a valid longitude.'); } $insert['long'] = $long; } // insert $regionDb = Yadda_Db_Table::getInstance('region'); $regionDb->insert(array_merge($insert, array( 'country_code' => 'za', // for now 'created' => Yadda_Db::now() ))); return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createToRegion($region)\n {\n // TODO: Implement createToRegion() method.\n }", "public function create()\n {\n return view('backend.region.create');\n \n }", "public function createRegion($name)\n {\n \t$this->state = self::STATE_REGION_CREATE;\n \t$region = IKL_Domain_Regional_Region::create($this, $name);\n \t$this->state = self::STATE_NEUTRAL;\n $this->data->getRegions()->add($region);\n return $region;\n }", "public function create()\n {\n return view('administrar.region.create');\n }", "public static function CreateRegion(\n $RegionDescription, \n $RegionID)\n { \n $Region = new Region();\n $Region->RegionDescription = $RegionDescription;\n $Region->RegionID = $RegionID;\n return $Region;\n }", "public function create($merchantId, Region $postBody, $optParams = [])\n {\n $params = ['merchantId' => $merchantId, 'postBody' => $postBody];\n $params = array_merge($params, $optParams);\n return $this->call('create', [$params], Region::class);\n }", "public function create()\n {\n //\n\n \n $params = [\n 'title' => 'Create Region'\n \n ];\n \n \n\n return view('admin.regions.regions_create')->with($params);\n\n }", "public function create()\n {\n \t$viewdata = $this->region->find(0);\n return view('dashboard.territory.region.create')->with([\n\t\t\t'viewdata' => $viewdata,\n\t\t\t'states' => $this->state->all(),\n\t\t]);\n }", "public function int__creatingRegion()\n {\n \treturn ($this->state == self::STATE_REGION_CREATE);\n }", "public function create()\n {\n \n \n return view('regions.create');\n }", "public function create()\n {\n return view('regiones.create');\n }", "public function create()\n {\n return view('admin.administrative-regions.create');\n }", "public function create()\n {\n return View::make('admin.operating-regions.form')\n ->with('title', 'Add New Operating Region')\n ->with('action', 'admin.operating-regions.store')\n ->with('method', 'post')\n ->with('region', new OperatingRegion());\n }", "public function createAction()\n {\n $tiles = array();\n // the old way: this renders the content in the same request.\n // $tiles[] = $this->editRegionAction();\n\n // here we clone the request for the region.\n $tiles[] = $createRegion = Region::create( $this->getCreateRegionPath(), array_merge($_REQUEST, [ \n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html') , [\n 'tiles' => $tiles,\n 'createRegion' => $createRegion,\n ]);\n }", "abstract public function region();", "public function addRegion()\n\t{\n\t\tglobal $cfg;\n\t\t$data = $cfg['data'];\n\n\t\t// Load the content model\n\t\t$content = $this->load_model('Content');\n\n\t\t// Get all the available regions from the database\n\t\t$regions[0] = '- New Region -';\n\t\tforeach ($content->get_regions() as $key) {\n\t\t\t$regions[$key['id']] .= $key['region'];\n\t\t}\n\n\t\t$form = new Form();\n\n\t\t$form->set_validate_rules(\"region\", \"Region name\", \"required\");\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$content = $this->load_model(\"Content\");\n\n\t\t\tif($_POST['region_id'] == 0)\n\t\t\t\t$content->insertRegion();\n\t\t\telse\n\t\t\t\t$content->updateRegion();\n\n\t\t\tredirect(\"content\");\n\t\t}\n\n\t\t$data['content']['main'] = \"<fieldset class='clearfix inline-block'><legend>New region</legend>\";\n\t\t$data['content']['main'] .= $form->start();\n\t\t$data['content']['main'] .= \"<lable>Excisting regions</lable>\";\n\t\t$data['content']['main'] .= $form->select($regions, array('style' => 'width:100%', 'name' => 'region_id'));\n\t\t$data['content']['main'] .= \"<lable>Region name</lable>\";\n\t\t$data['content']['main'] .= $form->input('text', array('style' => 'width:100%', 'name' => 'region'));\n\t\t$data['content']['main'] .= $form->input('submit', array('value' => 'Save', 'style' => 'width:100%'));\n\t\t$data['content']['main'] .= \"</form></fieldset>\";\n\t\t$data['content']['main'] .= $form->validate_error();\n\n\t\t$this->load_view('default', $data);\n\t}", "public function setRegion($var)\n {\n GPBUtil::checkString($var, True);\n $this->region = $var;\n\n return $this;\n }", "public function setRegion($var)\n {\n GPBUtil::checkString($var, True);\n $this->region = $var;\n\n return $this;\n }", "public function store(CreateregionRequest $request)\n {\n $input = $request->all();\n\n $region = $this->regionRepository->create($input);\n\n Flash::success('Region saved successfully.');\n\n return redirect(route('regions.index'));\n }", "public static function createRegion($region_name)\n {\n if (!$region_name || strlen($region_name) == 0) {\n Session::add('feedback_negative', Text::get('FEEDBACK_NOTE_CREATION_FAILED'));\n return false;\n }\n\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"INSERT INTO region (region_name) VALUES (:region_name)\";\n $query = $database->prepare($sql);\n $query->execute(array(':region_name' => $region_name));\n\n if ($query->rowCount() == 1) {\n return true;\n }\n\n // default return\n Session::add('feedback_negative', Text::get('FEEDBACK_NOTE_CREATION_FAILED'));\n return false;\n }", "public function create()\n {\n $country =Country::all();\n return view('setup.addresSetup.region.create')->with('country', $country);\n }", "public function create()\n {\n $regije = Region::all();\n\n return view('drzava.create', compact('regije'));\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($value)\n {\n return $this->set('Region', $value);\n }", "public function setRegion($region) \n {\n $this->region = $region;\n\n return $this;\n }", "public function create()\n {\n //\n $lsubreg = DB::table('mtl_region')->get();\n return view('master.subregion.create', compact('lsubreg'));\n }", "public function actionCreate() {\n $model = new Region;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n $countryList = \\common\\models\\address\\Country::getNameArr();\n return $this->render('create', [\n 'model' => $model,\n 'countryList' => $countryList, \n ]);\n }\n }", "public function create() {\n $regions = \\App\\Region::all();\n return view('agent.add-agent', array('regions' => $regions));\n }", "public function creerregion()\n {\n $pays=Pays::all();\n return view('Region.creerregion', compact('pays'));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name'=>'required|unique:regions',\n 'code'=>'required',\n 'country_id'=>'required',\n 'description'=>'required'\n ]);\n $region = new Region;\n \n $region->name = $request->name; \n $region->code = $request->code;\n $region->country_id = $request->country_id;\n $region->description = $request->description;\n\n $region->save();\n session()->flash('notif','Region SetUp Successfully Added');\n return redirect()->Route('region.index'); \n }", "public function getRegion(): RegionInterface;", "public function region(string $region)\n {\n $this->region = $region;\n\n return $this;\n }", "protected function createRegion(string $name): SecondLevelRegion\n {\n $name = sprintf('%s[%s].%s', $this->prefix, $this->getVersion(), $name);\n\n return new SecondLevelRegion($name, $this->store, $this->defaultLifetime);\n }", "public function create()\n {\n $regions = Region::lists('descripcion_region', 'id_region');\n\n return View::make('admin.ciudads.create')->withRegiones($regions);\n }", "public function create()\n {\n $regions = Region::all();\n\n return view('cities.create', [\n 'regions' => $regions\n ]);\n }", "public static function new(string $id, string $region)\n {\n return (new self())\n ->setId($id)\n ->setRegion($region)\n ->setDisplayName(null)\n ->setLogo(null)\n ->setStatus(null);\n }", "public static function createWithAvailabilityZone(AwsRegion $region)\n {\n $placement = new Placement();\n $placement->m_availability_zone = $region;\n return $placement;\n }", "function add_region()\n\n\t {\n\t $this->load->model( 'main_model' );\n\t $data['get_circle'] = $this->main_model->get_circle();\n $this->load->view('add_region',$data);\n\t }", "public function set_region($region)\n\t{\n\t\t$this->set_hostname($region);\n\t\treturn $this;\n\t}", "public function store(Request $request)\n {\n // Validation through type hinting cannot be used here, because it is not a form post, but JSON data.\n $regionData = $this->_getRequestData($request, 'region');\n $rules = $this->_getValidationRules(new StoreRegionRequest());\n\n $validator = Validator::make($regionData, $rules);\n if ($validator->fails()) {\n return response()\n ->json($this->_getResponseDataValidatorError($validator))\n ->setStatusCode(Response::HTTP_BAD_REQUEST);\n }\n\n $region = new Region($regionData);\n $region->iso = 'XXX'; // ISO 3166-1 Alpha-2 cannot easily be determined based upon User entered data.\n if ($region->save()) {\n $resource = new FractalResource\\Item($region, new IdOnlyTransformer());\n\n return response()\n ->json($this->_getResponseData($resource))\n ->setStatusCode(Response::HTTP_CREATED);\n }\n }", "public function store(StoreRegionRequest $request)\n {\n $this->region->create(\n [\n 'data' => $request->except('_token','_method'),\n ]);\n\n return redirect()->route('admin.region.index')->withFlashSuccess(trans('alerts.backend.region.created'));\n }", "public static function region() {\n\t\treturn static::randomElement(static::$regionNames);\n\t}", "public function set($region, $value)\n {\n // Content is reserve region for render sub-view.\n if ($region == 'content') return;\n\n $this->regions[$region] = $value;\n\n return $this;\n }", "public function setRegion($region)\n {\n $this->region = $region;\n\n return $this;\n }", "public function run()\n {\n $nc = Region::create(['code' => 'NC', 'name' => 'North Central']);\n $ne = Region::create(['code' => 'NE', 'name' => 'North East']);\n $nw = Region::create(['code' => 'NW', 'name' => 'North West']);\n $se = Region::create(['code' => 'SE', 'name' => 'South East']);\n $ss = Region::create(['code' => 'SS', 'name' => 'South South']);\n $sw = Region::create(['code' => 'SW', 'name' => 'South West']);\n }", "public static function create($rectangle) {}", "public function create()\n {\n return view('main.expedition.area.create');\n }", "public function store()\n {\n $region = OperatingRegion::create(Input::all());\n\n if ($region->save()) {\n return Redirect::route('admin.operating-regions.show', $region->id)\n ->withMessage('The region has been created successfully.');\n } else {\n return Redirect::route('admin.operating-regions.create')\n ->withError('The item could not be saved. ' .\n 'See below for more information.')\n ->withErrors($region->errors())\n ->withInput();\n }\n }", "public function run()\n {\n Region::insert([\n [\n \"name\" => \"OUEST\",\n \"slug\" => \"OU\"\n ],\n [\n \"name\" => \"NORD-OUEST\",\n \"slug\" => \"NO\"\n ],\n [\n \"name\" => \"SUD-OUEST\",\n \"slug\" => \"SO\"\n ],\n [\n \"name\" => \"NORD\",\n \"slug\" => \"ND\"\n ],\n [\n \"name\" => \"EXTREME-NORD\",\n \"slug\" => \"EN\"\n ],\n [\n \"name\" => \"SUD\",\n \"slug\" => \"SD\"\n ],\n [\n \"name\" => \"EST\",\n \"slug\" => \"ES\"\n ],\n [\n \"name\" => \"LITTORAL\",\n \"slug\" => \"LT\"\n ],\n [\n \"name\" => \"CENTRE\",\n \"slug\" => \"CE\"\n ],\n ]);\n }", "public static function AddRegion($arFields)\n\t{\n\t\tglobal $DB;\n\n\t\tif (!CSaleLocation::RegionCheckFields(\"ADD\", $arFields))\n\t\t\treturn false;\n\n\t\tif(self::isLocationProMigrated())\n\t\t{\n\t\t\treturn self::AddLocationUnattached('REGION', $arFields);\n\t\t}\n\n\t\tforeach (GetModuleEvents('sale', 'OnBeforeRegionAdd', true) as $arEvent)\n\t\t{\n\t\t\tif (ExecuteModuleEventEx($arEvent, array($arFields))===false)\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$arInsert = $DB->PrepareInsert(\"b_sale_location_region\", $arFields);\n\t\t$strSql =\n\t\t\t\"INSERT INTO b_sale_location_region(\".$arInsert[0].\") \".\n\t\t\t\"VALUES(\".$arInsert[1].\")\";\n\t\t$DB->Query($strSql, false, \"File: \".__FILE__.\"<br>Line: \".__LINE__);\n\n\t\t$ID = intval($DB->LastID());\n\n\t\t$db_lang = CLangAdmin::GetList('sort', 'asc', array(\"ACTIVE\" => \"Y\"));\n\t\twhile ($arLang = $db_lang->Fetch())\n\t\t{\n\t\t\tif ($arFields[$arLang[\"LID\"]])\n\t\t\t{\n\t\t\t\t$arInsert = $DB->PrepareInsert(\"b_sale_location_region_lang\", $arFields[$arLang[\"LID\"]]);\n\t\t\t\t$strSql =\n\t\t\t\t\t\"INSERT INTO b_sale_location_region_lang(REGION_ID, \".$arInsert[0].\") \".\n\t\t\t\t\t\"VALUES(\".$ID.\", \".$arInsert[1].\")\";\n\t\t\t\t$DB->Query($strSql, false, \"File: \".__FILE__.\"<br>Line: \".__LINE__);\n\t\t\t}\n\t\t}\n\n\t\tforeach (GetModuleEvents('sale', 'OnRegionAdd', true) as $arEvent)\n\t\t\tExecuteModuleEventEx($arEvent, array($ID, $arFields));\n\n\t\treturn $ID;\n\t}", "public function created(Region $region)\n {\n $this->cache->cacheFlush([\n ['allRegions'],\n ['allRegionChildren'],\n ['RegionAncestors']\n ]);\n }", "public function store(Request $request)\n {\n $region = Region::create($request->all());\n\t\n\t\treturn redirect(route('region.index'))->with([\n\t\t\t'message' => \"Информация по району $request->name добавлена\",\n\t\t]);\n }", "public function set_region($region)\n\t{\n\t\t// @codeCoverageIgnoreStart\n\t\t$this->set_hostname($region);\n\t\treturn $this;\n\t\t// @codeCoverageIgnoreEnd\n\t}", "public function __construct() {\n $this->regions = array(\n \t'block1' => 'block1',\n \t'block2' => 'block2',\n );\n }", "public function setRegion(Region $oRegion): self\n {\n $this->oRegion = $oRegion;\n return $this;\n }", "public function create()\n {\n $tipo_usuario = Auth::user()->tipo_usuario;\n if($tipo_usuario <> \"2\" || $tipo_usuario==\"5\"){\n return view('permisos');\n\n }else{\n $region=DB::table('region')->get();\n\n return view(\"nomina.directorio_regional.create\", ['region'=> $region]);\n }}", "public function create()\n {\n $regiones = Region::get(); \n\n return view('formAgregarDestino', ['regiones'=>$regiones]);\n }", "public static function addressRegion()\n {\n return new TextNode('address_region');\n }", "public function create($component_type_id, $position, $delta = 0, $region = 'content') {\n $container = new ExoComponentContainer($this->exoComponentManager, $component_type_id);\n $this->insertSectionComponent($container, $position, $delta, $region);\n $this->flagForSave();\n return $container;\n }", "public function run()\n {\n DB::table('regions')->insert(\n [\n [\n 'nom' => 'louga',\n ],\n [\n 'nom' => 'Rufisque',\n ],\n [\n 'nom' => 'Cap Skirring',\n ],\n [\n 'nom' => 'Bargny',\n ],\n [\n 'nom' => 'Pikine',\n ],\n [\n 'nom' => 'Dakar',\n ],\n [\n 'nom' => 'Richard-Toll',\n ],\n [\n 'nom' => 'Guediawaye',\n ],\n [\n 'nom' => 'Kedougou',\n ],\n [\n 'nom' => 'Mbour',\n ],\n [\n 'nom' => 'Thies',\n ],\n [\n 'nom' => 'Kaolack',\n ],\n [\n 'nom' => 'Saint-louis',\n ],\n [\n 'nom' => 'Tivaouane',\n ],\n [\n 'nom' => 'Joal Fadiouth',\n ],\n [\n 'nom' => 'Sédhiou',\n ],\n [\n 'nom' => 'Diourbel',\n ]\n ]\n );\n /*factory(\\App\\Region::class, 22)->create();*/\n }", "public function create(\n string $region,\n ?string $tablePrefix = null,\n ?string $version = null,\n ?array $additional = null\n ): ConnectionInterface;", "public function store(Request $request)\n {\n if($request->nombreRegion != null){\n // si atributo no es nulo\n if(is_string($request->nombreRegion)){ \n // si es string\n $region = new Region();\n $region->nombreRegion = $request->nombreRegion;\n $region->softDelete = False;\n $region->save();\n return response()->json([\n \"message\"=> \"Se ha creado una región\",\n \"id\"=> $region->id\n ], 202);\n }\n return response()->json([\"message\"=>\"Nombre region debe ser string.\"]);\n }\n return response()->json([\"message\"=>\"Nombre region es obligatorio.\"]);\n }", "public function create()\n {\n //\n return view('InterestPoint\n .create');\n }", "public function create()\n {\n return view('ilocations::admin.polygons.create');\n }", "public function store(Request $request)\n {\n $region = new Region;\n $region->pais_id = $request->pais_id;\n $region->nombre = $request->nombre;\n $region->save();\n\n return redirect()->route('regiones.index');\n }", "public function create()\n {\n $city = city::latest()->pluck('display_name_en','id');\n // return $city;\n return view('admin.regions.create')->with('city', $city);\n }", "public function create()\n {\n //\n return view('area.create');\n }", "public function setRegion(Region $region)\n {\n $this->region = $region;\n\n return $this;\n }", "public function setRegion(string $region): self\n {\n $this->options['region'] = $region;\n return $this;\n }", "private function setRegion()\n {\n if ( ! isset( $this->data['country'] ) ) {\n return;\n }\n \n if ( ! isset( $_POST['region'] ) ) {\n $this->data['error']['region'] = \"Please provide your province or state.\";\n $this->error = true;\n return;\n }\n \n $r = trim( $_POST['region'] );\n \n if ( $this->data['country'] == 'CA' ) {\n $regions = $this->regions->get('provinces');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your province.\";\n $this->error = true;\n return;\n }\n }\n elseif ( $this->data['country'] == 'US' ) {\n $regions = $this->regions->get('states');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your state.\";\n $this->error = true;\n return;\n }\n }\n \n $this->data['region'] = $r;\n }", "public function create()\n {\n $regions=Region::orderBy('name','ASC')->pluck('name', 'id')->prepend('',''); \n return view('admin.municipality.create')->with('regions',$regions);\n }", "public function addRegion(array $a=array()) {\r\n\t\tif($a){\r\n\t\t\t$region_name=$a['regionName'];\r\n\t\t\t$status=$a['status'];\r\n\t\t\t$sSql = \"INSERT INTO region_mstr (region_name,insert_date) VALUES ('\".$this->oMysqli->secure($region_name).\"',now())\";\r\n\t\t\t$data=$this->oMysqli->query($sSql);\r\n\t\t\treturn $data;\r\n\t\t}\r\n\t}", "public function setRegion($region)\n {\n \t$this->aws_as_region = $region;\n }", "public function actionCreate()\n {\n $model = new ListRegionType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $getParams = Yii::$app->getRequest()->get();\n $model->generateDefaults($getParams);\n return $this->render('form', ['model' => $model]);\n }\n }", "public function setRegion($region) {\n\t\t$this->region = $region;\n\t}", "public function store(Request $request)\n {\n $user = $request->user();\n $data = $request->only((new \\Blegrator\\Region())->getFillable());\n\n // Validation Request\n $validator = Validator::make($data, [\n 'name' => ['required'],\n 'photo' => ['sometimes', 'image', 'mimes:jpeg,png,jpg', 'max:10000'] //10MB\n ]);\n if ($validator->fails()) {\n return $this->responseWithValidateError($validator->errors()->all());\n }\n\n // Upload Image File\n if ($request->hasFile('photo')) {\n $data['photo'] = File::uploadImage($request, 'photo', \\Blegrator\\Region::$Image_Path, 75, 1024, null);\n }\n\n // Create New Item\n $region = \\Blegrator\\Region::create($data);\n\n // Return Data\n return $this->respondWithItem($region, new RegionTransformer());\n }", "public function create()\n {\n //\n return view('backend.area.create');\n }", "public function run()\n {\n $regions = [\n [\n 'name' => 'Region 1',\n 'country_id' => 1\n ],\n [\n 'name' => 'Region 2',\n 'country_id' => 1\n ],\n [\n 'name' => 'Region 7',\n 'country_id' => 2\n ],\n [\n 'name' => 'Region 3',\n 'country_id' => 2\n ]\n ];\n\n Region::insert($regions);\n }", "public function __construct( $country, $region ) {\n\n\t\t// if a country id or code is passed make sure we have a valid country_id\n\t\t$country_id = $country ? WPSC_Countries::get_country_id( $country ) : 0;\n\n\t\t// if we are creating a region use the country_id we just validated and get the region code\n\t\tif ( is_array( $region ) ) {\n\t\t\t$region['country_id'] = $country_id;\n\t\t\t$region_id_or_code = $this->_save_region_data( $region );\n\t\t} else {\n\t\t\t$region_id_or_code = $region;\n\t\t}\n\n\t\t// if we have both a country country id and a region id/code we can construct this object\n\t\tif ( $country && $region_id_or_code ) {\n\t\t\t$region_id = WPSC_Countries::get_region_id( $country_id, $region_id_or_code );\n\n\t\t\tif ( $country_id && $region_id ) {\n\t\t\t\t$wpsc_country = new WPSC_Country( $country_id );\n\t\t\t\t$wpsc_region = $wpsc_country->get_region( $region_id );\n\n\t\t\t\tif ( $wpsc_region ) {\n\t\t\t\t\t$this->_code = $wpsc_region->_code;\n\t\t\t\t\t$this->_id = $wpsc_region->_id;\n\t\t\t\t\t$this->_country_id = $wpsc_region->_country_id;\n\t\t\t\t\t$this->_name = $wpsc_region->_name;\n\t\t\t\t\t$this->_tax = $wpsc_region->_tax;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getRegionInstance()\n\t{\n\t\tif (!$this->_regionInstance) {\n\t\t\t$this->_regionInstance = Mage::getSingleton('fvets_salesrep/region');\n\t\t}\n\t\treturn $this->_regionInstance;\n\t}", "public function setRegion($region)\n {\n $this->region = $region;\n }", "public function getRegion() \n {\n return $this->region;\n }", "function eZRegion( $id = \"\" )\n {\n if ( is_array( $id ) )\n {\n $this->fill( $id );\n }\n else if ( $id != \"\" )\n {\n $this->ID = $id;\n\t\t\t$this->get( $this->ID );\n }\n }", "private function initRegion(Coords\\RegionRef $regionRef)\n {\n if (!isset($this->regions[$regionRef->toKey()])) {\n $this->regions[$regionRef->toKey()] = new Region($regionRef, $this->path);\n }\n }", "function facebook_instant_articles_add_regions(&$form, &$form_state) {\n\n // Get the entity_type, bundle and view mode.\n $entity_type = $form['#entity_type'];\n $bundle = $form['#bundle'];\n $view_mode = $form['#view_mode'];\n\n // Check layout.\n $layout = isset($form['#fbia_layout']) ? $form['#fbia_layout'] : FALSE;\n\n $table = &$form['fields'];\n\n $table['#header'] = array(\n t('Field'),\n t('Weight'),\n t('Parent'),\n t('Region'),\n t('Label'),\n array('data' => t('Format'), 'colspan' => 3),\n );\n\n $regions = array(\n 'header' => t('Header'),\n 'body' => t('Body'),\n 'footer' => t('Footer'),\n );\n\n $table['#regions'] = array();\n foreach ($regions as $region_key => $region_title) {\n $region_options[$region_key] = $region_title;\n $table['#regions'][$region_key] = array(\n 'title' => $region_title,\n 'message' => t('No fields are displayed in this region'),\n );\n }\n\n // Let other modules alter the regions.\n $context = array(\n 'entity_type' => $entity_type,\n 'bundle' => $bundle,\n 'view_mode' => $view_mode,\n );\n $region_info = array(\n 'region_options' => &$region_options,\n 'table_regions' => &$table['#regions'],\n );\n drupal_alter('facebook_instant_articles_layout_region', $context, $region_info);\n\n $region_options['hidden'] = $view_mode != 'form' ? t('Disabled') : t('Hidden');\n $table['#regions']['hidden'] = array(\n 'title' => $view_mode != 'form' ? t('Disabled') : t('Hidden'),\n 'message' => t('No fields are hidden.'),\n );\n\n $region = array(\n '#type' => 'select',\n '#options' => $region_options,\n '#default_value' => 'hidden',\n '#attributes' => array(\n 'class' => array('ds-field-region'),\n ),\n );\n\n $limit_items = array(\n '#type' => 'textfield',\n '#size' => 2,\n '#default_value' => '',\n '#weight' => 10,\n '#default_value' => '#',\n '#prefix' => '<div class=\"limit-float\">',\n '#suffix' => '</div><div class=\"clearfix\"></div>',\n '#attributes' => array(\n 'alt' => t(\"Enter a number to limit the number of items or 'delta' to print a specific delta (usually configured in views or found in entity->delta). Leave empty to display them all. Note that depending on the formatter settings, this option might not always work.\"),\n 'title' => t(\"Enter a number to limit the number of items or 'delta' to print a specific delta (usually configured in views or found in entity->delta). Leave empty to display them all. Note that depending on the formatter settings, this option might not always work.\"),\n ),\n );\n\n // Update existing rows by changing rowHandler and adding regions.\n foreach (element_children($table) as $name) {\n $row = &$table[$name];\n $row['#js_settings'] = array('rowHandler' => 'facebookInstantArticles');\n $row['#region_callback'] = 'facebook_instant_articles_field_ui_row_region';\n\n // Remove hidden format.\n if (isset($row['format']['type']['#options']['hidden'])) {\n unset($row['format']['type']['#options']['hidden']);\n }\n\n // Add label class.\n if (isset($row['label'])) {\n if (isset($form_state['formatter_settings']) && isset($form_state['formatter_settings'][$name]['ft'])) {\n if (!empty($form_state['formatter_settings'][$name]['ft']['lb'])) {\n $row['human_name']['#markup'] = check_plain($form_state['formatter_settings'][$name]['ft']['lb']) . ' ' . t('(Original: !orig)', array('!orig' => $row['human_name']['#markup']));\n }\n }\n }\n\n // Limit items.\n $field_info = field_info_field($name);\n if (isset($field_info['cardinality']) && $field_info['cardinality'] != 1 && $view_mode != 'form') {\n $row['format']['type']['#prefix'] = '<div class=\"limit-float\">';\n $row['format']['type']['#suffix'] = '</div>';\n $row['format']['limit'] = $limit_items;\n $row['format']['limit']['#default_value'] = (isset($layout->settings['limit']) && isset($layout->settings['limit'][$name])) ? $layout->settings['limit'][$name] : '#';\n }\n\n // Add region.\n $split = ($view_mode != 'form') ? 7 : 6;\n if ($row['#row_type'] == 'group' && $view_mode == 'form') {\n $split = ($view_mode != 'form') ? 8 : 7;\n }\n\n $second = array_splice($row, $split);\n $row['region'] = $region;\n $row['region']['#default_value'] = (isset($layout->settings['fields'][$name]) && isset($region_options[$layout->settings['fields'][$name]])) ? $layout->settings['fields'][$name] : 'hidden';\n\n $row = array_merge($row, $second);\n }\n return $form;\n}", "public function addRegion($tag, $content)\n\t{\n\t\t$this->regions[$tag] = $content;\n\t}" ]
[ "0.7402579", "0.72056437", "0.72023356", "0.70269537", "0.7003206", "0.6938643", "0.68484014", "0.6764048", "0.67341113", "0.67006123", "0.66175956", "0.6582799", "0.65268934", "0.6447237", "0.64321244", "0.6350188", "0.6240096", "0.6240096", "0.61230683", "0.61109453", "0.6074096", "0.60595757", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.60346097", "0.603352", "0.603352", "0.603352", "0.60326296", "0.60155827", "0.5997634", "0.5933733", "0.5878694", "0.5859982", "0.585327", "0.58363384", "0.58351606", "0.5823089", "0.57057625", "0.56710726", "0.56640726", "0.56433994", "0.5625534", "0.5608036", "0.558937", "0.5587321", "0.5576747", "0.55529016", "0.5513363", "0.5511644", "0.55040145", "0.54992044", "0.54975104", "0.54779416", "0.5476322", "0.5453153", "0.5452043", "0.5441798", "0.5426996", "0.54266876", "0.5413648", "0.5410771", "0.53999555", "0.5391779", "0.5384422", "0.53804857", "0.5375783", "0.53660387", "0.5364878", "0.5358527", "0.53414595", "0.53352195", "0.53288144", "0.5315278", "0.53083795", "0.53068715", "0.5300643", "0.5293777", "0.52909505", "0.5256639", "0.52561206", "0.52454734", "0.5244081", "0.5220546", "0.5208427", "0.51787436", "0.5156146", "0.5148065", "0.5147055", "0.5145269", "0.5128111" ]
0.665905
10
Converts a region row object to an array.
public static function toArray($region) { return array( 'id' => $region->id, 'name' => isset($region->name) ? $region->name : null, 'lat' => isset($region->lat) && $region->lat !== null ? (float) $region->lat : null, 'long' => isset($region->long) && $region->long !== null ? (float) $region->long : null ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getRowAsArray();", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "public function getRowDataAsArray( $iRow )\r\n {\r\n return $this->data[$iRow];\r\n }", "public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}", "public function getRowsAsArray(){\n $fieldNames=$this->getFieldNames();\n $result=[];\n if (!empty($this->valuesRows)){\n foreach($this->valuesRows as $valuesRow){\n $rowArr=[];\n foreach($fieldNames as $i=>$fieldName){\n if (isset($valuesRow[$i])){\n $rowArr[$fieldName]=$valuesRow[$i];\n }\n }\n $result[]=$rowArr;\n }\n }\n return $result;\n }", "public static function getRowsArray(): array {\n return range('A', 'J');\n }", "public function toArray(): array\n {\n $this->initialize();\n return $this->rows;\n }", "public function getArray()\n\t{\n\t\treturn $this->row;\n\t}", "public function toEntityArray()\n {\n $return = [];\n foreach ($this as $row) {\n $return[] = $row;\n }\n return $return;\n }", "public function toArray()\n {\n return ['rows' => $this->rows] + parent::toArray();\n }", "public function toArray()\n {\n return [\n 'id' => $this->getRowId(),\n 'data' => $this->item\n ];\n }", "public function getArrayRows()\n {\n $result = [];\n /** @var \\Magento\\Framework\\Data\\Form\\Element\\AbstractElement */\n $element = $this->getElement();\n $aValue = $element->getValue(); // get values\n if (is_array($aValue) === false) { // no array given? -> value from config.xml\n $aValue = json_decode($aValue, true); // convert string to array\n }\n if ($aValue && is_array($aValue)) {\n foreach ($aValue as $rowId => $row) {\n $rowColumnValues = [];\n foreach ($row as $key => $value) {\n $row[$key] = $value;\n $rowColumnValues[$this->_getCellInputElementId($rowId, $key)] = $row[$key]; // add value the row\n }\n $row['_id'] = $rowId;\n $row['column_values'] = $rowColumnValues;\n $result[$rowId] = new \\Magento\\Framework\\DataObject($row);\n $this->_prepareArrayRow($result[$rowId]);\n }\n }\n return $result;\n }", "public function toArray($decodePrivileges = false) {\n foreach ($this->_rows as $i => $row) {\n $this->_data[$i] = $row->toArray($decodePrivileges);\n }\n return $this->_data;\n }", "public function getValues($row){\n $data = array();\n while( ($obj = oci_fetch_assoc($this->result)) != false ){\n $data[] = $obj[$row];\n }\n return $data;\n }", "function getRowAsArray($query) {\n\t\topenDatabaseConnection();\n\t\t$result = mysql_query($query) or die(\"Invalid query: \" . mysql_error());\n\t\t# turn the result into an array\n\t\treturn mysql_fetch_assoc($result);\n\t}", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t$result[$column->name] = $this->_data[$column->name];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem converting the Record to an array.');\n\t\t}\n\t}", "public function toArray(): array\n {\n return (array) $this->result();\n }", "public function getToArray()\n {\n $row = [];\n foreach (array_keys($this->columns) as $column) {\n $row[$column] = trim($this->getColumnValue($column));\n }\n return $row;\n }", "abstract public function to_array();", "public function toArray()\n {\n $data = [];\n if (isset($this->descriptor)) {\n $data['descriptor'] = $this->descriptor;\n }\n if (isset($this->rowIndex)) {\n $data['rowIndex'] = $this->rowIndex;\n }\n if (isset($this->odd)) {\n $data['odd'] = $this->odd;\n }\n if (isset($this->even)) {\n $data['even'] = $this->even;\n }\n return $data;\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function decode(string $row): array\n {\n return [$row];\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.74998134", "0.67951405", "0.6701318", "0.64403456", "0.63062185", "0.62881124", "0.6234305", "0.6158783", "0.61094934", "0.6091654", "0.6083686", "0.60407126", "0.60230803", "0.59716725", "0.5964659", "0.59583354", "0.59583354", "0.59583354", "0.59583354", "0.59583354", "0.59583354", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.59515023", "0.5945872", "0.59178513", "0.5896039", "0.58789736", "0.58778256", "0.5845965", "0.5845965", "0.5845965", "0.5845965", "0.58455956", "0.58455956", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.58447504", "0.5837052", "0.58250636", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477", "0.5820477" ]
0.6808456
1
Find Meta Service Metrics for a nonadmin user.
public function findByMetaIdAndContact(int $metaId, ContactInterface $contact): ?array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public function findServicesDowntimesForNonAdminUser(): array;", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "public function findDowntimesForNonAdminUser(): array;", "public function getUserStats($userId);", "function scheduledreporting_component_get_reports($userid = 0)\n{\n $scheduled_reports = array();\n $temp = get_user_meta($userid, 'scheduled_reports');\n if ($temp != null)\n $scheduled_reports = mb_unserialize($temp);\n\n // Add user_id to reports\n if (empty($userid)) {\n $userid = $_SESSION['user_id'];\n }\n foreach ($scheduled_reports as $id => $report) {\n $scheduled_reports[$id]['user_id'] = $userid;\n }\n\n return $scheduled_reports;\n}", "public static function get($meta, $user);", "public function findServicesDowntimesForAdminUser(): array;", "abstract function getNonRegisteredUsers();", "public function findByNotSeen(int $userId): QueryResultInterface\n {\n $query = $this->createQuery();\n\n $query->getQuerySettings()->setRespectStoragePage(false);\n\n /* $query->matching($query->logicalNot(\n $query->contains('seenBy', $userId)\n ));*/\n\n return $query->execute();\n }", "private function getMetrics($context, $noHidden)\n {\n $cacheKey = $context;\n if ($noHidden) {\n $cacheKey .= '-no-hidden';\n }\n\n $callable = function () use ($context, $noHidden) {\n $metricsTable = TableRegistry::getTableLocator()->get('Metrics');\n $metrics = $metricsTable->find('threaded')\n ->select([\n 'id',\n 'name',\n 'description',\n 'type',\n 'parent_id',\n 'selectable',\n 'visible',\n ])\n ->where(['context' => $context])\n ->toArray();\n\n if ($noHidden) {\n $metrics = Metric::removeNotVisible($metrics);\n }\n\n return $metrics;\n };\n\n return Cache::remember($cacheKey, $callable, 'metrics_api');\n }", "public function getAllMeasurements($userId){\n\t\t$sql = 'SELECT * FROM measurements WHERE user_id = :userId';\n\t\t$pstmt = $this->db->prepare($sql);\n\t\t$pstmt->bindParam(':userId', $userId);\n\t\t$pstmt->execute();\n\t\treturn $pstmt->fetchAll(\\PDO::FETCH_OBJ);\n\t}", "public static function get_all( WP_User $user ) {\n\n\t\tglobal $wpdb;\n\n\t\t$mids = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\"SELECT `umeta_id` FROM {$wpdb->usermeta} WHERE `meta_key` = %s AND `user_id` = %d\",\n\t\t\tself::META_KEY,\n\t\t\t$user->ID\n\t\t) );\n\n\t\t$sessions = array();\n\n\t\tforeach ( $mids as $meta_id ) {\n\t\t\tif ( ! is_wp_error( $session = self::get( $meta_id ) ) ) {\n\t\t\t\t$sessions[] = $session;\n\t\t\t}\n\t\t}\n\n\t\treturn $sessions;\n\t}", "function YWR_2020_pre_user_query($user_search)\n{\n\n $user = wp_get_current_user();\n\n if (!current_user_can('manage_options')) {\n\n global $wpdb;\n\n $user_search->query_where =\n str_replace('WHERE 1=1',\n \"WHERE 1=1 AND {$wpdb->users}.ID IN (\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\n WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities'\n AND {$wpdb->usermeta}.meta_value NOT LIKE '%administrator%')\",\n $user_search->query_where\n );\n\n }\n}", "public function findHostDowntimesForNonAdminUser(): array;", "public function get_all_user_not_regis()\n\t{\n\t\t$sql = \"SELECT * FROM $this->hr_db.`hr_person` WHERE ps_id not in (SELECT su_ps_id FROM $this->swm_db.`swm_user`)\";\n\t\t$query = $this->swm->query($sql);\n\n\t\treturn $query;\n\t}", "function get_usermeta($user_id, $meta_key = '')\n {\n }", "Public Function getAllNonDeletedUsersWithStats()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user WHERE Deleted = 0');\n\t\tforeach($Users as $User)\n\t\t{\n\t\t\t$Temp = new User($User->id);\n\t\t\t$Temp->LoadStats();\n\t\t\t$Output[] = $Temp;\n\t\t}\t\n\t\treturn $Output;\n\t}", "function getAllReports(){\n global $errors;\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles, $keyword;\n\t\t$sql = \"SELECT * FROM reportedusers WHERE U_name like '%$keyword%' or rptr_u_name like '%$keyword%' or reason like '%$keyword%' order by timestamp desc \"; \n\t\tif($result = mysqli_query($conn, $sql)){\n $users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $users;\n }else{\n array_push($errors, \"there was a problem fetching Records\");\n }\n\n\t} else {\n\t\treturn null;\n\t}\n}", "public function dontSeeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->dontSeeInDatabase($tableName, $criteria);\n }", "public function findDowntimesForAdminUser(): array;", "function _get ($params = array()) {\n\t\tif (!$this->STATS_ENABLED) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_get_user_stats_for_ids (array($params[\"user_ids\"]));\n\t}", "public function getResultsOfUser($user_id);", "public function getAll($user = \"\")\n {\n $log = $user == \"\" ? R::findAll('mcslogs') : R::findAll('mcslogs',' user = :user', array( ':user' => $user ));\n return $log;\n }", "static function findAdministrators($exclude_user = null) {\n return Users::find(array(\n 'conditions' => $exclude_user instanceof User ? DB::prepare(\"type = 'Administrator' AND id != ? AND state = ?\", $exclude_user->getId(), STATE_VISIBLE) : DB::prepare(\"type = 'Administrator' AND state = ?\", STATE_VISIBLE),\n ));\n }", "function getMetrics($metric, $startDate, $endDate, $dimensions = false, $sort = false, $filter = false, $limit = false)\n\t{\n\t\t$analytics = new Google_AnalyticsService($this->client);\n\n\t\t$params = array();\n\n\t\tif ($dimensions)\n\t\t{\n\t\t\t$params['dimensions'] = $dimensions;\n\t\t}\n\t\tif ($sort)\n\t\t{\n\t\t\t$params['sort'] = $sort;\n\t\t}\n\t\tif ($filter)\n\t\t{\n\t\t\t$params['filters'] = $filter;\n\t\t}\n\t\tif ($limit)\n\t\t{\n\t\t\t$params['max-results'] = $limit;\n\t\t}\n \n // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking\n $filtered_id = str_replace( 'ga:', '', $this->accountId );\n \n if(!$filtered_id){\n echo 'Error - Account ID is blank';\n return false;\n }\n \n\t return $analytics->data_ga->get(\n\t 'ga:'.$filtered_id,\n\t $startDate,\n\t $endDate,\n\t $metric,\n\t $params\n\t );\n\t}", "public function findDowntimesByServiceForNonAdminUser(int $hostId, int $serviceId): array;", "public function stats(){\n\t\treturn apc_cache_info('user',true);\n\t}", "function get_user_analytics_info() {\n global $wp_version;\n\n $url = 'http://freegeoip.net/json/' . $_SERVER['REMOTE_ADDR'];\n $params = array(\n 'timeout' => 30,\n 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )\n );\n\n $response = wp_remote_get( $url, $params );\n $user_data = wp_remote_retrieve_body( $response );\n\n if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {\n return false;\n }\n\n $user_info = (array) json_decode( $user_data );\n $user_analytics_info = array_merge( $user_info, array( 'browser_pc' => $_SERVER['HTTP_USER_AGENT'] ) );\n\n return $user_analytics_info;\n }", "function statistics_extended_users_metadata_count($metadata,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN \" . $dbprefix . \"entities e ON e.guid = ue.guid AND e.enabled='yes' \";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "function wp_get_users_with_no_role($site_id = \\null)\n {\n }", "public function userMeta()\n {\n return $this->hasMany(UserMeta::class, 'user_id', 'ID');\n }", "public function availableMetrics()\n {\n return DashboardNova::allAvailableDashboardCards($this)->whereInstanceOf(Metric::class);\n }", "public function findUserByMonth()\n {\n $query = $this->getEntityManager()\n ->createQuery(\"\n SELECT COUNT(u.id) as total FROM OwbazUserBundle:User u\"\n );\n try { \n return $query->getArrayResult();\n \n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n } \n }", "public function getUserstatistic()\n {\n return $this->hasOne(Userstatistic::className(), ['user_id' => 'id']);\n }", "public function getMonthlyUserStats()\n {\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month )) as months group by monthName'));\n\n $total = [\n 'January' => 0,\n 'February' => 0,\n 'March' => 0,\n 'April' => 0,\n 'May' => 0,\n 'June' => 0,\n 'Jule' => 0,\n 'August' => 0,\n 'September' => 0,\n 'October' => 0,\n 'November' => 0,\n 'December' => 0\n ];\n\n $active = $total;\n\n foreach ($stats as $stat){\n $total[$stat->monthName] = $stat->usercount;\n }\n\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month) and is_active = 1) as months group by monthName'));\n\n foreach ($stats as $stat){\n $active[$stat->monthName] = $stat->usercount;\n }\n\n return [\n 'total' => $total,\n 'active' => $active\n ];\n }", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "public function stats() {\n\t\t$userCount = 0;\n\t\tif ($this->isAdmin) {\n\t\t\t$countByBackend = $this->userManager->countUsers();\n\n\t\t\tif (!empty($countByBackend)) {\n\t\t\t\tforeach ($countByBackend as $count) {\n\t\t\t\t\t$userCount += $count;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t'@phan-var \\OC\\Group\\Manager $this->groupManager';\n\t\t\t$groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($this->userSession->getUser());\n\n\t\t\t$uniqueUsers = [];\n\t\t\tforeach ($groups as $group) {\n\t\t\t\tforeach ($group->getUsers() as $uid => $displayName) {\n\t\t\t\t\t$uniqueUsers[$uid] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$userCount = \\count($uniqueUsers);\n\t\t}\n\n\t\treturn new DataResponse(\n\t\t\t[\n\t\t\t\t'totalUsers' => $userCount\n\t\t\t]\n\t\t);\n\t}", "public function forUserSpecial(User $user, $date_type, $data_type, $start_date, $end_date) {\n\t\treturn Statistics::where ( 'user_id', $user->id )->where ( 'date_type', $date_type )->where ( 'data_type', $data_type )->where ( 'statistic_date', '>', $start_date )->where ( 'statistic_date', '<=', $end_date )->orderBy ( 'created_at', 'desc' )->get ();\n\t}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "function getAllOtherAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllOtherAffinityGroupsFromUser($userID);\n }", "public function get_user_stats( $args = array(), $array_output = false ) {\n $default_args = array(\n 'order_by' => 'quantity',\n 'order' => 'DESC',\n 'group_by' => 'ip',\n 'fields' => array(\n 'post_id',\n 'ip',\n 'COUNT(ip) AS quantity',\n 'SUM(price) AS amount',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args, $array_output );\n }", "public function index()\n {\n $fields = [];\n $user = Auth::user();\n $start_date = $this->getStartDate(Input::get('start_date'));\n $end_date = $this->getEndDate(Input::get('end_date'));\n $time_increment = (bool) Input::get('time_increment', false);\n\n $ad_sets = $this->adSetRepository->byUserWithMetricsByDate( $user, $fields, $start_date, $end_date, $time_increment );\n\n // Return the results.\n //\n return $this->response( $ad_sets ?: [] );\n }", "private function loadMetadata($user)\n {\n // Gets authenticated user's metadatas\n $user->portfolios->portfolio_stocks;\n\n // Loads all metadata\n $stocksData = $user->portfolios->portfolio_stocks;\n\n // Gets all user's share counts\n $tickers = $this->getShareCount($stocksData);\n\n // Returns stock information through API request and tickers\n return array(\n 'info' => FinanceAPI::getAllStockInfo(array_keys($tickers)),\n 'tickers' => $tickers\n );\n }", "public static function mc_find_by_user_id($user_id){\n\t\treturn static::mc_find($user_id, true);\n\t}", "function statistics_extended_users_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,'create' as event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}entities \";\r\n\t$query.=\"WHERE type = 'user' \";\r\n\t$query.=\"AND enabled='yes' \";\r\n\t$query.=\"GROUP BY zoom\";\r\n\treturn get_data($query);\r\n}", "function metadata()\r\n {\r\n Cache::variable($this->metadata, function() {\r\n return (array)DB::object('userMetadataById', $this->id);\r\n });\r\n }", "function get_times_run_for_user( $user ) {\n\t\t$query = new Log_Query();\n\t\t$query->where_workflow( $this->get_id() );\n\n\t\tif ( $user->ID === 0 ) { // guest user\n\t\t\t$query->where_guest( $user->user_email );\n\t\t}\n\t\telse {\n\t\t\t$query->where_user( $user->ID );\n\t\t}\n\n\t\treturn count( $query->get_results() );\n\t}", "public function findHostDowntimesForAdminUser(): array;", "public function getMessageStats($userId);", "function GetSums($users = array(), $start, $end = false, $resolution = 'day', $hideNoEntries = false) {\n\t\t$this->stats = array();\n\t\tforeach ($users as $user) {\n\t\t\t$temp = new SaleStats();\n\t\t\t$temp->LoadSum($user['ID'], $start, $end, $resolution);\n\t\t\t$temp->mTitle = $user['first_name'].' '.$user['last_name'];\n\t\t\t$temp->mUserLastName = $user['last_name'];\n\t\t\t$temp->mUserFirstName = $user['first_name'];\n if ($hideNoEntries && $temp->mNumRecords == 0)\n continue;\n\t\t\t$this->stats[] = $temp;\n\t\t}\n\t}", "public function getAllOwned($userID, ILoggerService $logger){\n \n $logger->info(\"Entering AffinityGroupService.getAllOwned()\");\n \n //Creates a connection to the database\n $connection = new Connection();\n \n //Creates an instance of the dao\n $DAO = new AffinityGroupDAO($connection, $logger);\n \n //Stores the results of the dao method call\n $results = $DAO->getOwned($userID);\n \n $connection = null;\n \n $logger->info(\"Exiting AffinityGroupService.getAllOwned()\");\n \n return $results;\n }", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "function getMeta($userscript){\n $metaPattern = '/==UserScript==(.)*==\\/UserScript==/ms';\n if( preg_match($metaPattern, $userscript, $metaSections)){ //$userscript\n return $metaSections[0];\n }\n }", "public function getUserInfo($userId): array {\n $query = 'SELECT\n `registeredPage`,\n `mail`,\n `registeredGame`,\n `hashedKey`,\n `realKey`,\n `lastUpdate`,\n `remainingCredits`,\n `name`,\n `points`,\n `rank`,\n `level` FROM `userOverview` WHERE `id` = ' . $userId . '';\n\n $getUserInfo = $this->_conn->query($query);\n\n $result = [];\n\n if($getUserInfo->num_rows === 1) {\n while($data = $getUserInfo->fetch_assoc()) {\n\n $arr = [\n 'hashedKey' => $data['hashedKey'],\n 'realKey' => $data['realKey'],\n ];\n\n foreach($arr as $index => $key) {\n if($key === '') {\n $key = false;\n }\n $result[$index] = $key;\n }\n\n $arr = [\n 'registeredPage' => $data['registeredPage'],\n 'registeredGame' => $data['registeredGame'],\n 'lastUpdate' => $data['lastUpdate'],\n ];\n\n foreach($arr as $index => $timestamp) {\n $result[$index] = $this->_convertUnixTimestampToDateTime($timestamp);\n }\n\n $arr = [\n 'remainingCredits' => $data['remainingCredits'],\n 'mail' => $data['mail'],\n 'name' => $data['name'],\n 'points' => $data['points'],\n 'rank' => $data['rank'],\n 'level' => $data['level'],\n ];\n\n foreach($arr as $index => $value) {\n if($value === '') {\n $value = false;\n }\n\n $result[$index] = $value;\n }\n\n $result['securityToken'] = md5($data['registeredPage']);\n }\n }\n\n return $result;\n }", "public function seeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->seeInDatabase($tableName, $criteria);\n }", "function scheduledreporting_component_get_all_reports()\n{\n $scheduled_reports = array();\n\n // Get all the users and grab their reports\n $users = get_users();\n foreach ($users as $user) {\n $tmp = scheduledreporting_component_get_reports($user['user_id']);\n foreach ($tmp as $i => $t) {\n $tmp[$i]['user_id'] = $user['user_id'];\n }\n $scheduled_reports = array_merge($scheduled_reports, $tmp);\n }\n\n return $scheduled_reports;\n}", "public function getUserNotifications($user);", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "public function dontHaveUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->dontHaveInDatabase($tableName, $criteria);\n }", "function userExistsNotDeleted($userId) {\n return getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `id` =\" . escape(intval($userId)) . \" AND `deleted` =0 LIMIT 0, 1\");\n }", "public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}", "function get_user_meta($user_id, $key = '', $single = \\false)\n {\n }", "public function getObservationsPerUser(User $user)\n {\n $masqued = 'Masqué';\n $deleted = 'Supprimé';\n return $this->createQueryBuilder('o')\n ->andWhere('o.user = :user')\n ->setParameter('user', $user)\n ->leftJoin('o.mainStatus', 's')\n ->addSelect('s')\n ->andWhere('s.name <> :name_masqued')\n ->setParameter('name_masqued', $masqued)\n ->andWhere('s.name <> :name_deleted')\n ->setParameter('name_deleted', $deleted)\n ->getQuery()\n ->getResult();\n }", "function wporphanageex_search_user_role( $user_id = false ) {\n\tglobal $wpdb, $current_user;\n\n\t$current_user = wp_get_current_user();\n\tif ( ! $user_id ) {\n\t\t$user_id = $current_user->ID;\n\t}\n\n\t$prefixes = get_option( 'wporphanageex_prefixes' );\n\tif ( $prefixes && is_array( $prefixes ) ) {\n\t\tforeach ( $prefixes as $prefix ) {\n\t\t\t$role = get_user_meta( $user_id, $prefix . 'capabilities', true );\n\t\t\tif ( $role != '' && is_array( $role ) ) {\n\t\t\t\tforeach ( $role as $key => $value ) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// if no one was found, return default role\n\t$default = get_option( 'wporphanageex_role' );\n\treturn $default;\n}", "function get_owner_data($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_owner_data' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_id,\n ]);\n\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n \n $response = curl_exec($ch);\n curl_close($ch);\n \n return json_decode($response,true);\n\n }", "static function adminGetMetricDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n \r\n $sql = \"SELECT * FROM metric WHERE id=:id LIMIT 1\";\r\n $data = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow();\r\n \r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id=:id ORDER BY last_activity DESC\";\r\n $visits = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll(); \r\n \r\n if ($visits)\r\n foreach ($visits as $k=>$v)\r\n {\r\n $visits[$k]['location'] = Yii::app()->location->getLocation($v['location_id']);\r\n }\r\n \r\n $data['visits'] = $visits;\r\n \r\n \r\nFB::warn($data);\r\n \r\n \r\n \r\n/* \r\n $sql = \"SELECT user_id FROM metric WHERE id={$id}\";\r\n $userId = Yii::app()->db->createCommand($sql)->queryScalar();\r\n \r\n \r\n \r\n if ($userId)\r\n {\r\n $sql = \"SELECT id FROM metric WHERE user_id={$userId} ORDER BY id DESC\";\r\n $ids = Yii::app()->db->createCommand($sql)->queryColumn();\r\n }\r\n else\r\n {\r\n $ids[] = $id;\r\n }\r\n \r\n $res['user_id'] = $userId;\r\n \r\n if ($ids)\r\n foreach ($ids as $v)\r\n {\r\n //location\r\n\r\n $sql = \"SELECT ip, location_id,\tadded, last_activity FROM metric WHERE id={$v} LIMIT 1\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n $m['details']['location'] = Yii::app()->location->getLocation($m['details']['location_id']);\r\n \r\n //visits\r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id={$v} ORDER BY id DESC\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n \r\n \r\n \r\n //actions\r\n //$sql = \"SELECT viewed_user_id, added FROM metric_video_play WHERE metric_id={$v} ORDER BY id DESC\";\r\n //$m['details']['videos'] = Yii::app()->db->createCommand($sql)->queryAll();\r\n \r\n $res['info'][] = $m;\r\n }\r\n*/ \r\n \r\n return $data;\r\n }", "public function showStatsGames($user_id) {\n \t$stats = User::with(['rounds:id', 'game:id,time', 'statsDetails:id,user_stats_id,won,rising_points,points,won_bets', 'user_stats:id', 'user:pseudo']);\n }", "static function findAdministratorsIds($exclude_user = null) {\n $users_table = TABLE_PREFIX . 'users';\n if($exclude_user instanceof User) {\n return DB::executeFirstColumn(\"SELECT id FROM $users_table WHERE type = ? AND id != ? AND state = ?\", 'Administrator', $exclude_user->getId(), STATE_VISIBLE);\n } else {\n return DB::executeFirstColumn(\"SELECT id FROM $users_table WHERE type = ? AND state = ?\", 'Administrator', STATE_VISIBLE);\n } //if\n }", "function statistics_extended_logins_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}system_log \";\r\n\t$query.=\"WHERE event IN ('login') \";\r\n\t$query.=\"AND object_type='user' \";\r\n\t$query.=\"GROUP BY zoom,event\";\r\n\treturn get_data($query);\r\n}", "function nb_get_student_meta(){\n\tglobal $current_user;\n\n\tif( $current_user->ID != null){\n\t\t$sid = $current_user->ID;\n\t\t$student = get_userdata($sid); \n\n\t}\n\t\n\treturn $student;\n\n}", "public static function search_users_returns() {\n global $CFG;\n require_once($CFG->dirroot . '/user/externallib.php');\n return new external_single_structure(array(\n 'users' => new external_multiple_structure(user_summary_exporter::get_read_structure()),\n 'count' => new external_value(PARAM_INT, 'Total number of results.')\n ));\n }", "function getvotados($user) {\n\tglobal $wpdb;\n\tif(user_can($user, 'integrante')) {\n\t\t$votos = $wpdb->get_var( \"SELECT count(1) FROM \".$wpdb->prefix . \"poptest_votos where votante = \".$user.\" group by votante\");\n\t\treturn $votos;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getCignaMedical($userId)\n {\n $select = $this->getTable()->select();\n $select->where('user_id = ?', $userId);\n $rowSets = $this->getTable()->fetchAll($select);\n \n $info = array();\n foreach($rowSets as $k => $row) {\n $medical = array();\n $medical['user_id'] = $row->user_id;\n $medical['whos_covered'] = $row->whos_covered;\n $medical['date_of_birth'] = $row->date_of_birth;\n $medical['relationship'] = $row->relationship;\n $medical['coverage_from'] = $row->coverage_from;\n $medical['to'] = $row->to;\n $medical['primary_care_physician'] = $row->primary_care_physician;\n \n $info[] = $medical;\n }\n \n return $info;\n }", "public function getUserMeta(\\Ekino\\WordpressBundle\\Entity\\User $user, $name)\n {\n foreach ($user->getMetas() as $meta) {\n if ($name == $meta->getKey()) {\n return $meta;\n }\n }\n return null;\n }", "function getUsersNotInGroup() {\n\n\tglobal $db;\n\treturn $db->getUsersNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public static function getFilesMetadata($userId);", "public function find_no_reset_time_usage($username) {\n $usage = false;\n $this->_show_header('no reset time',$username); \n $q_r = $this->Radacct->query(\"SELECT IFNULL(SUM(AcctSessionTime),0) as used FROM radacct WHERE username='$username'\");\n $accounting_used = $q_r[0][0]['used'];\n return $accounting_used;\n }", "public function getOtherPublications($user)\n {\n return $this->getByCategoryType('Other', $user);\n }", "public function userStats() {\n\n try {\n \n $workouts = Workout::select('id', 'workout_date')\n ->where('user_id', Auth::id())\n ->orderBy('id', 'DESC')\n ->get();\n \n $last_weight_logged = Weight::select('weight', 'date')\n ->where('user_id', Auth::id())\n ->latest('date')\n ->first();\n\n if($workouts->isEmpty()) {\n $workouts = \"N/A\";\n $last_workout = \"N/A\";\n }\n else {\n $last_workout = $workouts->pluck('workout_date')->first();\n $workouts = count($workouts);\n }\n\n return response()->json([\n \"workout_count\" => $workouts,\n \"last_workout\" => $last_workout,\n \"last_weight_logged\" => $last_weight_logged,\n ], 200);\n \n } catch (Exception $e) {\n return response()->json([\n 'message' => '500_message',\n 'error' => (object)[\n $e->getCode() => [$e->getMessage()],\n ],\n ]);\n }\n }", "public function get_usermeta_admin($id, $meta_key){\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_usermeta` WHERE `user_id`= ? AND `meta_key` = ?\");\n\t\t$query->bindValue(1, $id);\n\t\t$query->bindValue(2, $meta_key);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data \t\t\t\t= $query->fetch();\n\n\t\t\treturn $data;\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "function getAllOptHide($userName) { \t \t\n $sql = \"call spGetOptHide('$userName',@out_status);\";\n $rs = $this->db->Execute($sql);\n \t$data = $rs->getArray();\n\t\t$rs->Close();\n \treturn $data; \n }", "function getAllOptHide($userName) { \t \t\n $sql = \"call spGetOptHide('$userName',@out_status);\";\n $rs = $this->db->Execute($sql);\n \t$data = $rs->getArray();\n\t\t$rs->Close();\n \treturn $data; \n }", "public function __invoke()\n {\n if (Gate::denies('browse users')) {\n return abort(404);\n }\n\n // suggestion: you can add filter scope\n $users = User::stats()->get();\n\n $metrics = (new UserMetrics($users))->getStats();\n\n return response()->json([\n 'data' => $metrics,\n ]);\n }", "function getAllOptHide($userName) { \t \t\n $sql = \"call spGetOptHide('$userName',@out_status);\";\n $rs = $this->db->Execute($sql);\n \t$data = $rs->getArray(); \n\t\t$rs->Close();\n \treturn $data; \n }", "function user_stats() {\n\n\t\t/*\n\t\targuments:\n\t\t\tnone\n\n\t\treturns:\n\t\n\t\tReturn:\n\t\t\tif successful:\n\t\t\t{\n\t\t\t\tuser_qty: how many users there are in gamo\n\t\t\t\tuser_qty_active: how many users are active\n\t\t\t\tavg_points: how many points on average users have\n\t\t\t\tavg_points_active: how many points on average active users have\n\t\t\t}\n\n\t\t\tif error:\n\t\t\t{\n\t\t\t\terror_code: The error code\n\t\t\t\terror_msg: The error message\n\t\t\t}\n\t\t*/\n\n\t\tglobal $dbh;\n\n\t\t$result = array(); // This is where the results will be stored\n\n\t\t// Retrieve status for all users (active + non-active)\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for all users\n\t\t$results['user_qty'] = $row['count(*)'];\n\t\t$results['avg_points'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\t// Retrieve status for active users only\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users WHERE points > 0';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for active only users\n\t\t$results['user_qty_active'] = $row['count(*)'];\n\t\t$results['avg_points_active'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\treturn $results;\n\n\t}", "public function getUserNotices(User $user) {\n \n return $this->createQueryBuilder('n')\n ->select('n, g, i, l, v, t')\n ->where('n.user = :user')\n ->andWhere('n.draft = :draft')\n ->join('n.gallery', 'g')\n ->join('n.location', 'l')\n ->join('n.type', 't')\n ->leftJoin('n.values', 'v')\n ->leftJoin('g.images', 'i')\n ->setParameter('user', $user)\n ->setParameter('draft', 'FALSE')\n ->orderBy('n.created_at', 'DESC')\n ->getQuery()\n ->getResult();\n }", "public function findByUserId($user_id)\n {\n return $this->onlinetrack->all()->where('user_id', $user_id)->first();\n }", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "public function getByReporter(User $user)\n {\n return static::fromCursor(\n $this->collection->find(array('reporter_name' => $user->username))\n );\n }", "function wp_sub_get_user_sites( int $user_id ) {\n\treturn get_user_meta( $user_id, \\WP_SUB\\WP_Separate_User_Base::SITE_META_KEY, false );\n}", "public function get_user_approved_mdm()\n {\n $obj = new View();\n $queryobj = new Jamf_model();\n $sql = \"SELECT COUNT(CASE WHEN `user_approved_mdm` = '1' THEN 1 END) AS Yes,\n COUNT(CASE WHEN `user_approved_mdm` = '0' THEN 1 END) AS No\n FROM `jamf`\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }", "function statistics_extended_users_metadata_value_count($metadata,$value,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN {$dbprefix}entities e ON ue.guid = e.guid AND e.enabled='yes'\";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"JOIN {$dbprefix}metadata m2 ON ue.guid = m2.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings m2v ON m.value_id = m2v.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n $query .= \"AND m2v.string like '$value' \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public function getMetricsManager($manager_id)\n {\n $dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $job_portfolio=array();\n $job_site=array();\n $manager_list=array();\n\n $comment_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n \n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_labor_tax_lag=0;\n $total_bill_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n \n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $user_id=0;\n $user = DB::table('users')\n ->where('manager_id', $manager_id)\n ->where('active', 1)\n ->get();\n\n foreach ($user as $user_item) {\n $user_id = $user_item->id;\n }\n\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1;\n $expense_calc_week2=$total_expense_week2;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n \n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => 0,\n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list\n ]);\n }", "public function mainApiNotifications(User $user)\n {\n \treturn $user->unreadNotifications;\n }", "protected function getVictoireCriteria_Criteria_UserDataSourceService()\n {\n return $this->services['victoire_criteria.criteria.user_data_source'] = new \\Victoire\\Bundle\\CriteriaBundle\\DataSource\\IsLoggedDataSource($this->get('security.authorization_checker'));\n }", "public function findByUserId(){\n $servicedisplay = Servicedisplay::find()\n ->where(['user_id' => Yii::$app->user->identity->id])\n ->all();\n\n return $servicedisplay;\n }", "public function getCount($user) {\n $query = $this\n ->createQueryBuilder('t')\n ->leftJoin('t.suite', 's')\n ->leftJoin('s.project', 'p')\n ->leftJoin('p.manager', 'm')\n ->select('count (s)');\n if ($user != NULL) {\n $query->where('p.manager = :id')\n ->orWhere('p.client = :id')\n ->setParameter('id', $user->getId());\n }\n return $query->getQuery()\n ->getSingleScalarResult();\n }", "public function space_getSpaceUserInfos($uids)\n\t{\n\t\treturn $this->call_method('baidu.space.space.getSpaceUserInfos', array('uids' => $uids));\n\t}", "public function all($user, $api) {\n if(!$result = $this->cacheService->get('pkm.storage')) {\n\n # if no cached result was found, perform the search on the database.\n $result = $this->get();\n\n # generate response for each marker\n foreach($result as $k => &$row)\n $row = $this->response($row, !$api);\n\n # set cache if is production\n if(getenv('APP_ENV') != 'local')\n $this->cacheService->set('pkm.storage', $result, 3600);\n }\n\n $data = [];\n\n # if user was found on first request\n if($user) {\n\n # get markers which are owned by the user.\n # @todo add caching for user.id.markers\n $x = \\DB::table('markers')\n ->where('markers.user_id', $user->id)\n ->get();\n\n # genera response\n foreach($x as &$row)\n $data[$row->uuid] = $this->generateDefaultOwnedMarkerResponse();\n\n # get reported markers\n # @todo add caching for user.id.reports\n $x = \\DB::table('reports')\n ->join('markers', 'markers.id', '=', 'reports.marker_id')\n ->where('reports.user_id', $user->id)\n ->select(['markers.uuid'])\n ->get();\n\n foreach($x as &$row) {\n\n # if marker was already retrieved, update its values\n if(isset($data[$row->uuid])) {\n\n $data[$row->uuid]['report'] = true;\n continue;\n }\n\n # if not, generate default response\n $data[$row->uuid] = $this->generateDefaultReportedMarkerResponse();\n }\n\n # get spotted markers\n # @todo add caching for user.id.sights\n $x = \\DB::table('sights')\n ->join('markers', 'markers.id', '=', 'sights.marker_id')\n ->where('sights.user_id', $user->id)\n ->select(['markers.uuid'])\n ->get();\n\n foreach($x as &$row) {\n\n # if marker was already retrieved, update its values\n if(isset($data[$row->uuid])) {\n\n $data[$row->uuid]['seen'] = true;\n continue;\n }\n\n # if not, generate default response\n $data[$row->uuid] = $this->generateDefaultSpottedMarkerResponse();\n }\n }\n\n # create response\n $response = [\n 'markers' => $result,\n 'data' => $data\n ];\n\n return $response;\n }" ]
[ "0.5972274", "0.56363", "0.5463804", "0.5361344", "0.5267238", "0.5202716", "0.518031", "0.5160211", "0.51215464", "0.5109712", "0.50758505", "0.5073204", "0.50724345", "0.5035563", "0.5030633", "0.5027781", "0.499708", "0.49824306", "0.49699515", "0.49592644", "0.49278292", "0.492282", "0.49046344", "0.4886131", "0.48850408", "0.48815143", "0.48550114", "0.48509666", "0.48360813", "0.48228025", "0.47812322", "0.47767797", "0.47752", "0.4739912", "0.4725787", "0.47214407", "0.47069308", "0.47030365", "0.46992093", "0.46876472", "0.46814644", "0.4675075", "0.46721935", "0.46663672", "0.46636245", "0.46571964", "0.4656313", "0.46438062", "0.46288633", "0.46175727", "0.46101916", "0.45976478", "0.45856747", "0.45796007", "0.45775768", "0.45769656", "0.45668823", "0.45657405", "0.45630422", "0.45596316", "0.45532134", "0.4550243", "0.4549487", "0.4546885", "0.45321292", "0.45319304", "0.45247847", "0.45162937", "0.4513652", "0.45130968", "0.45078248", "0.45070097", "0.45051053", "0.45026925", "0.45003244", "0.44857505", "0.44837812", "0.44827926", "0.44800276", "0.44783866", "0.44759968", "0.44677693", "0.44596884", "0.44596884", "0.44582248", "0.44425842", "0.44418746", "0.44361883", "0.44289488", "0.44194743", "0.44172117", "0.44157818", "0.44132078", "0.4410764", "0.44057497", "0.44045958", "0.4403915", "0.44012097", "0.43989357", "0.43988338", "0.43949348" ]
0.0
-1
Find Meta Service Metrics for a nonadmin user using SQL regexp service search and metric.
public function findByContactAndSqlRegexp( string $metricName, string $regexpString, ContactInterface $contact ): ?array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "function getAllReports(){\n global $errors;\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles, $keyword;\n\t\t$sql = \"SELECT * FROM reportedusers WHERE U_name like '%$keyword%' or rptr_u_name like '%$keyword%' or reason like '%$keyword%' order by timestamp desc \"; \n\t\tif($result = mysqli_query($conn, $sql)){\n $users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $users;\n }else{\n array_push($errors, \"there was a problem fetching Records\");\n }\n\n\t} else {\n\t\treturn null;\n\t}\n}", "function YWR_2020_pre_user_query($user_search)\n{\n\n $user = wp_get_current_user();\n\n if (!current_user_can('manage_options')) {\n\n global $wpdb;\n\n $user_search->query_where =\n str_replace('WHERE 1=1',\n \"WHERE 1=1 AND {$wpdb->users}.ID IN (\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\n WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities'\n AND {$wpdb->usermeta}.meta_value NOT LIKE '%administrator%')\",\n $user_search->query_where\n );\n\n }\n}", "private function searchMembers() {\n $searchStr = $this->postVars['memberSearch'];\n $searchStrArr = array();\n if(preg_match('/\\s/',$searchStr)) {\n $searchStrArr = explode(\" \", $searchStr);\n }\n \n if(empty($searchStrArr)) {\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n WHERE u.user_email = '$searchStr'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id AND n.nhc_pin = '$searchStr'\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%$searchStr%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%$searchStr%'\";\n //JOIN {$this->db->prefix}usermeta um4 ON um4.user_id = u.id AND um4.meta_key = 'expiration_date' AND um4.meta_value = '$expireDate'\";\n }\n else { // looking specifically for a full name\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%{$searchStrArr[0]}%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%{$searchStrArr[1]}%'\";\n \n }\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n // filter through to weed out any duplicates\n $showArr = array();\n foreach($membersArr as $member) {\n if(!in_array($member['id'], $showArr)) {\n $showArr[] = $member['id'];\n }\n }\n $idStr = implode(\",\", $showArr);\n \n $query = \"SELECT DISTINCT u.id, n.nhc_pin, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email, um3.meta_value AS level\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um3 ON um3.user_id = u.id AND um3.meta_key = 'member_level'\n WHERE u.id IN ($idStr)\n ORDER BY n.nhc_pin\";\n \n $this->showResults($query, 'search', true);\n }", "function getMetrics($metric, $startDate, $endDate, $dimensions = false, $sort = false, $filter = false, $limit = false)\n\t{\n\t\t$analytics = new Google_AnalyticsService($this->client);\n\n\t\t$params = array();\n\n\t\tif ($dimensions)\n\t\t{\n\t\t\t$params['dimensions'] = $dimensions;\n\t\t}\n\t\tif ($sort)\n\t\t{\n\t\t\t$params['sort'] = $sort;\n\t\t}\n\t\tif ($filter)\n\t\t{\n\t\t\t$params['filters'] = $filter;\n\t\t}\n\t\tif ($limit)\n\t\t{\n\t\t\t$params['max-results'] = $limit;\n\t\t}\n \n // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking\n $filtered_id = str_replace( 'ga:', '', $this->accountId );\n \n if(!$filtered_id){\n echo 'Error - Account ID is blank';\n return false;\n }\n \n\t return $analytics->data_ga->get(\n\t 'ga:'.$filtered_id,\n\t $startDate,\n\t $endDate,\n\t $metric,\n\t $params\n\t );\n\t}", "function statistics_extended_users_metadata_count($metadata,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN \" . $dbprefix . \"entities e ON e.guid = ue.guid AND e.enabled='yes' \";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "function search_for_users($needle)\n {\n $needle = trim($needle);\n if ($needle != '')\n {\n $user = $this->ion_auth->get_user();\n\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name, user_meta.grad_year, school_data.school\n FROM user_meta LEFT JOIN school_data ON user_meta.school_id = school_data.id\n WHERE MATCH(user_meta.first_name, user_meta.last_name) AGAINST (? IN BOOLEAN MODE)\n AND user_meta.user_id <> ?\";\n\n // Generate a string to exclude people the user is already following.\n $following_ids = $this->get_following_ids();\n if (count($following_ids) > 0)\n {\n $query_string .= \" AND user_meta.user_id <> '\" . implode(\"' AND user_meta.user_id <> '\", $following_ids) . \"'\";\n }\n $query_string .= ' LIMIT 15';\n\n $query = $this->db->query($query_string, array(str_replace(' ', '* ', $needle) . '*', $user->id));\n\n // Echo the results\n foreach ($query->result() as $row)\n {\n $this->echo_user_entry($row, 'add following', $profile_links_enabled = false);\n }\n }\n }", "function getMeta($userscript){\n $metaPattern = '/==UserScript==(.)*==\\/UserScript==/ms';\n if( preg_match($metaPattern, $userscript, $metaSections)){ //$userscript\n return $metaSections[0];\n }\n }", "function statistics_extended_members_views($group){\r\n\tglobal $CONFIG;\r\n\tif(!empty($group)){\r\n\t\t$query = \"SELECT sum(m.string) as count FROM {$CONFIG->dbprefix}annotations a, {$CONFIG->dbprefix}metastrings m \";\r\n\t\t$views_counter_id = get_metastring_id(\"views_counter\");\r\n\t\t$query.= \"WHERE name_id={$views_counter_id} \";\r\n\t\t$query.= \"AND entity_guid={$group} \";\r\n\t\t$query.= \"AND owner_guid IN (SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n\t\t$query.= \"AND a.value_id = m.id\";\r\n\t\t$count = get_data_row($query);\r\n\t\treturn $count->count;\r\n\t}\r\n\treturn 0;\r\n}", "public abstract function find_users($search);", "function statistics_extended_users_metadata_value_count($metadata,$value,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN {$dbprefix}entities e ON ue.guid = e.guid AND e.enabled='yes'\";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"JOIN {$dbprefix}metadata m2 ON ue.guid = m2.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings m2v ON m.value_id = m2v.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n $query .= \"AND m2v.string like '$value' \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public function findServicesDowntimesForNonAdminUser(): array;", "public static function search_users_returns() {\n global $CFG;\n require_once($CFG->dirroot . '/user/externallib.php');\n return new external_single_structure(array(\n 'users' => new external_multiple_structure(user_summary_exporter::get_read_structure()),\n 'count' => new external_value(PARAM_INT, 'Total number of results.')\n ));\n }", "public function getUserStats($userId);", "function GetUsersPermissionsValue( $username , $class , $operation , $parname )\n{\n $user_regex = \".*\" ;\n\n //QUERY DATABASE TO GET THE USERID\n $result_user_id = mysql_query( \"SELECT u.ID FROM USERS u\".\n \" where u.Username = '\".$username.\"' and u.DELETED = 0\" ) ;\n\n if( mysql_num_rows( $result_user_id ) )\n {\n $row_user_id = mysql_fetch_array( $result_user_id ) ;\n $user_id = $row_user_id['ID'] ;\n mysql_free_result( $result_user_id ) ;\n\n //QUERY DATABASE TO GET THE IS_ENFORCED OF READ_ATTEST\n $result_pt = mysql_query( \"SELECT pt.ID , pt.IS_ENFORCED FROM PERMISSIONS_TYPES pt\".\n \" where pt.CLASS = '\".$class.\"' and pt.OPERATION = '\".$operation.\"' and pt.PAR_NAME = '\".$parname.\"'\" ) ;\n if( mysql_num_rows( $result_pt ) )\n {\n $row_pt = mysql_fetch_array( $result_pt ) ;\n $is_enforced = $row_pt['IS_ENFORCED'] ;\n\n //IF IS_ENFORCED IS TRUE, WE HAVE TO SEARCH FOR THE REGEX VALUE\n if( $is_enforced == 1 )\n {\n $result_user_regex = mysql_query( \"SELECT up.VALUE FROM USERS_PERMISSIONS up\".\n \" where up.ID_PERMISSIONS_TYPES = \".$row_pt['ID'].\" AND up.ID_USERS = \".$user_id ) ;\n\n if( mysql_num_rows( $result_user_regex ) )\n {\n $row_user_regex = mysql_fetch_array( $result_user_regex ) ;\n $user_regex = $row_user_regex['VALUE'] ;\n mysql_free_result( $result_user_regex ) ;\n }\n else\n {\n // ALWAYS UNMATCHABLE\n $user_regex = \"\" ;\n }\n }\n mysql_free_result( $result_pt ) ;\n }\n }\n else\n {\n // ALWAYS UNMATCHABLE\n $user_regex = \"\" ;\n }\n\n return $user_regex ;\n}", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getResultsOfUser($user_id);", "function statistics_extended_logins_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}system_log \";\r\n\t$query.=\"WHERE event IN ('login') \";\r\n\t$query.=\"AND object_type='user' \";\r\n\t$query.=\"GROUP BY zoom,event\";\r\n\treturn get_data($query);\r\n}", "function search($db,$page,$per,$status='',$year=0,$month=0,$userid=0)\r\n\t{\r\n//if($condition=='name'){\r\n//$sql.=\" and b.name like '%\".$keys.\"%'\";\r\n//}\r\n\t\t$sql = \"select * from \".AGENT_TOTAL_TABLE.\" where id>0\";\r\n\t\t\tif($status>-1){\r\n\t\t\t\t$sql.=\" and status ='\".$status.\"'\";\r\n\t\t\t}\r\n\t\t\tif($year>0){\r\n\t\t\t\t$sql.=\" and year ='\".$year.\"'\";\r\n\t\t\t}\r\n\t\t\tif($month>0){\r\n\t\t\t\t$sql.=\" and month ='\".$month.\"'\";\r\n\t\t\t}\r\n\t\t\tif($userid>0){\r\n\t\t\t\t$sql.=\" and agent_userid ='\".$userid.\"'\";\r\n\t\t\t}\r\n\t\t$sql.=\" order by id desc\";\r\n//\t\techo $sql;\r\n\t\t$pager = get_pager_data($db, $sql, $page,$per);\r\n\t\treturn $pager;\r\n\t}", "public function userStatistics(){\n\n\t\t//\tFetch form filters\n\t\t$date = date('Y-m-d');\n\t\t$from = Input::get('start');\n\t\tif(!$from) $from = date('Y-m-01');\n\n\t\t$to = Input::get('end');\n\t\tif(!$to) $to = $date;\n\t\t\n\t\t$selectedUser = Input::get('user');\n\t\tif(!$selectedUser)$selectedUser = \"\";\n\t\telse $selectedUser = \" USER: \".User::find($selectedUser)->name;\n\n\t\t$reportTypes = array('Summary', 'Patient Registry', 'Specimen Registry', 'Tests Registry', 'Tests Performed');\n\n\t\t$selectedReport = Input::get('report_type');\n\t\tif(!$selectedReport)$selectedReport = 0;\n\n\t\tswitch ($selectedReport) {\n\t\t\tcase '1':\n\t\t\t\t$reportData = User::getPatientsRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-patients-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t$reportData = User::getSpecimensRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-specimens-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\t$reportData = User::getTestsRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-tests-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\t$reportData = User::getTestsPerformed($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-tests-performed-report-title',1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$reportData = User::getSummaryUserStatistics($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-summary-report-title',1);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$reportTitle = str_replace(\"[FROM]\", $from, $reportTitle);\n\t\t$reportTitle = str_replace(\"[TO]\", $to, $reportTitle);\n\t\t$reportTitle = str_replace(\"[USER]\", $selectedUser, $reportTitle);\n\t\t\n\t\treturn View::make('reports.userstatistics.index')\n\t\t\t\t\t->with('reportTypes', $reportTypes)\n\t\t\t\t\t->with('reportData', $reportData)\n\t\t\t\t\t->with('reportTitle', $reportTitle)\n\t\t\t\t\t->with('selectedReport', $selectedReport)\n\t\t\t\t\t->withInput(Input::all());\n\t}", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}", "protected function _filter($user, $info) {\n foreach($this->_pattern as $item => $pattern) {\n if($item == 'user') {\n if(!preg_match($pattern, $user)) return false;\n } else if($item == 'grps') {\n if(!count(preg_grep($pattern, $info['grps']))) return false;\n } else {\n if(!preg_match($pattern, $info[$item])) return false;\n }\n }\n return true;\n }", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "function searchMentor($name, $genre, $instrument)\r\n\t{\r\n\t\t$users = array();\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$pdo = new PDO(DBCONNSTRING,DBUSER,DBPASS);\r\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t//Prepare a statement by setting parameters\r\n\r\n\t\t\t//SQL STATEMENTS\r\n\t\t\tif ($genre == \"*\" && $instrument != \"*\")\t\t//Genre ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument == \"*\")\t//Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre == \"*\" && $instrument == \"*\")\t//Genre and Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users WHERE mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument != \"*\")\t//Genre and Instrument SET\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\t$sql_name = 'SELECT username FROM mm_users WHERE id = :id';\r\n\t\t\t$sql_genre = 'SELECT genre FROM mm_genres INNER JOIN mm_user_genres ON mm_genres.id = mm_user_genres.genre_id WHERE mm_user_genres.user_id = :id';\r\n\t\t\t$sql_inst = 'SELECT instrument FROM mm_instruments INNER JOIN mm_user_instruments ON mm_instruments.id = mm_user_instruments.instrument_id WHERE mm_user_instruments.user_id = :id';\r\n\r\n\t\t\t//PREPARE STATEMENTS\r\n\t\t\t$statement_user = $pdo->prepare($sql_user);\r\n\t\t\t$statement_name = $pdo->prepare($sql_name);\r\n\t\t\t$statement_genre = $pdo->prepare($sql_genre);\r\n\t\t\t$statement_inst = $pdo->prepare($sql_inst);\r\n\r\n\t\t\t//BIND VALUES FOR INITIAL QUERY and EXECUTE\r\n\t\t\t$statement_user->bindValue(':name', $name);\r\n\t\t\tif ($genre != \"*\") $statement_user->bindValue(':genre', $genre);\r\n\t\t\tif ($instrument != \"*\") $statement_user->bindValue(':inst', $instrument); //Bind value of sql statement with value of id in query string\r\n\r\n\t\t\t$statement_user->execute();\r\n\t\t\twhile ($row = $statement_user->fetch())\r\n\t\t\t{\r\n\t\t\t\t$users[] = new User($row[\"id\"], null);\r\n\t\t\t}\r\n\r\n\t\t\t//BIND VALUES FOR USERNAME, GENRES, INSTRUMENTS AND EXECUTE THE RESPECTIVE STATEMENTS\r\n\t\t\tforeach ($users as $u)\r\n\t\t\t{\r\n\t\t\t\t$genres = array();\r\n\t\t\t\t$inst = array();\r\n\t\t\t\t$statement_name->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_genre->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_inst->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_name->execute();\r\n\t\t\t\twhile ($row = $statement_name->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$u->setUsername($row[\"username\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$statement_genre->execute();\r\n\t\t\t\twhile ($row = $statement_genre->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$genres[] = $row[\"genre\"];\r\n\t\t\t\t}\r\n\t\t\t\t$statement_inst->execute();\r\n\t\t\t\twhile ($row = $statement_inst->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$inst[] = $row[\"instrument\"];\r\n\t\t\t\t}\r\n\t\t\t\t$u->setGenres($genres);\r\n\t\t\t\t$u->setInstruments($inst);\r\n\t\t\t}\r\n\t\t\t$pdo = null;\r\n\t\t}\r\n\r\n\t\tcatch (PDOException $e) {\r\n\t\t\tdie( $e->getMessage() );\r\n\t\t}\r\n\t\treturn $users;\r\n\t}", "function getAllOtherAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllOtherAffinityGroupsFromUser($userID);\n }", "public function search($params, $unuse=false)\n {\n $con_str = \"\";\n if($unuse) {\n $q = DcmdServicePoolNode::find()->asArray()->all();\n $con_str = \" ip not in(0\";\n foreach($q as $item) $con_str .=\",'\".$item['ip'].\"'\";\n $con_str .=\")\";\n \n }\n if(Yii::$app->user->getIdentity()->sa != 1)\n {\n $gid = \"select gid from dcmd_user_group where uid =\".Yii::$app->user->getId();\n $gid = \"select gid from dcmd_user_group where uid =\".Yii::$app->user->getId();\n// $sql = \"select ngroup_id from dcmd_node_group where ngroup_id in(select ngroup_id from dcmd_app_node_group where app_id in (select app_id from dcmd_app where sa_gid in (\".$gid.\") or svr_gid in (\".$gid.\"))) order by ngroup_name\";\n $sql = \"select ngroup_id from dcmd_node_group where gid in(select gid from dcmd_user_group where uid =\".Yii::$app->user->getId().\") order by ngroup_name\";\n $ngroup = DcmdNodeGroup::findBySql($sql)->asArray()->all();\n if(!$unuse) {\n $con_str = \"dcmd_node.ngroup_id in(0\";\n foreach($ngroup as $item) $con_str .=\",'\".$item['ngroup_id'].\"'\";\n $con_str .=\")\";\n }\n }\n $query = DcmdNode::find()->where($con_str)->orderBy('ip');\n $query->joinWith(['dcmd_node_group']);\n $dataProvider = new ActiveDataProvider([\n /* 'ngroup_name' => [\n 'asc' => ['dcmd_node_group.ngroup_name' => SORT_ASC],\n 'desc' => ['dcmd_node_group.ngroup_name' => SORT_DESC],\n 'label' => 'Ngroup Name'\n ],*/\n 'query' => $query,\n 'pagination' => [ 'pagesize' => '20',]\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n $query->andFilterWhere([\n 'nid' => $this->nid,\n 'dcmd_node.ngroup_id' => $this->ngroup_id,\n 'utime' => $this->utime,\n 'ctime' => $this->ctime,\n 'opr_uid' => $this->opr_uid,\n ]);\n\n $query->andFilterWhere(['like', 'ip', $this->ip])\n ->andFilterWhere(['like', 'host', $this->host])\n ->andFilterWhere(['like', 'sid', $this->sid])\n ->andFilterWhere(['like', 'did', $this->did])\n ->andFilterWhere(['like', 'bend_ip', $this->bend_ip])\n ->andFilterWhere(['like', 'dcmd_node_group.ngroup_name', $this->ngroup_name])\n ->andFilterWhere(['like', 'public_ip', $this->public_ip]);\n \n return $dataProvider;\n }", "private function search_user_by($column,$data,$db,$start=0,$limit=10){\n\t\tif (empty($column) || strlen($data)<3){\n\t\t\treturn null;\n\t\t}\n\t\t$data=strtolower($data);\n\t\t$data=Db::escapee($data,true);\n\t\t$sql=Db::create_sql(array(\n\t\t\t\t\"user_id\",\n\t\t\t\t\"first_name\",\n\t\t\t\t\"last_name\"\n\t\t),\n\t\t\t\t'users',\n\t\t\t\t\"$column LIKE '%$data%' AND\n\t\t\t\tstatus=1\",\n\t\t\t\tnull,null,\n\t\t\t\t\"$start,$limit\");\n\t\t\t\treturn empty($db)?$sql:Db::fetch_array($db, $sql);\n\t}", "static function adminGetMetricDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n \r\n $sql = \"SELECT * FROM metric WHERE id=:id LIMIT 1\";\r\n $data = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow();\r\n \r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id=:id ORDER BY last_activity DESC\";\r\n $visits = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll(); \r\n \r\n if ($visits)\r\n foreach ($visits as $k=>$v)\r\n {\r\n $visits[$k]['location'] = Yii::app()->location->getLocation($v['location_id']);\r\n }\r\n \r\n $data['visits'] = $visits;\r\n \r\n \r\nFB::warn($data);\r\n \r\n \r\n \r\n/* \r\n $sql = \"SELECT user_id FROM metric WHERE id={$id}\";\r\n $userId = Yii::app()->db->createCommand($sql)->queryScalar();\r\n \r\n \r\n \r\n if ($userId)\r\n {\r\n $sql = \"SELECT id FROM metric WHERE user_id={$userId} ORDER BY id DESC\";\r\n $ids = Yii::app()->db->createCommand($sql)->queryColumn();\r\n }\r\n else\r\n {\r\n $ids[] = $id;\r\n }\r\n \r\n $res['user_id'] = $userId;\r\n \r\n if ($ids)\r\n foreach ($ids as $v)\r\n {\r\n //location\r\n\r\n $sql = \"SELECT ip, location_id,\tadded, last_activity FROM metric WHERE id={$v} LIMIT 1\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n $m['details']['location'] = Yii::app()->location->getLocation($m['details']['location_id']);\r\n \r\n //visits\r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id={$v} ORDER BY id DESC\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n \r\n \r\n \r\n //actions\r\n //$sql = \"SELECT viewed_user_id, added FROM metric_video_play WHERE metric_id={$v} ORDER BY id DESC\";\r\n //$m['details']['videos'] = Yii::app()->db->createCommand($sql)->queryAll();\r\n \r\n $res['info'][] = $m;\r\n }\r\n*/ \r\n \r\n return $data;\r\n }", "function TotalUserAdmin($search1=null,$search2=null,$search3=0)\n {\n $this->db->select('count(*) as total');\n if ($search1 != null) $this->db->where(\"LCASE(name) LIKE '%\".utf8_strtolower($search1) . \"%'\");\n if ($search2 != null) $this->db->where(\"LCASE(email) LIKE '%\".utf8_strtolower($search2) . \"%'\");\n if ($search3 != 1) $this->db->where('is_superadmin',0);\n $query = $this->db->get('users');\n if ($query->num_rows()>0)\n {\n $row = $query->row_array();\n return $row['total'];\n }\n else\n {\n return '0';\n }\n }", "public function rate_tribe_users_device_tokens($post_data){\n $userId = $post_data['loginUserId'];\n $searchId = $post_data['searchId'];\n\n /*$sql = \"SELECT t.*,u.userId,u.firstName,u.deviceToken,u.email \n FROM tribe t \n LEFT JOIN users u ON u.userId = t.fromuserId OR u.userId = t.touserId \n WHERE t.status = 'accept' AND t.touserId!= $userId AND t.deleteFlag !=1 AND u.deleteFlag !=1 AND t.searchId = $searchId GROUP BY t.touserId\n \";\n */\n $sql = \"SELECT u.userId,u.firstName,u.email,u.deviceToken,u.deleteFlag \n FROM users u where (u.userId in (SELECT t.touserId FROM tribe t where t.searchId=$searchId AND t.touserId !=$userId AND t.status = 'accept' AND t.deleteFlag !=1 )\n OR u.userId in (SELECT t.fromuserId FROM tribe t where t.searchId=$searchId AND t.fromuserId!=$userId)) AND u.deleteFlag !=1\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n\n }", "public function seeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->seeInDatabase($tableName, $criteria);\n }", "public function regexp( Application_Model_User $antaUser, $filters ){\r\t\t\r\t\t$orderBy = implode(\",\", empty($filters->orders)? array(\"date DESC\", \"id_document DESC\",\"position ASC\"):$filters->orders );\r\t\t\r\t\t# create result set object\r\t\t$matches = new Anta_Frog_Matches(); \r\t\t$whereClause = \"\";\r\t\t$binds = array();\r\t\t\r\t\t# 1. filter documents by documents id\r\t\tif( !(empty( $filters->docs ))){\r\t\t\t$whereClause .= \" id_document IN (\".implode(\",\",array_fill( 0, count($filters->docs), \"?\" )).\" ) \";\r\t\t\t$binds = array_merge( $binds, $filters->docs );\r\t\t}\r\t\t\r\t\t# 2. filter documents by document tags\r\t\tif( !(empty( $filters->tags ))){\r\t\t\t$whereClause .= (strlen($whereClause)>0?\"AND \":\"\").\" id_document IN ( \r\t\t\t\tSELECT id_document FROM anta_{$antaUser->username}.`documents_tags` \r\t\t\t\tNATURAL JOIN anta_{$antaUser->username}.`tags` \r\t\t\t\tWHERE id_tag IN (\".implode(\",\",array_fill( 0, count($filters->tags), \"?\" )).\" ) )\";\r\t\t\t$binds = array_merge( $binds, $filters->tags );\r\t\t}\r\t\t\r\t\t$startTime = microtime(true);\r\t\t# get a list of sentences that matches\r\t\t$query = \"\r\t\t\tSELECT SQL_CALC_FOUND_ROWS title, DATE_FORMAT( do.date,'%d/%m/%Y' ) as date, content, position, id_sentence, id_document \r\t\t\tFROM (\r\t\t\t\tSELECT id_document, title, date FROM anta_{$antaUser->username}.documents \r\t\t\t\t\".( strlen( $whereClause )>0?\"WHERE {$whereClause}\":\"\").\"\r\t\t\t\t\r\t\t\t) do\r\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? ORDER BY {$orderBy} LIMIT {$filters->offset},{$filters->limit}\"\r\t\t;\r\t\t\r\t\t$mysqli = Anta_Core::getMysqliConnection();\r\t\t$stmt = $mysqli->query( $query, array_merge( $binds, array($filters->query) ) );\r\t\t\r\t\t\r\t\t\r\t\t// create a list of different document. size property is the number of sentences\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\tif( !isset( $matches->documents[ $row->id_document ] ) ){ \r\t\t\t\t$matches->documents[ $row->id_document ] = array(\r\t\t\t\t\t\"title\" => $row->title,\r\t\t\t\t\t\"date\" => $row->date,\r\t\t\t\t\t\"tags\" => Application_Model_DocumentsMapper::getTags( $antaUser, $row->id_document ),\r\t\t\t\t\t\"size\" => Application_Model_SentencesMapper::getNumberOfSentences( $antaUser, $row->id_document )\r\t\t\t\t);\r\t\t\t}\r\t\t\t\r\t\t\t$matches->sentences[ $row->id_sentence ] = new Application_Model_Sentence( $row->id_sentence, $row->content, $row->id_document, $row->position, $row->date );\r\t\t\t\r\t\t}\r\t\t\r\t\t// get total items\r\t\t$stmt = $mysqli->query(\"SELECT FOUND_ROWS() as totalItems\");\r\t\t$matches->totalItems = $stmt->fetchObject()->totalItems;\r\t\t\r\t\t$checkPointA = microtime(true) - $startTime;\r\t\t$startTime = microtime(true);\r\t\t\r\t\t// test, again... find all documents id containing that regexp\r\t\t$stmt = $mysqli->query(\r\t\t\t\"SELECT DISTINCT id_document FROM anta_{$antaUser->username}.documents do\r\t\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? \", array($filters->query)\r\t\t);\r\t\t$ids = array();\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t$ids[] = $row->id_document;\r\t\t}\r\t\t\t\t\t\t\r\t\t\r\t\t// computate tags statistics, top FIVE for each category using filter in id_documents\r\t\tforeach( Application_Model_CategoriesMapper::getAll( $antaUser ) as $category ){\r\t\t\t\r\t\t\t$matches->categories[ $category->content ] = array();\r\t\t\t$query = \"SELECT dt.id_tag, dtd.content, count(distinct dt.`id_document`) AS `number_of_documents`\r\t\t\t\tFROM \r\t\t\t\t\tanta_{$antaUser->username}.documents_tags dt \r\t\t\t\t\t\r\t\t\t\tINNER JOIN\r\t\t\t\t\tanta_{$antaUser->username}.`tags` dtd\r\t\t\t\t\tUSING ( id_tag ) \r\t\t\t\tWHERE id_document IN(\".implode(\",\",$ids).\") AND {$whereClause} \".( strlen( $whereClause )>0? \"AND \":\"\" ).\" id_category = ? \r\t\t\t\tGROUP BY dtd.id_tag ORDER BY `number_of_documents` DESC LIMIT 0,5\";\r\t\t\t\t\r\t\t\t$stmt = $mysqli->query($query, array_merge( $binds,array( $category->id ) ) );\r\t\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t\t$matches->categories[ $category->content ][ $row->id_tag ] = $row;\r\t\t\t}\r\t\t\r\t\t};\r\t\t$checkPointB = microtime(true) - $startTime;\r\t\techo $checkPointA.\", \".$checkPointB;\r\t\treturn $matches;\r\t\t// \r\t\t\r\t\t\r\t}", "public function adminUserConditionDoesNotMatchRegularUser() {}", "function index()\r\n{\r\n\tif(!isset($_GET['search']))\r\n\t\t$_GET['search']=\"NULL\";\r\n\tif(!isset($_GET['paging']))\r\n\t\theader(\"location: /gadmin/user/?paging=1&search=\".$_GET['search']);\r\n\t//preparing to query\r\n\t$max_results=10;\r\n\t$arr_get=array(\r\n\t\t\t\"status_not\" => \"delete\"\r\n\t);\r\n\t$order=array(\r\n\t\t\t\"by\" => \"date_created\",\r\n\t\t\t\"sort\" => \"DESC\"\r\n\t);\r\n\t$limit=array(\r\n\t\t\t\"start\" => (($_GET['paging']*$max_results)-$max_results),\r\n\t\t\t\"end\" => $max_results\r\n\t);\r\n\t//setting search\r\n\tif($_GET['search']!=\"NULL\")\r\n\t\t$arr_get['search']=\"%\".$_GET['search'].\"%\";\r\n\t//assigning variables\r\n\t$users=User::get($arr_get, true, $order, $limit);\r\n\tforeach($users as $user)\r\n\t{\r\n\t\t$par1=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tnext($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$par2=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tprev($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$user->params=\"\";\r\n\t\tif(isset($par1))\r\n\t\t\t$user->params=$user->params.$par1->value;\r\n\t\tif(isset($par2))\r\n\t\t\t$user->params=$user->params.\" \".$par2->value;\r\n\t\t$credit=MetaUser::get(array(\"id_user\" => $user->id, \"name\" => \"credit\"));\r\n\t\tif(isset($credit))\r\n\t\t\t$user->credit=$credit->value;\r\n\t\telse\r\n\t\t\t$user->credit=0;\r\n\t}\r\n\t$GLOBALS['GCMS']->assign('users', $users);\r\n\t$GLOBALS['GCMS']->assign('paging', ceil(User::get_count($arr_get)/$max_results));\r\n}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "function statistics_extended_users_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,'create' as event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}entities \";\r\n\t$query.=\"WHERE type = 'user' \";\r\n\t$query.=\"AND enabled='yes' \";\r\n\t$query.=\"GROUP BY zoom\";\r\n\treturn get_data($query);\r\n}", "function get_metric() {\n $processes = array();\n //$output = `ps aux | awk '{ print $1,$2,$3,$4,$9,$10,$11 }'`;\n $output = `ps -eo pcpu,pmem,pid,user,args,time,start | grep -v '\\[' | sort -k 1 -r | head -30 | awk '{print $4,$3,$1,$2,$7,$6,$5}'`;\n $output = explode(\"\\n\", $output);\n if (!is_array($output) || count($output)<2) {\n return false; \n }\n array_shift($output);\n foreach ($output as $line) {\n //$line = preg_split('/\\s+/', $line);\n $line = explode(' ', $line);\n if (count($line)<6) {\n continue;\n }\n //var_dump($line);\n //echo count($line);\n if (empty($processes[$line[6]])) {\n $processes[$line[6]] = array_combine(array('user', 'pid', '%cpu', '%mem','start','time', 'command'), $line);\n } else {\n $processes[$line[6]]['%cpu'] += $line[2];\n $processes[$line[6]]['%mem'] += $line[3];\n }\n }\n\n return $processes;\n }", "function GetAllUsersAdmin($search1=null,$search2=null,$search3=0,$limit=0,$per_pg=0)\n {\n if ($search1 != null) $this->db->where(\"LCASE(name) LIKE '%\".utf8_strtolower($search1) . \"%'\");\n if ($search2 != null) $this->db->where(\"LCASE(email) LIKE '%\".utf8_strtolower($search2) . \"%'\");\n if ($search3 != 1) $this->db->where('is_superadmin',0);\n $this->db->where('group_id <>', 3);\n $this->db->limit($per_pg,$limit);\n $query = $this->db->get('users');\n return $query;\n }", "public function get_user_search_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1 \";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }", "public function adminUserConditionMatchesRegularUser() {}", "public function graphdayused_dashboard()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\tfor($i = 0; $i <= 24; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_time' \t=> \t$regex_Date,\n \t\t\t\t\t'use_date' \t=> \t$this->use_date\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$i.'/'); \n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_time' \t=> \t$regex_Date, \n \t\t\t\t\t'use_date' \t=> \t$this->use_date\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "public function get_user_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId = s.userId AND u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1\";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "protected function registerManagedQueries() {\n $table = Model_Charge::TABLE_NAME;\n $query = \"SELECT * FROM $table WHERE user_id = :user_id AND charge_date >= :start_date AND \" .\n \"charge_date <= :end_date ORDER BY charge_date ASC\";\n $this->registerManagedQuery(\"findByUserIdAndChargeDates\", $query, null, self::RETURN_MANY);\n\n $query = \"DELETE FROM $table WHERE charge_id = :charge_id\";\n $this->registerManagedQuery(\"delete\", $query, null, self::RETURN_NONE);\n\n $query = \"SELECT user_id, sum(amount) as total_charges FROM $table WHERE \" .\n \"charge_date >= :start_date AND charge_date <= :end_date GROUP BY user_id\";\n $this->registerManagedQuery(\"findTotalChargesByUserIdForChargeDates\", $query, null, self::RETURN_ARRAY);\n\n $query = \"SELECT * FROM $table ORDER BY create_date DESC LIMIT 10\";\n $this->registerManagedQuery(\"findRecentlyAddedCharges\", $query);\n }", "protected function users_search_sql($search, $u = 'u', $searchanywhere = true,\n array $exclude = null, array $includeonly = null) {\n global $DB, $CFG;\n $params = array();\n $tests = array();\n\n if ($u) {\n $u .= '.';\n }\n\n // If we have a $search string, put a field LIKE '$search%' condition on each field.\n if ($search) {\n /*$conditions = array(\n $DB->sql_fullname($u . 'firstname', $u . 'lastname'),\n $conditions[] = $u . 'lastname'\n );*/\n \n $conditions = [$this->propertyFromConfigToDisplay];\n /*foreach ($extrafields as $field) {\n $conditions[] = $u . $field;\n }*/\n if ($searchanywhere) {\n $searchparam = '%' . $search . '%';\n } else {\n $searchparam = $search . '%';\n }\n $i = 0;\n \n foreach ($conditions as $key => $condition) {\n $conditions[$key] = $DB->sql_like($condition, \":con{$i}00\", false, false);\n $params[\"con{$i}00\"] = $searchparam;\n $i++;\n }\n $tests[] = '(' . implode(' OR ', $conditions) . ')';\n }\n\n // Add some additional sensible conditions.\n $tests[] = $u . \"id <> :guestid\";\n $params['guestid'] = $CFG->siteguest;\n $tests[] = $u . 'deleted = 0';\n $tests[] = $u . 'confirmed = 1';\n\n // If we are being asked to exclude any users, do that.\n if (!empty($exclude)) {\n list($usertest, $userparams) = $DB->get_in_or_equal($exclude, SQL_PARAMS_NAMED, 'ex', false);\n $tests[] = $u . 'id ' . $usertest;\n $params = array_merge($params, $userparams);\n }\n\n // If we are validating a set list of userids, add an id IN (...) test.\n if (!empty($includeonly)) {\n list($usertest, $userparams) = $DB->get_in_or_equal($includeonly, SQL_PARAMS_NAMED, 'val');\n $tests[] = $u . 'id ' . $usertest;\n $params = array_merge($params, $userparams);\n }\n\n // In case there are no tests, add one result (this makes it easier to combine\n // this with an existing query as you can always add AND $sql).\n if (empty($tests)) {\n $tests[] = '1 = 1';\n }\n\n // Combing the conditions and return.\n return array(implode(' AND ', $tests), $params);\n }", "function find_allusersearch_desc($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC\");\n }\n}", "public function get_stats()\n { \n $sql = \"SELECT COUNT(CASE WHEN `status` = 'Enabled' THEN 1 END) AS 'Enabled',\n COUNT(CASE WHEN `status` = 'Disabled' THEN 1 END) AS 'Disabled'\n FROM findmymac\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n\n $queryobj = new Findmymac_model();\n $out = [];\n foreach($queryobj->query($sql)[0] as $label => $value){\n $out[] = ['label' => $label, 'count' => $value];\n }\n \n jsonView($out);\n }", "public function findServicesDowntimesForAdminUser(): array;", "function getmoname($data)\r\n {\r\n \r\n $query = $this->db->query(\"SELECT username,user_id,firstname FROM `oc_user` where user_group_id='4' and firstname like '%\".$data[\"filter_name\"].\"%' order by firstname asc limit 5 \");\r\n \r\n return $query->rows; \r\n }", "public function index()\n {\n $fields = [];\n $user = Auth::user();\n $start_date = $this->getStartDate(Input::get('start_date'));\n $end_date = $this->getEndDate(Input::get('end_date'));\n $time_increment = (bool) Input::get('time_increment', false);\n\n $ad_sets = $this->adSetRepository->byUserWithMetricsByDate( $user, $fields, $start_date, $end_date, $time_increment );\n\n // Return the results.\n //\n return $this->response( $ad_sets ?: [] );\n }", "public function getAllMeasurements($userId){\n\t\t$sql = 'SELECT * FROM measurements WHERE user_id = :userId';\n\t\t$pstmt = $this->db->prepare($sql);\n\t\t$pstmt->bindParam(':userId', $userId);\n\t\t$pstmt->execute();\n\t\treturn $pstmt->fetchAll(\\PDO::FETCH_OBJ);\n\t}", "public function dontSeeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->dontSeeInDatabase($tableName, $criteria);\n }", "function searchUserName($userId) {\n\n\t\t// INFORMACION RESPONSABLE\n $detailsResponsable = \"https://intranet.idex.cc/rest/117/w0qdwl5fbr0hpuf1/user.get?ID=\".$userId;\n // OBTIENE LA RESPUESTA DE LA API REST BITRIX\n $responseAPI = file_get_contents($detailsResponsable);\n\n // CAMPOS DE LA RESPUESTA\n $responsable = json_decode($responseAPI, true);\n // FIN INFORMACION RESPOSABLE\n return $responsable[\"result\"];\n\t}", "public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}", "function friendSearchHandler() {\n global $inputs;\n\n $keyword = $inputs['keyword'];\n $res = getAll(\"SELECT a.name,a.email \n FROM member a \n WHERE a.name LIKE '%$keyword%' \n AND a.id NOT IN (\n SELECT apply_member_id \n FROM member_friend_apply \n WHERE status = 0)\"\n );\n\n formatOutput(true, 'success',$res);\n}", "public function getDependencyByManagerUser($search)\n {\n $objDataBase = $this->_connectSuperDataBase();\n\n $arraySetVariable = array(\"@InSearch\");\n $arrayValueVariable = array($search);\n $arrayTypeDataVariable = array(Class_Object::DATA_INT);\n $arraySizeDataVariable = array(null);\n\n $result = $objDataBase->executeQueryStoreProcedure(\"get_dependencyByManagerUser\", $arraySetVariable,\n $arrayValueVariable, $arrayTypeDataVariable, $arraySizeDataVariable);\n\n $dato = array();\n while ($tempRows = $objDataBase->exploreArraySelect($result)) { \n $dato[] = $tempRows;\n }\n return $dato;\n }", "function getStatistics()\n{\n $data = [];\n $data['users'] = [];\n\n // 65k rows\n \n $data['users'] = DB::raw(\n \"Select t.user_id, concat(users.first_name, users.last_name) as name, \n Sum(if(t.active_status = \" . ActiveStatus::ACTIVE . \", 1, 0)) as valid,\n Sum(if(t.active_status = \" . ActiveStatus::ACTIVE . \", t.cash, 0)) as cash,\n Sum(if(t.active_status = \" . ActiveStatus::PENDING . \", 1, 0)) as pending,\n Sum(if(t.active_status = \" . ActiveStatus::DELETED . \", 1, 0)) as invalid,\n count(t.id) as total\n From tariff_provider_tariff_match as t\n INNER JOIN users on users.id = t.user_id\n Group By t.user_id\n \");\n\n return $data;\n}", "function getMetrics(&$db,$userObj,$args, $result_cfg, $labels)\n{\n $debug = true;\n $begin_time = microtime(true);\n $user_id = $args->currentUserID;\n $tproject_id = $args->tproject_id;\n $linked_tcversions = array();\n $metrics = array();\n $tplan_mgr = new testplan($db);\n $show_platforms = false;\n $platforms = array();\n\n // get all tesplans accessibles for user, for $tproject_id\n $options = array('output' => 'map');\n $options['active'] = $args->show_only_active ? ACTIVE : TP_ALL_STATUS; \n $test_plans = $userObj->getAccessibleTestPlans($db,$tproject_id,null,$options);\n\n // Get count of testcases linked to every testplan\n // Hmm Count active and inactive ?\n $linkedItemsQty = $tplan_mgr->count_testcases(array_keys($test_plans),null,array('output' => 'groupByTestPlan'));\n \n \n $metricsMgr = new tlTestPlanMetrics($db);\n $show_platforms = false;\n \n $metrics = array('testplans' => null, 'total' => null);\n $mm = &$metrics['testplans'];\n $metrics['total'] = array('active' => 0,'total' => 0, 'executed' => 0);\n foreach($result_cfg['status_label_for_exec_ui'] as $status_code => &$dummy)\n {\n $metrics['total'][$status_code] = 0; \n } \n \n $codeStatusVerbose = array_flip($result_cfg['status_code']);\n if($debug){\n echo 'test_plans_count:'.count($test_plans).\"<br/>\";\n $index = 0;\n foreach($test_plans as $key => &$dummy)\n {\n $item_begin_time = microtime(true);\n // We need to know if test plan has builds, if not we can not call any method \n // that try to get exec info, because you can only execute if you have builds.\n //\n // 20130909 - added active filter\n $buildSet = $tplan_mgr->get_builds($key,testplan::ACTIVE_BUILDS);\n if( is_null($buildSet) )\n {\n continue;\n }\n\n $platformSet = $tplan_mgr->getPlatforms($key);\n if (isset($platformSet)) \n {\n $platforms = array_merge($platforms, $platformSet);\n } \n $show_platforms_for_tplan = !is_null($platformSet);\n $show_platforms = $show_platforms || $show_platforms_for_tplan;\n if( !is_null($platformSet) )\n {\n $neurus = $metricsMgr->getExecCountersByPlatformExecStatus($key,null,\n array('getPlatformSet' => true,\n 'getOnlyActiveTCVersions' => true));\n $mm[$key]['overall']['active'] = $mm[$key]['overall']['executed'] = 0;\n foreach($neurus['with_tester'] as $platform_id => &$pinfo)\n {\n $xd = &$mm[$key]['platforms'][$platform_id];\n $xd['tplan_name'] = $dummy['name'];\n $xd['platform_name'] = $neurus['platforms'][$platform_id];\n $xd['total'] = $xd['active'] = $neurus['total'][$platform_id]['qty'];\n $xd['executed'] = 0;\n \n foreach($pinfo as $code => &$elem)\n {\n $xd[$codeStatusVerbose[$code]] = $elem['exec_qty'];\n if($codeStatusVerbose[$code] != 'not_run')\n {\n $xd['executed'] += $elem['exec_qty'];\n }\n if( !isset($mm[$key]['overall'][$codeStatusVerbose[$code]]) )\n {\n $mm[$key]['overall'][$codeStatusVerbose[$code]] = 0;\n }\n $mm[$key]['overall'][$codeStatusVerbose[$code]] += $elem['exec_qty'];\n $metrics['total'][$codeStatusVerbose[$code]] += $elem['exec_qty']; \n }\n $mm[$key]['overall']['executed'] += $xd['executed'];\n $mm[$key]['overall']['active'] += $xd['active'];\n } \n unset($neurus);\n $mm[$key]['overall']['total'] = $mm[$key]['overall']['active']; \n $metrics['total']['executed'] += $mm[$key]['overall']['executed'];\n $metrics['total']['active'] += $mm[$key]['overall']['active'];\n }\n else\n {\n if($key == 764205){$my_begin_time = microtime(true);}\n $mm[$key]['overall']['builds'] = $metricsMgr->getBuildExecCountersByExecStatus($key,null,null);\n if($key == 764205){$my_end_time = microtime(true);echo 'my_diff:'.($my_end_time - $my_begin_time).\"<br/>\";}\n $mm[$key]['overall']['active'] = 0;\n foreach ($mm[$key]['overall']['builds'] as $build_id => $status_column)\n {\n $mm[$key]['overall']['active'] += $status_column['total'];\n foreach ($status_column as $status_code => $qty)\n {\n if(!isset($metrics['total'][$status_code]))\n {\n $metrics['total'][$status_code] = 0;\n }\n $metrics['total'][$status_code] += $qty;\n \n if (!isset($mm[$key]['overall'][$status_code]))\n {\n $mm[$key]['overall'][$status_code] = 0;\n }\n $mm[$key]['overall'][$status_code] += $qty;\n }\n }\n\n //$metrics['total']['executed'] += $mm[$key]['overall']['executed'];\n $metrics['total']['active'] += $mm[$key]['overall']['active'];\n \n $mm[$key]['platforms'][0] = $mm[$key]['overall'];\n $mm[$key]['platforms'][0]['tplan_name'] = $dummy['name'];\n $mm[$key]['platforms'][0]['platform_name'] = $labels['not_aplicable'];\n } \n $item_end_time = microtime(true);\n echo \"key:$key,diff_time:\".($item_end_time - $item_begin_time).\"<br/>\";\n $index ++;\n if($index > 2){\n break;\n }\n }\n}\n \n // remove duplicate platform names\n $platformsUnique = array();\n foreach($platforms as $platform) \n {\n if(!in_array($platform['name'], $platformsUnique)) \n {\n $platformsUnique[] = $platform['name'];\n }\n }\n \n $end_time = microtime(true);\n echo 'diff_time'.($end_time - $begin_time);\n return array($metrics, $show_platforms, $platformsUnique);\n}", "function getAllAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllAffinityGroupsFromUser($userID);\n }", "function get_user_analytics_info() {\n global $wp_version;\n\n $url = 'http://freegeoip.net/json/' . $_SERVER['REMOTE_ADDR'];\n $params = array(\n 'timeout' => 30,\n 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )\n );\n\n $response = wp_remote_get( $url, $params );\n $user_data = wp_remote_retrieve_body( $response );\n\n if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {\n return false;\n }\n\n $user_info = (array) json_decode( $user_data );\n $user_analytics_info = array_merge( $user_info, array( 'browser_pc' => $_SERVER['HTTP_USER_AGENT'] ) );\n\n return $user_analytics_info;\n }", "public static function logDailyBenchmarks() {\n\n\t\t$dbprefix = elgg_get_config('dbprefix');\n\n\t\t$svc = new LoggingService();\n\n\t\t$ia = elgg_set_ignore_access();\n\n\t\t$users = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:total',\n\t\t\t'value' => $users,\n\t\t]);\n\n\t\t$banned = elgg_get_entities([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'joins' => [\n\t\t\t\t\"JOIN {$dbprefix}users_entity ue ON ue.guid = e.guid\",\n\t\t\t],\n\t\t\t'wheres' => [\n\t\t\t\t\"ue.banned = 'yes'\",\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:banned',\n\t\t\t'value' => $banned,\n\t\t]);\n\n\t\t$validated = elgg_get_entities_from_metadata([\n\t\t\t'types' => 'user',\n\t\t\t'count' => true,\n\t\t\t'metadata_name_value_pairs' => [\n\t\t\t\t'validated' => true,\n\t\t\t],\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'users:validated',\n\t\t\t'value' => $validated,\n\t\t]);\n\n\t\t$groups = elgg_get_entities([\n\t\t\t'types' => 'group',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'groups:total',\n\t\t\t'value' => $groups,\n\t\t]);\n\n\t\t$posts = elgg_get_entities([\n\t\t\t'types' => 'object',\n\t\t\t'count' => true,\n\t\t]);\n\n\t\t$svc->logBenchmark([\n\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t'metric' => 'posts:total',\n\t\t\t'value' => $posts,\n\t\t]);\n\n\t\t$subtypes = get_registered_entity_types('object');\n\n\t\tforeach ($subtypes as $subtype) {\n\t\t\t$posts = elgg_get_entities([\n\t\t\t\t'types' => 'object',\n\t\t\t\t'subtypes' => $subtype,\n\t\t\t\t'count' => true,\n\t\t\t]);\n\n\t\t\t$svc->logBenchmark([\n\t\t\t\t'target_guid' => elgg_get_site_entity()->guid,\n\t\t\t\t'metric' => \"posts:$subtype\",\n\t\t\t\t'value' => $posts,\n\t\t\t]);\n\t\t}\n\n\t\telgg_set_ignore_access($ia);\n\t}", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "function user_stats() {\n\n\t\t/*\n\t\targuments:\n\t\t\tnone\n\n\t\treturns:\n\t\n\t\tReturn:\n\t\t\tif successful:\n\t\t\t{\n\t\t\t\tuser_qty: how many users there are in gamo\n\t\t\t\tuser_qty_active: how many users are active\n\t\t\t\tavg_points: how many points on average users have\n\t\t\t\tavg_points_active: how many points on average active users have\n\t\t\t}\n\n\t\t\tif error:\n\t\t\t{\n\t\t\t\terror_code: The error code\n\t\t\t\terror_msg: The error message\n\t\t\t}\n\t\t*/\n\n\t\tglobal $dbh;\n\n\t\t$result = array(); // This is where the results will be stored\n\n\t\t// Retrieve status for all users (active + non-active)\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for all users\n\t\t$results['user_qty'] = $row['count(*)'];\n\t\t$results['avg_points'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\t// Retrieve status for active users only\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users WHERE points > 0';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for active only users\n\t\t$results['user_qty_active'] = $row['count(*)'];\n\t\t$results['avg_points_active'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\treturn $results;\n\n\t}", "function find_allusersearch_desclimit($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC LIMIT 1\");\n }\n}", "public function getResultAgainstMetric();", "abstract function getNonRegisteredUsers();", "private function construct_user_allsessions_log(user_data $userdata) {\n global $USER;\n\n $allsessions = new stdClass();\n\n $shortform = false;\n if ($USER->id == $userdata->user->id) {\n // This is a user viewing their own stuff - hide non-relevant columns.\n $shortform = true;\n }\n\n $groupby = $userdata->pageparams->groupby;\n\n $table = new html_table();\n $table->attributes['class'] = 'generaltable attwidth boxaligncenter allsessions';\n $table->head = array();\n $table->align = array();\n $table->size = array();\n $table->colclasses = array();\n $colcount = 0;\n $summarywidth = 0;\n\n // If grouping by date, we need some form of date up front.\n // Only need course column if we are not using course to group\n // (currently date is only option which does not use course).\n if ($groupby === 'date') {\n $table->head[] = '';\n $table->align[] = 'left';\n $table->colclasses[] = 'grouper';\n $table->size[] = '1px';\n\n $table->head[] = get_string('date');\n $table->align[] = 'left';\n $table->colclasses[] = 'datecol';\n $table->size[] = '1px';\n $colcount++;\n\n $table->head[] = get_string('course');\n $table->align[] = 'left';\n $table->colclasses[] = 'colcourse';\n $colcount++;\n } else {\n $table->head[] = '';\n $table->align[] = 'left';\n $table->colclasses[] = 'grouper';\n $table->size[] = '1px';\n if ($groupby === 'activity') {\n $table->head[] = '';\n $table->align[] = 'left';\n $table->colclasses[] = 'grouper';\n $table->size[] = '1px';\n }\n }\n\n // Need activity column unless we are using activity to group.\n if ($groupby !== 'activity') {\n $table->head[] = get_string('pluginname', 'mod_attendance');\n $table->align[] = 'left';\n $table->colclasses[] = 'colcourse';\n $table->size[] = '*';\n $colcount++;\n }\n\n // If grouping by date, it belongs up front rather than here.\n if ($groupby !== 'date') {\n $table->head[] = get_string('date');\n $table->align[] = 'left';\n $table->colclasses[] = 'datecol';\n $table->size[] = '1px';\n $colcount++;\n }\n\n // Use \"session\" instead of \"description\".\n $table->head[] = get_string('session', 'attendance');\n $table->align[] = 'left';\n $table->colclasses[] = 'desccol';\n $table->size[] = '*';\n $colcount++;\n\n if (!$shortform) {\n $table->head[] = get_string('sessiontypeshort', 'attendance');\n $table->align[] = '';\n $table->size[] = '*';\n $table->colclasses[] = '';\n $colcount++;\n }\n\n if (!empty($USER->attendanceediting)) {\n $table->head[] = get_string('status', 'attendance');\n $table->align[] = 'center';\n $table->colclasses[] = 'statuscol';\n $table->size[] = '*';\n $colcount++;\n $summarywidth++;\n\n $table->head[] = get_string('remarks', 'attendance');\n $table->align[] = 'center';\n $table->colclasses[] = 'remarkscol';\n $table->size[] = '*';\n $colcount++;\n $summarywidth++;\n } else {\n $table->head[] = get_string('status', 'attendance');\n $table->align[] = 'center';\n $table->colclasses[] = 'statuscol';\n $table->size[] = '*';\n $colcount++;\n $summarywidth++;\n\n $table->head[] = get_string('points', 'attendance');\n $table->align[] = 'center';\n $table->colclasses[] = 'pointscol';\n $table->size[] = '1px';\n $colcount++;\n $summarywidth++;\n\n $table->head[] = get_string('remarks', 'attendance');\n $table->align[] = 'center';\n $table->colclasses[] = 'remarkscol';\n $table->size[] = '*';\n $colcount++;\n $summarywidth++;\n }\n\n $statusmaxpoints = array();\n foreach ($userdata->statuses as $attid => $attstatuses) {\n $statusmaxpoints[$attid] = attendance_get_statusset_maxpoints($attstatuses);\n }\n\n $lastgroup = array(null, null);\n $groups = array();\n $stats = array(\n 'course' => array(),\n 'activity' => array(),\n 'date' => array(),\n 'overall' => array(\n 'points' => 0,\n 'maxpointstodate' => 0,\n 'maxpoints' => 0,\n 'pcpointstodate' => null,\n 'pcpoints' => null,\n 'statuses' => array()\n )\n );\n $group = null;\n if ($userdata->sessionslog) {\n foreach ($userdata->sessionslog as $sess) {\n if ($groupby === 'date') {\n $weekformat = date(\"YW\", $sess->sessdate);\n if ($weekformat != $lastgroup[0]) {\n if ($group !== null) {\n array_push($groups, $group);\n }\n $group = array();\n $lastgroup[0] = $weekformat;\n }\n if (!array_key_exists($weekformat, $stats['date'])) {\n $stats['date'][$weekformat] = array(\n 'points' => 0,\n 'maxpointstodate' => 0,\n 'maxpoints' => 0,\n 'pcpointstodate' => null,\n 'pcpoints' => null,\n 'statuses' => array()\n );\n }\n $statussetmaxpoints = $statusmaxpoints[$sess->attendanceid];\n // Ensure all possible acronyms for current sess's statusset are available as\n // keys in status array for period.\n //\n // A bit yucky because we can't tell whether we've seen statusset before, and\n // we usually will have, so much wasted spinning.\n foreach ($userdata->statuses[$sess->attendanceid] as $attstatus) {\n if ($attstatus->setnumber === $sess->statusset) {\n if (!array_key_exists($attstatus->acronym, $stats['date'][$weekformat]['statuses'])) {\n $stats['date'][$weekformat]['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n if (!array_key_exists($attstatus->acronym, $stats['overall']['statuses'])) {\n $stats['overall']['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n }\n }\n // The array_key_exists check is for hidden statuses.\n if (isset($sess->statusid) && array_key_exists($sess->statusid, $userdata->statuses[$sess->attendanceid])) {\n $status = $userdata->statuses[$sess->attendanceid][$sess->statusid];\n $stats['date'][$weekformat]['statuses'][$status->acronym]['count']++;\n $stats['date'][$weekformat]['points'] += $status->grade;\n $stats['date'][$weekformat]['maxpointstodate'] += $statussetmaxpoints[$sess->statusset];\n $stats['overall']['statuses'][$status->acronym]['count']++;\n $stats['overall']['points'] += $status->grade;\n $stats['overall']['maxpointstodate'] += $statussetmaxpoints[$sess->statusset];\n }\n $stats['date'][$weekformat]['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n $stats['overall']['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n } else {\n // By course and perhaps activity.\n if (\n ($sess->courseid != $lastgroup[0]) ||\n ($groupby === 'activity' && $sess->cmid != $lastgroup[1])\n ) {\n if ($group !== null) {\n array_push($groups, $group);\n }\n $group = array();\n $lastgroup[0] = $sess->courseid;\n $lastgroup[1] = $sess->cmid;\n }\n if (!array_key_exists($sess->courseid, $stats['course'])) {\n $stats['course'][$sess->courseid] = array(\n 'points' => 0,\n 'maxpointstodate' => 0,\n 'maxpoints' => 0,\n 'pcpointstodate' => null,\n 'pcpoints' => null,\n 'statuses' => array()\n );\n }\n $statussetmaxpoints = $statusmaxpoints[$sess->attendanceid];\n // Ensure all possible acronyms for current sess's statusset are available as\n // keys in status array for course\n //\n // A bit yucky because we can't tell whether we've seen statusset before, and\n // we usually will have, so much wasted spinning.\n foreach ($userdata->statuses[$sess->attendanceid] as $attstatus) {\n if ($attstatus->setnumber === $sess->statusset) {\n if (!array_key_exists($attstatus->acronym, $stats['course'][$sess->courseid]['statuses'])) {\n $stats['course'][$sess->courseid]['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n if (!array_key_exists($attstatus->acronym, $stats['overall']['statuses'])) {\n $stats['overall']['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n }\n }\n // The array_key_exists check is for hidden statuses.\n if (isset($sess->statusid) && array_key_exists($sess->statusid, $userdata->statuses[$sess->attendanceid])) {\n $status = $userdata->statuses[$sess->attendanceid][$sess->statusid];\n $stats['course'][$sess->courseid]['statuses'][$status->acronym]['count']++;\n $stats['course'][$sess->courseid]['points'] += $status->grade;\n $stats['course'][$sess->courseid]['maxpointstodate'] += $statussetmaxpoints[$sess->statusset];\n $stats['overall']['statuses'][$status->acronym]['count']++;\n $stats['overall']['points'] += $status->grade;\n $stats['overall']['maxpointstodate'] += $statussetmaxpoints[$sess->statusset];\n }\n $stats['course'][$sess->courseid]['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n $stats['overall']['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n\n if (!array_key_exists($sess->cmid, $stats['activity'])) {\n $stats['activity'][$sess->cmid] = array(\n 'points' => 0,\n 'maxpointstodate' => 0,\n 'maxpoints' => 0,\n 'pcpointstodate' => null,\n 'pcpoints' => null,\n 'statuses' => array()\n );\n }\n $statussetmaxpoints = $statusmaxpoints[$sess->attendanceid];\n // Ensure all possible acronyms for current sess's statusset are available as\n // keys in status array for period\n //\n // A bit yucky because we can't tell whether we've seen statusset before, and\n // we usually will have, so much wasted spinning.\n foreach ($userdata->statuses[$sess->attendanceid] as $attstatus) {\n if ($attstatus->setnumber === $sess->statusset) {\n if (!array_key_exists($attstatus->acronym, $stats['activity'][$sess->cmid]['statuses'])) {\n $stats['activity'][$sess->cmid]['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n if (!array_key_exists($attstatus->acronym, $stats['overall']['statuses'])) {\n $stats['overall']['statuses'][$attstatus->acronym] =\n array('count' => 0, 'description' => $attstatus->description);\n }\n }\n }\n // The array_key_exists check is for hidden statuses.\n if (isset($sess->statusid) && array_key_exists($sess->statusid, $userdata->statuses[$sess->attendanceid])) {\n $status = $userdata->statuses[$sess->attendanceid][$sess->statusid];\n $stats['activity'][$sess->cmid]['statuses'][$status->acronym]['count']++;\n $stats['activity'][$sess->cmid]['points'] += $status->grade;\n $stats['activity'][$sess->cmid]['maxpointstodate'] += $statussetmaxpoints[$sess->statusset];\n }\n $stats['activity'][$sess->cmid]['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n $stats['overall']['maxpoints'] += $statussetmaxpoints[$sess->statusset];\n }\n array_push($group, $sess);\n }\n array_push($groups, $group);\n }\n\n $points = $stats['overall']['points'];\n $maxpoints = $stats['overall']['maxpointstodate'];\n $summarytable = new html_table();\n $summarytable->attributes['class'] = 'generaltable table-bordered table-condensed';\n $row = new html_table_row();\n $cell = new html_table_cell(get_string('allsessionstotals', 'attendance'));\n $cell->colspan = 2;\n $cell->header = true;\n $row->cells[] = $cell;\n $summarytable->data[] = $row;\n foreach ($stats['overall']['statuses'] as $acronym => $status) {\n $row = new html_table_row();\n $row->cells[] = $status['description'] . \":\";\n $row->cells[] = $status['count'];\n $summarytable->data[] = $row;\n }\n\n $row = new html_table_row();\n if ($maxpoints !== 0) {\n $pctodate = format_float( $points * 100 / $maxpoints);\n $pointsinfo = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n $pointsinfo .= \" (\" . $pctodate . \"%)\";\n } else {\n $pointsinfo = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n }\n $pointsinfo .= \" \" . get_string('todate', 'attendance');\n $cell = new html_table_cell($pointsinfo);\n $cell->colspan = 2;\n $row->cells[] = $cell;\n $summarytable->data[] = $row;\n $allsessions->summary = html_writer::table($summarytable);\n\n $lastgroup = array(null, null);\n foreach ($groups as $group) {\n\n $statussetmaxpoints = $statusmaxpoints[$sess->attendanceid];\n\n // For use in headings etc.\n $sess = $group[0];\n\n if ($groupby === 'date') {\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $cell = new html_table_cell();\n $cell->rowspan = count($group) + 2;\n $row->cells[] = $cell;\n $week = date(\"W\", $sess->sessdate);\n $year = date(\"Y\", $sess->sessdate);\n // ISO week starts on day 1, Monday.\n $weekstart = date_timestamp_get(date_isodate_set(date_create(), $year, $week, 1));\n $dmywformat = get_string('strftimedmyw', 'attendance');\n $cell = new html_table_cell(get_string('weekcommencing', 'attendance') . \": \" . userdate($weekstart, $dmywformat));\n $cell->colspan = $colcount - $summarywidth;\n $cell->rowspan = 2;\n $cell->attributes['class'] = 'groupheading';\n $row->cells[] = $cell;\n $weekformat = date(\"YW\", $sess->sessdate);\n $points = $stats['date'][$weekformat]['points'];\n $maxpoints = $stats['date'][$weekformat]['maxpointstodate'];\n if ($maxpoints !== 0) {\n $pctodate = format_float( $points * 100 / $maxpoints);\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n $summary .= \" (\" . $pctodate . \"%)\";\n } else {\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n }\n $summary .= \" \" . get_string('todate', 'attendance');\n $cell = new html_table_cell($summary);\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $summary = array();\n foreach ($stats['date'][$weekformat]['statuses'] as $acronym => $status) {\n array_push($summary, html_writer::tag('b', $acronym) . $status['count']);\n }\n $cell = new html_table_cell(implode(\" \", $summary));\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n $lastgroup[0] = date(\"YW\", $weekstart);\n } else {\n if ($groupby === 'course' || $sess->courseid !== $lastgroup[0]) {\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $cell = new html_table_cell();\n $cell->rowspan = count($group) + 2;\n if ($groupby === 'activity') {\n $headcell = $cell; // Keep ref to be able to adjust rowspan later.\n $cell->rowspan += 2;\n $row->cells[] = $cell;\n $cell = new html_table_cell();\n $cell->rowspan = 2;\n }\n $row->cells[] = $cell;\n $courseurl = new moodle_url('/course/view.php', array('id' => $sess->courseid));\n $cell = new html_table_cell(get_string('course', 'attendance') . \": \" .\n html_writer::link($courseurl, $sess->cname));\n $cell->colspan = $colcount - $summarywidth;\n $cell->rowspan = 2;\n $cell->attributes['class'] = 'groupheading';\n $row->cells[] = $cell;\n $points = $stats['course'][$sess->courseid]['points'];\n $maxpoints = $stats['course'][$sess->courseid]['maxpointstodate'];\n if ($maxpoints !== 0) {\n $pctodate = format_float( $points * 100 / $maxpoints);\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n $summary .= \" (\" . $pctodate . \"%)\";\n } else {\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n }\n $summary .= \" \" . get_string('todate', 'attendance');\n $cell = new html_table_cell($summary);\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $summary = array();\n foreach ($stats['course'][$sess->courseid]['statuses'] as $acronym => $status) {\n array_push($summary, html_writer::tag('b', $acronym) . $status['count']);\n }\n $cell = new html_table_cell(implode(\" \", $summary));\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n }\n if ($groupby === 'activity') {\n if ($sess->courseid === $lastgroup[0]) {\n $headcell->rowspan += count($group) + 2;\n }\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $cell = new html_table_cell();\n $cell->rowspan = count($group) + 2;\n $row->cells[] = $cell;\n $attendanceurl = new moodle_url('/mod/attendance/view.php', array('id' => $sess->cmid,\n 'studentid' => $userdata->user->id,\n 'view' => ATT_VIEW_ALL));\n $cell = new html_table_cell(get_string('pluginname', 'mod_attendance') .\n \": \" . html_writer::link($attendanceurl, $sess->attname));\n $cell->colspan = $colcount - $summarywidth;\n $cell->rowspan = 2;\n $cell->attributes['class'] = 'groupheading';\n $row->cells[] = $cell;\n $points = $stats['activity'][$sess->cmid]['points'];\n $maxpoints = $stats['activity'][$sess->cmid]['maxpointstodate'];\n if ($maxpoints !== 0) {\n $pctodate = format_float( $points * 100 / $maxpoints);\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n $summary .= \" (\" . $pctodate . \"%)\";\n } else {\n $summary = get_string('points', 'attendance') . \": \" . $points . \"/\" . $maxpoints;\n }\n $summary .= \" \" . get_string('todate', 'attendance');\n $cell = new html_table_cell($summary);\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n $row = new html_table_row();\n $row->attributes['class'] = 'grouper';\n $summary = array();\n foreach ($stats['activity'][$sess->cmid]['statuses'] as $acronym => $status) {\n array_push($summary, html_writer::tag('b', $acronym) . $status['count']);\n }\n $cell = new html_table_cell(implode(\" \", $summary));\n $cell->colspan = $summarywidth;\n $row->cells[] = $cell;\n $table->data[] = $row;\n }\n $lastgroup[0] = $sess->courseid;\n $lastgroup[1] = $sess->cmid;\n }\n\n // Now iterate over sessions in group...\n\n foreach ($group as $sess) {\n $row = new html_table_row();\n\n // If grouping by date, we need some form of date up front.\n // Only need course column if we are not using course to group\n // (currently date is only option which does not use course).\n if ($groupby === 'date') {\n // What part of date do we want if grouped by it already?\n $row->cells[] = userdate($sess->sessdate, get_string('strftimedmw', 'attendance')) .\n \" \". $this->construct_time($sess->sessdate, $sess->duration);\n\n $courseurl = new moodle_url('/course/view.php', array('id' => $sess->courseid));\n $row->cells[] = html_writer::link($courseurl, $sess->cname);\n }\n\n // Need activity column unless we are using activity to group.\n if ($groupby !== 'activity') {\n $attendanceurl = new moodle_url('/mod/attendance/view.php', array('id' => $sess->cmid,\n 'studentid' => $userdata->user->id,\n 'view' => ATT_VIEW_ALL));\n $row->cells[] = html_writer::link($attendanceurl, $sess->attname);\n }\n\n // If grouping by date, it belongs up front rather than here.\n if ($groupby !== 'date') {\n $row->cells[] = userdate($sess->sessdate, get_string('strftimedmyw', 'attendance')) .\n \" \". $this->construct_time($sess->sessdate, $sess->duration);\n }\n\n $sesscontext = context_module::instance($sess->cmid);\n if (has_capability('mod/attendance:takeattendances', $sesscontext)) {\n $sessionurl = new moodle_url('/mod/attendance/take.php', array('id' => $sess->cmid,\n 'sessionid' => $sess->id,\n 'grouptype' => $sess->groupid));\n $description = html_writer::link($sessionurl, $sess->description);\n } else {\n $description = $sess->description;\n }\n $row->cells[] = $description;\n\n if (!$shortform) {\n if ($sess->groupid) {\n $sessiontypeshort = get_string('group') . ': ' . $userdata->groups[$sess->courseid][$sess->groupid]->name;\n } else {\n $sessiontypeshort = get_string('commonsession', 'attendance');\n }\n $row->cells[] = html_writer::tag('nobr', $sessiontypeshort);\n }\n\n if (!empty($USER->attendanceediting)) {\n $context = context_module::instance($sess->cmid);\n if (has_capability('mod/attendance:takeattendances', $context)) {\n // Takedata needs:\n // sessioninfo->sessdate\n // sessioninfo->duration\n // statuses\n // updatemode\n // sessionlog[userid]->statusid\n // sessionlog[userid]->remarks\n // pageparams->viewmode == mod_attendance_take_page_params::SORTED_GRID\n // and urlparams to be able to use url method later.\n //\n // user needs:\n // enrolmentstart\n // enrolmentend\n // enrolmentstatus\n // id.\n\n $nastyhack = new \\ReflectionClass('mod_attendance\\output\\take_data');\n $takedata = $nastyhack->newInstanceWithoutConstructor();\n $takedata->sessioninfo = $sess;\n $takedata->statuses = array_filter($userdata->statuses[$sess->attendanceid], function($x) use ($sess) {\n return ($x->setnumber == $sess->statusset);\n });\n $takedata->updatemode = true;\n $takedata->sessionlog = array($userdata->user->id => $sess);\n $takedata->pageparams = new stdClass();\n $takedata->pageparams->viewmode = mod_attendance_take_page_params::SORTED_GRID;\n $ucdata = $this->construct_take_session_controls($takedata, $userdata->user);\n\n $celltext = join($ucdata['text']);\n\n if (array_key_exists('warning', $ucdata)) {\n $celltext .= html_writer::empty_tag('br');\n $celltext .= $ucdata['warning'];\n }\n if (array_key_exists('class', $ucdata)) {\n $row->attributes['class'] = $ucdata['class'];\n }\n\n $cell = new html_table_cell($celltext);\n $row->cells[] = $cell;\n\n $celltext = empty($ucdata['remarks']) ? '' : $ucdata['remarks'];\n $cell = new html_table_cell($celltext);\n $row->cells[] = $cell;\n\n } else {\n if (!empty($sess->statusid)) {\n $status = $userdata->statuses[$sess->attendanceid][$sess->statusid];\n $row->cells[] = $status->description;\n $row->cells[] = $sess->remarks;\n }\n }\n\n } else {\n if (!empty($sess->statusid)) {\n $status = $userdata->statuses[$sess->attendanceid][$sess->statusid];\n $row->cells[] = $status->description;\n $row->cells[] = format_float($status->grade, 1, true, true) . ' / ' .\n format_float($statussetmaxpoints[$status->setnumber], 1, true, true);\n $row->cells[] = $sess->remarks;\n } else if (($sess->sessdate + $sess->duration) < $userdata->user->enrolmentstart) {\n $cell = new html_table_cell(get_string('enrolmentstart', 'attendance',\n userdate($userdata->user->enrolmentstart, '%d.%m.%Y')));\n $cell->colspan = 3;\n $row->cells[] = $cell;\n } else if ($userdata->user->enrolmentend && $sess->sessdate > $userdata->user->enrolmentend) {\n $cell = new html_table_cell(get_string('enrolmentend', 'attendance',\n userdate($userdata->user->enrolmentend, '%d.%m.%Y')));\n $cell->colspan = 3;\n $row->cells[] = $cell;\n } else {\n list($canmark, $reason) = attendance_can_student_mark($sess, false);\n if ($canmark) {\n // Student can mark their own attendance.\n // URL to the page that lets the student modify their attendance.\n\n $url = new moodle_url('/mod/attendance/attendance.php',\n array('sessid' => $sess->id, 'sesskey' => sesskey()));\n if (attendance_session_open_for_students($sess)) {\n $cell = new html_table_cell(html_writer::link($url, get_string('submitattendance', 'attendance')));\n } else {\n $cell = new html_table_cell(html_writer::link($url, get_string('submitattendancefuture', 'attendance')));\n }\n $cell->colspan = 3;\n $row->cells[] = $cell;\n } else { // Student cannot mark their own attendace.\n $row->cells[] = '?';\n $row->cells[] = '? / ' . format_float($statussetmaxpoints[$sess->statusset], 1, true, true);\n $row->cells[] = '';\n }\n }\n }\n\n $table->data[] = $row;\n }\n }\n\n if (!empty($USER->attendanceediting)) {\n $row = new html_table_row();\n $params = array(\n 'type' => 'submit',\n 'class' => 'btn btn-primary',\n 'value' => get_string('save', 'attendance'));\n $cell = new html_table_cell(html_writer::tag('center', html_writer::empty_tag('input', $params)));\n $cell->colspan = $colcount + (($groupby == 'activity') ? 2 : 1);\n $row->cells[] = $cell;\n $table->data[] = $row;\n }\n\n $logtext = html_writer::table($table);\n\n if (!empty($USER->attendanceediting)) {\n $formtext = html_writer::start_div('no-overflow');\n $formtext .= $logtext;\n $formtext .= html_writer::input_hidden_params($userdata->url(array('sesskey' => sesskey())));\n $formtext .= html_writer::end_div();\n // Could use userdata->urlpath if not private or userdata->url_path() if existed, but '' turns\n // out to DTRT.\n $logtext = html_writer::tag('form', $formtext, array('method' => 'post', 'action' => '',\n 'id' => 'attendancetakeform'));\n }\n $allsessions->detail = $logtext;\n return $allsessions;\n }", "public function user_numbers($user_id)\n { \n $sql = \"SELECT \t \n coalesce(a.total,0) as profileview,\n coalesce(b.total,0) as friends,\n coalesce(c.total,0) as followers,\n coalesce(d.total,0) as following,\n (coalesce(e.total,0) + coalesce(f.total,0)) as request,\n round((coalesce(g.yaycount,0) + coalesce(h.yaycount,0) + (coalesce(i.yaycount,0) / 10)) / 3) as avg_rating\n FROM users u\n LEFT OUTER JOIN (select userprofileview.profile_userid,\n COUNT(*) total\n FROM userprofileview\n GROUP BY userprofileview.profile_userid) as a ON a.profile_userid = u.id\n LEFT OUTER JOIN (select userfriends.user_one_id,\n COUNT(*) total\n FROM userfriends\n WHERE userfriends.status = 1\n GROUP BY userfriends.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE useracquiantances.status = 1\n GROUP BY useracquiantances.user_two_id) as c ON c.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE useracquiantances.status = 1\n GROUP BY useracquiantances.user_one_id) as d ON d.user_one_id = u.id\n LEFT OUTER JOIN (select uf.user_two_id,\n COUNT(*) total\n FROM userfriends uf\n WHERE (uf.user_two_id={$user_id} AND uf.status=0)\n GROUP BY uf.user_two_id) as e ON e.user_two_id = u.id\n LEFT OUTER JOIN (select ua.user_two_id,\n COUNT(*) total\n FROM useracquiantances ua\n WHERE (ua.user_two_id={$user_id} AND ua.status=0)\n GROUP BY ua.user_two_id) as f ON f.user_two_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as g ON g.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as h ON h.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as i ON i.user_id = u.id\n WHERE u.id={$user_id}\";\n\n return DB::select(DB::raw($sql));\n }", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "function mysqlnd_qc_set_user_handlers($get_hash, $find_query_in_cache, $return_to_cache, $add_query_to_cache_if_not_exists, $query_is_select, $update_query_run_time_stats, $get_stats, $clear_cache)\n{\n}", "function get_usermeta($user_id, $meta_key = '')\n {\n }", "public static function get_all_media_location_counts($user_id){\n $column_name = \"location\";\n $header = \"media_locations\";\n\n $database = Database::instance();\n $sql = \"SELECT COUNT(*) as num, \" . $column_name . \" as type, 'book' as media FROM \" . CONFIG::DBTables()->book . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $sql .= \" UNION SELECT COUNT(*) as num, \" . $column_name . \" as type, 'movie' as media FROM \" . CONFIG::DBTables()->movie . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $sql .= \" UNION SELECT COUNT(*) as num, \" . $column_name . \" as type, 'game' as media FROM \" . CONFIG::DBTables()->game . \" WHERE active = 1 AND \" . $column_name . \" IS NOT NULL AND user_id = \" . $user_id . \" GROUP BY \" . $column_name;\n $query = $database->prepare($sql);\n $query->execute();\n $result = $query->fetchAll(\\PDO::FETCH_ASSOC);\n $query->closeCursor();\n if ($result === false || $result === null){\n APIService::response_fail(HttpFailCodes::http_response_fail()->get_media_counts);\n }else{\n return array($header => $result);\n }\n }", "function test_general_entries_search_on_frm_items_user_id() {\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entries table';\n\t\tself::run_entries_found_tests( $msg, $items, 4, array( 'steph_entry_key', 'steve_entry_key', 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\t}", "public function forUserSpecial(User $user, $date_type, $data_type, $start_date, $end_date) {\n\t\treturn Statistics::where ( 'user_id', $user->id )->where ( 'date_type', $date_type )->where ( 'data_type', $data_type )->where ( 'statistic_date', '>', $start_date )->where ( 'statistic_date', '<=', $end_date )->orderBy ( 'created_at', 'desc' )->get ();\n\t}", "public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }", "function statistics_extended_active_count($group=null){\r\n\tglobal $CONFIG;\r\n\t$query_tpl =\"SELECT COUNT(*) as members FROM {$CONFIG->dbprefix}users_entity ue \";\r\n\t$query_tpl.=\"JOIN {$CONFIG->dbprefix}entities e ON e.guid=ue.guid WHERE e.enabled='yes' AND \";\r\n\r\n\tif(!empty($group)){\r\n\t\t$query_tpl.=\" e.guid IN (SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) AND \";\r\n\t}\r\n\t$query_tpl.=\" last_login {{CONDITION}} 0\";\r\n\t// Active users\r\n\t$query = str_replace(\"{{CONDITION}}\",\"!=\",$query_tpl);\r\n\t$count = get_data_row($query);\r\n\t$active = $count->members;\r\n\r\n\t$query = str_replace(\"{{CONDITION}}\",\"=\",$query_tpl);\r\n\t$count = get_data_row($query);\r\n\t$inactive = $count->members;\r\n\r\n\treturn array($active,$inactive);\r\n}", "public function search(string $q)\n {\n return User::where('privilege', '>', 0)\n ->where(function ($query) use ($q) {\n $query->where('username', 'like', \"%{$q}%\")\n ->orWhere('email', 'like', \"%{$q}%\");\n })\n ->limit(10)\n ->get();\n }", "function getAutoSalesRip($search_string=null){\r\n\t\t$this->db->select(TBL_USERS.'.id,'.TBL_USER_INFORMATION.'.first_name,'.TBL_USER_INFORMATION.'.last_name');\r\n\t\t$this->db->from(TBL_USERS);\r\n\t\t$this->db->join(TBL_USER_INFORMATION,TBL_USER_INFORMATION.'.tbl_users_id='.TBL_USERS.'.id');\r\n\t\t$this->db->where(array(TBL_USERS.'.is_active'=>true,TBL_USERS.'.role'=>SALES_RIP_NAME));\r\n\t // $this->db->like(TBL_USER_INFORMATION.'.first_name', $search_string);\r\n\t\t//$this->db->or_like(TBL_USER_INFORMATION.'.last_name', $search_string);\r\n\t\t$this->db->where(\"(\".TBL_USER_INFORMATION.\".first_name like '%\".$search_string.\"%' or \".TBL_USER_INFORMATION.\".last_name like '%\".$search_string.\"%')\");\r\n\r\n\t\t//echo $this->db->_compile_select();\r\n\t\t$recordSet = $this->db->get();\r\n\t\t$data=$recordSet->result() ;\r\n\t\treturn $data;\r\n\t}", "function sessionStats()\n{\n return generateQuery('-st | sed \\'s/ */ /g\\' '); \n}", "public function getDailyUsersByMB($idApp, $initialDate, $finalDate, $mb){\n @list($d1, $m1, $y1) = explode( $this->separador,$initialDate,3);\n @list($d2, $m2, $y2) = explode( $this->separador,$finalDate,3);\n $c=$this->getConector($y1, $y2);\n $this->otherdb->select('year, month, day, platformname, count(id_download) as Users');\n $this->otherdb->from('dailyuserdata');\n $this->otherdb->where(\"id_app\", $idApp);\n $this->otherdb->where(\"model\", $mb);\n $this->otherdb->where(\"((year = $y1 and ( $m1 < month or ($m1=month and day >= $d1 and day <= 31 ) )) $c \n (year = $y2 and ( $m2 > month or ($m2=month and day >= 01 and $d2 >= day ))))\" );\n $this->otherdb->group_by(\"year, month, day, platformname\");\n /*$query = \" select year, month, day, platformname, count(id_download) as Users from dailyuserdata \n where id_app='$idApp' and model = '$mb' and\n ((year = $y1 and ( $m1 < month or ($m1=month and day >= $d1 and day <= 31 ) )) $c\n (year = $y2 and ( $m2 > month or ($m2=month and day >= 01 and $d2 >= day ))))\n group by year, month, day, platformname\";*/\n $this->addSegmentQuery($this->otherdb);\n $result = $this->otherdb->get();\n //$result = $this->otherdb->query($query);\n $titlearray = array(\"Users\");\n \n return $this->prepareResultSet($titlearray, $initialDate, $finalDate,$result->result_array());\n }", "public function Search($criteria, $userId);", "public function getUsersMatching($keyword) {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user WHERE firstname LIKE ? OR mail LIKE ? OR role LIKE ?';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array(\"%$keyword%\", \"%$keyword%\", \"%$keyword%\"));\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n\n }", "public function getMonthlyUserStats()\n {\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month )) as months group by monthName'));\n\n $total = [\n 'January' => 0,\n 'February' => 0,\n 'March' => 0,\n 'April' => 0,\n 'May' => 0,\n 'June' => 0,\n 'Jule' => 0,\n 'August' => 0,\n 'September' => 0,\n 'October' => 0,\n 'November' => 0,\n 'December' => 0\n ];\n\n $active = $total;\n\n foreach ($stats as $stat){\n $total[$stat->monthName] = $stat->usercount;\n }\n\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month) and is_active = 1) as months group by monthName'));\n\n foreach ($stats as $stat){\n $active[$stat->monthName] = $stat->usercount;\n }\n\n return [\n 'total' => $total,\n 'active' => $active\n ];\n }", "protected function _getSessDetails($token, $device_id, $user_type, $extra = NULL) {\n\n if ($user_type == '1')\n $getDetQry = \"select us.oid, us.expiry, us.device, us.type, us.loggedIn, us.sid,doc.first_name,doc.last_name,doc.profile_pic,doc.email,doc.stripe_id,doc.mobile,doc.workplace_id,doc.status from user_sessions us, master doc where us.oid = doc.mas_id and us.token = '\" . $token . \"' and us.device = '\" . $device_id . \"' and us.user_type = '\" . $user_type . \"'\"; // and us.loggedIn = 1\n else if ($user_type == '2')\n $getDetQry = \"select us.oid, us.expiry, us.device, us.type, us.loggedIn, us.sid,pat.first_name,pat.last_name,pat.profile_pic,pat.email,pat.stripe_id,pat.phone,pat.status as mobile from user_sessions us, slave pat where us.oid = pat.slave_id and us.token = '\" . $token . \"' and us.device = '\" . $device_id . \"' and us.user_type = '\" . $user_type . \"'\"; // and us.loggedIn = 1\n//echo $getDetQry;\n $getDetRes = mysql_query($getDetQry, $this->db->conn);\n\n if (mysql_num_rows($getDetRes) > 0) {\n\n $sessDet = mysql_fetch_assoc($getDetRes);\n//print_r($sessDet);\n\n if ($sessDet['loggedIn'] == '2')\n return array('flag' => '2', 'test' => $getDetQry);\n else if ($sessDet['loggedIn'] == '3')\n return array('flag' => '3', 'errNum' => 96);\n\n if ($sessDet['profile_pic'] == \"\")\n $sessDet['profile_pic'] = $this->default_profile_pic;\n\n if ($extra == NULL)\n if ($sessDet['status'] == '4')\n return array('flag' => '3', 'errNum' => 94);\n else if ($sessDet['status'] == '2' || $sessDet['status'] == '1')\n return array('flag' => '3', 'errNum' => 10);\n\n if ($sessDet['expiry'] > $this->curr_date_time)\n return array('flag' => '0', 'sid' => $sessDet['sid'], 'entityId' => $sessDet['oid'], 'deviceId' => $sessDet['device'], 'deviceType' => $sessDet['type'], 'firstName' => $sessDet['first_name'], 'last_name' => $sessDet['last_name'], 'pPic' => $sessDet['profile_pic'], 'email' => $sessDet['email'], 'stripe_id' => $sessDet['stripe_id'], 'mobile' => $sessDet['mobile'], 'workplaceId' => $sessDet['workplace_id']); // 'currLat' => $sessDet['Current_Lat'], 'currLong' => $sessDet['Current_Long'],\n else\n return array('flag' => '1', 'entityId' => $sessDet['oid']);\n } else {\n return array('flag' => '2', 'test' => $getDetQry);\n }\n }", "private function log_search_engine($data) {\n\t\t@preg_match('@^(?:http://)?([^/]+)@i', $data[0], $domain);\n\t\t\t\n\t\t$q = mysql_query(\"SELECT id,qexpr FROM robots WHERE '$domain[1]' REGEXP urlexpr\"); //or die (mysql_error());\n\t\t$r = mysql_fetch_object($q);\n\t\t\n\t\tif (isset($r->id)) {\n\t\t\t@preg_match('/'.$r->qexpr.'/', $data[0], $query);\n\t\t\t@preg_match('/((\\d+).(\\d+).(\\d+).(\\d+))/', $data[1], $ip);\n\t\t\t@mysql_query(\"INSERT INTO robot_queries SET search = '\".str_replace(\"+\", \" \", $query[1]).\"', source = '$ip[0]'\") or $this->log(mysql_error);\n\t\t\tif(DEBUG)\n\t\t\t\t@$this->log(\"Search query: \".$query[1]);\n\t\t}\n\t\n\t}", "function superadmin_index() {\n\t\t$this->set('meta_title','User Group');\n\t\t$search = '';\n\t\t$argArr = array();\n\t\t$cond = '';\t\t\n\tif(isset($this->params['pass'][0]) && isset($this->params['pass'][1]) && $this->params['pass'][1] == 'page_record') {\n\t\t$this->Session->write('per_page_record',$this->params['pass'][0]);\n\t}\t\t\n\t\t/* Search conditon for text value */\n\t\tif(!empty($this->data)) {\n\t\t\t$search = $this->data['Role']['search'];\n\t\t\t$this->Session->write('data_search',$this->data['Role']);\n\t\t\t\tif($this->Session->read('param_search')) {\n\t\t\t\t\t$this->Session->delete('param_search');\n\t\t\t\t}\t\t\t\n\t\t}\n\t\telse if(isset($this->params['named']['search']) && $this->params['named']['search']) {\n\t\t\t $this->Session->write('param_search',$this->params['named']);\n\t\t\t\t if($this->Session->read('data_search')) {\n\t\t\t\t\t$this->Session->delete('data_search');\n\t\t\t\t}\t\t\t \n\t\t\t \n\t\t}\n\t\telse if($this->Session->read('data_search')) {\n\t\t\t$search = $this->Session->read('data_search.search');\n\t\t\t\tif($this->Session->read('param_search')) {\n\t\t\t\t\t$this->Session->delete('param_search');\n\t\t\t\t}\t\t\n\t\t}\n\t\telse if($this->Session->read('param_search')) {\n\t\t\t$search = $this->Session->read('param_search.search');\n\t\t\t\t if($this->Session->read('data_search')) {\n\t\t\t\t\t$this->Session->delete('data_search');\n\t\t\t\t}\t\t\n\t\t}\n\t\tif($search) {\n\t\t\t$argArr['search'] = $search;\n\t\t $cond[] = array('OR'=>array('Role.role_name LIKE'=>'%'.$search.'%'));\n\t\t}\n\t\t$this->set('search', $search); \n\t\t$this->set('argArr', $argArr);\n\t\t/* End Search conditon for text value */\n\t\t$condition = $cond;\n\t\t$record = ($this->Session->read('per_page_record')) ? $this->Session->read('per_page_record') : ADMIN_PER_PAGE_RECORD;\n\t\t$this->paginate = array('limit' =>$record,'order' => array('Role.role_name' => 'ASC'));\n\t\t$data = $this->paginate('Role', $condition);\n\t\t$this->set('data', $data); \n\t }", "public function get_user_serach_property_info($searchId,$shortlistedId){\n $sql = \"SELECT s.searchName,u.firstName,u.deviceToken,sh.propertyName FROM searchcriteria s,users u,shortlistedproperty sh WHERE s.userId = u.userId AND s.searchId = $searchId AND s.searchId = sh.searchId AND sh.shortlistedId = $shortlistedId\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n }", "public function getMessageStats($userId);", "function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo->Size = 100; // The first 100 accounts for this page of results\n\n $ordering = new OrderBy();\n $ordering->Field = OrderByField::Number;\n $ordering->Order = SortOrder::Ascending; \n\n $predicate = new Predicate();\n $predicate->Field = \"UserId\";\n $predicate->Operator = PredicateOperator::Equals;\n $predicate->Value = $userId; \n\n $request = new SearchAccountsRequest();\n $request->Ordering = $ordering;\n $request->PageInfo = $pageInfo;\n $request->Predicates = array($predicate);\n\n return $GLOBALS['proxy']->GetService()->SearchAccounts($request)->Accounts;\n}", "function scorm_get_user_data($userid) {\n/// for report.php\n\n return get_record('user','id',$userid,'','','','','firstname, lastname, picture');\n}", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "function sidsearch($sid){\r\n\t\tif ($this->db->get_where('user',array('member_id'=>$sid))->num_rows()==1){\r\n\t\t\t$uid = end($this->db->get_where('user',array('member_id'=>$sid))->result())->id;\r\n\t\t\t$user_info = $this->db->get_where('user_info',array('uid'=>$uid))->row_array();\r\n\t\t\t$user_info['appendix'] = unserialize($user_info['appendix']);\r\n\t\t\tif (isset($user_info['appendix']['ulib']['comp_id']) && is_numeric($user_info['appendix']['ulib']['comp_id'])){\r\n\t\t\t\t$registered = TRUE;\r\n\t\t\t}else{\r\n\t\t\t\t$registered = FALSE;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//generate output\r\n\t\t\t$output = array('en' => $user_info['enn'],\r\n\t\t\t\t\t\t\t'fn' => $user_info['cnfn'],\r\n\t\t\t\t\t\t\t'ln' => $user_info['cnln'],\r\n\t\t\t\t\t\t\t'msg' => 'Target located',\r\n\t\t\t\t\t\t\t'code' => 0,\r\n\t\t\t\t\t\t\t'regi' => $registered,\r\n\t\t\t\t\t\t\t'class' => $user_info['appendix']['class']\r\n\t\t\t);\r\n\t\t}\r\n\t\t//get unregistered user information\r\n\t\telseif ($this->db->get_where('user_veri',array('member_id'=>$sid))->num_rows()==1){\r\n\t\t\t//get app\r\n\t\t\t$user_info = $this->db->get_where('user_veri',array('member_id'=>$sid))->row_array();\r\n\t\t\t$user_info['appendix'] = unserialize($user_info['appendix']);\r\n\t\t\tif (isset($user_info['appendix']['ulib']['comp_id']) && is_numeric($user_info['appendix']['ulib']['comp_id'])){\r\n\t\t\t\t$registered = TRUE;\r\n\t\t\t}else{\r\n\t\t\t\t$registered = FALSE;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$output = array('en' => $user_info['enn'],\r\n\t\t\t\t\t\t\t'fn' => $user_info['cnfn'],\r\n\t\t\t\t\t\t\t'ln' => $user_info['cnln'],\r\n\t\t\t\t\t\t\t'msg' => 'Target located',\r\n\t\t\t\t\t\t\t'code' => 0,\r\n\t\t\t\t\t\t\t'regi' => $registered,\r\n\t\t\t\t\t\t\t'class' => $user_info['appendix']['class']\r\n\t\t\t);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$output = array('msg' => \"Not yet matched\",\r\n\t\t\t\t\t\t\t'code' => 100\r\n\t\t\t);\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}", "public function count_search_criteria_list($post_data){\n $userId = $post_data['userId']; \n $date = date(\"Y-m-d H:i:s\");\n $keyword = $post_data['keyword'];\n $latitude = $post_data['latitude'];\n $longitude = $post_data['longitude'];\n // $filter = $post_data['filter']; //fav_teacher/all\n // $type = $post_data['type']; // upcoming/past\n \n\n if(!empty($keyword)){\n $keyword = \"AND (s.searchName LIKE '%$keyword%' OR s.idealMovingDate LIKE '%$keyword%' OR s.houseType LIKE '%$keyword%' OR s.priceRange LIKE '%$keyword%' OR s.bedroom LIKE '%$keyword%')\";\n }\n\n if(!empty($latitude) && !empty($longitude))\n {\n $distance_in_km = \"( 6371 * acos( cos( radians($latitude) ) * cos( radians( lc.latitude) ) \n * cos( radians( lc.longitude ) - radians($longitude) ) + \n sin( radians($latitude) ) * sin( radians( lc.latitude ) ) ) ) \n AS distance_in_km\";\n }\n\n if (!empty($latitude) && !empty($longitude)) {\n\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1) +1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }else{\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }\n\n $record = $this->db->query($sql);\n return $record->num_rows();\n }", "public function query( $sql ) {\n\t\tglobal $wpdb;\n\n\t\t// Prevent more expensive regex from running if not a user query\n\t\tif ( 0 !== strpos( $sql, 'SELECT' ) || false === strpos( $sql, 'FROM ' . $wpdb->users ) ) {\n\t\t\treturn $sql;\n\t\t}\n\n\n\t\tforeach ( $this->get_query_regex() as $pattern ) {\n\t\t\tif ( preg_match( $pattern, $sql ) && wp_sub_enabled() ) {\n\t\t\t\t$sql = $this->add_meta_sql( $sql );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function all_about_us_services_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_service ORDER BY service_id DESC\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function get_user_serach_info($searchId){\n $sql = \"SELECT s.searchName,u.firstName,u.deviceToken FROM searchcriteria s,users u WHERE s.userId = u.userId AND s.searchId = $searchId\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n }", "public function get_user_stats( $args = array(), $array_output = false ) {\n $default_args = array(\n 'order_by' => 'quantity',\n 'order' => 'DESC',\n 'group_by' => 'ip',\n 'fields' => array(\n 'post_id',\n 'ip',\n 'COUNT(ip) AS quantity',\n 'SUM(price) AS amount',\n ),\n );\n $args = wp_parse_args( $args, $default_args );\n\n return $this->get_results( $args, $array_output );\n }", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "public function searchUsers(){\n\t\t$validator = Validator::make(Request::all(), [\n 'accessToken' => 'required',\n 'userId' => 'required',\n 'searchUser' => 'required',\n 'searchOption' => 'required'\n ]);\n if ($validator->fails()) {\n #display error if validation fails \n $this->status = 'Validation fails';\n $this->message = 'arguments missing';\n } else {\n \t$siteUrl=URL::to('/');\n\t\t\t$result=Request::all();\n\t\t\t$accesstoken = Request::get('accessToken');\n\t $user_id = Request::get('userId');\n\t\t\t$user_info = User::find($user_id);\n\t\t\tif(isset($user_info)){\n\t\t\t\t$user_id = $user_info->id;\n\t\t\t\t$location = $user_info->location;\t\n\t\t\t}else{\n\t\t\t\t$user_id = 0;\n\t\t\t\t$location = '';\n\t\t\t}\n\t\t\t$searchresult = array();\n\t\t\t$start =0; $perpage=10;\n\t\t\tif(!empty($user_info)){\n\t\t\t\tif($accesstoken == $user_info->site_token){\n\t\t\t\tif(!empty($result)) \n\t\t\t\t{\n\t\t\t\t\t$search = Request::get('searchUser');\n\t\t \t$searchOption = Request::get('searchOption');\n\t\t\t\t\tif($searchOption == 'People'){\n\t\t\t\t\t $searchqueryResult =User::where('id','!=',$user_id)->where('fname', 'LIKE', '%'.$search.'%')->orWhere('lname','LIKE', '%'.$search.'%')->orWhere('location','LIKE', '%'.$search.'%')->orWhere('summary','LIKE', '%'.$search.'%')->orWhere('headline','LIKE', '%'.$search.'%')->where('userstatus','=','approved')->orderBy('karmascore','DESC')->get();\n\t\t\t\t\t\tif(!empty($searchqueryResult)){\n\t\t\t\t\t \t\tforeach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t\t$receiver=$value->id;\n\t\t\t\t\t \t\t\t$receiverDetail = User::find($receiver);\n\t\t\t\t\t \t\t\t$meetingRequestPending = $receiverDetail->Giver()->Where('status','=','pending')->count();\n\t\t\t\t\t \t\t\t$commonConnectionData=KarmaHelper::commonConnection($user_id,$value->id);\n\t\t\t\t\t \t\t\t$getCommonConnectionData=array_unique($commonConnectionData);\n\t\t\t\t\t \t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\t\t$searchquery[$key]['meetingRequestPending']=$meetingRequestPending;\n\t\t\t\t\t \t\t\t$searchquery[$key]['noofmeetingspm']=$value->noofmeetingspm;\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t\t\t\t\t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}elseif($searchOption == 'Skills'){\n\t\t\t\t\t\t$skillTag = array(); \n\t\t \t \t$searchqueryResult = DB::table('tags')\n\t\t\t\t\t ->join('users_tags', 'tags.id', '=', 'users_tags.tag_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_tags.user_id')\n\t\t\t\t\t ->where('name', 'LIKE', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id', '!=', $user_id)\t\t\t \n\t\t\t\t\t ->groupBy('users_tags.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('tags.name', 'tags.id', 'users_tags.user_id', 'users.fname', 'users.lname','users.karmascore', 'users.email', 'users.piclink', 'users.linkedinid', 'users.linkedinurl', 'users.location', 'users.headline')\n\t\t\t\t\t //->skip($start)->take($perpage)\n\t\t\t\t\t ->get();\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t\t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t foreach ($searchquery as $key => $value) {\n\t\t\t\t\t\t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($value->user_id)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t\t\t\t\t\tforeach ($tags as $skillkey => $skillvalue) {\n\t\t\t \t \t\t\t$skillTag[$skillkey]['name'] = $skillvalue->name;\n\t\t\t \t \t\t}\n\t\t\t\t\t\t\t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $skillTag;\n\t\t\t \t \t\t//echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\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}elseif($searchOption == 'Location'){\n\t\t\t\t\t\t$searchqueryResult = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`karmascore`, `users`.`headline`, `users`.`location`, `users`.`id` As user_id from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where location LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where location LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location limit 10 offset '.$start )); \t\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Groups'){\t\t\t\t\n\t\t\t\t\t\t$searchqueryResult = DB::table('groups')\n\t\t\t\t\t ->join('users_groups', 'groups.id', '=', 'users_groups.group_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_groups.user_id')\n\t\t\t\t\t ->where('name', '=', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id','<>',$user_id)\t\n\t\t\t\t\t ->groupBy('users_groups.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('groups.name', 'groups.id', 'users_groups.user_id', 'users.fname', 'users.lname', 'users.email', 'users.piclink', 'users.linkedinid', 'users.karmascore', 'users.location', 'users.headline')\n\t\t\t\t\t ->get();\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n \t\t\t\t\t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t \t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t // echo \"<pre>\";print_r($searchquery);echo \"</pre>\";die;\n\t\t \t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Tags'){\n\t\t\t\t\t\t$searchquery = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`linkedinurl`, `users`.`headline`, `users`.`location`, `users`.`id` from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where headline LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where headline LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location = \"'.$location.'\" desc limit 10 offset'.$start )); \t\n\t\t\t\t\t //echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value->linkedinid;\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Failure';\n\t\t\t\t\t\t$this->message='There is no such category';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message\n\t\t\t\t \t\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($searchquery)){\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\t$this->message='There is no data available';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message,\n\t\t\t\t \t'searchresult'=>$searchquery\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//return $searchresult;exit;\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->status = 'Failure';\n\t \t$this->message = 'You are not a login user.';\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->status = 'Failure';\n \t$this->message = 'You are not a current user.';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t \t'status'=>$this->status,\n\t\t\t \t'message'=>$this->message\n\t\t));\t\n\t\t\t\n\t}" ]
[ "0.5193046", "0.5148894", "0.5019362", "0.49109045", "0.48917776", "0.47886133", "0.47000948", "0.4699067", "0.4653645", "0.46240857", "0.455254", "0.4548656", "0.45162448", "0.44882306", "0.4472489", "0.44717714", "0.44703698", "0.44570047", "0.4454439", "0.44487864", "0.44443962", "0.44351733", "0.44273093", "0.44253996", "0.44181213", "0.44172627", "0.44161904", "0.43990046", "0.4385541", "0.43840337", "0.43808264", "0.43761694", "0.43716756", "0.43652678", "0.43610963", "0.436095", "0.43596843", "0.4347664", "0.43476588", "0.43406188", "0.4340382", "0.4339141", "0.4333664", "0.43279183", "0.43247154", "0.4314579", "0.43080977", "0.43031573", "0.43006855", "0.4299264", "0.42979202", "0.42908913", "0.42900303", "0.4284204", "0.42801362", "0.42797238", "0.42788327", "0.42786357", "0.42714942", "0.42612863", "0.42574027", "0.42508128", "0.42484936", "0.4245678", "0.42388144", "0.42372936", "0.42363533", "0.423527", "0.42296365", "0.42271546", "0.4223126", "0.4222844", "0.42188904", "0.42159596", "0.42159253", "0.42137572", "0.42120808", "0.42110345", "0.4207021", "0.42061362", "0.41929632", "0.41920042", "0.4191246", "0.4186648", "0.41866454", "0.41856042", "0.4185201", "0.4174628", "0.41696367", "0.41671813", "0.4165761", "0.41651142", "0.41648364", "0.41641256", "0.41635096", "0.41554034", "0.41542092", "0.41522542", "0.41512737", "0.41484103", "0.41477475" ]
0.0
-1
Find Meta Service Metrics for an admin user.
public function findByMetaId(int $metaId): ?array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "public function findServicesDowntimesForAdminUser(): array;", "public function admins()\n {\n return $this->newQuery('getUsers', ['type' => 'AdminUsers']);\n }", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "static function adminGetMetricDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n \r\n $sql = \"SELECT * FROM metric WHERE id=:id LIMIT 1\";\r\n $data = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow();\r\n \r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id=:id ORDER BY last_activity DESC\";\r\n $visits = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll(); \r\n \r\n if ($visits)\r\n foreach ($visits as $k=>$v)\r\n {\r\n $visits[$k]['location'] = Yii::app()->location->getLocation($v['location_id']);\r\n }\r\n \r\n $data['visits'] = $visits;\r\n \r\n \r\nFB::warn($data);\r\n \r\n \r\n \r\n/* \r\n $sql = \"SELECT user_id FROM metric WHERE id={$id}\";\r\n $userId = Yii::app()->db->createCommand($sql)->queryScalar();\r\n \r\n \r\n \r\n if ($userId)\r\n {\r\n $sql = \"SELECT id FROM metric WHERE user_id={$userId} ORDER BY id DESC\";\r\n $ids = Yii::app()->db->createCommand($sql)->queryColumn();\r\n }\r\n else\r\n {\r\n $ids[] = $id;\r\n }\r\n \r\n $res['user_id'] = $userId;\r\n \r\n if ($ids)\r\n foreach ($ids as $v)\r\n {\r\n //location\r\n\r\n $sql = \"SELECT ip, location_id,\tadded, last_activity FROM metric WHERE id={$v} LIMIT 1\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n $m['details']['location'] = Yii::app()->location->getLocation($m['details']['location_id']);\r\n \r\n //visits\r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id={$v} ORDER BY id DESC\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n \r\n \r\n \r\n //actions\r\n //$sql = \"SELECT viewed_user_id, added FROM metric_video_play WHERE metric_id={$v} ORDER BY id DESC\";\r\n //$m['details']['videos'] = Yii::app()->db->createCommand($sql)->queryAll();\r\n \r\n $res['info'][] = $m;\r\n }\r\n*/ \r\n \r\n return $data;\r\n }", "public function index()\n {\n $fields = [];\n $user = Auth::user();\n $start_date = $this->getStartDate(Input::get('start_date'));\n $end_date = $this->getEndDate(Input::get('end_date'));\n $time_increment = (bool) Input::get('time_increment', false);\n\n $ad_sets = $this->adSetRepository->byUserWithMetricsByDate( $user, $fields, $start_date, $end_date, $time_increment );\n\n // Return the results.\n //\n return $this->response( $ad_sets ?: [] );\n }", "public function getUserStats($userId);", "public static function admins()\n {\n return User::all()->where('idpapel', 1)->where('stusuario', 'ati')->toArray();\n }", "public function findDowntimesForAdminUser(): array;", "public function index(UserManagerDataTable $userDataTable)\n {\n return $userDataTable->render('settings.users.manager.index');\n }", "public function stats() {\n\t\t$userCount = 0;\n\t\tif ($this->isAdmin) {\n\t\t\t$countByBackend = $this->userManager->countUsers();\n\n\t\t\tif (!empty($countByBackend)) {\n\t\t\t\tforeach ($countByBackend as $count) {\n\t\t\t\t\t$userCount += $count;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t'@phan-var \\OC\\Group\\Manager $this->groupManager';\n\t\t\t$groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($this->userSession->getUser());\n\n\t\t\t$uniqueUsers = [];\n\t\t\tforeach ($groups as $group) {\n\t\t\t\tforeach ($group->getUsers() as $uid => $displayName) {\n\t\t\t\t\t$uniqueUsers[$uid] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$userCount = \\count($uniqueUsers);\n\t\t}\n\n\t\treturn new DataResponse(\n\t\t\t[\n\t\t\t\t'totalUsers' => $userCount\n\t\t\t]\n\t\t);\n\t}", "public function getManagers() {\r\n\r\n $users = array();\r\n\r\n $magentoUsers = mage::getSingleton('admin/user')->getCollection();\r\n\r\n foreach ($magentoUsers as $manager) {\r\n $users[$manager->getId()] = $manager->getusername();\r\n }\r\n\r\n return $users;\r\n }", "public function getStats(){\n if(Admin::isAdmin()){\n return View::make('analytics.user_analytics');\n }else{\n return Redirect::to('/');\n }\n }", "public function getAdmins()\n {\n $query = $this->newQuery();\n $query->where('admin', true);\n\n return $this->doQuery($query, false, false);\n }", "public function get_usermeta_admin($id, $meta_key){\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_usermeta` WHERE `user_id`= ? AND `meta_key` = ?\");\n\t\t$query->bindValue(1, $id);\n\t\t$query->bindValue(2, $meta_key);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data \t\t\t\t= $query->fetch();\n\n\t\t\treturn $data;\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "public function all_about_us_services_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_service ORDER BY service_id DESC\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "private function get_admins_info() {\n $stm=$this->uSup->get_com_admins_to_notify_about_requests(\"user_id\",$this->company_id);\n\n $q_user_id=\"(1=0 \";\n /** @noinspection PhpUndefinedMethodInspection */\n while($admin=$stm->fetch(PDO::FETCH_OBJ)) {\n $q_user_id.=\" OR u235_users.user_id='\".$admin->user_id.\"' \";\n }\n $q_user_id.=\")\";\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uAuth\")->prepare(\"SELECT DISTINCT\n firstname,\n secondname,\n email\n FROM\n u235_users\n JOIN \n u235_usersinfo\n ON\n u235_users.user_id=u235_usersinfo.user_id AND\n u235_usersinfo.status=u235_users.status\n WHERE\n \" .$q_user_id. \" AND \n u235_users.status='active' AND\n u235_usersinfo.site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n return $stm;\n }", "public function getAllMeasurements($userId){\n\t\t$sql = 'SELECT * FROM measurements WHERE user_id = :userId';\n\t\t$pstmt = $this->db->prepare($sql);\n\t\t$pstmt->bindParam(':userId', $userId);\n\t\t$pstmt->execute();\n\t\treturn $pstmt->fetchAll(\\PDO::FETCH_OBJ);\n\t}", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "function getAllReports(){\n global $errors;\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles, $keyword;\n\t\t$sql = \"SELECT * FROM reportedusers WHERE U_name like '%$keyword%' or rptr_u_name like '%$keyword%' or reason like '%$keyword%' order by timestamp desc \"; \n\t\tif($result = mysqli_query($conn, $sql)){\n $users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $users;\n }else{\n array_push($errors, \"there was a problem fetching Records\");\n }\n\n\t} else {\n\t\treturn null;\n\t}\n}", "public function index()\n {\n return Metric::all();\n }", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "public static function get_admin_users(){\n \n global $db;\n \n $query = \"SELECT * FROM users \";\n $query .= \"WHERE user_role = 'admin'\";\n \n $result = User::makeQuery($query);\n \n return $result;\n }", "private function get_siteadmins() {\n global $DB;\n $sql = \"SELECT rgt.userid, rgt.gmail\n FROM mdl_repository_gdrive_tokens rgt\n JOIN mdl_config cfg\n ON cfg.name = 'siteadmins'\n WHERE find_in_set(rgt.userid, cfg.value) > 0;\";\n $siteadmins = $DB->get_records_sql($sql);\n return $siteadmins;\n }", "public function admins()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_ADMIN)->get();\n }", "public function indexAdmin ()\n {\n $listOfUsers = $this->userRequest->usersIndexForAdmin();\n return $listOfUsers;\n }", "public function stats(){\n\t\treturn apc_cache_info('user',true);\n\t}", "function get_administrators(EntityManager $em)\n{\n // to perform DB queries\n return $em->createQueryBuilder()\n ->select('u')\n ->from('User', 'u')\n ->where('u.admin = 1')\n ->getQuery()->getArrayResult();\n}", "function _get ($params = array()) {\n\t\tif (!$this->STATS_ENABLED) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->_get_user_stats_for_ids (array($params[\"user_ids\"]));\n\t}", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "static function findAdministrators($exclude_user = null) {\n return Users::find(array(\n 'conditions' => $exclude_user instanceof User ? DB::prepare(\"type = 'Administrator' AND id != ? AND state = ?\", $exclude_user->getId(), STATE_VISIBLE) : DB::prepare(\"type = 'Administrator' AND state = ?\", STATE_VISIBLE),\n ));\n }", "public function findHostDowntimesForAdminUser(): array;", "public function getMetricsManager($manager_id)\n {\n $dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $job_portfolio=array();\n $job_site=array();\n $manager_list=array();\n\n $comment_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n \n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_labor_tax_lag=0;\n $total_bill_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n \n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $user_id=0;\n $user = DB::table('users')\n ->where('manager_id', $manager_id)\n ->where('active', 1)\n ->get();\n\n foreach ($user as $user_item) {\n $user_id = $user_item->id;\n }\n\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1;\n $expense_calc_week2=$total_expense_week2;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n \n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => 0,\n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list\n ]);\n }", "public function availableMetrics()\n {\n return DashboardNova::allAvailableDashboardCards($this)->whereInstanceOf(Metric::class);\n }", "public function findServicesDowntimesForNonAdminUser(): array;", "public function getAdminAttribute()\n {\n return User::whereId($this->accountId)->first();\n }", "public static function get($meta, $user);", "private function getAdminKuserId()\r\n\t{\r\n\t\t$partnerId = KalturaGlobalData::getData(\"@TEST_PARTNER_ID@\");\r\n\t\t$puserId = KalturaGlobalData::getData(\"TEST_PARTNER_USER_ID\");\r\n\t\tKuserPeer::getKuserByPartnerAndUid($partnerId, $puserId);\r\n\t}", "function getMetrics($metric, $startDate, $endDate, $dimensions = false, $sort = false, $filter = false, $limit = false)\n\t{\n\t\t$analytics = new Google_AnalyticsService($this->client);\n\n\t\t$params = array();\n\n\t\tif ($dimensions)\n\t\t{\n\t\t\t$params['dimensions'] = $dimensions;\n\t\t}\n\t\tif ($sort)\n\t\t{\n\t\t\t$params['sort'] = $sort;\n\t\t}\n\t\tif ($filter)\n\t\t{\n\t\t\t$params['filters'] = $filter;\n\t\t}\n\t\tif ($limit)\n\t\t{\n\t\t\t$params['max-results'] = $limit;\n\t\t}\n \n // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking\n $filtered_id = str_replace( 'ga:', '', $this->accountId );\n \n if(!$filtered_id){\n echo 'Error - Account ID is blank';\n return false;\n }\n \n\t return $analytics->data_ga->get(\n\t 'ga:'.$filtered_id,\n\t $startDate,\n\t $endDate,\n\t $metric,\n\t $params\n\t );\n\t}", "function admin_userReports()\n\t{\n\t\t$this->User->recursive = 0;\n\t\t$rol = $this->data['User']['role_id'];\t\n\t\tforeach($this->data['User'] as $indice =>$valor)\n\t\t{\n\t\t\tif($valor==1)\n\t\t\t{\n\t\t\t\t$array[] = $indice;\n\t\t\t}\n\t\t}\n\t\t$reporte = $this->User->find('all', array('fields'=>$array,'conditions'=>array('User.role_id'=>$rol)));\n\t\t$this->set(compact('reporte'));\n\t}", "public function getWebsitesAdmin()\n {\n $res = $this->searchAdmin();\n if ($res) {\n array_push($this->site_ids, array('access' => 'admin', 'ids' => array()));\n if ($res['count'] > 0) {\n foreach ($res as $r) {\n if (is_array($r)) {\n array_push($site_ids[1]['ids'], $this->getSiteId($r[strtolower($this->to_get_admin)][0]));\n }\n }\n }\n }\n }", "function YWR_2020_pre_user_query($user_search)\n{\n\n $user = wp_get_current_user();\n\n if (!current_user_can('manage_options')) {\n\n global $wpdb;\n\n $user_search->query_where =\n str_replace('WHERE 1=1',\n \"WHERE 1=1 AND {$wpdb->users}.ID IN (\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\n WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities'\n AND {$wpdb->usermeta}.meta_value NOT LIKE '%administrator%')\",\n $user_search->query_where\n );\n\n }\n}", "public function adminUserConditionMatchesAdminUser() {}", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "function scheduledreporting_component_get_reports($userid = 0)\n{\n $scheduled_reports = array();\n $temp = get_user_meta($userid, 'scheduled_reports');\n if ($temp != null)\n $scheduled_reports = mb_unserialize($temp);\n\n // Add user_id to reports\n if (empty($userid)) {\n $userid = $_SESSION['user_id'];\n }\n foreach ($scheduled_reports as $id => $report) {\n $scheduled_reports[$id]['user_id'] = $userid;\n }\n\n return $scheduled_reports;\n}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "public function getStatistics(){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"status\"])\n\t\t\t||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"])\n\t\t\treturn false;\n\n\t\t// get entry stats\n\t\t$query = Queries::getuploads();\n\t\t$uploads = $this->query($query);\n\n\t\t// get user stats\n\t\t$query = Queries::getjoins();\n\t\t$joins = $this->query($query);\n\n\t\t// get sex stats\n\t\t$query = Queries::getsexcounts();\n\t\t$gender = $this->query($query);\n\n\t\t$result = array();\n\t\t$result[\"uploads\"]=$uploads;\n\t\t$result[\"joins\"]=$joins;\n\t\t$result[\"genders\"]=$gender;\n\n\t\treturn $result;\n\t}", "public function index()\n\t{\n\t\t$metrics = Metric::all();\n\t\treturn $metrics;\n\t}", "public function users(){\n\t\t$user = $this->ion_auth->user()->row();\n\n\t\t$query = $this->db->select()\n\t\t\t\t\t\t\t\t\t\t\t ->from('users')\n\t\t\t\t\t\t\t\t\t\t\t ->where('admin_id',$user->id)\n\t\t\t\t\t\t\t\t\t\t\t ->order_by('id', 'asc')\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $query;\n\t}", "function mapit_admin_get_stats() {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.admin_get_stats', $params);\n return $result;\n}", "public function adminInfo($id){\n $info = DB::table('admins')->where('uid', $id)->first();\n return $info;\n }", "public static function getAllAdmins()\n\t{\n\t\t$admins = self::where('users_role',UserRole::ADMIN_ROLE_ID)->get();\n\t\treturn $admins;\n\t}", "protected function _getAdminSettings(){\n if (is_null($this->_adminSettings)){\n $this->_adminSettings = $settings = Mage::getModel('easylife_gridenhancer/settings')\n ->loadByAdmin(\n Mage::getSingleton('admin/session')->getUser()->getId(),\n Easylife_GridEnhancer_Helper_Customer::CUSTOMER_GRID_IDENTIFIER\n );\n }\n return $this->_adminSettings;\n }", "public function freeAdmins() {\n\t\t$schoolAdminsGroup = \\Sentry::findGroupByName('School Administrator');\n\n return \\User::ofGroup($schoolAdminsGroup)->get();\n \n\t\t//return \\User::withoutSchool()->ofGroup($schoolAdminsGroup)->get();\n\t}", "public static function get_admins();", "public function getResultsOfUser($user_id);", "public static function getAdminsList()\n {\n $data_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $data_to_load, \"SELECT * FROM `admin_users`\") === false)\n Status::message(Status::ERROR, \"Couldn't retrieve `admin_users` from DB\");\n \n Status::message(Status::SUCCESS, $data_to_load);\n }", "public function get_admin_reports_instance() {\n\t\treturn $this->admin_reports;\n\t}", "public function getAdmin()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true) {\n $this->_f3->set('admin', $admin);\n }\n }", "function metadata()\r\n {\r\n Cache::variable($this->metadata, function() {\r\n return (array)DB::object('userMetadataById', $this->id);\r\n });\r\n }", "public function admins() {\n $data = array();\n // verify user has priviledges\n if($this->User->isLoggedIn() && $this->User->isAdmin()) {\n $flash = null;\n \n if (isset($_POST['delete_admin'])) {\n if ($this->User->removeAdminRights($_POST['user_id'])) {\n $flash = \"Admin user removed\";\n }\n }\n \n if (isset($_POST['email'])) {\n $user_id = $this->User->getByEmail($_POST['email']);\n if(isset($user_id['id'])) {\n if($this->User->bestowAdminRights($user_id['id'])) {\n $flash = \"{$_POST['email']} added as an admin.\";\n }\n }\n }\n \n // fetch admin users\n $users = $this->User->getAdmins();\n \n //set the title\n $data = array(\n 'users' => $users,\n 'flash' => $flash,\n 'title' => 'Manage Admin Users'\n );\n \n } else {\n header(\"Location: \".app::site_url(array('users','login')));\n exit(0);\n }\n return $data;\n }", "public function seeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->seeInDatabase($tableName, $criteria);\n }", "function get_super_admins()\n {\n }", "public function admin_logs_manage() {\n $app = $this->app;\n if ($this->isUserAdmin()) {\n $srv = $this->srv;\n $logs = $srv->retrieve_all_logs();\n $app->render('Logbook/admin_manage_logs.html.twig', ['globals' => $this->getGlobals(), 'logs' => $logs]);\n } else {\n $app->flash('error', 'Ongeldige bewerking.');\n $app->redirect($app->urlFor('main_page'));\n }\n }", "function userAdmin( )\n {\n return $this->UserAdmin ;\n }", "public function getAdmins()\n\t{\n\t\t$query = <<<QUERY\nSELECT\n\t*\nFROM\n\tplayer\nWHERE\n\trole LIKE '%admin%'\nQUERY;\n\n\t\treturn $this->database->query( $query, 'Get admins from player table' );\n\t}", "public function getIndexAdmin()\n {\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Admin\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n $user = new User();\n\n $username = $this->di->get(\"session\")->get(\"account\");\n $user->username = $username;\n $user->setDb($this->di->get(\"db\"));\n $user->find(\"username\", $username);\n\n $allUsers = new User();\n $allUsers->setDb($this->di->get(\"db\"));\n\n $data = [\n \"users\" => $allUsers->findAll(),\n ];\n\n $view->add(\"user/adminIndex\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function add_custom_users_api() {\n\t\t// only when adminbar is available\n\t\tif (!is_admin_bar_showing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tregister_rest_route('mio', '/omnisearch', array(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [$this, 'rest_callback_admin_search'],\n\t\t\t));\n\t}", "public function getAdminUser()\n {\n return $this->registry->registry('current_admin_user');\n }", "public function getMonthlyUserStats()\n {\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month )) as months group by monthName'));\n\n $total = [\n 'January' => 0,\n 'February' => 0,\n 'March' => 0,\n 'April' => 0,\n 'May' => 0,\n 'June' => 0,\n 'Jule' => 0,\n 'August' => 0,\n 'September' => 0,\n 'October' => 0,\n 'November' => 0,\n 'December' => 0\n ];\n\n $active = $total;\n\n foreach ($stats as $stat){\n $total[$stat->monthName] = $stat->usercount;\n }\n\n $stats = DB::select(DB::raw('select monthName, count(*) as usercount from\n (select MONTHNAME(created_at) as monthName from users\n where created_at > date_sub(now(), interval 12 month) and is_active = 1) as months group by monthName'));\n\n foreach ($stats as $stat){\n $active[$stat->monthName] = $stat->usercount;\n }\n\n return [\n 'total' => $total,\n 'active' => $active\n ];\n }", "public function findServicesByIdsForAdminUser(array $serviceIds): array;", "public function getAdmins()\n {\n $role = Role::where('name', 'admin')->first();\n return $role->users;\n }", "public static function get_all( WP_User $user ) {\n\n\t\tglobal $wpdb;\n\n\t\t$mids = $wpdb->get_col( $wpdb->prepare(\n\t\t\t\"SELECT `umeta_id` FROM {$wpdb->usermeta} WHERE `meta_key` = %s AND `user_id` = %d\",\n\t\t\tself::META_KEY,\n\t\t\t$user->ID\n\t\t) );\n\n\t\t$sessions = array();\n\n\t\tforeach ( $mids as $meta_id ) {\n\t\t\tif ( ! is_wp_error( $session = self::get( $meta_id ) ) ) {\n\t\t\t\t$sessions[] = $session;\n\t\t\t}\n\t\t}\n\n\t\treturn $sessions;\n\t}", "public function query()\n {\n return Admin::query();\n }", "private function check_if_user_is_admin()\n {\n $user = wp_get_current_user();\n $tasks_performer = new TasksPerformer;\n if (!$tasks_performer->is_mtii_admin()) {\n exit(\"Woof Woof Woof\");\n }\n }", "public function wpzoom_helper_guide_get_admin_colors() {\n\n\t\tif(is_customize_preview()){\n\t\t\tregister_admin_color_schemes();\n\t\t}\n\n\t\tglobal $_wp_admin_css_colors;\n\n\n\t\t$current_color_scheme = get_user_meta( get_current_user_id(), 'admin_color', true );\n\t\t$colors = $_wp_admin_css_colors[ $current_color_scheme ]->colors;\n\n\t\treturn $colors;\n\t}", "public function actionIndex()\n {\n $agency_id = 0;\n $searchModel = new UsersSearch();\n $params = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($params);\n if(isset($params['UsersSearch']['agency_id']) && !empty($params['UsersSearch']['agency_id'])){\n $agency_id = $params['UsersSearch']['agency_id'];\n }else if(\\Yii::$app->user->identity->type==3){\n $agency_id = \\Yii::$app->user->identity->uid;\n }\n $statistics = $this->getUserStatistics($agency_id);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'statistice' =>$statistics,\n ]);\n }", "public function adminStatsAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\n\t\t// redirection des non-admins\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location: account');\n\t\t\texit();\n\t\t}\n\t\t\n\t\t//récupération des infos produits\n\t\t$productsManager = new ProductsManager();\n\t\t$products = $productsManager -> getAllWithStats();\n\n\t\t//pour tous les produits, récupération du total des ventes s'ils ont déjà été vendus\n\t\t$productsNumber = $productsManager -> count();\n\t\tfor ($i=0; $i < $productsNumber; $i++) { \n\t\t\tif ($products[$i]['quantityOrdered'] === null) {\n\t\t\t\t$products[$i]['quantityOrdered'] = 0;\n\t\t\t\t$products[$i]['total']['HTTotal'] = 0;\n\t\t\t\t$products[$i]['total']['TTCTotal'] = 0;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$products[$i]['total'] = $productsManager -> getTotal($products[$i]['productId']); \n\t\t\t}\n\n\t\t}\n\t\t$this -> viewData['products'] = $products;\n\n\t\t//récupération des infos de catégories\n\t\t$categoriesManager = new CategoriesManager();\n\t\t$this -> viewData['categories'] = $categoriesManager -> getAll();\n\t\t$this -> viewData['CSRFToken'] = $customer['CSRFToken'];\n\t\t$this -> generateView('products/admin-stats.phtml');\n\t}", "public function eventsByAdmin(Admin $admin_id)\n {\n return $admin_id->events()->whereBetween('start', [Carbon::today(), Carbon::today()->addMonths(2)])->get();\n }", "public function index()\n {\n $totalMedicos = Medicos::select(DB::raw('COUNT(*) AS totalMedicos'))->where('meta_value','=','a:1:{s:8:\"customer\";b:1;}')->get();\n $novosMedicosDia = WP_Users::select(DB::raw('COUNT(*) AS novosMedicosDia'))->whereYear('user_registered', date('Y'))->whereMonth('user_registered', date('n'))->whereDay('user_registered', date('j'))->get();\n\t\t$novosMedicosSemana = DB::select(\"SELECT COUNT(*) AS novosMedicosSemana FROM wp_users WHERE YEAR(user_registered) = \".date('Y').\" AND WEEK (user_registered ,0) = WEEK(NOW())\");\n $novosMedicosMes = WP_Users::select(DB::raw('COUNT(*) AS novosMedicosMes'))->whereYear('user_registered', date('Y'))->whereMonth('user_registered', date('n'))->get();\n \n\n return \\Response::json([$totalMedicos, $novosMedicosDia, $novosMedicosSemana, $novosMedicosMes]);\n }", "public static function mc_find_by_user_id($user_id){\n\t\treturn static::mc_find($user_id, true);\n\t}", "public function __invoke()\n {\n if (Gate::denies('browse users')) {\n return abort(404);\n }\n\n // suggestion: you can add filter scope\n $users = User::stats()->get();\n\n $metrics = (new UserMetrics($users))->getStats();\n\n return response()->json([\n 'data' => $metrics,\n ]);\n }", "public function checkAdmin($user_info) {\n $user_id = $user_info['userId'];\n \n #creates MySQL query to check if member is an administrator\n $sql = \"SELECT users.userId AS userId, admin.adminOption AS isAdmin\n FROM users\n INNER JOIN admin\n ON users.userIsAdmin = admin.adminId\n WHERE (users.userId = ?)\n \";\n \n #executes query passing in the user_id value cast as an integer\n $statement = $this->db->query($sql,array((int)$user_id));\n \n #returns the result value as a row_array\n return $statement->row_array();\n \n }", "public function show(AdminUser $adminUser)\n {\n //\n }", "public function admin_index() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array(\n 'User.username' => 'asc',\n ) ,\n 'conditions' => array(\n 'User.status' => 1,\n ),\n );\n $users = $this->paginate('User');\n $this->set(compact('users'));\n }", "public function index()\n {\n // count all orders where time since order is less than 24 hours\n $newOrders = Order::where([\n ['created_at', '>=', Carbon::now()->subDays(1)]\n ])->count();\n\n // count total orders in database\n $totalOrders = Order::count();\n\n $totalCustomers = User::where('verificationStatus', 1)->count();\n $totalPharmacist = Pharmacist::where('verificationStatus', 1)->count();\n\n // most searched medicine\n $medicines=DB::table('mostsearch')->select('name', DB::raw('count(name) as total'))->whereMonth('created_at', '=', date('m'))->groupBy('name')->orderBy('total', 'DESC')->take(10)->get();\n return view('admin.adminDashboard', compact('medicines', 'newOrders', 'totalOrders', 'totalCustomers', 'totalPharmacist'));\n }", "public static function getAll() {\n global $lC_Database, $lC_Language, $_module;\n\n $lC_Language->loadIniFile('administrators.php');\n \n $media = $_GET['media'];\n \n /* Filtering */\n $aWhere = \"\";\n if ($_GET['aSearch'] != \"\") {\n $aWhere = \"where id = '\" . (int)$_GET['aSearch'] . \"'\";\n } \n\n $Qadmins = $lC_Database->query('select * from :table_administrators ' . $aWhere . ' order by user_name');\n $Qadmins->bindTable(':table_administrators', TABLE_ADMINISTRATORS);\n $Qadmins->execute();\n\n $result = array('entries' => array());\n $result = array('aaData' => array());\n $cnt = 0;\n while ( $Qadmins->next() ) {\n $group = self::getGroupName($Qadmins->valueInt('access_group_id')) ;\n $color = ($odd == $cnt%2) ? 'purple-bg' : 'green-bg';\n if ($Qadmins->valueInt('access_group_id') == 1) $color = 'red-bg';\n\n $last = '<td>' . $Qadmins->valueProtected('last_name') . '</td>';\n $first = '<td>' . $Qadmins->valueProtected('first_name') . '</td>';\n $user = '<td>' . $Qadmins->valueProtected('user_name') . '</td>';\n $group = '<td><small class=\"tag ' . $color . '\">' . self::getGroupName($Qadmins->valueInt('access_group_id')) . '</small></td>';\n $action = '<td class=\"align-right vertical-center\"><span class=\"button-group compact\">\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://\" onclick=\"editAdmin(\\'' . $Qadmins->valueInt('id') . '\\')') . '\" class=\"button icon-pencil ' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? 'disabled' : NULL) . '\">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://\" onclick=\"deleteAdmin(\\'' . $Qadmins->valueInt('id') . '\\', \\'' . urlencode($Qadmins->valueProtected('user_name')) . '\\')') . '\" class=\"button icon-trash with-tooltip ' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? 'disabled' : NULL) . '\" title=\"' . $lC_Language->get('icon_delete') . '\"></a></span></td>';\n\n $result['aaData'][] = array(\"$last\", \"$first\", \"$user\", \"$group\", \"$action\");\n $result['entries'][] = $Qadmins->toArray();\n $cnt++;\n }\n $Qadmins->freeResult();\n\n return $result;\n }", "function get_user_analytics_info() {\n global $wp_version;\n\n $url = 'http://freegeoip.net/json/' . $_SERVER['REMOTE_ADDR'];\n $params = array(\n 'timeout' => 30,\n 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )\n );\n\n $response = wp_remote_get( $url, $params );\n $user_data = wp_remote_retrieve_body( $response );\n\n if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {\n return false;\n }\n\n $user_info = (array) json_decode( $user_data );\n $user_analytics_info = array_merge( $user_info, array( 'browser_pc' => $_SERVER['HTTP_USER_AGENT'] ) );\n\n return $user_analytics_info;\n }", "public static function getUser() {\n return self::$ADMIN_USER;\n }", "function _admins_overview() {\n\t\t// Get admin users\n\t\t$admin_users = $this->users_model->get_admin_users();\n\n\t\t// Prepare data to pass into UI\n\t\t$data = array(\n\t\t\t'users' => $admin_users['results'],\n\t\t\t'total' => $admin_users['num_rows']\n\t\t);\n\n\t\t// If more than 5 records found, add pagination to UI\n\t\tif( $admin_users['num_rows'] > 5 ) {\n\t\t\t// Configure pagination for admin overview\n\t\t\t$pagination_config = array(\n\t\t\t\t'full_tag_open' => '<ul class=\"pagination admin-overview-pagination ajax-pagination pull-right\">',\n\t\t\t\t'base_url' => site_url( 'users/ajax/admins_overview' ),\n\t\t\t\t'first_url' => site_url( 'users/ajax/admins_overview' ),\n\t\t\t\t'total_rows' => $admin_users['num_rows'],\n\t\t\t\t'per_page' => 20,\n\t\t\t\t'first_link' => FALSE,\n\t\t\t\t'last_link' => FALSE,\n\t\t\t\t'show_inactive' => TRUE,\n\t\t\t);\n\n\t\t\t$this->logtrino_ui->_set_up_pagination( $pagination_config );\n\n\t\t\t$data['pagination'] = $this->logtrino_ui->_pagination( FALSE );\n\t\t}\n\t\t\n\t\t// Display notifications\n\t\t$this->logtrino_ui->_set_data( $data );\n\t\t$this->logtrino_ui->_render( 'users/widget/admins_overview' );\n\n\t\techo $this->logtrino_ui->_get_render_data();\n\t}", "public function searchAdmin()\n {\n $this->connect();\n $bind = $this->bind($this->conn);\n $filter = sprintf($this->to_filter_admin, $this->login);\n if ($this->to_get_type_admin == 'string') {\n $wanted = array($this->to_get_admin);\n }\n if ($this->to_get_type_admin == 'array') {\n $to_get_array = explode(',', $this->to_get_admin);\n }\n $sr = ldap_search($this->conn, $this->dn, $filter, $wanted);\n $sr_res = ldap_get_entries($this->conn, $sr);\n $result = $sr_res;\n ldap_close($this->connect());\n\n return $result;\n }", "public function getAdmin() {\n $sql = \"SELECT *\n FROM {$this->tablename} p\n WHERE p.status='admin'\";\n return $this->db->query($sql)->single($this->entity);\n }", "public function getAdmin($id)\n {\n return $this->user->where('salon_id',$id)->first();\n }", "public function allForUser($userId)\n {\n return $this->model->where('staff_id', $userId)->get();\n }", "public function get_user_approved_mdm()\n {\n $obj = new View();\n $queryobj = new Jamf_model();\n $sql = \"SELECT COUNT(CASE WHEN `user_approved_mdm` = '1' THEN 1 END) AS Yes,\n COUNT(CASE WHEN `user_approved_mdm` = '0' THEN 1 END) AS No\n FROM `jamf`\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }", "function statistics_extended_users_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,'create' as event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}entities \";\r\n\t$query.=\"WHERE type = 'user' \";\r\n\t$query.=\"AND enabled='yes' \";\r\n\t$query.=\"GROUP BY zoom\";\r\n\treturn get_data($query);\r\n}", "public function retrieveReactorMetrics()\n {\n return $this->start()->uri(\"/api/reactor/metrics\")\n ->get()\n ->go();\n }", "public function index()\n {\n \n if (\\Gate::allows('isAdminOrMerchant')) { \n return AttributeGroup::latest()->where('merchant_id',Auth::user()->userable_id)->paginate(10);\n } \n \n }", "public function admin() {\n return $this->teachers()->where('role', '=', User::SCHOOL_ADMIN)->first();\n }", "function getHouseholdAdmin(){\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$level = $member->getUserLevel();\n\t\t\tif($level == 'admin'){\n\t\t\t\t$admin = $member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $admin;\n\t}", "private function getIdentityAdmin($request){\n $jwtAuth = new JwtAuth();\n $token = $request->header('Authorization', null);\n $admin = $jwtAuth->checkToken($token, true);\n\n return $admins;\n }" ]
[ "0.5866052", "0.55005014", "0.5389249", "0.53510654", "0.52953017", "0.52677965", "0.52526456", "0.51433134", "0.51259315", "0.51238215", "0.5122769", "0.5103745", "0.51028866", "0.5089422", "0.5075603", "0.50174886", "0.5015007", "0.50093424", "0.49919614", "0.49707", "0.49590117", "0.49567354", "0.49499565", "0.49447247", "0.4938725", "0.49334925", "0.49214637", "0.4915536", "0.4898225", "0.4898062", "0.489043", "0.48713267", "0.48625392", "0.48540086", "0.48517373", "0.4829475", "0.482757", "0.48227763", "0.48027682", "0.4798551", "0.47893333", "0.4784984", "0.47818452", "0.47746298", "0.47726303", "0.47716942", "0.4770544", "0.4768869", "0.47673965", "0.47583875", "0.474485", "0.4741095", "0.47393003", "0.47329992", "0.47272593", "0.47242707", "0.47221732", "0.4717638", "0.4713236", "0.47048974", "0.47018012", "0.46846765", "0.46825334", "0.46716768", "0.46676955", "0.4660326", "0.46575248", "0.46569818", "0.46564734", "0.4655422", "0.4654974", "0.46528277", "0.46480283", "0.4646232", "0.46434036", "0.46413922", "0.46390972", "0.46384987", "0.46374878", "0.46355885", "0.4634086", "0.46331128", "0.46316314", "0.46284848", "0.4626702", "0.46230403", "0.46198505", "0.4617131", "0.46120137", "0.4602142", "0.46009797", "0.45983008", "0.45980352", "0.45960236", "0.45912537", "0.4589005", "0.45882827", "0.4585063", "0.45811558", "0.45799598", "0.45786157" ]
0.0
-1
Find Meta Service Metrics for an admin user using SQL regexp service search and metric.
public function findBySqlRegexp(string $metricName, string $regexpString): ?array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function metrics($user_id = 'me') {\n \t$result = $this->get(\"/v2/users/{$user_id}/metrics\");\n \treturn $result;\n }", "function getAllReports(){\n global $errors;\n\tif (in_array($_SESSION['user']['role'], ['admin'])) {\n\t\tglobal $conn, $roles, $keyword;\n\t\t$sql = \"SELECT * FROM reportedusers WHERE U_name like '%$keyword%' or rptr_u_name like '%$keyword%' or reason like '%$keyword%' order by timestamp desc \"; \n\t\tif($result = mysqli_query($conn, $sql)){\n $users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $users;\n }else{\n array_push($errors, \"there was a problem fetching Records\");\n }\n\n\t} else {\n\t\treturn null;\n\t}\n}", "static function adminGetMetricDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n \r\n $sql = \"SELECT * FROM metric WHERE id=:id LIMIT 1\";\r\n $data = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow();\r\n \r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id=:id ORDER BY last_activity DESC\";\r\n $visits = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll(); \r\n \r\n if ($visits)\r\n foreach ($visits as $k=>$v)\r\n {\r\n $visits[$k]['location'] = Yii::app()->location->getLocation($v['location_id']);\r\n }\r\n \r\n $data['visits'] = $visits;\r\n \r\n \r\nFB::warn($data);\r\n \r\n \r\n \r\n/* \r\n $sql = \"SELECT user_id FROM metric WHERE id={$id}\";\r\n $userId = Yii::app()->db->createCommand($sql)->queryScalar();\r\n \r\n \r\n \r\n if ($userId)\r\n {\r\n $sql = \"SELECT id FROM metric WHERE user_id={$userId} ORDER BY id DESC\";\r\n $ids = Yii::app()->db->createCommand($sql)->queryColumn();\r\n }\r\n else\r\n {\r\n $ids[] = $id;\r\n }\r\n \r\n $res['user_id'] = $userId;\r\n \r\n if ($ids)\r\n foreach ($ids as $v)\r\n {\r\n //location\r\n\r\n $sql = \"SELECT ip, location_id,\tadded, last_activity FROM metric WHERE id={$v} LIMIT 1\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n $m['details']['location'] = Yii::app()->location->getLocation($m['details']['location_id']);\r\n \r\n //visits\r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id={$v} ORDER BY id DESC\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n \r\n \r\n \r\n //actions\r\n //$sql = \"SELECT viewed_user_id, added FROM metric_video_play WHERE metric_id={$v} ORDER BY id DESC\";\r\n //$m['details']['videos'] = Yii::app()->db->createCommand($sql)->queryAll();\r\n \r\n $res['info'][] = $m;\r\n }\r\n*/ \r\n \r\n return $data;\r\n }", "private function searchMembers() {\n $searchStr = $this->postVars['memberSearch'];\n $searchStrArr = array();\n if(preg_match('/\\s/',$searchStr)) {\n $searchStrArr = explode(\" \", $searchStr);\n }\n \n if(empty($searchStrArr)) {\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n WHERE u.user_email = '$searchStr'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id AND n.nhc_pin = '$searchStr'\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%$searchStr%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%$searchStr%'\";\n //JOIN {$this->db->prefix}usermeta um4 ON um4.user_id = u.id AND um4.meta_key = 'expiration_date' AND um4.meta_value = '$expireDate'\";\n }\n else { // looking specifically for a full name\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%{$searchStrArr[0]}%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%{$searchStrArr[1]}%'\";\n \n }\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n // filter through to weed out any duplicates\n $showArr = array();\n foreach($membersArr as $member) {\n if(!in_array($member['id'], $showArr)) {\n $showArr[] = $member['id'];\n }\n }\n $idStr = implode(\",\", $showArr);\n \n $query = \"SELECT DISTINCT u.id, n.nhc_pin, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email, um3.meta_value AS level\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um3 ON um3.user_id = u.id AND um3.meta_key = 'member_level'\n WHERE u.id IN ($idStr)\n ORDER BY n.nhc_pin\";\n \n $this->showResults($query, 'search', true);\n }", "function YWR_2020_pre_user_query($user_search)\n{\n\n $user = wp_get_current_user();\n\n if (!current_user_can('manage_options')) {\n\n global $wpdb;\n\n $user_search->query_where =\n str_replace('WHERE 1=1',\n \"WHERE 1=1 AND {$wpdb->users}.ID IN (\n SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta\n WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities'\n AND {$wpdb->usermeta}.meta_value NOT LIKE '%administrator%')\",\n $user_search->query_where\n );\n\n }\n}", "function getMetrics($metric, $startDate, $endDate, $dimensions = false, $sort = false, $filter = false, $limit = false)\n\t{\n\t\t$analytics = new Google_AnalyticsService($this->client);\n\n\t\t$params = array();\n\n\t\tif ($dimensions)\n\t\t{\n\t\t\t$params['dimensions'] = $dimensions;\n\t\t}\n\t\tif ($sort)\n\t\t{\n\t\t\t$params['sort'] = $sort;\n\t\t}\n\t\tif ($filter)\n\t\t{\n\t\t\t$params['filters'] = $filter;\n\t\t}\n\t\tif ($limit)\n\t\t{\n\t\t\t$params['max-results'] = $limit;\n\t\t}\n \n // Just incase, the ga: is still used in the account id, strip it out to prevent it breaking\n $filtered_id = str_replace( 'ga:', '', $this->accountId );\n \n if(!$filtered_id){\n echo 'Error - Account ID is blank';\n return false;\n }\n \n\t return $analytics->data_ga->get(\n\t 'ga:'.$filtered_id,\n\t $startDate,\n\t $endDate,\n\t $metric,\n\t $params\n\t );\n\t}", "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "function GetAllUsersAdmin($search1=null,$search2=null,$search3=0,$limit=0,$per_pg=0)\n {\n if ($search1 != null) $this->db->where(\"LCASE(name) LIKE '%\".utf8_strtolower($search1) . \"%'\");\n if ($search2 != null) $this->db->where(\"LCASE(email) LIKE '%\".utf8_strtolower($search2) . \"%'\");\n if ($search3 != 1) $this->db->where('is_superadmin',0);\n $this->db->where('group_id <>', 3);\n $this->db->limit($per_pg,$limit);\n $query = $this->db->get('users');\n return $query;\n }", "function TotalUserAdmin($search1=null,$search2=null,$search3=0)\n {\n $this->db->select('count(*) as total');\n if ($search1 != null) $this->db->where(\"LCASE(name) LIKE '%\".utf8_strtolower($search1) . \"%'\");\n if ($search2 != null) $this->db->where(\"LCASE(email) LIKE '%\".utf8_strtolower($search2) . \"%'\");\n if ($search3 != 1) $this->db->where('is_superadmin',0);\n $query = $this->db->get('users');\n if ($query->num_rows()>0)\n {\n $row = $query->row_array();\n return $row['total'];\n }\n else\n {\n return '0';\n }\n }", "public function searchAdmin()\n {\n $this->connect();\n $bind = $this->bind($this->conn);\n $filter = sprintf($this->to_filter_admin, $this->login);\n if ($this->to_get_type_admin == 'string') {\n $wanted = array($this->to_get_admin);\n }\n if ($this->to_get_type_admin == 'array') {\n $to_get_array = explode(',', $this->to_get_admin);\n }\n $sr = ldap_search($this->conn, $this->dn, $filter, $wanted);\n $sr_res = ldap_get_entries($this->conn, $sr);\n $result = $sr_res;\n ldap_close($this->connect());\n\n return $result;\n }", "public function all_about_us_services_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_service ORDER BY service_id DESC\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function index()\n {\n $fields = [];\n $user = Auth::user();\n $start_date = $this->getStartDate(Input::get('start_date'));\n $end_date = $this->getEndDate(Input::get('end_date'));\n $time_increment = (bool) Input::get('time_increment', false);\n\n $ad_sets = $this->adSetRepository->byUserWithMetricsByDate( $user, $fields, $start_date, $end_date, $time_increment );\n\n // Return the results.\n //\n return $this->response( $ad_sets ?: [] );\n }", "public function adminUserConditionMatchesRegularUser() {}", "public function get_user_serach_property_info($searchId,$shortlistedId){\n $sql = \"SELECT s.searchName,u.firstName,u.deviceToken,sh.propertyName FROM searchcriteria s,users u,shortlistedproperty sh WHERE s.userId = u.userId AND s.searchId = $searchId AND s.searchId = sh.searchId AND sh.shortlistedId = $shortlistedId\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n }", "function statistics_extended_members_views($group){\r\n\tglobal $CONFIG;\r\n\tif(!empty($group)){\r\n\t\t$query = \"SELECT sum(m.string) as count FROM {$CONFIG->dbprefix}annotations a, {$CONFIG->dbprefix}metastrings m \";\r\n\t\t$views_counter_id = get_metastring_id(\"views_counter\");\r\n\t\t$query.= \"WHERE name_id={$views_counter_id} \";\r\n\t\t$query.= \"AND entity_guid={$group} \";\r\n\t\t$query.= \"AND owner_guid IN (SELECT guid_one FROM {$CONFIG->dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n\t\t$query.= \"AND a.value_id = m.id\";\r\n\t\t$count = get_data_row($query);\r\n\t\treturn $count->count;\r\n\t}\r\n\treturn 0;\r\n}", "function statistics_extended_users_metadata_count($metadata,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN \" . $dbprefix . \"entities e ON e.guid = ue.guid AND e.enabled='yes' \";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "function get_metrics_w_results($pat_id, $ver, $ass_id, $metrics_list){\n\t\t\t/** First, check whether an array of metric information is not exist or not. */\n\t\t\tif($metrics_list != NULL){\n\t\t\t\t/** Runs through all metrics in an array */\n\t\t\t\tforeach ($metrics_list as $metr) {\n\t\t\t\t\t/**\n\t\t\t\t\t * \tCheck the type of the metric from the metric abbreviation. There is a specific behavior\n\t\t\t\t\t *\twhen getting the CRE metric only that the result also be updated. Otherwise, the result\n\t\t\t\t\t *\twill be fetched into an array with its detail.\n\t\t\t\t\t */\n\t\t\t\t\tswitch ($metr['metric_abberv']) {\n\t\t\t\t\t\tcase 'PAP':\n\t\t\t\t\t\t\t$result = $this->mPAPResult->get_result($pat_id, $ver, $ass_id);\n\n\t\t\t\t\t\t\tif($result != NULL){\n\t\t\t\t\t\t\t\t$result['detail'] = $this->mPAPResult->get_result_detail($result['result_id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'CRE':\n\t\t\t\t\t\t\t$result = $this->mCREResult->get_result($pat_id, $ver, $ass_id);\n\n\t\t\t\t\t\t\tif($result != NULL){\n\t\t\t\t\t\t\t\t$result['detail'] = $this->mCREResult->get_result_detail($result['result_id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($result == NULL OR $result['detail'] == NULL){\n\n\t\t\t\t\t\t\t\t/** Fetch the pattern and pattern description objects */\n\t\t\t\t\t\t\t\t$pat = $this->mPattern->get_pattern($pat_id);\n\t\t\t\t\t\t\t\t$desc = (!is_bool($pat))?$this->mPatternDesc->get_pattern_description_by_pattern($pat_id, $pat['pattern_assess_version'])[0]: array();\n\n\t\t\t\t\t\t\t\t/** Sets a temporary object for CRE metric result for passing to create_function() method. */\n\t\t\t\t\t\t\t\t$tmp = array(\"pattern\" => $pat, \"description\" => $desc, \"ass_id\" => $ass_id);\n\t\t\t\t\t\t\t\t$result = $this->mCREResult->create_result($pat_id, $ver, $ass_id, $tmp);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'CSD':\n\t\t\t\t\t\t\t$result = $this->mCSDResult->get_result($pat_id, $ver, $ass_id);\n\t\t\t\t\t\t\tif($result != NULL){\n\t\t\t\t\t\t\t\t$result['detail'] = $this->mCSDResult->get_result_detail($result['result_id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'DKT':\n\t\t\t\t\t\t\t$result = $this->mDKTResult->get_result($pat_id, $ver, $ass_id);\n\n\t\t\t\t\t\t\tif($result != NULL){\n\t\t\t\t\t\t\t\t$result['detail'] = $this->mDKTResult->get_result_detail($result['result_id']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$result = NULL;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t/** \n\t\t\t\t\t *\tAfter fetching the result object, it is possible that there is not result exist\n\t\t\t\t\t *\tso this condtion handles this exceptional case.\n\t\t\t\t\t */\n\t\t\t\t\tif($result != NULL){\n\n\t\t\t\t\t\t/** Starts mapping the score from the result objects to the metric information array */\n\t\t\t\t\t\t$metrics_list[$metr['metric_abberv']][\"result\"] = $result[\"score\"];\n\t\t\t\t\t\t$count = 0;\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * \tRuns through all variables in metric array and map with the variable score\n\t\t\t\t\t\t *\tin the result objects.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tforeach ($metr['detail'] as $det){\n\t\t\t\t\t\t\tforeach ($result['detail'] as $v){\n\n\t\t\t\t\t\t\t\t/** Map the ID of metric variable to the variable ID in the result objects. */\n\t\t\t\t\t\t\t\tif($det['id'] == $v['variable_id']){\n\t\t\t\t\t\t\t\t\t$metrics_list[$metr[\"metric_abberv\"]][\"detail\"][$count][\"var_score\"] = $v[\"variable_score\"];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$count++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $metrics_list;\n\t\t}", "protected function registerManagedQueries() {\n $table = Model_Charge::TABLE_NAME;\n $query = \"SELECT * FROM $table WHERE user_id = :user_id AND charge_date >= :start_date AND \" .\n \"charge_date <= :end_date ORDER BY charge_date ASC\";\n $this->registerManagedQuery(\"findByUserIdAndChargeDates\", $query, null, self::RETURN_MANY);\n\n $query = \"DELETE FROM $table WHERE charge_id = :charge_id\";\n $this->registerManagedQuery(\"delete\", $query, null, self::RETURN_NONE);\n\n $query = \"SELECT user_id, sum(amount) as total_charges FROM $table WHERE \" .\n \"charge_date >= :start_date AND charge_date <= :end_date GROUP BY user_id\";\n $this->registerManagedQuery(\"findTotalChargesByUserIdForChargeDates\", $query, null, self::RETURN_ARRAY);\n\n $query = \"SELECT * FROM $table ORDER BY create_date DESC LIMIT 10\";\n $this->registerManagedQuery(\"findRecentlyAddedCharges\", $query);\n }", "private function _metrics()\n\t{\n\t\t$this->metrics['favoriteWeapon'] = $this->bg->queryFontMetrics($this->bigText, $this->favoriteWeapon);\n\t\t$this->metrics['spartan'] = $this->bg->queryFontMetrics($this->bigText, rawurldecode($this->spartan));\n\t\t$this->metrics['weaponChoice'] = $this->bg->queryFontMetrics($this->text, 'WEAPON OF CHOICE');\n\t}", "function index()\r\n{\r\n\tif(!isset($_GET['search']))\r\n\t\t$_GET['search']=\"NULL\";\r\n\tif(!isset($_GET['paging']))\r\n\t\theader(\"location: /gadmin/user/?paging=1&search=\".$_GET['search']);\r\n\t//preparing to query\r\n\t$max_results=10;\r\n\t$arr_get=array(\r\n\t\t\t\"status_not\" => \"delete\"\r\n\t);\r\n\t$order=array(\r\n\t\t\t\"by\" => \"date_created\",\r\n\t\t\t\"sort\" => \"DESC\"\r\n\t);\r\n\t$limit=array(\r\n\t\t\t\"start\" => (($_GET['paging']*$max_results)-$max_results),\r\n\t\t\t\"end\" => $max_results\r\n\t);\r\n\t//setting search\r\n\tif($_GET['search']!=\"NULL\")\r\n\t\t$arr_get['search']=\"%\".$_GET['search'].\"%\";\r\n\t//assigning variables\r\n\t$users=User::get($arr_get, true, $order, $limit);\r\n\tforeach($users as $user)\r\n\t{\r\n\t\t$par1=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tnext($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$par2=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tprev($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$user->params=\"\";\r\n\t\tif(isset($par1))\r\n\t\t\t$user->params=$user->params.$par1->value;\r\n\t\tif(isset($par2))\r\n\t\t\t$user->params=$user->params.\" \".$par2->value;\r\n\t\t$credit=MetaUser::get(array(\"id_user\" => $user->id, \"name\" => \"credit\"));\r\n\t\tif(isset($credit))\r\n\t\t\t$user->credit=$credit->value;\r\n\t\telse\r\n\t\t\t$user->credit=0;\r\n\t}\r\n\t$GLOBALS['GCMS']->assign('users', $users);\r\n\t$GLOBALS['GCMS']->assign('paging', ceil(User::get_count($arr_get)/$max_results));\r\n}", "function test_general_entries_search_on_frm_items_user_id() {\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entries table';\n\t\tself::run_entries_found_tests( $msg, $items, 4, array( 'steph_entry_key', 'steve_entry_key', 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\t}", "public function findServicesDowntimesForAdminUser(): array;", "function search($db,$page,$per,$status='',$year=0,$month=0,$userid=0)\r\n\t{\r\n//if($condition=='name'){\r\n//$sql.=\" and b.name like '%\".$keys.\"%'\";\r\n//}\r\n\t\t$sql = \"select * from \".AGENT_TOTAL_TABLE.\" where id>0\";\r\n\t\t\tif($status>-1){\r\n\t\t\t\t$sql.=\" and status ='\".$status.\"'\";\r\n\t\t\t}\r\n\t\t\tif($year>0){\r\n\t\t\t\t$sql.=\" and year ='\".$year.\"'\";\r\n\t\t\t}\r\n\t\t\tif($month>0){\r\n\t\t\t\t$sql.=\" and month ='\".$month.\"'\";\r\n\t\t\t}\r\n\t\t\tif($userid>0){\r\n\t\t\t\t$sql.=\" and agent_userid ='\".$userid.\"'\";\r\n\t\t\t}\r\n\t\t$sql.=\" order by id desc\";\r\n//\t\techo $sql;\r\n\t\t$pager = get_pager_data($db, $sql, $page,$per);\r\n\t\treturn $pager;\r\n\t}", "public function getUserStats($userId);", "public function adminUserConditionMatchesAdminUser() {}", "public function metricList(){\n\t\t\n\t\t$req = $this -> curl_req(\"GET\", \"api/v1/metrics\"); \n\t\t\n\t\t/* Check if the transaction was successfull and pass the data else return false */\n\t\t\n\t\treturn ($req[1]['http_code'] === 200) ? $req[0] : false;\n\t}", "function superadmin_index() {\n\t\t$this->set('meta_title','User Group');\n\t\t$search = '';\n\t\t$argArr = array();\n\t\t$cond = '';\t\t\n\tif(isset($this->params['pass'][0]) && isset($this->params['pass'][1]) && $this->params['pass'][1] == 'page_record') {\n\t\t$this->Session->write('per_page_record',$this->params['pass'][0]);\n\t}\t\t\n\t\t/* Search conditon for text value */\n\t\tif(!empty($this->data)) {\n\t\t\t$search = $this->data['Role']['search'];\n\t\t\t$this->Session->write('data_search',$this->data['Role']);\n\t\t\t\tif($this->Session->read('param_search')) {\n\t\t\t\t\t$this->Session->delete('param_search');\n\t\t\t\t}\t\t\t\n\t\t}\n\t\telse if(isset($this->params['named']['search']) && $this->params['named']['search']) {\n\t\t\t $this->Session->write('param_search',$this->params['named']);\n\t\t\t\t if($this->Session->read('data_search')) {\n\t\t\t\t\t$this->Session->delete('data_search');\n\t\t\t\t}\t\t\t \n\t\t\t \n\t\t}\n\t\telse if($this->Session->read('data_search')) {\n\t\t\t$search = $this->Session->read('data_search.search');\n\t\t\t\tif($this->Session->read('param_search')) {\n\t\t\t\t\t$this->Session->delete('param_search');\n\t\t\t\t}\t\t\n\t\t}\n\t\telse if($this->Session->read('param_search')) {\n\t\t\t$search = $this->Session->read('param_search.search');\n\t\t\t\t if($this->Session->read('data_search')) {\n\t\t\t\t\t$this->Session->delete('data_search');\n\t\t\t\t}\t\t\n\t\t}\n\t\tif($search) {\n\t\t\t$argArr['search'] = $search;\n\t\t $cond[] = array('OR'=>array('Role.role_name LIKE'=>'%'.$search.'%'));\n\t\t}\n\t\t$this->set('search', $search); \n\t\t$this->set('argArr', $argArr);\n\t\t/* End Search conditon for text value */\n\t\t$condition = $cond;\n\t\t$record = ($this->Session->read('per_page_record')) ? $this->Session->read('per_page_record') : ADMIN_PER_PAGE_RECORD;\n\t\t$this->paginate = array('limit' =>$record,'order' => array('Role.role_name' => 'ASC'));\n\t\t$data = $this->paginate('Role', $condition);\n\t\t$this->set('data', $data); \n\t }", "public static function search_users_returns() {\n global $CFG;\n require_once($CFG->dirroot . '/user/externallib.php');\n return new external_single_structure(array(\n 'users' => new external_multiple_structure(user_summary_exporter::get_read_structure()),\n 'count' => new external_value(PARAM_INT, 'Total number of results.')\n ));\n }", "public function userStatistics(){\n\n\t\t//\tFetch form filters\n\t\t$date = date('Y-m-d');\n\t\t$from = Input::get('start');\n\t\tif(!$from) $from = date('Y-m-01');\n\n\t\t$to = Input::get('end');\n\t\tif(!$to) $to = $date;\n\t\t\n\t\t$selectedUser = Input::get('user');\n\t\tif(!$selectedUser)$selectedUser = \"\";\n\t\telse $selectedUser = \" USER: \".User::find($selectedUser)->name;\n\n\t\t$reportTypes = array('Summary', 'Patient Registry', 'Specimen Registry', 'Tests Registry', 'Tests Performed');\n\n\t\t$selectedReport = Input::get('report_type');\n\t\tif(!$selectedReport)$selectedReport = 0;\n\n\t\tswitch ($selectedReport) {\n\t\t\tcase '1':\n\t\t\t\t$reportData = User::getPatientsRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-patients-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t$reportData = User::getSpecimensRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-specimens-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\t$reportData = User::getTestsRegistered($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-tests-register-report-title',1);\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\t$reportData = User::getTestsPerformed($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-tests-performed-report-title',1);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$reportData = User::getSummaryUserStatistics($from, $to.' 23:59:59', Input::get('user'));\n\t\t\t\t$reportTitle = Lang::choice('messages.user-statistics-summary-report-title',1);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$reportTitle = str_replace(\"[FROM]\", $from, $reportTitle);\n\t\t$reportTitle = str_replace(\"[TO]\", $to, $reportTitle);\n\t\t$reportTitle = str_replace(\"[USER]\", $selectedUser, $reportTitle);\n\t\t\n\t\treturn View::make('reports.userstatistics.index')\n\t\t\t\t\t->with('reportTypes', $reportTypes)\n\t\t\t\t\t->with('reportData', $reportData)\n\t\t\t\t\t->with('reportTitle', $reportTitle)\n\t\t\t\t\t->with('selectedReport', $selectedReport)\n\t\t\t\t\t->withInput(Input::all());\n\t}", "function searchMentor($name, $genre, $instrument)\r\n\t{\r\n\t\t$users = array();\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$pdo = new PDO(DBCONNSTRING,DBUSER,DBPASS);\r\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t//Prepare a statement by setting parameters\r\n\r\n\t\t\t//SQL STATEMENTS\r\n\t\t\tif ($genre == \"*\" && $instrument != \"*\")\t\t//Genre ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument == \"*\")\t//Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre == \"*\" && $instrument == \"*\")\t//Genre and Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users WHERE mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument != \"*\")\t//Genre and Instrument SET\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\t$sql_name = 'SELECT username FROM mm_users WHERE id = :id';\r\n\t\t\t$sql_genre = 'SELECT genre FROM mm_genres INNER JOIN mm_user_genres ON mm_genres.id = mm_user_genres.genre_id WHERE mm_user_genres.user_id = :id';\r\n\t\t\t$sql_inst = 'SELECT instrument FROM mm_instruments INNER JOIN mm_user_instruments ON mm_instruments.id = mm_user_instruments.instrument_id WHERE mm_user_instruments.user_id = :id';\r\n\r\n\t\t\t//PREPARE STATEMENTS\r\n\t\t\t$statement_user = $pdo->prepare($sql_user);\r\n\t\t\t$statement_name = $pdo->prepare($sql_name);\r\n\t\t\t$statement_genre = $pdo->prepare($sql_genre);\r\n\t\t\t$statement_inst = $pdo->prepare($sql_inst);\r\n\r\n\t\t\t//BIND VALUES FOR INITIAL QUERY and EXECUTE\r\n\t\t\t$statement_user->bindValue(':name', $name);\r\n\t\t\tif ($genre != \"*\") $statement_user->bindValue(':genre', $genre);\r\n\t\t\tif ($instrument != \"*\") $statement_user->bindValue(':inst', $instrument); //Bind value of sql statement with value of id in query string\r\n\r\n\t\t\t$statement_user->execute();\r\n\t\t\twhile ($row = $statement_user->fetch())\r\n\t\t\t{\r\n\t\t\t\t$users[] = new User($row[\"id\"], null);\r\n\t\t\t}\r\n\r\n\t\t\t//BIND VALUES FOR USERNAME, GENRES, INSTRUMENTS AND EXECUTE THE RESPECTIVE STATEMENTS\r\n\t\t\tforeach ($users as $u)\r\n\t\t\t{\r\n\t\t\t\t$genres = array();\r\n\t\t\t\t$inst = array();\r\n\t\t\t\t$statement_name->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_genre->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_inst->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_name->execute();\r\n\t\t\t\twhile ($row = $statement_name->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$u->setUsername($row[\"username\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$statement_genre->execute();\r\n\t\t\t\twhile ($row = $statement_genre->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$genres[] = $row[\"genre\"];\r\n\t\t\t\t}\r\n\t\t\t\t$statement_inst->execute();\r\n\t\t\t\twhile ($row = $statement_inst->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$inst[] = $row[\"instrument\"];\r\n\t\t\t\t}\r\n\t\t\t\t$u->setGenres($genres);\r\n\t\t\t\t$u->setInstruments($inst);\r\n\t\t\t}\r\n\t\t\t$pdo = null;\r\n\t\t}\r\n\r\n\t\tcatch (PDOException $e) {\r\n\t\t\tdie( $e->getMessage() );\r\n\t\t}\r\n\t\treturn $users;\r\n\t}", "function statistics_extended_logins_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}system_log \";\r\n\t$query.=\"WHERE event IN ('login') \";\r\n\t$query.=\"AND object_type='user' \";\r\n\t$query.=\"GROUP BY zoom,event\";\r\n\treturn get_data($query);\r\n}", "public function run()\n {\n // DB::table('widgets')->truncate();\n\n $metrics = array(\n\narray(\n 'name' => 'Top Customers',\n 'type' => 'table',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n 'related' => '',\n),\narray('name' => 'Number of Inactive Customers',\n 'type' => 'snapshot',\n 'updates_default' => '600',\n 'user_parameters' => '{\"env\":\"\",\"options\":{\"IC_TIME_FRAME\":{ \"value\":\"7\", \"description\":\"The time frame in days where activity is monitored.\"}}}', \n 'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}', \n 'related' => ''),\narray(\n\t'name' => 'Active Calls',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , \narray(\n\t'name' => 'New Active Customers',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"NAC_TIME_FRAME\":{\"value\":\"1\", \"description\":\"The time frame in days for a customer to be considered \\'new\\'.\")}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) ,\narray(\n\t'name' => 'Number Of Customers With Overdue Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"overdue\"}',\n\t'related' => '35'\n) , array(\n\t'name' => 'Generated Revenue',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Revenue\"}',\n\t'related' => '36'\n) , array(\n\t'name' => 'Revenue This Month',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Calls Per Day',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ASR',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"asr\"}',\n\t'related' => '37'\n) , array(\n\t'name' => 'Call Volume (ONNET)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ONNET\"}',\n\t'related' => '38,39'\n) , array(\n\t'name' => 'Total Registered Locations',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Connection Utilization (OB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"originate\"}',\n\t'related' => '41'\n) , array(\n\t'name' => 'Failed Calls',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"FAILEDCALLS_TIME_FRAME\":{\"value\":\"600\", \"description\":\"The time frame in seconds that is considered for analysis.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD & PDD By Vendor',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\"}, \"PDD_RED_THESHOLD\": {\"value\":\"10000\"}, \"PDD_YELLOW_THESHOLD\": {\"value\":\"4000\"}, \"SHOW_INTERNAL_CNX\":{\"value\":\"true\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call Loss Ratio',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Short Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_SHORT\":{\"value\":\"10\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"short\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Nr Of Long Calls',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"UC_TOO_LONG\":{\"value\":\"7200\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"long\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top 10 Destinations',\n\t'type' => 'table',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_DESTINATIONS_TIME_FRAME\": {\"value\":\"3600\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Outbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\":\"originate\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'Top Vendors (Inbound)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"TOP_VENDORS_TIME_FRAME\":{\"value\":\"86400\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":{\"1\"1:\"answer\"}}',\n\t'related' => ''\n) , array(\n\t'name' => 'PDD',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\":{\"value\":\"\",\"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Active Calls by Customer',\n\t'type' => 'snapshot',\n\t'updates_default' => '600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Call volume by Customer',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'Number Of Customers With Unpaid Invoices',\n\t'type' => 'snapshot',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"unpaid\"}',\n\t'related' => '14'\n) , array(\n\t'name' => 'Incurred Cost',\n\t'type' => 'duration',\n\t'updates_default' => '86400',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"Cost\"}',\n\t'related' => '15'\n) , array(\n\t'name' => 'NER',\n\t'type' => 'duration',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"ner\"}',\n\t'related' => '18'\n) , array(\n\t'name' => 'Call Volume (OB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"OUT\"}',\n\t'related' => '19,39'\n) , array(\n\t'name' => 'Call Volume (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_vendor\": {\"value\":\"\", \"description\":\"The ID of the PortaSwitch internal vendor.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"IN\"}',\n\t'related' => '19,38'\n) , array(\n\t'name' => 'Connection Utilization (IB)',\n\t'type' => 'table',\n\t'updates_default' => '600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => ''\n) , array(\n\t'name' => 'ACD (IB)',\n\t'type' => 'duration',\n\t'updates_default' => '3600',\n\t'user_parameters' => '{\"env\":\"\",\"options\":{\"ps_internal_sip\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'SIP-UA\\' connection.\"}, \"ps_internal_um\": {\"value\":\"\",\"description\":\"The ID of the PortaSwitch \\'INTERNAL\\' connection.\"}}}',\n\t'system_parameters' => '{\"db\":\"slave\",\"mode\":\"answer\"}',\n\t'related' => '23'\n)\n\n );\n\n // Uncomment the below to run the seeder\n DB::table('metrics')->insert($metrics);\n \n \n }", "public function searchMateriasAdmin($value){\n\t\t$sql = \"SELECT id,materia FROM materias WHERE materia like ? and estado=0 \"; \n\t\t$params = array(\"$value%\");\n\t\treturn Database::getRows($sql, $params);\n\t}", "public static function searchManager_is_admin($keyword)\n\t\t{\n\t\t\t$qry = 'SELECT * FROM manager WHERE email LIKE \"%' . $keyword . '%\"';\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t\treturn $result;\n\t\t}", "public function testComAdobeGraniteQueriesImplHcQueryHealthCheckMetrics()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.queries.impl.hc.QueryHealthCheckMetrics';\n\n $crawler = $client->request('POST', $path);\n }", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "function search_for_users($needle)\n {\n $needle = trim($needle);\n if ($needle != '')\n {\n $user = $this->ion_auth->get_user();\n\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name, user_meta.grad_year, school_data.school\n FROM user_meta LEFT JOIN school_data ON user_meta.school_id = school_data.id\n WHERE MATCH(user_meta.first_name, user_meta.last_name) AGAINST (? IN BOOLEAN MODE)\n AND user_meta.user_id <> ?\";\n\n // Generate a string to exclude people the user is already following.\n $following_ids = $this->get_following_ids();\n if (count($following_ids) > 0)\n {\n $query_string .= \" AND user_meta.user_id <> '\" . implode(\"' AND user_meta.user_id <> '\", $following_ids) . \"'\";\n }\n $query_string .= ' LIMIT 15';\n\n $query = $this->db->query($query_string, array(str_replace(' ', '* ', $needle) . '*', $user->id));\n\n // Echo the results\n foreach ($query->result() as $row)\n {\n $this->echo_user_entry($row, 'add following', $profile_links_enabled = false);\n }\n }\n }", "public function all_about_us_rules_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_rules\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "function getMeta($userscript){\n $metaPattern = '/==UserScript==(.)*==\\/UserScript==/ms';\n if( preg_match($metaPattern, $userscript, $metaSections)){ //$userscript\n return $metaSections[0];\n }\n }", "public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }", "public abstract function find_users($search);", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "private function get_admins_info() {\n $stm=$this->uSup->get_com_admins_to_notify_about_requests(\"user_id\",$this->company_id);\n\n $q_user_id=\"(1=0 \";\n /** @noinspection PhpUndefinedMethodInspection */\n while($admin=$stm->fetch(PDO::FETCH_OBJ)) {\n $q_user_id.=\" OR u235_users.user_id='\".$admin->user_id.\"' \";\n }\n $q_user_id.=\")\";\n try {\n /** @noinspection PhpUndefinedMethodInspection */\n $stm=$this->uFunc->pdo(\"uAuth\")->prepare(\"SELECT DISTINCT\n firstname,\n secondname,\n email\n FROM\n u235_users\n JOIN \n u235_usersinfo\n ON\n u235_users.user_id=u235_usersinfo.user_id AND\n u235_usersinfo.status=u235_users.status\n WHERE\n \" .$q_user_id. \" AND \n u235_users.status='active' AND\n u235_usersinfo.site_id=:site_id\n \");\n $site_id=site_id;\n /** @noinspection PhpUndefinedMethodInspection */$stm->bindParam(':site_id', $site_id,PDO::PARAM_INT);\n /** @noinspection PhpUndefinedMethodInspection */$stm->execute();\n }\n catch(PDOException $e) {$this->uFunc->error('120'/*.$e->getMessage()*/);}\n\n return $stm;\n }", "function statistics_extended_users_metadata_value_count($metadata,$value,$group=null){\r\n $sector_metadata = get_metastring_id($metadata);\r\n $dbprefix = elgg_get_config('dbprefix');\r\n\r\n $query = \"SELECT mv.string AS data, count(*) as total \";\r\n $query .= \"FROM {$dbprefix}users_entity ue \";\r\n $query .= \"JOIN {$dbprefix}entities e ON ue.guid = e.guid AND e.enabled='yes'\";\r\n $query .= \"JOIN {$dbprefix}metadata m ON ue.guid = m.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings mv ON m.value_id = mv.id \";\r\n $query .= \"JOIN {$dbprefix}metadata m2 ON ue.guid = m2.entity_guid \";\r\n $query .= \"JOIN {$dbprefix}metastrings m2v ON m.value_id = m2v.id \";\r\n $query .= \"WHERE m.name_id = {$sector_metadata} \";\r\n $query .= \"AND m2v.string like '$value' \";\r\n if(!empty($group)){\r\n $query.=\"AND ue.guid IN (SELECT guid_one FROM {$dbprefix}entity_relationships WHERE relationship='member' AND guid_two={$group}) \";\r\n }\r\n\r\n $query .= \"GROUP BY data\";\r\n $resp = array();\r\n $entities = get_data($query);\r\n if (! empty($entities)) {\r\n foreach ( $entities as $entity ) {\r\n $resp[$entity->data] = $entity->total;\r\n }\r\n }\r\n return $resp;\r\n}", "public function seeUserMetaInDatabase(array $criteria)\n {\n $tableName = $this->grabPrefixedTableNameFor('usermeta');\n $this->seeInDatabase($tableName, $criteria);\n }", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}", "private function search_user_by($column,$data,$db,$start=0,$limit=10){\n\t\tif (empty($column) || strlen($data)<3){\n\t\t\treturn null;\n\t\t}\n\t\t$data=strtolower($data);\n\t\t$data=Db::escapee($data,true);\n\t\t$sql=Db::create_sql(array(\n\t\t\t\t\"user_id\",\n\t\t\t\t\"first_name\",\n\t\t\t\t\"last_name\"\n\t\t),\n\t\t\t\t'users',\n\t\t\t\t\"$column LIKE '%$data%' AND\n\t\t\t\tstatus=1\",\n\t\t\t\tnull,null,\n\t\t\t\t\"$start,$limit\");\n\t\t\t\treturn empty($db)?$sql:Db::fetch_array($db, $sql);\n\t}", "public function get_stats()\n { \n $sql = \"SELECT COUNT(CASE WHEN `status` = 'Enabled' THEN 1 END) AS 'Enabled',\n COUNT(CASE WHEN `status` = 'Disabled' THEN 1 END) AS 'Disabled'\n FROM findmymac\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n\n $queryobj = new Findmymac_model();\n $out = [];\n foreach($queryobj->query($sql)[0] as $label => $value){\n $out[] = ['label' => $label, 'count' => $value];\n }\n \n jsonView($out);\n }", "function statistics_extended_users_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,'create' as event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}entities \";\r\n\t$query.=\"WHERE type = 'user' \";\r\n\t$query.=\"AND enabled='yes' \";\r\n\t$query.=\"GROUP BY zoom\";\r\n\treturn get_data($query);\r\n}", "public function getResultsOfUser($user_id);", "public function rate_tribe_users_device_tokens($post_data){\n $userId = $post_data['loginUserId'];\n $searchId = $post_data['searchId'];\n\n /*$sql = \"SELECT t.*,u.userId,u.firstName,u.deviceToken,u.email \n FROM tribe t \n LEFT JOIN users u ON u.userId = t.fromuserId OR u.userId = t.touserId \n WHERE t.status = 'accept' AND t.touserId!= $userId AND t.deleteFlag !=1 AND u.deleteFlag !=1 AND t.searchId = $searchId GROUP BY t.touserId\n \";\n */\n $sql = \"SELECT u.userId,u.firstName,u.email,u.deviceToken,u.deleteFlag \n FROM users u where (u.userId in (SELECT t.touserId FROM tribe t where t.searchId=$searchId AND t.touserId !=$userId AND t.status = 'accept' AND t.deleteFlag !=1 )\n OR u.userId in (SELECT t.fromuserId FROM tribe t where t.searchId=$searchId AND t.fromuserId!=$userId)) AND u.deleteFlag !=1\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n\n }", "public function calculate_man_hours($site_id = NULL, $date_limit = NULL, $user_id = NULL) {\r // Requires: $site_id and $date_limit. $date_limit must be in MySQL date format\r // $user_id is optional. \r \r $site_visits_table = $this->db->dbprefix('site_visits');\r \r // query looks up man_hours for individual school only\r $query_text = \"SELECT $site_visits_table.location_id, \r SEC_TO_TIME(SUM(TIME_TO_SEC($site_visits_table.time_worked))) as man_hours\r FROM $site_visits_table\r \r WHERE \r $site_visits_table.location_id = '$site_id' \r \";\r // If there is a date limit, use it. Date limit must be in date format.\r if ($date_limit)\r {\r $query_text .= \" AND date >= '$date_limit'\";\r }\r \r if ($user_id)\r {\r $query_text .= \" AND $site_visits_table.user_id = '$user_id' \";\r }\r $query_text .= \" GROUP BY $site_visits_table.location_id\";\r \r //echo \"<p>Query = $query_text</p>\";\r $query = $this->db->query($query_text);\r return $query->row();\r }", "function getAnAdmin($criteria)\n{\n $selector = [];\n foreach ($criteria as $match => $value) {\n if (is_numeric($value)) {\n $selector[] = $match.$value;\n } //is_numeric($value)\n else {\n $selector[] = $match.db_quote($value);\n }\n } //$criteria as $match => $value\n $sql = 'SELECT * FROM '.prefix('administrators').' WHERE '.implode(' AND ', $selector).' LIMIT 1';\n $admin = query_single_row($sql, false);\n if ($admin) {\n return newAdministrator($admin['user'], $admin['valid']);\n } //$admin\n else {\n return;\n }\n}", "function getmoname($data)\r\n {\r\n \r\n $query = $this->db->query(\"SELECT username,user_id,firstname FROM `oc_user` where user_group_id='4' and firstname like '%\".$data[\"filter_name\"].\"%' order by firstname asc limit 5 \");\r\n \r\n return $query->rows; \r\n }", "function Monitor_Shortcuts_convertPageOfMetricsToResponse($request, $match, $page)\n{\n // User defined format\n if (Monitor_Shortcuts_isPrometheusRequest($request)) {\n $items = $page->fetchItems();\n $result = '';\n foreach ($items as $metric) {\n $value = $metric->invoke($request, $match);\n $result = $result . //\n Monitor_Shortcuts_convertMetricToPrometheusLabel($metric) . \" \" . //\n ($value ? $value : '0') . PHP_EOL;\n }\n return new Pluf_HTTP_Response($result, 'text/plain');\n }\n return $page;\n}", "public function getAllMeasurements($userId){\n\t\t$sql = 'SELECT * FROM measurements WHERE user_id = :userId';\n\t\t$pstmt = $this->db->prepare($sql);\n\t\t$pstmt->bindParam(':userId', $userId);\n\t\t$pstmt->execute();\n\t\treturn $pstmt->fetchAll(\\PDO::FETCH_OBJ);\n\t}", "function user_stats() {\n\n\t\t/*\n\t\targuments:\n\t\t\tnone\n\n\t\treturns:\n\t\n\t\tReturn:\n\t\t\tif successful:\n\t\t\t{\n\t\t\t\tuser_qty: how many users there are in gamo\n\t\t\t\tuser_qty_active: how many users are active\n\t\t\t\tavg_points: how many points on average users have\n\t\t\t\tavg_points_active: how many points on average active users have\n\t\t\t}\n\n\t\t\tif error:\n\t\t\t{\n\t\t\t\terror_code: The error code\n\t\t\t\terror_msg: The error message\n\t\t\t}\n\t\t*/\n\n\t\tglobal $dbh;\n\n\t\t$result = array(); // This is where the results will be stored\n\n\t\t// Retrieve status for all users (active + non-active)\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for all users\n\t\t$results['user_qty'] = $row['count(*)'];\n\t\t$results['avg_points'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\t// Retrieve status for active users only\n\t\t$sql = 'SELECT\n\t\tcount(*),\n\t\tSUM(points) as total_points\n\t\tFROM ' . CORE_DB . '.users WHERE points > 0';\n\n\t\t$sth = $dbh->prepare($sql);\n\t\t$sth->execute();\n\t\t$row = $sth->fetch();\n\n\t\t// Store the results for active only users\n\t\t$results['user_qty_active'] = $row['count(*)'];\n\t\t$results['avg_points_active'] = floor($row['total_points'] / max($row['count(*)'], 1));\n\n\t\treturn $results;\n\n\t}", "public function get_user_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId = s.userId AND u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1\";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "public function get_user_search_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1 \";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }", "public function add_custom_users_api() {\n\t\t// only when adminbar is available\n\t\tif (!is_admin_bar_showing()) {\n\t\t\treturn;\n\t\t}\n\n\t\tregister_rest_route('mio', '/omnisearch', array(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [$this, 'rest_callback_admin_search'],\n\t\t\t));\n\t}", "public function graphdayused_dashboard()\n \t{\n \t\t// announce return variable\n \t\t$return \t= \tarray();\n \t\t$count \t\t=\tarray();\n \t\t// select logger collection \n \t\t$use_data \t= \t$this->mongo_db->db->used;\n \t\t// preparing query data\n \t\tfor($i = 0; $i <= 24; $i++) \n \t\t{\n \t\t\tif (strlen($i) == 1) \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^0'.$i.'/');\n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_time' \t=> \t$regex_Date,\n \t\t\t\t\t'use_date' \t=> \t$this->use_date\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t} \n \t\t\telse \n \t\t\t{\n \t\t\t\t// use mongoRegex (while like in sql)\n \t\t\t\t$regex_Date \t= \tnew MongoRegex('/^'.$i.'/'); \n \t\t\t\t// build query data\n \t\t\t\t$querydata \t\t= \tarray(\n \t\t\t\t\t'use_time' \t=> \t$regex_Date, \n \t\t\t\t\t'use_date' \t=> \t$this->use_date\n \t\t\t\t\t);\n \t\t\t\t// count and insert data to array\n \t\t\t\tarray_push($count, $use_data->count($querydata));\n \t\t\t}\n \t\t}\n\n \t\t$return\t\t=\tarray(\n \t\t\t'name'\t\t=>\t\t'User',\n \t\t\t'data'\t\t=>\t\t$count\n \t\t\t);\n\n \t\treturn $return;\t\n \t}", "function mysqlnd_qc_set_user_handlers($get_hash, $find_query_in_cache, $return_to_cache, $add_query_to_cache_if_not_exists, $query_is_select, $update_query_run_time_stats, $get_stats, $clear_cache)\n{\n}", "public function findDowntimesByServiceForAdminUser(int $hostId, int $serviceId): array;", "function getMetrics(&$db,$userObj,$args, $result_cfg, $labels)\n{\n $debug = true;\n $begin_time = microtime(true);\n $user_id = $args->currentUserID;\n $tproject_id = $args->tproject_id;\n $linked_tcversions = array();\n $metrics = array();\n $tplan_mgr = new testplan($db);\n $show_platforms = false;\n $platforms = array();\n\n // get all tesplans accessibles for user, for $tproject_id\n $options = array('output' => 'map');\n $options['active'] = $args->show_only_active ? ACTIVE : TP_ALL_STATUS; \n $test_plans = $userObj->getAccessibleTestPlans($db,$tproject_id,null,$options);\n\n // Get count of testcases linked to every testplan\n // Hmm Count active and inactive ?\n $linkedItemsQty = $tplan_mgr->count_testcases(array_keys($test_plans),null,array('output' => 'groupByTestPlan'));\n \n \n $metricsMgr = new tlTestPlanMetrics($db);\n $show_platforms = false;\n \n $metrics = array('testplans' => null, 'total' => null);\n $mm = &$metrics['testplans'];\n $metrics['total'] = array('active' => 0,'total' => 0, 'executed' => 0);\n foreach($result_cfg['status_label_for_exec_ui'] as $status_code => &$dummy)\n {\n $metrics['total'][$status_code] = 0; \n } \n \n $codeStatusVerbose = array_flip($result_cfg['status_code']);\n if($debug){\n echo 'test_plans_count:'.count($test_plans).\"<br/>\";\n $index = 0;\n foreach($test_plans as $key => &$dummy)\n {\n $item_begin_time = microtime(true);\n // We need to know if test plan has builds, if not we can not call any method \n // that try to get exec info, because you can only execute if you have builds.\n //\n // 20130909 - added active filter\n $buildSet = $tplan_mgr->get_builds($key,testplan::ACTIVE_BUILDS);\n if( is_null($buildSet) )\n {\n continue;\n }\n\n $platformSet = $tplan_mgr->getPlatforms($key);\n if (isset($platformSet)) \n {\n $platforms = array_merge($platforms, $platformSet);\n } \n $show_platforms_for_tplan = !is_null($platformSet);\n $show_platforms = $show_platforms || $show_platforms_for_tplan;\n if( !is_null($platformSet) )\n {\n $neurus = $metricsMgr->getExecCountersByPlatformExecStatus($key,null,\n array('getPlatformSet' => true,\n 'getOnlyActiveTCVersions' => true));\n $mm[$key]['overall']['active'] = $mm[$key]['overall']['executed'] = 0;\n foreach($neurus['with_tester'] as $platform_id => &$pinfo)\n {\n $xd = &$mm[$key]['platforms'][$platform_id];\n $xd['tplan_name'] = $dummy['name'];\n $xd['platform_name'] = $neurus['platforms'][$platform_id];\n $xd['total'] = $xd['active'] = $neurus['total'][$platform_id]['qty'];\n $xd['executed'] = 0;\n \n foreach($pinfo as $code => &$elem)\n {\n $xd[$codeStatusVerbose[$code]] = $elem['exec_qty'];\n if($codeStatusVerbose[$code] != 'not_run')\n {\n $xd['executed'] += $elem['exec_qty'];\n }\n if( !isset($mm[$key]['overall'][$codeStatusVerbose[$code]]) )\n {\n $mm[$key]['overall'][$codeStatusVerbose[$code]] = 0;\n }\n $mm[$key]['overall'][$codeStatusVerbose[$code]] += $elem['exec_qty'];\n $metrics['total'][$codeStatusVerbose[$code]] += $elem['exec_qty']; \n }\n $mm[$key]['overall']['executed'] += $xd['executed'];\n $mm[$key]['overall']['active'] += $xd['active'];\n } \n unset($neurus);\n $mm[$key]['overall']['total'] = $mm[$key]['overall']['active']; \n $metrics['total']['executed'] += $mm[$key]['overall']['executed'];\n $metrics['total']['active'] += $mm[$key]['overall']['active'];\n }\n else\n {\n if($key == 764205){$my_begin_time = microtime(true);}\n $mm[$key]['overall']['builds'] = $metricsMgr->getBuildExecCountersByExecStatus($key,null,null);\n if($key == 764205){$my_end_time = microtime(true);echo 'my_diff:'.($my_end_time - $my_begin_time).\"<br/>\";}\n $mm[$key]['overall']['active'] = 0;\n foreach ($mm[$key]['overall']['builds'] as $build_id => $status_column)\n {\n $mm[$key]['overall']['active'] += $status_column['total'];\n foreach ($status_column as $status_code => $qty)\n {\n if(!isset($metrics['total'][$status_code]))\n {\n $metrics['total'][$status_code] = 0;\n }\n $metrics['total'][$status_code] += $qty;\n \n if (!isset($mm[$key]['overall'][$status_code]))\n {\n $mm[$key]['overall'][$status_code] = 0;\n }\n $mm[$key]['overall'][$status_code] += $qty;\n }\n }\n\n //$metrics['total']['executed'] += $mm[$key]['overall']['executed'];\n $metrics['total']['active'] += $mm[$key]['overall']['active'];\n \n $mm[$key]['platforms'][0] = $mm[$key]['overall'];\n $mm[$key]['platforms'][0]['tplan_name'] = $dummy['name'];\n $mm[$key]['platforms'][0]['platform_name'] = $labels['not_aplicable'];\n } \n $item_end_time = microtime(true);\n echo \"key:$key,diff_time:\".($item_end_time - $item_begin_time).\"<br/>\";\n $index ++;\n if($index > 2){\n break;\n }\n }\n}\n \n // remove duplicate platform names\n $platformsUnique = array();\n foreach($platforms as $platform) \n {\n if(!in_array($platform['name'], $platformsUnique)) \n {\n $platformsUnique[] = $platform['name'];\n }\n }\n \n $end_time = microtime(true);\n echo 'diff_time'.($end_time - $begin_time);\n return array($metrics, $show_platforms, $platformsUnique);\n}", "public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }", "function groupSearchHandler() {\n global $inputs;\n\n $keyword = $inputs['keyword'];\n $res = getAll(\"SELECT * \n FROM `group` \n WHERE group_name LIKE '%$keyword%' OR description LIKE '%$keyword%'\");\n \n formatOutput(true, 'success',$res);\n}", "protected function users_search_sql($search, $u = 'u', $searchanywhere = true,\n array $exclude = null, array $includeonly = null) {\n global $DB, $CFG;\n $params = array();\n $tests = array();\n\n if ($u) {\n $u .= '.';\n }\n\n // If we have a $search string, put a field LIKE '$search%' condition on each field.\n if ($search) {\n /*$conditions = array(\n $DB->sql_fullname($u . 'firstname', $u . 'lastname'),\n $conditions[] = $u . 'lastname'\n );*/\n \n $conditions = [$this->propertyFromConfigToDisplay];\n /*foreach ($extrafields as $field) {\n $conditions[] = $u . $field;\n }*/\n if ($searchanywhere) {\n $searchparam = '%' . $search . '%';\n } else {\n $searchparam = $search . '%';\n }\n $i = 0;\n \n foreach ($conditions as $key => $condition) {\n $conditions[$key] = $DB->sql_like($condition, \":con{$i}00\", false, false);\n $params[\"con{$i}00\"] = $searchparam;\n $i++;\n }\n $tests[] = '(' . implode(' OR ', $conditions) . ')';\n }\n\n // Add some additional sensible conditions.\n $tests[] = $u . \"id <> :guestid\";\n $params['guestid'] = $CFG->siteguest;\n $tests[] = $u . 'deleted = 0';\n $tests[] = $u . 'confirmed = 1';\n\n // If we are being asked to exclude any users, do that.\n if (!empty($exclude)) {\n list($usertest, $userparams) = $DB->get_in_or_equal($exclude, SQL_PARAMS_NAMED, 'ex', false);\n $tests[] = $u . 'id ' . $usertest;\n $params = array_merge($params, $userparams);\n }\n\n // If we are validating a set list of userids, add an id IN (...) test.\n if (!empty($includeonly)) {\n list($usertest, $userparams) = $DB->get_in_or_equal($includeonly, SQL_PARAMS_NAMED, 'val');\n $tests[] = $u . 'id ' . $usertest;\n $params = array_merge($params, $userparams);\n }\n\n // In case there are no tests, add one result (this makes it easier to combine\n // this with an existing query as you can always add AND $sql).\n if (empty($tests)) {\n $tests[] = '1 = 1';\n }\n\n // Combing the conditions and return.\n return array(implode(' AND ', $tests), $params);\n }", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function Search($criteria, $userId);", "public function regexp( Application_Model_User $antaUser, $filters ){\r\t\t\r\t\t$orderBy = implode(\",\", empty($filters->orders)? array(\"date DESC\", \"id_document DESC\",\"position ASC\"):$filters->orders );\r\t\t\r\t\t# create result set object\r\t\t$matches = new Anta_Frog_Matches(); \r\t\t$whereClause = \"\";\r\t\t$binds = array();\r\t\t\r\t\t# 1. filter documents by documents id\r\t\tif( !(empty( $filters->docs ))){\r\t\t\t$whereClause .= \" id_document IN (\".implode(\",\",array_fill( 0, count($filters->docs), \"?\" )).\" ) \";\r\t\t\t$binds = array_merge( $binds, $filters->docs );\r\t\t}\r\t\t\r\t\t# 2. filter documents by document tags\r\t\tif( !(empty( $filters->tags ))){\r\t\t\t$whereClause .= (strlen($whereClause)>0?\"AND \":\"\").\" id_document IN ( \r\t\t\t\tSELECT id_document FROM anta_{$antaUser->username}.`documents_tags` \r\t\t\t\tNATURAL JOIN anta_{$antaUser->username}.`tags` \r\t\t\t\tWHERE id_tag IN (\".implode(\",\",array_fill( 0, count($filters->tags), \"?\" )).\" ) )\";\r\t\t\t$binds = array_merge( $binds, $filters->tags );\r\t\t}\r\t\t\r\t\t$startTime = microtime(true);\r\t\t# get a list of sentences that matches\r\t\t$query = \"\r\t\t\tSELECT SQL_CALC_FOUND_ROWS title, DATE_FORMAT( do.date,'%d/%m/%Y' ) as date, content, position, id_sentence, id_document \r\t\t\tFROM (\r\t\t\t\tSELECT id_document, title, date FROM anta_{$antaUser->username}.documents \r\t\t\t\t\".( strlen( $whereClause )>0?\"WHERE {$whereClause}\":\"\").\"\r\t\t\t\t\r\t\t\t) do\r\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? ORDER BY {$orderBy} LIMIT {$filters->offset},{$filters->limit}\"\r\t\t;\r\t\t\r\t\t$mysqli = Anta_Core::getMysqliConnection();\r\t\t$stmt = $mysqli->query( $query, array_merge( $binds, array($filters->query) ) );\r\t\t\r\t\t\r\t\t\r\t\t// create a list of different document. size property is the number of sentences\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\tif( !isset( $matches->documents[ $row->id_document ] ) ){ \r\t\t\t\t$matches->documents[ $row->id_document ] = array(\r\t\t\t\t\t\"title\" => $row->title,\r\t\t\t\t\t\"date\" => $row->date,\r\t\t\t\t\t\"tags\" => Application_Model_DocumentsMapper::getTags( $antaUser, $row->id_document ),\r\t\t\t\t\t\"size\" => Application_Model_SentencesMapper::getNumberOfSentences( $antaUser, $row->id_document )\r\t\t\t\t);\r\t\t\t}\r\t\t\t\r\t\t\t$matches->sentences[ $row->id_sentence ] = new Application_Model_Sentence( $row->id_sentence, $row->content, $row->id_document, $row->position, $row->date );\r\t\t\t\r\t\t}\r\t\t\r\t\t// get total items\r\t\t$stmt = $mysqli->query(\"SELECT FOUND_ROWS() as totalItems\");\r\t\t$matches->totalItems = $stmt->fetchObject()->totalItems;\r\t\t\r\t\t$checkPointA = microtime(true) - $startTime;\r\t\t$startTime = microtime(true);\r\t\t\r\t\t// test, again... find all documents id containing that regexp\r\t\t$stmt = $mysqli->query(\r\t\t\t\"SELECT DISTINCT id_document FROM anta_{$antaUser->username}.documents do\r\t\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? \", array($filters->query)\r\t\t);\r\t\t$ids = array();\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t$ids[] = $row->id_document;\r\t\t}\r\t\t\t\t\t\t\r\t\t\r\t\t// computate tags statistics, top FIVE for each category using filter in id_documents\r\t\tforeach( Application_Model_CategoriesMapper::getAll( $antaUser ) as $category ){\r\t\t\t\r\t\t\t$matches->categories[ $category->content ] = array();\r\t\t\t$query = \"SELECT dt.id_tag, dtd.content, count(distinct dt.`id_document`) AS `number_of_documents`\r\t\t\t\tFROM \r\t\t\t\t\tanta_{$antaUser->username}.documents_tags dt \r\t\t\t\t\t\r\t\t\t\tINNER JOIN\r\t\t\t\t\tanta_{$antaUser->username}.`tags` dtd\r\t\t\t\t\tUSING ( id_tag ) \r\t\t\t\tWHERE id_document IN(\".implode(\",\",$ids).\") AND {$whereClause} \".( strlen( $whereClause )>0? \"AND \":\"\" ).\" id_category = ? \r\t\t\t\tGROUP BY dtd.id_tag ORDER BY `number_of_documents` DESC LIMIT 0,5\";\r\t\t\t\t\r\t\t\t$stmt = $mysqli->query($query, array_merge( $binds,array( $category->id ) ) );\r\t\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t\t$matches->categories[ $category->content ][ $row->id_tag ] = $row;\r\t\t\t}\r\t\t\r\t\t};\r\t\t$checkPointB = microtime(true) - $startTime;\r\t\techo $checkPointA.\", \".$checkPointB;\r\t\treturn $matches;\r\t\t// \r\t\t\r\t\t\r\t}", "function get_metric() {\n $processes = array();\n //$output = `ps aux | awk '{ print $1,$2,$3,$4,$9,$10,$11 }'`;\n $output = `ps -eo pcpu,pmem,pid,user,args,time,start | grep -v '\\[' | sort -k 1 -r | head -30 | awk '{print $4,$3,$1,$2,$7,$6,$5}'`;\n $output = explode(\"\\n\", $output);\n if (!is_array($output) || count($output)<2) {\n return false; \n }\n array_shift($output);\n foreach ($output as $line) {\n //$line = preg_split('/\\s+/', $line);\n $line = explode(' ', $line);\n if (count($line)<6) {\n continue;\n }\n //var_dump($line);\n //echo count($line);\n if (empty($processes[$line[6]])) {\n $processes[$line[6]] = array_combine(array('user', 'pid', '%cpu', '%mem','start','time', 'command'), $line);\n } else {\n $processes[$line[6]]['%cpu'] += $line[2];\n $processes[$line[6]]['%mem'] += $line[3];\n }\n }\n\n return $processes;\n }", "public function query( $sql ) {\n\t\tglobal $wpdb;\n\n\t\t// Prevent more expensive regex from running if not a user query\n\t\tif ( 0 !== strpos( $sql, 'SELECT' ) || false === strpos( $sql, 'FROM ' . $wpdb->users ) ) {\n\t\t\treturn $sql;\n\t\t}\n\n\n\t\tforeach ( $this->get_query_regex() as $pattern ) {\n\t\t\tif ( preg_match( $pattern, $sql ) && wp_sub_enabled() ) {\n\t\t\t\t$sql = $this->add_meta_sql( $sql );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "public function getMetricsManager($manager_id)\n {\n $dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $job_portfolio=array();\n $job_site=array();\n $manager_list=array();\n\n $comment_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n \n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_labor_tax_lag=0;\n $total_bill_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n \n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $user_id=0;\n $user = DB::table('users')\n ->where('manager_id', $manager_id)\n ->where('active', 1)\n ->get();\n\n foreach ($user as $user_item) {\n $user_id = $user_item->id;\n }\n\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', $user_id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', $user_id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1;\n $expense_calc_week2=$total_expense_week2;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n \n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => 0,\n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list\n ]);\n }", "public function manage(){\n if($this->request->data!=null){\n $search = '%'.$this->request->data['User']['searchstring'].'%';\n } else {\n $search ='%%';\n }\n\n $this->paginate = array (\n 'conditions' => array(\n 'User.status' => 1,\n 'User.role' =>'author',\n 'User.username LIKE' => $search\n ),\n 'limit' => 10,\n 'order' => array('User.created'=>'DESC')\n );\n\n $this->set('users',$this->paginate());\n }", "public function getDependencyByManagerUser($search)\n {\n $objDataBase = $this->_connectSuperDataBase();\n\n $arraySetVariable = array(\"@InSearch\");\n $arrayValueVariable = array($search);\n $arrayTypeDataVariable = array(Class_Object::DATA_INT);\n $arraySizeDataVariable = array(null);\n\n $result = $objDataBase->executeQueryStoreProcedure(\"get_dependencyByManagerUser\", $arraySetVariable,\n $arrayValueVariable, $arrayTypeDataVariable, $arraySizeDataVariable);\n\n $dato = array();\n while ($tempRows = $objDataBase->exploreArraySelect($result)) { \n $dato[] = $tempRows;\n }\n return $dato;\n }", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "function mapit_admin_get_stats() {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.admin_get_stats', $params);\n return $result;\n}", "public function get_user_approved_mdm()\n {\n $obj = new View();\n $queryobj = new Jamf_model();\n $sql = \"SELECT COUNT(CASE WHEN `user_approved_mdm` = '1' THEN 1 END) AS Yes,\n COUNT(CASE WHEN `user_approved_mdm` = '0' THEN 1 END) AS No\n FROM `jamf`\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n $obj->view('json', array('msg' => current($queryobj->query($sql))));\n }", "public static function getAll() {\n global $lC_Database, $lC_Language, $_module;\n\n $lC_Language->loadIniFile('administrators.php');\n \n $media = $_GET['media'];\n \n /* Filtering */\n $aWhere = \"\";\n if ($_GET['aSearch'] != \"\") {\n $aWhere = \"where id = '\" . (int)$_GET['aSearch'] . \"'\";\n } \n\n $Qadmins = $lC_Database->query('select * from :table_administrators ' . $aWhere . ' order by user_name');\n $Qadmins->bindTable(':table_administrators', TABLE_ADMINISTRATORS);\n $Qadmins->execute();\n\n $result = array('entries' => array());\n $result = array('aaData' => array());\n $cnt = 0;\n while ( $Qadmins->next() ) {\n $group = self::getGroupName($Qadmins->valueInt('access_group_id')) ;\n $color = ($odd == $cnt%2) ? 'purple-bg' : 'green-bg';\n if ($Qadmins->valueInt('access_group_id') == 1) $color = 'red-bg';\n\n $last = '<td>' . $Qadmins->valueProtected('last_name') . '</td>';\n $first = '<td>' . $Qadmins->valueProtected('first_name') . '</td>';\n $user = '<td>' . $Qadmins->valueProtected('user_name') . '</td>';\n $group = '<td><small class=\"tag ' . $color . '\">' . self::getGroupName($Qadmins->valueInt('access_group_id')) . '</small></td>';\n $action = '<td class=\"align-right vertical-center\"><span class=\"button-group compact\">\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : 'javascript://\" onclick=\"editAdmin(\\'' . $Qadmins->valueInt('id') . '\\')') . '\" class=\"button icon-pencil ' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? 'disabled' : NULL) . '\">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://\" onclick=\"deleteAdmin(\\'' . $Qadmins->valueInt('id') . '\\', \\'' . urlencode($Qadmins->valueProtected('user_name')) . '\\')') . '\" class=\"button icon-trash with-tooltip ' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? 'disabled' : NULL) . '\" title=\"' . $lC_Language->get('icon_delete') . '\"></a></span></td>';\n\n $result['aaData'][] = array(\"$last\", \"$first\", \"$user\", \"$group\", \"$action\");\n $result['entries'][] = $Qadmins->toArray();\n $cnt++;\n }\n $Qadmins->freeResult();\n\n return $result;\n }", "function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo->Size = 100; // The first 100 accounts for this page of results\n\n $ordering = new OrderBy();\n $ordering->Field = OrderByField::Number;\n $ordering->Order = SortOrder::Ascending; \n\n $predicate = new Predicate();\n $predicate->Field = \"UserId\";\n $predicate->Operator = PredicateOperator::Equals;\n $predicate->Value = $userId; \n\n $request = new SearchAccountsRequest();\n $request->Ordering = $ordering;\n $request->PageInfo = $pageInfo;\n $request->Predicates = array($predicate);\n\n return $GLOBALS['proxy']->GetService()->SearchAccounts($request)->Accounts;\n}", "public function getStatistics(){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"status\"])\n\t\t\t||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"])\n\t\t\treturn false;\n\n\t\t// get entry stats\n\t\t$query = Queries::getuploads();\n\t\t$uploads = $this->query($query);\n\n\t\t// get user stats\n\t\t$query = Queries::getjoins();\n\t\t$joins = $this->query($query);\n\n\t\t// get sex stats\n\t\t$query = Queries::getsexcounts();\n\t\t$gender = $this->query($query);\n\n\t\t$result = array();\n\t\t$result[\"uploads\"]=$uploads;\n\t\t$result[\"joins\"]=$joins;\n\t\t$result[\"genders\"]=$gender;\n\n\t\treturn $result;\n\t}", "public function index(UserManagerDataTable $userDataTable)\n {\n return $userDataTable->render('settings.users.manager.index');\n }", "public function get_user_serach_info($searchId){\n $sql = \"SELECT s.searchName,u.firstName,u.deviceToken FROM searchcriteria s,users u WHERE s.userId = u.userId AND s.searchId = $searchId\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n }", "public function incSearch() {\n\t\t$result = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\tif ( $this->input->get( 'term' ) ) {\n\t\t\t\t/** @var \\wpdb $wpdb */\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$query = '%' . $this->input->get( 'term' ) . '%';\n\t\t\t\t$sql = <<<SQL\n\t\t\t\t\tSELECT SQL_CALC_FOUND_ROWS\n\t\t\t\t\t\tID, user_login, display_name\n\t\t\t\t\tFROM {$wpdb->users}\n\t\t\t\t\tWHERE user_login LIKE %s\n\t\t\t\t\t OR user_email LIKE %s\n\t\t\t\t\t OR display_name LIKE %s\n ORDER BY display_name ASC\n\t\t\t\t\tLIMIT 10\nSQL;\n\t\t\t\t$result = array_map( function ( $user ) {\n\t\t\t\t\t$user->avatar = get_avatar( $user->ID, '48', '', $user->display_name );\n\n\t\t\t\t\treturn $user;\n\t\t\t\t}, $wpdb->get_results( $wpdb->prepare( $sql, $query, $query, $query ) ) );\n\t\t\t}\n\t\t}\n\t\twp_send_json( $result );\n\t}", "function MWX__where ($where)\n{\n global $wp_query, $wpdb;\n\n if (current_user_can ('edit_users'))\n return $where;\n\n $user_maturity = MWX__get_current_user_maturity ();\n\n return $where . \" AND (meta_value IS NULL OR meta_value <= $user_maturity)\";\n}", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "public function stats() {\n\t\t$userCount = 0;\n\t\tif ($this->isAdmin) {\n\t\t\t$countByBackend = $this->userManager->countUsers();\n\n\t\t\tif (!empty($countByBackend)) {\n\t\t\t\tforeach ($countByBackend as $count) {\n\t\t\t\t\t$userCount += $count;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t'@phan-var \\OC\\Group\\Manager $this->groupManager';\n\t\t\t$groups = $this->groupManager->getSubAdmin()->getSubAdminsGroups($this->userSession->getUser());\n\n\t\t\t$uniqueUsers = [];\n\t\t\tforeach ($groups as $group) {\n\t\t\t\tforeach ($group->getUsers() as $uid => $displayName) {\n\t\t\t\t\t$uniqueUsers[$uid] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$userCount = \\count($uniqueUsers);\n\t\t}\n\n\t\treturn new DataResponse(\n\t\t\t[\n\t\t\t\t'totalUsers' => $userCount\n\t\t\t]\n\t\t);\n\t}", "public function get_usermeta_admin($id, $meta_key){\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_usermeta` WHERE `user_id`= ? AND `meta_key` = ?\");\n\t\t$query->bindValue(1, $id);\n\t\t$query->bindValue(2, $meta_key);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data \t\t\t\t= $query->fetch();\n\n\t\t\treturn $data;\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "function GetUsersPermissionsValue( $username , $class , $operation , $parname )\n{\n $user_regex = \".*\" ;\n\n //QUERY DATABASE TO GET THE USERID\n $result_user_id = mysql_query( \"SELECT u.ID FROM USERS u\".\n \" where u.Username = '\".$username.\"' and u.DELETED = 0\" ) ;\n\n if( mysql_num_rows( $result_user_id ) )\n {\n $row_user_id = mysql_fetch_array( $result_user_id ) ;\n $user_id = $row_user_id['ID'] ;\n mysql_free_result( $result_user_id ) ;\n\n //QUERY DATABASE TO GET THE IS_ENFORCED OF READ_ATTEST\n $result_pt = mysql_query( \"SELECT pt.ID , pt.IS_ENFORCED FROM PERMISSIONS_TYPES pt\".\n \" where pt.CLASS = '\".$class.\"' and pt.OPERATION = '\".$operation.\"' and pt.PAR_NAME = '\".$parname.\"'\" ) ;\n if( mysql_num_rows( $result_pt ) )\n {\n $row_pt = mysql_fetch_array( $result_pt ) ;\n $is_enforced = $row_pt['IS_ENFORCED'] ;\n\n //IF IS_ENFORCED IS TRUE, WE HAVE TO SEARCH FOR THE REGEX VALUE\n if( $is_enforced == 1 )\n {\n $result_user_regex = mysql_query( \"SELECT up.VALUE FROM USERS_PERMISSIONS up\".\n \" where up.ID_PERMISSIONS_TYPES = \".$row_pt['ID'].\" AND up.ID_USERS = \".$user_id ) ;\n\n if( mysql_num_rows( $result_user_regex ) )\n {\n $row_user_regex = mysql_fetch_array( $result_user_regex ) ;\n $user_regex = $row_user_regex['VALUE'] ;\n mysql_free_result( $result_user_regex ) ;\n }\n else\n {\n // ALWAYS UNMATCHABLE\n $user_regex = \"\" ;\n }\n }\n mysql_free_result( $result_pt ) ;\n }\n }\n else\n {\n // ALWAYS UNMATCHABLE\n $user_regex = \"\" ;\n }\n\n return $user_regex ;\n}", "private function log_search_engine($data) {\n\t\t@preg_match('@^(?:http://)?([^/]+)@i', $data[0], $domain);\n\t\t\t\n\t\t$q = mysql_query(\"SELECT id,qexpr FROM robots WHERE '$domain[1]' REGEXP urlexpr\"); //or die (mysql_error());\n\t\t$r = mysql_fetch_object($q);\n\t\t\n\t\tif (isset($r->id)) {\n\t\t\t@preg_match('/'.$r->qexpr.'/', $data[0], $query);\n\t\t\t@preg_match('/((\\d+).(\\d+).(\\d+).(\\d+))/', $data[1], $ip);\n\t\t\t@mysql_query(\"INSERT INTO robot_queries SET search = '\".str_replace(\"+\", \" \", $query[1]).\"', source = '$ip[0]'\") or $this->log(mysql_error);\n\t\t\tif(DEBUG)\n\t\t\t\t@$this->log(\"Search query: \".$query[1]);\n\t\t}\n\t\n\t}", "function find_allusersearch_desc($user) {\n global $db;\n {\n return find_by_sql(\"SELECT * FROM search WHERE user='{$db->escape($user)}' ORDER BY id DESC\");\n }\n}", "public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}", "function count_searchcustindex($query, $loginID = '', $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$SHARED_ACCOUNTS = DplusWire::wire('config')->sharedaccounts;\n\t\t$search = QueryBuilder::generate_searchkeyword($query);\n\t\t$groupedcustindexquery = (new QueryBuilder())->table('custindex')->group('custid, shiptoid');\n\n\t\t$q = new QueryBuilder();\n\t\t$q->field($q->expr('COUNT(*)'));\n\n\t\t// CHECK if Users has restrictions by Application Config, then User permissions\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep'] && DplusWire::wire('pages')->get('/config/')->restrict_allowedcustomers) {\n\t\t\t$custpermquery = (new QueryBuilder())->table('custperm')->field('custid, shiptoid')->where('loginid', [$loginID, $SHARED_ACCOUNTS]);\n\n\t\t\tif (DplusWire::wire('config')->cptechcustomer == 'stempf') {\n\t\t\t\t$q->table($groupedcustindexquery, 'custgrouped');\n\t\t\t} else {\n\t\t\t\t$q->table('custindex');\n\t\t\t}\n\n\t\t\t$q->where('(custid, shiptoid)','in', $custpermquery);\n\t\t} else {\n\t\t\tif (DplusWire::wire('config')->cptechcustomer == 'stempf') {\n\t\t\t\t$q->table($groupedcustindexquery, 'custgrouped');\n\t\t\t} else {\n\t\t\t\t$q->table('custindex');\n\t\t\t}\n\t\t}\n\t\t$fieldstring = implode(\", ' ', \", array_keys(Contact::generate_classarray()));\n\n\t\t$q->where($q->expr(\"UCASE(REPLACE(CONCAT($fieldstring), '-', '')) LIKE UCASE([])\", [$search]));\n\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\treturn $sql->fetchColumn();\n\t\t}\n\t}", "function get_user_analytics_info() {\n global $wp_version;\n\n $url = 'http://freegeoip.net/json/' . $_SERVER['REMOTE_ADDR'];\n $params = array(\n 'timeout' => 30,\n 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )\n );\n\n $response = wp_remote_get( $url, $params );\n $user_data = wp_remote_retrieve_body( $response );\n\n if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {\n return false;\n }\n\n $user_info = (array) json_decode( $user_data );\n $user_analytics_info = array_merge( $user_info, array( 'browser_pc' => $_SERVER['HTTP_USER_AGENT'] ) );\n\n return $user_analytics_info;\n }", "function user_search_columns($columns, $search, $WP_User_Query)\n {\n }", "function getAllAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllAffinityGroupsFromUser($userID);\n }", "public function count_search_criteria_list($post_data){\n $userId = $post_data['userId']; \n $date = date(\"Y-m-d H:i:s\");\n $keyword = $post_data['keyword'];\n $latitude = $post_data['latitude'];\n $longitude = $post_data['longitude'];\n // $filter = $post_data['filter']; //fav_teacher/all\n // $type = $post_data['type']; // upcoming/past\n \n\n if(!empty($keyword)){\n $keyword = \"AND (s.searchName LIKE '%$keyword%' OR s.idealMovingDate LIKE '%$keyword%' OR s.houseType LIKE '%$keyword%' OR s.priceRange LIKE '%$keyword%' OR s.bedroom LIKE '%$keyword%')\";\n }\n\n if(!empty($latitude) && !empty($longitude))\n {\n $distance_in_km = \"( 6371 * acos( cos( radians($latitude) ) * cos( radians( lc.latitude) ) \n * cos( radians( lc.longitude ) - radians($longitude) ) + \n sin( radians($latitude) ) * sin( radians( lc.latitude ) ) ) ) \n AS distance_in_km\";\n }\n\n if (!empty($latitude) && !empty($longitude)) {\n\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1) +1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }else{\n $sql = \"SELECT s.*,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC\";\n \n }\n\n $record = $this->db->query($sql);\n return $record->num_rows();\n }", "public function search_criteria_list($post_data){\n $userId = $post_data['userId']; \n $date = date(\"Y-m-d H:i:s\");\n $keyword = $post_data['keyword'];\n $latitude = $post_data['latitude'];\n $longitude = $post_data['longitude'];\n $limit = $post_data['limit'];\n $offset = $post_data['offset'];\n // $filter = $post_data['filter']; //fav_teacher/all\n // $type = $post_data['type']; // upcoming/past\n \n\n if(!empty($keyword)){\n $keyword = \"AND (s.searchName LIKE '%$keyword%' OR s.idealMovingDate LIKE '%$keyword%' OR s.houseType LIKE '%$keyword%' OR s.priceRange LIKE '%$keyword%' OR s.bedroom LIKE '%$keyword%')\";\n }\n\n if(!empty($latitude) && !empty($longitude))\n {\n $distance_in_km = \"( 6371 * acos( cos( radians($latitude) ) * cos( radians( lc.latitude) ) \n * cos( radians( lc.longitude ) - radians($longitude) ) + \n sin( radians($latitude) ) * sin( radians( lc.latitude ) ) ) ) \n AS distance_in_km\";\n }\n\n if (!empty($latitude) && !empty($longitude)) {\n $sql = \"SELECT s.searchId,s.userId,s.searchName,s.idealMovingDate,s.area,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId =$userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC LIMIT $offset, $limit\";\n }else{\n $sql = \"SELECT s.searchId,s.userId,s.searchName,s.idealMovingDate,s.area,u.userId,u.firstName,u.lastName,((SELECT COUNT(*) from tribe t1 WHERE t1.searchId = s.searchId AND t1.status ='accept' AND t1.deleteFlag != 1)+1) as participantCount,\n (SELECT COUNT(*) from shortlistedproperty sp WHERE sp.searchId = s.searchId AND sp.deleteFlag !=1) as properties\n FROM searchcriteria s \n left join tribe t on s.searchId = t.searchId AND t.fromuserId = $userId\n left join users u on s.userId = u.userId\n left join shortlistedproperty p on s.searchId = p.searchId \n where s.searchId in (SELECT t.searchId from tribe t where (t.touserId = $userId OR t.fromuserId =$userId) AND t.status = 'accept' AND t.deleteFlag != 1) OR s.userId =$userId $keyword\n GROUP BY s.searchId ORDER BY s.createdAt DESC LIMIT $offset, $limit\";\n }\n\n //echo $sql;exit();\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array();\n } \n }", "function user_freq($low, $high, $user_type) {\n\n $conn = sql_connect();\n\n $query1 = \"SELECT * FROM Actions WHERE (Action_Time BETWEEN '\".$low.\"' AND '\".$high.\"');\";\n $query2 = \"SELECT * FROM Actions WHERE (Action_Time BETWEEN '\".$low.\"' AND '\".$high.\"') AND (User_Type='\".$user_type.\"');\";\n\n $sql_res1 = mysqli_query($conn, $query1);\n $sql_res2 = mysqli_query($conn, $query2);\n\n if (mysqli_num_rows($sql_res1) == 0) {\n return 0;\n }\n \n return number_format(mysqli_num_rows($sql_res2)/(float)mysqli_num_rows($sql_res1), 2);\n\n }", "function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}", "public function get_main_admin_character_in_corporation(){\n\t global $wpdb;\n\t //Get all users in the DB\n\t $wp_user_search = $wpdb->get_results(\"SELECT ID, display_name FROM $wpdb->users ORDER BY ID\");\n\t $SSO=new Top_Ratter_SSO();\n\n\t \n\t $sql=\"SELECT * FROM `\".$wpdb->prefix.\"tr_sso_credentials`\";\n\t $credentials=$wpdb->get_row($sql,ARRAY_A);\n\t \n\t \n\t $return_array=array();\n\t \n\t //Loop through all users\n\t foreach ( $wp_user_search as $userid ) {\n\t //Current user ID we are looping through\n\t $curID = $userid->ID;\n\t //Grab the user info of current ID\n\t $curuser = get_userdata($curID);\n\t //Current user level\n\t $user_level = $curuser->user_level;\n\t //Only look for admins\n\t if($user_level >= 8){//levels 8, 9 and 10 are admin\n\t \n\t //check if user has main chars related in user_chars table. \n\t $sql=\"SELECT * FROM `\".$wpdb->prefix.\"tr_users_chars`\n JOIN \" . $wpdb->prefix . \"tr_characters ON \" . $wpdb->prefix . \"tr_users_chars.char_id=\" . $wpdb->prefix . \"tr_characters.id\n WHERE `user_id`='$curID' AND `is_main_char`='1'\";\n\t \n\t $main_char=$wpdb->get_row($sql,ARRAY_A);\n\t \n\t if($main_char){\n\t $corp=$SSO->char_id_to_corp_id($main_char['owner_id']);\n \n \t if($corp['corporation_id']==$credentials['corporation_id']){\n \t \n \t $return_array['name']=$main_char['ownerName2'];\n \t $return_array['email']=$curuser->user_email;\n \t break;\n \t }\n\t } \n\t }\n\t }\n\t return$return_array; \n\t}" ]
[ "0.5234762", "0.51400363", "0.498763", "0.49706236", "0.49480426", "0.49471435", "0.49172598", "0.48804057", "0.4798091", "0.4795935", "0.4786672", "0.47255105", "0.470884", "0.4648722", "0.46418184", "0.4610412", "0.4604389", "0.46030703", "0.46025935", "0.45913148", "0.45662206", "0.45635518", "0.45514703", "0.45243675", "0.4518103", "0.4512299", "0.450844", "0.45036796", "0.4498143", "0.44891477", "0.4487331", "0.44872037", "0.44822165", "0.44758937", "0.4474951", "0.4458833", "0.4457704", "0.44405472", "0.4434888", "0.44323137", "0.44305328", "0.4402556", "0.43951586", "0.43905044", "0.43870133", "0.43721992", "0.43608618", "0.43581548", "0.4355705", "0.43555954", "0.43429232", "0.43334857", "0.43307948", "0.4325197", "0.4320571", "0.4313604", "0.43121463", "0.43113694", "0.43097228", "0.43080536", "0.4301548", "0.42949328", "0.42865878", "0.4283381", "0.42826015", "0.42585543", "0.42582265", "0.4257131", "0.42554966", "0.4253542", "0.4252749", "0.42508996", "0.42504272", "0.42472962", "0.42456183", "0.42431775", "0.42411014", "0.42397115", "0.42392355", "0.42356205", "0.42305908", "0.4229754", "0.42273393", "0.42232174", "0.42221695", "0.42175093", "0.42125425", "0.42044234", "0.42030907", "0.4198951", "0.41941708", "0.41900167", "0.41879216", "0.418097", "0.41792277", "0.41786435", "0.4177664", "0.41769078", "0.4176735", "0.4171558", "0.41658834" ]
0.0
-1
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE config (id INT AUTO_INCREMENT NOT NULL, code CHAR(255) NOT NULL, value CHAR(255) DEFAULT NULL, description CHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE content_file (id INT AUTO_INCREMENT NOT NULL, storage_name CHAR(255) NOT NULL, mime_type CHAR(64) NOT NULL, active TINYINT(1) NOT NULL, label CHAR(255) DEFAULT NULL, description CHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE simpleshop_category (id INT AUTO_INCREMENT NOT NULL, active TINYINT(1) NOT NULL, label CHAR(255) NOT NULL, sequence SMALLINT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE simpleshop_order (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, status_id INT DEFAULT NULL, shipping_address_id INT DEFAULT NULL, billing_address_id INT DEFAULT NULL, date DATETIME NOT NULL, comment LONGTEXT DEFAULT NULL, INDEX IDX_72E4278BA76ED395 (user_id), INDEX IDX_72E4278B6BF700BD (status_id), INDEX IDX_72E4278B4D4CFF2B (shipping_address_id), INDEX IDX_72E4278B79D0C0E4 (billing_address_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE user_user (id INT AUTO_INCREMENT NOT NULL, name CHAR(64) NOT NULL, email CHAR(128) NOT NULL, phone CHAR(16) NOT NULL, password CHAR(64) NOT NULL, role CHAR(32) NOT NULL, active TINYINT(1) NOT NULL, activation_hash CHAR(16) DEFAULT NULL, UNIQUE INDEX UNIQ_F7129A80E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE simpleshop_product (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, image_id INT DEFAULT NULL, active TINYINT(1) NOT NULL, label CHAR(128) NOT NULL, description CHAR(255) DEFAULT NULL, price INT NOT NULL, sequence SMALLINT NOT NULL, INDEX IDX_7EA9B56712469DE2 (category_id), INDEX IDX_7EA9B5673DA5256D (image_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE user_address (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title CHAR(255) DEFAULT NULL, city CHAR(255) NOT NULL, zipCode CHAR(16) NOT NULL, street CHAR(128) NOT NULL, houseNumber CHAR(16) NOT NULL, floor CHAR(16) DEFAULT NULL, door CHAR(16) DEFAULT NULL, doorBell CHAR(16) DEFAULT NULL, INDEX IDX_5543718BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE content_page (id INT AUTO_INCREMENT NOT NULL, code CHAR(128) NOT NULL, title CHAR(255) NOT NULL, description CHAR(255) DEFAULT NULL, keywords CHAR(255) DEFAULT NULL, text LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE content_text (id INT AUTO_INCREMENT NOT NULL, code CHAR(128) NOT NULL, text LONGTEXT NOT NULL, enabled_parameters LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE simpleshop_order_item (id INT AUTO_INCREMENT NOT NULL, order_id INT DEFAULT NULL, product_id INT DEFAULT NULL, count INT NOT NULL, price INT DEFAULT NULL, INDEX IDX_A0F20098D9F6D38 (order_id), INDEX IDX_A0F20094584665A (product_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('CREATE TABLE simpleshop_order_status (id INT AUTO_INCREMENT NOT NULL, label CHAR(128) NOT NULL, code CHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE simpleshop_order ADD CONSTRAINT FK_72E4278BA76ED395 FOREIGN KEY (user_id) REFERENCES user_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE simpleshop_order ADD CONSTRAINT FK_72E4278B6BF700BD FOREIGN KEY (status_id) REFERENCES simpleshop_order_status (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE simpleshop_order ADD CONSTRAINT FK_72E4278B4D4CFF2B FOREIGN KEY (shipping_address_id) REFERENCES user_address (id)'); $this->addSql('ALTER TABLE simpleshop_order ADD CONSTRAINT FK_72E4278B79D0C0E4 FOREIGN KEY (billing_address_id) REFERENCES user_address (id)'); $this->addSql('ALTER TABLE simpleshop_product ADD CONSTRAINT FK_7EA9B56712469DE2 FOREIGN KEY (category_id) REFERENCES simpleshop_category (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE simpleshop_product ADD CONSTRAINT FK_7EA9B5673DA5256D FOREIGN KEY (image_id) REFERENCES content_file (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE user_address ADD CONSTRAINT FK_5543718BA76ED395 FOREIGN KEY (user_id) REFERENCES user_user (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE simpleshop_order_item ADD CONSTRAINT FK_A0F20098D9F6D38 FOREIGN KEY (order_id) REFERENCES simpleshop_order (id) ON DELETE SET NULL'); $this->addSql('ALTER TABLE simpleshop_order_item ADD CONSTRAINT FK_A0F20094584665A FOREIGN KEY (product_id) REFERENCES simpleshop_product (id) ON DELETE SET NULL'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}" ]
[ "0.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.7329024", "0.7313519", "0.7298817", "0.72950184", "0.72917736", "0.7291469", "0.72913444", "0.72849613", "0.72839737", "0.7272078", "0.7271878", "0.72659117", "0.7262893", "0.7261672", "0.7256839", "0.72505474", "0.7249633", "0.72441125", "0.724062", "0.72376186", "0.7218244", "0.72177947", "0.72046006", "0.7203395", "0.7196059", "0.7191219", "0.7189963", "0.7177052", "0.71761394", "0.7167738", "0.7164105", "0.7164105", "0.7159096", "0.7147647", "0.7136521", "0.7129768", "0.7124664", "0.7123368", "0.71168584", "0.7104628", "0.7104628", "0.7104618", "0.7097006", "0.70931643", "0.70886755", "0.7087018", "0.7086326", "0.70830804", "0.70829463", "0.70780045", "0.70702124", "0.70690626", "0.7066111", "0.7062268", "0.7058938", "0.705882", "0.70556235", "0.70549136", "0.7054758", "0.70498437", "0.70483595", "0.7047308", "0.7045881", "0.70445794", "0.7043173", "0.703882", "0.7038126", "0.703674", "0.7033728", "0.7032356", "0.7031423", "0.70257956", "0.70142514", "0.70101255", "0.7006208", "0.6988486", "0.6984963", "0.69629973", "0.69612974", "0.69587934", "0.6957519" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE simpleshop_product DROP FOREIGN KEY FK_7EA9B5673DA5256D'); $this->addSql('ALTER TABLE simpleshop_product DROP FOREIGN KEY FK_7EA9B56712469DE2'); $this->addSql('ALTER TABLE simpleshop_order_item DROP FOREIGN KEY FK_A0F20098D9F6D38'); $this->addSql('ALTER TABLE simpleshop_order DROP FOREIGN KEY FK_72E4278BA76ED395'); $this->addSql('ALTER TABLE user_address DROP FOREIGN KEY FK_5543718BA76ED395'); $this->addSql('ALTER TABLE simpleshop_order_item DROP FOREIGN KEY FK_A0F20094584665A'); $this->addSql('ALTER TABLE simpleshop_order DROP FOREIGN KEY FK_72E4278B4D4CFF2B'); $this->addSql('ALTER TABLE simpleshop_order DROP FOREIGN KEY FK_72E4278B79D0C0E4'); $this->addSql('ALTER TABLE simpleshop_order DROP FOREIGN KEY FK_72E4278B6BF700BD'); $this->addSql('DROP TABLE config'); $this->addSql('DROP TABLE content_file'); $this->addSql('DROP TABLE simpleshop_category'); $this->addSql('DROP TABLE simpleshop_order'); $this->addSql('DROP TABLE user_user'); $this->addSql('DROP TABLE simpleshop_product'); $this->addSql('DROP TABLE user_address'); $this->addSql('DROP TABLE content_page'); $this->addSql('DROP TABLE content_text'); $this->addSql('DROP TABLE simpleshop_order_item'); $this->addSql('DROP TABLE simpleshop_order_status'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Extract CSS and move it inline JTMailer always put HTML as body.
public function onJtmailPresending(MailEvent $event) { $message = $event->getMessage(); /* Get HTML and Text messages */ switch ($message->getContentType()) { /* Text only */ case 'text/plain': return; /* HTML only */ case 'text/html': $html = $message->getBody(); $text = null; break; /* HTML + Text */ case 'multipart/alternative': $html = $message->getBody(); $text = $message->getChildren()[0]->getBody(); break; /* HTML or/and Text + File(s) */ case 'multipart/mixed': $html = $message->getBody(); if ($html == strip_tags($this->isHtml)) { // If text => no premailing return; } foreach ($message->getChildren() as $child) { // Get alternative text if ($child->getContentType() == 'text/plain') { $text = $child->getBody(); } } break; default: throw new \InvalidArgumentException('"' . $message->getContentType() . '" is not a valid Content-Type.'); } /* Edit HTML and eventually generate a text version */ $this->preMailer->process($html); /* SET HTML and Text messages */ $message->setBody($this->preMailer->getHtml()); if(null !== $generatedText = $this->preMailer->getText()) { switch ($message->getContentType()) { case 'text/html': $message->addPart($generatedText); break; case 'multipart/alternative': $message->getChildren()[0]->setBody($generatedText); break; case 'multipart/mixed': foreach ($message->getChildren() as $child) { // Get alternative text if ($child->getContentType() == 'text/plain') { $child->setBody($generatedText); } } } } // Save the edited message $event->setMessage($message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function getTransactionalEmailCSS()\n {\n $file = Mage::getStoreConfig('markdown/markdown_extra/te_md_css');\n if (empty($file)) {\n return '';\n }\n $content = trim(implode('', @file(Mage::getBaseDir() . DS . $file)));\n if (empty($content)) {\n Mage::log('Markdown CSS file [' . $file . '] is empty!');\n }\n $content = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $content); // comments\n $content = preg_replace('~\\s+~', ' ', $content); // all whitespaces\n $content = preg_replace('~\\s*(:|\\{|\\}|,|;)\\s*~', '\\\\1', $content); // all other whitespaces\n return $content;\n }", "protected function generateCSS() {}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "private function _replace_inline_css()\n\t{\n\t\t// preg_match_all( '/url\\s*\\(\\s*(?![\"\\']?data:)(?![\\'|\\\"]?[\\#|\\%|])([^)]+)\\s*\\)([^;},\\s]*)/i', $this->content, $matches ) ;\n\n\t\t/**\n\t\t * Excludes `\\` from URL matching\n\t\t * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS\n\t\t * @see #685485\n\t\t * @since 3.0\n\t\t */\n\t\tpreg_match_all( '#url\\((?![\\'\"]?data)[\\'\"]?([^\\)\\'\"\\\\\\]+)[\\'\"]?\\)#i', $this->content, $matches ) ;\n\t\tforeach ( $matches[ 1 ] as $k => $url ) {\n\t\t\t$url = str_replace( array( ' ', '\\t', '\\n', '\\r', '\\0', '\\x0B', '\"', \"'\", '&quot;', '&#039;' ), '', $url ) ;\n\n\t\t\tif ( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "public function extractCss()\n {\n $tmp = $this->css;\n $this->css = '';\n return $tmp;\n }", "public function convert(Message $message)\n {\n $content = $message->getBody();\n\n if (preg_match('#\\<style(.*?)\\>(.*?)\\</style\\>#s', $content, $m)) {\n try {\n $ci = new CssToInlineStyles();\n $ci->setHTML(str_replace($m[0], '', $content));\n $ci->setCSS($m[2]);\n\n $message->setBody($ci->convert());\n libxml_clear_errors();\n } catch (\\TijsVerkoyen\\CssToInlineStyles\\Exception $e) {\n\n }\n }\n }", "protected function doConcatenateCss() {}", "public static function css();", "protected function doCompressCss() {}", "public function css();", "public function formatCSS() {\n echo $this->head;\n echo \"<link rel='stylesheet' href='desktop.css'>\";\n }", "function inlineCss($html, $strip_css=false) {\n $params = array();\n $params[\"html\"] = $html;\n $params[\"strip_css\"] = $strip_css;\n return $this->callServer(\"inlineCss\", $params);\n }", "public function css() {\n\t\theader(\"Content-Type: text/css\");\n\t\techo file_get_contents(APPPATH.'third_party/blog/css/mojoblog.css');\n\t}", "private function _print_html_head_css()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t//Check if theme defined\n\t\t$theme = ($this->theme) ? $this->theme : '';\n\t\t\n\t\tforeach($this->css as $style) {\n\t\t\t$skip = FALSE;\n\t\t\t\n\t\t\t$partpath = (strpos($style, '.css') === FALSE) ? \"{$theme}css/{$style}.css\" : \"/{$style}\";\n\t\t\t$fullpath = Ashtree_Common::get_real_path($partpath, TRUE);\n\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\tif (!file_exists($fullpath)) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t\t\n\t\t\t\t$partpath = \"css/{$style}.css\";\n\t\t\t\t$fullpath = ASH_BASEPATH . $partpath;\n\t\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\t\tif (!file_exists($partpath)) {\n\t\t\t\t $skip = TRUE;\n\t\t\t\t} else {\n\t\t\t\t $this->_debug->clear();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($skip) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t} else {\n\t\t\t\t$this->_debug->status('OK');\n\t\t\t\t$fullpath = Ashtree_Common::get_real_path($fullpath);\n\t\t\t\t$output .= \"<link type=\\\"text/css\\\" media=\\\"screen\\\" rel=\\\"stylesheet\\\" href=\\\"{$fullpath}\\\" />\\n\";\n\t\t\t}\n\t\t\t\n\t\t}//foreach\n\t\t\n\t\t$output .= \"<style type=\\\"text/css\\\">\\n\";\n\t\t\n\t\tforeach($this->style as $style) {\n\t\t\t$output .= \"\\t{$style}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"</style>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "function media_theplatform_mpx_extract_all_css_inline($text) {\n $pattern = '/<style.*>(.*)<\\/style>/sU';\n preg_match_all($pattern, $text, $results);\n return $results[1];\n}", "public function cssp()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: text/css');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set css data string\n $results = implode(\"\\n\", $this->vars);\n // send\n echo $results;\n }\n }", "function cc_css() {\n\t// This makes sure that the positioning is also good for right-to-left languages\n\t$x = is_rtl() ? 'left' : 'right';\n\n\techo \"\n\t<style type='text/css'>\n\t#content_commander_logo {\n\t\tfloat: $x;\n\t\tpadding-$x: 2px;\n\t\tpadding-top: 2px;\t\t\n\t\tmargin: 0;\n\t\theight: 22px;\n\t}\n #arb_html {\n width: 50%; \n min-height: 300px;\n }\n\t</style>\n\t\";\n}", "public static function smtp_inner () \n { \n $html = null;\n\n $top = __( 'SMTP Send : Message', 'default-message' );\n $inner = self::smtp_inner_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'smtp', $top, $inner, $bottom );\n\n return $html;\n }", "private function addHtmlToComments( $body )\r\n {\r\n $this->model->action('common','textTextileParser',\r\n array('content' => & $body));\r\n return $body;\r\n }", "public function renderCSS()\n {\n }", "public function getConcatenateCss() {}", "public function customCSS() {\n\n\t if ( isset( $this->options['customCSS'] ) ){\n\n\t \t$content = \"<style type='text/css'>\\n\";\n\t \t$content .= $this->options['customCSS'].\"\\n\";\n\t \t$content .= \"</style>\";\n\n\t \techo $content;\n\t }\n\t}", "public function inline_css(){\n\n /*\n * @AgreablePollPlugin is a Twig namespace which Herbert generates from\n * values in herbert.config.php.\n * @see http://twig.sensiolabs.org/doc/api.html#loaders\n *\n * Using get_field() which is an ACF function to retrieve theme\n * specific options affecting the style of the quiz.\n * ACF definitions for Panel are in app/panels.php.\n */\n $ns = Helper::get('agreable_namespace');\n echo view('@AgreablePollPlugin/styles.twig', [\n 'common_css_path' => Helper::asset('styles.css'),\n 'plugin_settings_property_primary_colour' => get_field($ns.'_plugin_settings_property_primary_colour', 'option'),\n 'plugin_settings_property_secondary_colour' => get_field($ns.'_plugin_settings_property_secondary_colour', 'option'),\n 'plugin_settings_property_font_family' => get_field($ns.'_plugin_settings_property_font_family', 'option'),\n 'plugin_settings_free_text' => get_field($ns.'_plugin_settings_free_text_css', 'option'),\n ])->getBody();\n }", "function beaver_extender_fe_css_echo() {\n\n\t$output = '';\n $custom_css = beaver_extender_preserve_backslashes( beaver_extender_get_custom_css( 'custom_css' ) );\n\n\tif ( $custom_css != '' )\n\t\t$output .= $custom_css . \"\\n\";\n\t\n\t$output = \"\\n\\n<!-- Begin echoed Beaver Extender Custom CSS -->\\n<style id=\\\"beaver-extender-custom-css-echo\\\" type=\\\"text/css\\\">\\n\" . beaver_extender_preserve_backslashes( $output ) . \"</style>\\n<!-- End echoed Beaver Extender Custom CSS -->\\n\";\n\n\tif ( beaver_extender_get_settings( 'responsive_enabled' ) ) {\n\t\t\n\t\t$media_query_css = '\n@media only screen and (max-width: ' . beaver_extender_get_responsive( 'media_query_large_cascading_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_large_cascading_content' ) . '\n}\n@media only screen and (min-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_large_min_width' ) . 'px) and (max-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_large_max_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_large_content' ) . '\n}\n@media only screen and (min-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_medium_large_min_width' ) . 'px) and (max-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_medium_large_max_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_medium_large_content' ) . '\n}\n@media only screen and (max-width: ' . beaver_extender_get_responsive( 'media_query_medium_cascading_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_medium_cascading_content' ) . '\n}\n@media only screen and (min-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_medium_min_width' ) . 'px) and (max-width: ' . beaver_extender_get_responsive( 'beaver_extender_media_query_medium_max_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_medium_content' ) . '\n}\n@media only screen and (max-width: ' . beaver_extender_get_responsive( 'media_query_small_width' ) . 'px) {\n' . beaver_extender_get_responsive( 'media_query_small_content' ) . '\n}';\n\n\t\t$media_query_css = \"\\n<!-- Begin Media Query Custom CSS -->\\n<style id=\\\"media-query-custom-css-echo\\\" type=\\\"text/css\\\">\" . beaver_extender_preserve_backslashes( $media_query_css ) . \"\\n</style>\\n<!-- End Media Query Custom CSS -->\\n\\n\";\n\t\t\n\t} else {\n\t\t\n\t\t$media_query_css = '';\n\t\t\n\t}\n\t\n\techo stripslashes( $output . $media_query_css );\n\t\n}", "function pmpro_send_html( $phpmailer ) {\n\t\n\t//to check if we should wpautop later\n\t$original_body = $phpmailer->Body;\n\t\n\t// Set the original plain text message\n\t$phpmailer->AltBody = wp_specialchars_decode($phpmailer->Body, ENT_QUOTES);\n\t// Clean < and > around text links in WP 3.1\n\t$phpmailer->Body = preg_replace('#<(https?://[^*]+)>#', '$1', $phpmailer->Body);\t\n\t\n\t// If there is no HTML, run through wpautop\t\n\tif($phpmailer->Body == strip_tags($phpmailer->Body))\n\t\t$phpmailer->Body = wpautop($phpmailer->Body);\n\t\n\t// Convert line breaks & make links clickable\n\t$phpmailer->Body = make_clickable ($phpmailer->Body);\n\t\t\n\t// Get header for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_stylesheet_directory() . \"/email_header.html\");\n\telseif(file_exists(get_template_directory() . \"/email_header.html\"))\n\t\t$header = file_get_contents(get_template_directory() . \"/email_header.html\");\n\telse\n\t\t$header = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($header) && $header == strip_tags($header))\n\t\t$header = wpautop($header);\n\t\n\t// Get footer for message if found\n\tif(file_exists(get_stylesheet_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_stylesheet_directory() . \"/email_footer.html\");\n\telseif(file_exists(get_template_directory() . \"/email_footer.html\"))\n\t\t$footer = file_get_contents(get_template_directory() . \"/email_footer.html\");\n\telse\n\t\t$footer = \"\";\n\t\n\t//wpautop header if needed\n\tif(!empty($footer) && $footer == strip_tags($footer))\n\t\t$footer = wpautop($footer);\n\t\n\t// Add header/footer to the email\n\tif(!empty($header))\n\t\t$phpmailer->Body = $header . \"\\n\" . $phpmailer->Body;\n\tif(!empty($footer))\n\t\t$phpmailer->Body = $phpmailer->Body . \"\\n\" . $footer;\n\t\n\t// Replace variables in email\n\tglobal $current_user;\n\t$data = array(\n\t\t\t\t\"name\" => $current_user->display_name,\n\t\t\t\t\"sitename\" => get_option(\"blogname\"),\n\t\t\t\t\"login_link\" => pmpro_url(\"account\"),\n\t\t\t\t\"display_name\" => $current_user->display_name,\n\t\t\t\t\"user_email\" => $current_user->user_email,\n\t\t\t\t\"subject\" => $phpmailer->Subject\n\t\t\t);\n\tforeach($data as $key => $value)\n\t{\n\t\t$phpmailer->Body = str_replace(\"!!\" . $key . \"!!\", $value, $phpmailer->Body);\n\t}\t\n\t\t\n\tdo_action(\"pmpro_after_phpmailer_init\", $phpmailer);\n\tdo_action(\"pmpro_after_pmpmailer_init\", $phpmailer);\t//typo left in for backwards compatibility\n}", "function custom_edd_email_styles( $which ) {\n\tob_start();\n\n\tswitch( $which ) {\n\t\tdefault:\n\t\tcase 'receipt':\n\t\t\t$styles = include 'receipt.css';\n\t\t\tbreak;\n\t}\n\n\treturn ob_get_clean();\n}", "protected function renderStylesheet(){\n \n return sprintf(\n '<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" media=\"%s\">',\n $this->getField('url'),\n $this->getField('media','screen, projection')\n );\n \n }", "public function build_css() {\n\t\t\t\n\t\t}", "function createstring_CSSForHeader($HTML) {\n return $HTML . strip_tags($this->addon->options['custom_css']);\n }", "public function print_inline_css() {\n\t\t?>\n\t\t<style>\n\t\t#wcp-list-table .manage-column.column-payment {\n\t\t\twidth: 30%;\n\t\t}\n\n\t\t#wcp-list-table .manage-column {\n\t\t\twidth: 10%;\n\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "function output_css() {\n\t\t\techo $this->get_css();\n\t\t}", "public function CssOutsideOfHead()\n\t\t{\n\t\t\t//1) the link tag is used with an external css file outside of head (a rare mistake which may work in some browsers) and\n\t\t\t//2) style tags are found in the body, that aren't inline\n\n\t\t\t//for now, we'll just\n\n\t\t\tglobal $ft_dom;\n\n\t\t\t$code = array('');\n\n\t\t\t$body = $ft_dom->getElementsByTagName('body');\n\n\t\t\t//assuming there is one body tag. IMPROVE.\n\t\t\t//$elements = $body->item(0)->getElementsByTagName('link');\n\n\t\t\tforeach( $body as $body_test ) \n\t\t\t{\n\t\t\t\t//1)\n\t\t\t\t$elements = $body_test->getElementsByTagName('link'); \n\t\t foreach ($elements as $element) { \n\t\t\t\t\tif ($element->hasAttribute('href')) {\n\t\t\t\t\t\tif(strripos($element->getAttribute('href'),'.css') == (strlen($element->getAttribute('href')) - 4) && strpos($element->getAttribute('href'),'jquery') == false) {\n\t\t\t\t\t\t\t$code[0] .= Helper::printCodeWithLineNumber($element);\n\t\t\t\t\t\t\treturn $code;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//2)\n\t\t\t\t/*\n\t\t\t\t$style_tags = $body_test->getElementsByTagName('style'); \n\t\t if($style_tags->length != 0) {\n\t\t\t\t\t//only kick off this result if there is quite a bit of css inline\n\t\t\t\t\t$code[0] .= Helper::printCodeWithLineNumber($style_tags->item(0));\n\t\t\t\t\treturn $code;\t\t\n\t\t\t\t}\t\n\t\t\t\t*/\t\t\n\t\t\t}\t\t\n\n\t\t\t//$code = Helper::testForElement('style');\t\t\n\n\t\t\treturn false;\n\t\t}", "public function enableConcatenateCss() {}", "function css()\n {\n # determine the media\n global $TMPL;\n $media = ( $temp = $TMPL->fetch_param('media') ) ? 'media=\"' . $temp . '\"' : '';\n \n return ( '<link rel=\"stylesheet\" type=\"text/css\" ' . $media .\n ' href=\"http://gist.github.com/stylesheets/gist/embed.css\" />' );\n }", "function tlh_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function wpgrade_gallery_style($css) {\r\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\r\n}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "function boiler_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "private function _compile_css(){\n\t\t$compiled_css = \"\";\n\t\tforeach($this->css as $css_file){\n\t\t\t$compiled_css .= \"\\t<link rel=\\\"stylesheet\\\" href=\\\"\".$this->assets_url('css').\"/{$css_file}.css\\\" />\\n\";\n\t\t}\n\t\t\n\t\tif ($compiled_css == \"\") return \"\";\n\n\t\treturn \"<!-- START Compiled CSS -->\\n\".$compiled_css.\"\\t<!-- END Compiled CSS -->\\n\";\n\t}", "function bones_gallery_style($css)\n{\n\treturn preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "private static function inject_styles( $content ) {\n\t\tif ( class_exists( 'Emogrifier' ) ) {\n\t\t\ttry {\n\t\t\t\t$emogrifier = new Emogrifier( $content, self::get_styles() );\n\t\t\t\t$content = $emogrifier->emogrify();\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\ttrigger_error( 'Unable to inject styles into email notification: ' . $e->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $content;\n\t}", "function ft_hook_add_css() {}", "public function getCSS()\n {\n ob_start();\n ?>\n div.webFormHelpBox {\n position: absolute;\n left: 320px;\n top: 330px;\n width: 200px;\n font-family: Arial, Verdana, sans-serif;\n font-size: 8pt;\n line-height: 8pt;\n font-weight: normal;\n background-color: #f7f7f7;\n border: 1px solid #cccccc;\n padding: 8px;\n visibility: hidden;\n }\n div.webFormErrorBox {\n position: absolute;\n left: 320px;\n top: 330px;\n width: 200px;\n font-family: Arial, Verdana, sans-serif;\n font-size: 8pt;\n line-height: 8pt;\n font-weight: normal;\n background-color: #fddbdb;\n border: 1px solid #9a1515;\n padding: 8px;\n visibility: hidden;\n color: #000000;\n }\n td.wfErrorText {\n font-family: Arial, Verdana, sans-serif;\n font-size: 12px;\n font-weight: normal;\n color: #000000;\n line-height: 14px;\n }\n div.webFormCaption {\n font-size: 8pt;\n color: #888888;\n line-height: 10pt;\n font-family: Arial, Verdana, sans-serif;\n text-align: left;\n width: 150px;\n padding: 2px;\n display: none;\n }\n span.webFormVerifyText {\n font-family: Arial, Verdana, sans-serif;\n font-size: 9pt;\n font-weight: normal;\n }\n input.webFormSaveButton {\n font-family: Arial, Verdana, sans-serif;\n font-size: 7pt;\n font-weight: bold;\n }\n div.webFormVerifyFieldContainer {\n padding: 1px;\n background-color: #f0f0f0;\n border: 1px solid #c0c0c0;\n }\n div.webFormVerifyFieldContainerBox {\n padding: 1px;\n background-color: #f0f0f0;\n border: 1px solid #c0c0c0;\n /*height: 63px;*/\n }\n a.webFormVerifyFieldLink {\n font-family: Arial, Verdana, sans-serif;\n font-size: 10pt;\n font-weight: normal;\n text-decoration: none;\n color: #000000;\n }\n input:hover {\n background-color: #f2f2f2;\n }\n textarea:hover {\n background-color: #f2f2f2;\n }\n\n /* Elements <input>-type items */\n <?php if ($this->_verifyForm) { ?>\n .webFormElementText {\n padding: 3px 0px 2px 18px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementTextBox {\n padding: 0px 0px 0px 0px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementSelect {\n\n }\n <?php } else { ?>\n .webFormElementText {\n padding: 3px 0px 2px 3px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementTextBox {\n padding: 0px 0px 0px 0px;\n background-color: #ffffff;\n border: 1px solid #c0c0c0;\n }\n .webFormElementSelect {\n\n }\n <?php } ?>\n\n <?php\n $css = ob_get_contents();\n ob_end_clean();\n\n return $css;\n }", "function hellopro_css_output() {\n\n\t$css = '';\n\n\t$css .= '/* ----------------- // ADD CUSTOM STYLES INLINE // ----------------- */\n\t';\n\n\t$css .= '\t/* CUSTOM FONT SIZES */\n\t\t';\n\t$css .= hello_pro_inline_font_sizes();\n\n\t$css .= '\n\t';\n\n\t$css .= '\t/* APPLY CUSTOMIZER COLORS TO BLOCKS */\n\t\t';\n\t$css .= hello_pro_inline_color_palette();\n\n\t$css .= '\n\t';\n\n\tif ( $css ) {\n\t\twp_add_inline_style( CHILD_THEME_HANDLE, $css );\n\t}\n\n}", "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}", "function loadCSS() {\n\t\t$first = true;\n\t\t$cssPart = '';\n\t\tforeach( $this->conf->css->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$cssPart .= chr( 9 );\n\t\t\t}\n\t\t\t$cssPart .= '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"';\n\t\t\t$cssPart .= $this->conf->path->baseUrl . $this->conf->path->css . $file;\n\t\t\t$cssPart .= '\" />' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalCSS ) >= 1 ) {\n\t\t\tforeach( $this->additionalCSS as $key => $value ) {\n\t\t\t\t$cssPart .= '<style type=\"text/css\">' . chr( 10 );\n\t\t\t\t$cssPart .= $value . chr( 10 );\n\t\t\t\t$cssPart .= '</style>' . chr( 10 );\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn $cssPart;\n\t}", "function admin_css() {\n?>\n<style type=\"text/css\">\n\t.plugin-update-tr .update-message-ignore {\n\t\tmargin: 5px;\n\t\tpadding: 3px 5px;\n\t\tborder-width: 1px;\n\t\tborder-style: solid;\n\t\t-moz-border-radius: 5px;\n\t\t-khtml-border-radius: 5px;\n\t\t-webkit-border-radius: 5px;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #ffebe8;\n\t\tborder-color: #c00;\n\t\tfont-weight: bold;\n\t}\n\t.error a {\n\t\tcolor: #c00;\n\t}\n</style>\n<?php\n\t}", "function spartan_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "private function css($content)\n\t{\n\t\trequire_once __DIR__ . '/thirdparty/cssmin.php';\n\t\treturn \\CssMin::minify($content);\n\t}", "public function print_preview_css()\n {\n }", "function queue_css_url($url, $media = 'all', $conditional = false)\n{\n get_view()->headLink()->appendStylesheet($url, $media, $conditional);\n}", "public function inline_css() { ?>\n\n\t\t\t<style type=\"text/css\">\n\t\t\t\tbody #wprt-add-widget h3 { text-align: center !important; padding: 15px 7px; font-size: 1.3em; margin-top: 5px; }\n\t\t\t\tbody div#widgets-right .sidebar-wprt-custom .widgets-sortables { padding-bottom: 45px }\n\t\t\t\tbody div#widgets-right .sidebar-wprt-custom.closed .widgets-sortables { padding-bottom: 0 }\n\t\t\t\tbody .wprt-widget-area-footer { display: block; position: absolute; bottom: 0; left: 0; height: 40px; line-height: 40px; width: 100%; border-top: 1px solid #e4e4e4; }\n\t\t\t\tbody .wprt-widget-area-footer > div { padding: 8px 8px 0 }\n\t\t\t\tbody .wprt-widget-area-footer .wprt-widget-area-id { display: block; float: left; max-width: 48%; overflow: hidden; position: relative; top: -6px; }\n\t\t\t\tbody .wprt-widget-area-footer .wprt-widget-area-buttons { float: right }\n\t\t\t\tbody .wprt-widget-area-footer .description { padding: 0 !important; margin: 0 !important; }\n\t\t\t\tbody div#widgets-right .sidebar-wprt-custom.closed .widgets-sortables .wprt-widget-area-footer { display: none }\n\t\t\t\tbody .wprt-widget-area-footer .wprt-widget-area-delete { display: block; float: right; margin: 0; }\n\t\t\t\tbody .wprt-widget-area-footer .wprt-widget-area-delete-confirm { display: none; float: right; margin: 0 5px 0 0; }\n\t\t\t\tbody .wprt-widget-area-footer .wprt-widget-area-delete-cancel { display: none; float: right; margin: 0; }\n\t\t\t\tbody .wprt-widget-area-delete-confirm:hover:before { color: red }\n\t\t\t\tbody .wprt-widget-area-delete-confirm:hover { color: #333 }\n\t\t\t\tbody .wprt-widget-area-delete:hover:before { color: #919191 }\n\t\t\t\tbody .activate_spinner { display: block !important; position: absolute; top: 10px; right: 4px; background-color: #ECECEC; }\n\t\t\t\tbody #wprt-add-widget form { text-align: center }\n\t\t\t\tbody #widget_area-wprt-custom,\n\t\t\t\tbody #widget_area-wprt-custom h3 { position: relative }\n\t\t\t\tbody #wprt-add-widget p { margin-top: 0 }\n\t\t\t\tbody #wprt-add-widget { margin: 10px 0 0; position: relative; }\n\t\t\t\tbody #wprt-add-widget-input { max-width: 95%; padding: 8px; margin-bottom: 14px; margin-top: 3px; text-align: center; }\n\t\t\t</style>\n\n\t\t<?php }", "private function getHtmlBody(): string\n {\n return <<<EOT\n<div>A div tag</div>\n<script></script> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<link rel=\"stylesheet\"> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\n<h1>A heading</h1>\n<style></style> // This tag should have a `nonce` attribute added\n<div>A div tag</div>\nEOT;\n }", "function po_gallery_style($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/fix-ie.css\" />';\n if ($language->direction == LANGUAGE_RTL) {\n $iecss .= '<style type=\"text/css\" media=\"all\">@import \"'. base_path() . path_to_theme() .'/fix-ie-rtl.css\";</style>';\n }\n\n return $iecss;\n}", "public function include_css($env) {\n global $CFG;\n $css = '';\n $cssurl = $CFG->dirroot . '/course/format/ludimoodle/motivators/' . $this->get_short_name() . '/styles.css';\n\n // We can't require css like this in format because <head> is already closed\n //$page = $env->get_page();\n //$page->requires->css($cssurl);\n\n // if css is not already in page\n if (file_exists($cssurl) && (!in_array($cssurl, $env->cssinitdata))) {\n // mark that this css is in page\n $env->cssinitdata[] = $cssurl;\n $css = '<style>' . file_get_contents($cssurl) . '</style>';\n }\n return $css;\n }", "public function getCompressCss() {}", "public function update(SplSubject $subject) {\n \n if ( ! empty( $this->css ) ) {\n echo $this->css;\n }\n\n }", "private static final function getCSSHeader () {\r\n $cssHeaderString = new S;\r\n $cssReplaceString = new S ('[%CSS_HREF%]');\r\n $cssPureString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_css.tp');\r\n foreach (self::$objPageCSS as $k => $v) {\r\n $cssHeaderString->appendString (str_replace ($cssReplaceString->toString (),\r\n self::$objPageCSS[$k], $cssPureString->toString ()));\r\n }\r\n // Do return ...\r\n return $cssHeaderString;\r\n }", "public function disableConcatenateCss() {}", "function zilla_custom_css($content) {\n\t\t$zilla_values = get_option( 'zilla_framework_values' );\n\t\tif( array_key_exists( 'style_custom_css', $zilla_values ) && $zilla_values['style_custom_css'] != '' ){\n\t\t\t$content .= '/* Custom CSS */' . \"\\n\";\n\t\t\t\t$content .= stripslashes($zilla_values['style_custom_css']);\n\t\t\t\t$content .= \"\\n\\n\";\n\t\t}\n\t\treturn $content;\n\t\t\n}", "function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}", "protected function compile() {\n\n // set default values for styling preview\n if( $this->isStylePreview ) {\n\n if( !$this->url && !$this->linkTitle ) {\n\n $this->url = '#';\n $this->linkTitle = 'Button';\n }\n\n $this->titleText = $this->titleText?:'Tooltip';\n }\n\n parent::compile();\n\n $this->Template->unique = Helper::getUniqueID($this);\n\n $strStyle = $this->generateStylesheet();\n\n if( strlen($strStyle) ) {\n $GLOBALS['TL_HEAD'][] = '<style>'.$strStyle.'</style>';\n }\n }", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "function bodyContent($type_suffix)\n\t{\n\t\t$temp_layout = $this->controller->layout; // store the current controller layout\n\t\n\t\tif ($type_suffix == 'html')\n\t\t\t $this->controller->layout = '..'.DS.'email';\n\t\telse\n\t\t\t $this->controller->layout = '';\n\t\n\t\t$mail = $this->controller->render($this->templateLocation('_'.strtolower($type_suffix)));\n\t\t// render() automatically adds to the controller->output, we'll remove it\n\t\t$this->controller->output = str_replace($mail, '', $this->controller->output);\n\t\n\t\t$this->controller->layout = $temp_layout; // restore the controller layout\n\t\treturn $mail;\n\t}", "public function add_inline_styles() {\n\n\t\t// echo '<div class=\"revsliderstyles\">';\n\t\techo '<style scoped>';\n\n\t\t$db = new UniteDBRev();\n\n\t\t$styles = $db->fetch( GlobalsRevSlider::$table_css );\n\t\tforeach ( $styles as $key => $style ) {\n\t\t\t$handle = str_replace( '.tp-caption', '', $style['handle'] );\n\t\t\tif ( ! isset( $this->class_include[ $handle ] ) ) { unset( $styles[ $key ] ); }\n\t\t}\n\n\t\t$styles = UniteCssParserRev::parseDbArrayToCss( $styles, \"\\n\" );\n\t\t$styles = UniteCssParserRev::compress_css( $styles );\n\t\techo $styles;\n\n\t\techo '</style>' . \"\\n\";\n\t\t// echo '</div>';\n\t}", "function roots_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "abstract protected function getHtmlBody();", "function mdwpfp_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "public function enableCompressCss() {}", "protected function override_body()\n {\n $sections = $this->sections->get_body()->find_all();\n\n return Blog_Entry_Bodyizer::generate($sections, $this->_object['id']);\n }", "private function processBody($text) {\n $text = $this->processImages($text);\n $text = $this->processLinks($text);\n return $text->html();\n }", "final protected function extract(HTMLView $view) {\n if ($view->externalScripts !== null) {\n foreach ($view->externalScripts as $exScript) {\n $this->addExternalScript($exScript);\n }\n }\n if ($view->externalCSS !== null) {\n foreach ($view->externalCSS as $exCSS) {\n $this->addExternalCSS($exCSS);\n }\n }\n $this->addInlineScript($view->getInlineScripts());\n $this->setPageTitle($view->title);\n $this->customCSS .= ($this->customCSS != \"\" ? \"\\n\" : \"\") . $view->customCSS;\n\t$this->consolidate($view);\n }", "private function wrapHtml($content): string\n {\n return <<<HTML\n<html>\n <head>\n <style>\n body {color: #545454; font:14px/22px ''; margin: 20px;}\n div.message {margin-bottom: 10px; padding: 6px 12px;}\n div.step {display: flex;}\n span.index {display: block; flex: 0 0 20px; padding: 6px 12px;}\n span.detail {display: block; flex: 0 1 auto; padding: 6px 12px;}\n span.execution {color: #B71C1C; display: block;}\n span.argument {color: #545454;}\n span.position {display: block; font-size: 12px;}\n span.file {color: #F57F17;}\n </style>\n </head>\n <body>\n $content\n </body>\n</html>\nHTML;\n }", "public function renderBody()\n {\n $emailBody = $this->_renderer->render(\n $this->config->get('layout_email_push', 'default'),\n array(\n 'order' => $this->getOrder(),\n 'mailer' => $this->_mailer\n )\n );\n\n if (!$this->_isHtml()) {\n $emailBody = JString::trim($emailBody);\n\n // clean up text (experimental)\n //$emailBody = strip_tags($emailBody, '<br><br/>');\n //$emailBody = preg_replace('#<br[/\\s]*>#ius', PHP_EOL, $emailBody);\n //$emailBody = str_replace(array(\"\\n\", \"\\r\", \"\\r\\n\", \"\\n\\r\", PHP_EOL), PHP_EOL, $emailBody);\n }\n\n return $emailBody;\n }", "function ti_wp_foundation_theme_gallery_style($css) {\n return preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function queue_css_string($string, $media = 'all', $conditional = false)\n{\n $attrs = array();\n if ($media) {\n $attrs['media'] = $media;\n }\n if ($conditional) {\n $attrs['conditional'] = $conditional;\n }\n get_view()->headStyle()->appendStyle($string, $attrs);\n}", "function echoCSS()\n{\n\techo <<<CSS\n\nhtml {\n background: #f0f0f0;\n font-size: 62.5%;\n}\n\nbody {\n\tfont-size: 12pt;\n font-family: Calibri, \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n\ttext-rendering: optimizeLegibility;\n\tbackground: transparent;\n\tcolor:#555;\n\twidth:100%;\n\tmax-width:980px;\n\tmargin: 0 auto;\n}\n\n#page-container {\n\tposition:relative;\n\tmargin:5% 0;\n\tbackground: #f9f9f9;\n\tborder: medium solid #ddd;\n}\n\n#header {\n\tcolor: #555;\n\tbackground: #eaeaea;\n\tbackground-clip: padding-box;\n\tmargin-bottom: 0.7em;\n\tborder-bottom: 2px solid #ddd;\n\tpadding:.25em;\n font-size: 24pt;\n\tline-height: 1.2;\n\ttext-align: center;\n}\n\n#footer {\n\tfont-size: 9pt;\n\tcolor: #999;\n\ttext-align: center;\n\tborder-top: 1px solid #ddd;\n\tpadding: 1em 1em;\n\tbackground: #eaeaea;\n\tclear: both;\n}\n\n#footer a {\n\tcolor: #88a;\n\ttext-decoration: none;\n}\n\n#error, .error {\n\tx-display: none;\n\tborder: solid #cc0000;\n\tborder-width: 4px 0;\n\tbackground: rgb(255,255,136);\n\tcolor: #990000;\n\tpadding:1em 2em;\n\tmargin-bottom: 1.15em;\n\ttext-align:center;\n}\n\n#error h3, .error h3 {\n\tmargin: 0;\n\tpadding: 0;\n\tfont-size: 12pt;\n}\n\n.clr {\n\tclear: both;\n}\n\n.circle {\n\tdisplay: block;\n\tfloat: left;\n\tborder-radius: 2em;\n\tborder: 2px solid #e5e5e5;\n\tfont-weight: bold;\n\tfont-size: 14pt;\n\tline-height:1.5em;\n\tcolor: #fff;\n\theight: 1.5em;\n\twidth: 1.5em;\n margin: 0.75em;\n text-align: center;\n background: rgb(35,83,138);\n}\n\n.area-container {\n\tmargin: 1em 2em;\n}\n\n#page2a .area-container {\n\tmargin: 1em 0;\n}\n\n#runInstaller,\n#runCleanup,\n#gotoSite,\n#gotoAdministrator,\n#gotoPostRestorationRroubleshooting {\n margin: 0 2em 1.3em;\n}\n\nh2 {\n\tfont-size: 18pt;\n\tfont-weight: normal;\n line-height: 1.3;\n\tborder: solid #ddd;\n\tborder-left:none;\n\tborder-right:none;\n\tpadding: 0.5em 0;\n background: #eaeaea;\n}\n\n#preextraction h2 {\n\tmargin-top:0;\n\tborder-top:0;\n\ttext-align:center;\n}\n\ninput,\nselect,\ntextarea {\n font-size : 100%;\n margin : 0;\n vertical-align : baseline;\n *vertical-align: middle;\n}\n\nbutton,\ninput {\n line-height : normal;\n\tfont-weight:normal;\n *overflow: visible;\n}\n\ninput,\nselect,\ntextarea {\n\tbackground:#fff;\n\tcolor:#777;\n\tfont-size: 12pt;\n\tborder:1px solid #d5d5d5;\n border-radius: .25em;\n box-sizing: border-box;\n\twidth:50%;\n\tpadding:0 0 0 .5em;\n}\n\ninput[type=\"checkbox\"] {\n\twidth:auto;\n}\n\n.field {\n\theight:1.5em;\n}\n\nlabel {\n\tdisplay:inline-block;\n\twidth:30%;\n\tfont-size: 95%;\n font-weight: normal;\n cursor : pointer;\n\tcolor: #333;\n\tmargin:.5em 0;\n}\n\n.help {\n\twidth: 60%;\n\tmargin-left: 30%;\n\tmargin-bottom: 1.5em;\n\tfont-size: small;\n\tcolor: #888;\n}\n\ninput:focus, input:hover {\n\tbackground-color: #f6f6ff;\n}\n\n.button {\n\tdisplay: inline-block;\n\tmargin: 1em .25em;\n\tpadding: 1em 2em;\n\tbackground: #2cb12c;\n\tcolor:#fff;\n\tborder: 1px solid #ccc;\n\tcursor: pointer;\n\tborder-radius: .25em;\n \ttransition: 0.3s linear all;\n}\n\n#checkFTPTempDir.button,\n#resetFTPTempDir.button,\n#testFTP.button,\n#browseFTP,\n#reloadArchives,\n#notWorking.button {\n\tpadding: .5em 1em;\n}\n\n.button:hover {\n\tbackground: #259625;\n}\n\n.button:active {\n\tbackground: #3c3;\n\tborder: 1px solid #eaeaea;\n\tborder-radius: .25em;\n}\n\n#notWorking.button, .bluebutton {\n\ttext-decoration: none;\n\tbackground: #66a8ff;\n}\n#notWorking.button:hover, .bluebutton:hover {\n\tbackground: #4096ee;\n}\n#notWorking.button:active, .bluebutton:active {\n\tbackground: #7abcff;\n}\n\n.loprofile {\n\tpadding: 0.5em 1em;\n\tfont-size: 80%;\n}\n\n.black_overlay{\n\tdisplay: none;\n\tposition: absolute;\n\ttop: 0%;\n\tleft: 0%;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: black;\n\tz-index:1001;\n\t-moz-opacity: 0.8;\n\topacity:.80;\n\tfilter: alpha(opacity=80);\n}\n\n.white_content {\n\tdisplay: none;\n\tposition: absolute;\n\tpadding: 0 0 1em;\n\tbackground: #fff;\n\tborder: 1px solid #ddd;\n\tborder: 1px solid rgba(0,0,0,.3);\n\tz-index:1002;\n\toverflow: hidden;\n}\n.white_content a{\n\tmargin-left:4em;\n}\nol {\n\tmargin:0 2em;\n\tpadding:0 2em 1em;\n}\nli {\n\tmargin : 0 0 .5em;\n}\n\n#genericerror {\n\tbackground-color: #f0f000 !important;\n\tborder: 4px solid #fcc !important;\n}\n\n#genericerrorInner {\n\tfont-size: 110%;\n\tcolor: #33000;\n}\n\n#warn-not-close, .warn-not-close {\n\tpadding: 0.2em 0.5em;\n\ttext-align: center;\n\tbackground: #fcfc00;\n\tfont-size: smaller;\n\tfont-weight: bold;\n}\n\n#progressbar, .progressbar {\n\tdisplay: block;\n\twidth: 80%;\n\theight: 32px;\n\tborder: 1px solid #ccc;\n\tmargin: 1em 10% 0.2em;\n\tborder-radius: .25em;\n}\n\n#progressbar-inner, .progressbar-inner {\n\tdisplay: block;\n\twidth: 100%;\n\theight: 100%;\n\tbackground: #4096ee;\n}\n\n#currentFile {\n\tfont-family: Consolas, \"Courier New\", Courier, monospace;\n\tfont-size: 9pt;\n\theight: 10pt;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tbackground: #ccc;\n\tmargin: 0 10% 1em;\n\tpadding:.125em;\n}\n\n#extractionComplete {\n}\n\n#warningsContainer {\n\tborder-bottom: 2px solid brown;\n\tborder-left: 2px solid brown;\n\tborder-right: 2px solid brown;\n\tpadding: 5px 0;\n\tbackground: #ffffcc;\n\tborder-bottom-right-radius: 5px;\n\tborder-bottom-left-radius: 5px;\n}\n\n#warningsHeader h2 {\n\tcolor: black;\n\tborder-top: 2px solid brown;\n\tborder-left: 2px solid brown;\n\tborder-right: 2px solid brown;\n\tborder-bottom: thin solid brown;\n\tborder-top-right-radius: 5px;\n\tborder-top-left-radius: 5px;\n\tbackground: yellow;\n\tfont-size: large;\n\tpadding: 2px 5px;\n\tmargin: 0px;\n}\n\n#warnings {\n\theight: 200px;\n\toverflow-y: scroll;\n}\n\n#warnings div {\n\tbackground: #eeeeee;\n\tfont-size: small;\n\tpadding: 2px 4px;\n\tborder-bottom: thin solid #333333;\n}\n\n#automode {\n\tdisplay: inline-block;\n\tpadding: 6pt 12pt;\n\tbackground-color: #cc0000;\n\tborder: thick solid yellow;\n\tcolor: white;\n\tfont-weight: bold;\n\tfont-size: 125%;\n\tposition: absolute;\n\tfloat: right;\n\ttop: 1em;\n\tright: 1em;\n}\n\n.helpme,\n#warn-not-close {\n\tbackground: rgb(255,255,136);\n\tpadding: 0.75em 0.5em;\n\tborder: solid #febf01;\n\tborder-width: 1px 0;\n\ttext-align: center;\n}\n\n#update-notification {\n\tmargin: 1em;\n\tpadding: 0.5em;\n\tbackground-color: #FF9;\n\tcolor: #F33;\n\ttext-align: center;\n\tborder-radius: 20px;\n\tborder: medium solid red;\n}\n\n.update-notify {\n\tfont-size: 20pt;\n\tfont-weight: bold;\n}\n\n.update-links {\n\tcolor: #333;\n\tfont-size: 14pt;\n}\n\n#update-dlnow {\n\ttext-decoration: none;\n\tcolor: #333;\n\tborder: thin solid #333;\n\tpadding: 0.5em;\n\tborder-radius: 5px;\n\tbackground-color: #f0f0f0;\n}\n\n#update-dlnow:hover {\n\tbackground-color: #fff;\n}\n\n#update-whatsnew {\n\tfont-size: 11pt;\n\tcolor: blue;\n\ttext-decoration: underline;\n}\n\n.update-whyupdate {\n\tcolor: #333;\n\tfont-size: 9pt;\n}\n\n/* FTP Browser */\n.breadcrumb {background-color: #F5F5F5; border-radius: 4px; list-style: none outside none; margin: 0 0 18px; padding: 8px 15px;}\n.breadcrumb > li {display: inline-block; text-shadow: 0 1px 0 #FFFFFF;}\n#ak_crumbs span {padding: 1px 3px;}\n#ak_crumbs a {cursor: pointer;}\n#ftpBrowserFolderList a{cursor:pointer}\n\n/* Bootstrap porting */\n.table {margin-bottom: 18px;width: 100%;}\n.table th, .table td {border-top: 1px solid #DDDDDD; line-height: 18px; padding: 8px; text-align: left; vertical-align: top;}\n.table-striped tbody > tr:nth-child(2n+1) > td, .table-striped tbody > tr:nth-child(2n+1) > th { background-color: #F9F9F9;}\n\n/* Layout helpers\n----------------------------------*/\n.ui-helper-hidden { display: none; }\n.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }\n.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }\n.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: \"\"; display: table; }\n.ui-helper-clearfix:after { clear: both; }\n.ui-helper-clearfix { zoom: 1; }\n.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }\n\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-disabled { cursor: default !important; }\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }\n\n/* Misc visuals\n----------------------------------*/\n\n/* Overlays */\n.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }\n.ui-resizable { position: relative;}\n.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }\n.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }\n.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }\n.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }\n.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }\n.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }\n.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }\n.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }\n.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }\n.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}\n.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */\n.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }\n.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */\nbutton.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */\n.ui-button-icons-only { width: 3.4em; }\nbutton.ui-button-icons-only { width: 3.7em; }\n\n/*button text element */\n.ui-button .ui-button-text { display: block; line-height: 1.4; }\n.ui-button-text-only .ui-button-text { padding: 0; }\n.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }\n.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }\n.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }\n.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }\n/* no icon support for input elements, provide padding by default */\ninput.ui-button { padding: .4em 1em; }\n\n/*button icon element(s) */\n.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }\n.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }\n.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }\n.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }\n.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }\n\n/*button sets*/\n.ui-buttonset { margin-right: 7px; }\n.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }\n\n/* workarounds */\nbutton.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */\n.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }\n.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }\n.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }\n.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; display:none}\n.ui-dialog .ui-dialog-titlebar-close span { display: none; margin: 1px; }\n.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }\n.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }\n.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }\n.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }\n.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }\n.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }\n.ui-draggable .ui-dialog-titlebar { cursor: move; }\n\n/* Component containers\n----------------------------------*/\n.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd; color: #222222; }\n.ui-widget-content a { color: #222222; }\n.ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc ; color: #ffffff; font-weight: bold; }\n.ui-widget-header a { color: #ffffff; }\n\n/* Interaction states\n----------------------------------*/\n.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited {text-decoration: none; }\n.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover{\n background: #4096ee;\n\tbackground: -moz-linear-gradient(top, #4096ee 0%, #60abf8 56%, #7abcff 100%);\n\tbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4096ee), color-stop(56%,#60abf8), color-stop(100%,#7abcff));\n\tbackground: -webkit-linear-gradient(top, #4096ee 0%,#60abf8 56%,#7abcff 100%);\n\tbackground: -o-linear-gradient(top, #4096ee 0%,#60abf8 56%,#7abcff 100%);\n\tbackground: -ms-linear-gradient(top, #4096ee 0%,#60abf8 56%,#7abcff 100%);\n\tbackground: linear-gradient(top, #4096ee 0%,#60abf8 56%,#7abcff 100%);\n}\n.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #1d5987; text-decoration: none; }\n.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; }\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 ; color: #363636; }\n.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }\n.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec ; color: #cd0a0a; }\n.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }\n.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }\n.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }\n.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }\n.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }\n.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */\n\n/* Icons\n----------------------------------*/\n\n/* states and images */\n.ui-icon { display:none}\n\n/* Misc visuals\n----------------------------------*/\n\n/* Corner radius */\n.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; }\n.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; }\n.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }\n.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }\n\n/* Overlays */\n.ui-widget-overlay { background: #000000 ; opacity: .8;filter:Alpha(Opacity=80); }\n.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000 ; opacity: .8;filter:Alpha(Opacity=80); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }\n\n\n.ui-button {\n font-family: Calibri,\"Helvetica Neue\",Helvetica,Arial,sans-serif;\n font-size: 1.4rem;\n\tdisplay: inline-block;\n\tpadding: .5em 1em;\n\tmargin: 1em .25em;\n\tcolor:#fff;\n text-decoration: none;\n\tbackground: #7abcff;\n\tborder: solid #ddd;\n\tcursor: pointer;\n\tborder-radius: .25em;\n \ttransition: 0.3s linear all;\n}\n\nCSS;\n\n\tcallExtraFeature('onExtraHeadCSS');\n}", "function phptemplate_get_ie_styles() {\n global $language;\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"' . base_path() . path_to_theme() . '/fix-ie.css\" />';\n if ($language->direction == LANGUAGE_RTL) {\n $iecss .= '<style type=\"text/css\" media=\"all\">@import \"' . base_path() . path_to_theme() . '/fix-ie-rtl.css\";</style>';\n }\n return $iecss;\n}", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/fix-ie.css\" />';\n\n return $iecss;\n}", "protected function compile()\n\t{\n\n\t\t$this->Template->tweetcontainer = $this->html;\n\n\t}", "function head_content()\n{\n?>\n <style type=\"text/css\">\nb a\t{text-decoration: none;\n\tcolor: #57f;}\nb a:visited {color: #57f;}\n\n.box\t{font-size: 10pt;}\n </style>\n\n <script type=\"text/javascript\">\n </script>\n<?php\n}", "public function write() {\n\t\tcopy($this->_path, str_replace('.css', getDatetime(time(), 'Y-m-d_H-i-s') . '.css', $this->_path));\n\t\t$cssData = preg_replace('/\\/\\*\\* @_START_@ \\*\\/(.*?)\\/\\*\\* @_END_@ \\*\\//s', '/** @_START_@ */\n' . $this->toString() . '\n/** @_END_@ */', $this->_fileContent);\n\t\tfile_put_contents($this->_path, $cssData);\n\t}", "function start_remove_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public static function use_inline_styles(){\n return false;\n }", "protected function compileCss() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function theme_gallery_style($css) {\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\n}", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "function custom_css() {\n\t\t\t$mod = $this->get_cached_mod('customcss');\n\t\t\t$customcss = json_decode($mod, true);\n\t\t\treturn is_array($customcss) && isset($customcss['css']) && '' != $customcss['css'] ? str_replace(array('{', '}'), array(\"{\\n\\t\", \"\\n}\\n\"), trim($customcss['css'])) : $mod;\n\t\t}", "function phptemplate_get_ie_styles() {\n global $language;\n\n $iecss = '<link type=\"text/css\" rel=\"stylesheet\" media=\"all\" href=\"'. base_path() . path_to_theme() .'/css/fix-ie.css\" />';\n\n return $iecss;\n}", "function css($arquivo);", "function yoda_css() {\n\techo \"\n\t<style type='text/css'>\n\t#yoda {\n\t\tfloat: right;\n\t\tpadding: 5px 10px;\n\t\tmargin: 0;\n\t\tfont-size: 12px;\n line-height: 1.6666;\n color: green;\n\n\t}\n\n\t.table{\n\t\ttext-align: center;\n\t}\n\t.rtl #yoda {\n\t\tfloat: left;\n\t}\n\t.block-editor-page #yoda {\n\t\tdisplay: none;\n\t}\n\t@media screen and (max-width: 782px) {\n\t\t#yoda,\n\t\t.rtl #yoda {\n\t\t\tfloat: none;\n\t\t\tpadding-left: 0;\n\t\t\tpadding-right: 0;\n\t\t}\n\t}\n\t</style>\n\t\";\n}" ]
[ "0.64962256", "0.64962256", "0.64962256", "0.64962256", "0.64962256", "0.610543", "0.5855399", "0.5840615", "0.5805651", "0.5801226", "0.5789414", "0.57276225", "0.56321144", "0.5632025", "0.56120867", "0.560823", "0.5575287", "0.55176", "0.55121815", "0.5477666", "0.5432915", "0.54226476", "0.538981", "0.53801197", "0.5349339", "0.53264874", "0.5319814", "0.5281167", "0.52746516", "0.52688175", "0.5262579", "0.5261243", "0.5231299", "0.5230404", "0.5229328", "0.5224245", "0.51946825", "0.5194077", "0.51902074", "0.5177783", "0.5177167", "0.51652265", "0.5163606", "0.51530564", "0.5142252", "0.5141164", "0.51271343", "0.5126223", "0.51121056", "0.5105827", "0.5105665", "0.5101754", "0.5097865", "0.50873286", "0.50847816", "0.50746495", "0.50720936", "0.5060642", "0.5056946", "0.50535464", "0.50526965", "0.50463057", "0.50439", "0.5043109", "0.50382173", "0.50380933", "0.5027337", "0.5025515", "0.502202", "0.5021953", "0.50213045", "0.50196767", "0.50136745", "0.501197", "0.5009217", "0.50086755", "0.500259", "0.49974757", "0.49963433", "0.4995279", "0.498765", "0.49835628", "0.49825168", "0.49811345", "0.4979171", "0.49744868", "0.49726787", "0.49689192", "0.49631628", "0.49617285", "0.49616244", "0.49616244", "0.49616244", "0.4961581", "0.49573833", "0.49543098", "0.4947339", "0.49468914", "0.4944901", "0.49414042", "0.49338332" ]
0.0
-1
Create a new message instance.
public function __construct($tituloCorreo, $usuario, $destinatario, $mensaje, $filename, $asunto) { // $this->tituloCorreo = $tituloCorreo; $this->usuario = $usuario; $this->destinatario = $destinatario; $this->mensaje = $mensaje; $this->filename = $filename; $this->asunto = $asunto; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createMessage()\n {\n $message = new Message(new Swift_Message);\n\n\n // If a global from address has been specified we will set it on every message\n // instances so the developer does not have to repeat themselves every time\n // they create a new message. We will just go ahead and push the address.\n if (isset($this->from['address'])) {\n $message->from($this->from['address'], $this->from['name']);\n }\n\n return $message;\n }", "protected function createMessage() {\n $config = $this->messageConfig;\n if (!array_key_exists('class', $config)) {\n $config['class'] = $this->messageClass;\n }\n $config['smser'] = $this;\n return Yii::createObject($config);\n }", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "private function newMessage()\n {\n /* @var $config ModuleOptions */\n $config = $this->serviceLocator->get('EscoMail\\Options');\n\n $this->message = new Message();\n $this->message->setFrom($config->getMailSendFrom(), $config->getMailSendFromName());\n\n return $this->message;\n }", "protected function createMessage()\n\t{\n\t\t$config = $this->messageConfig;\n\t\tif (!array_key_exists('class', $config)) {\n\t\t\t$config['class'] = $this->messageClass;\n\t\t}\n\t\t$config['mailer'] = $this;\n\n\t\treturn Yii::createObject($config);\n\t}", "public function createMessage(): MessageInterface;", "public function create(string $message = ''): BusMessageInterface;", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public static function createInstance()\n {\n return new MailMessage('[email protected]');\n }", "public static function init( $_id )\n {\n $message = new Message();\n $message->get( $_id );\n return $message;\n }", "public function createMessage(string $typeName): MessageInterface;", "public function createMailMessage();", "static public function factory($messageType = 3) {\n\t\treturn new self($messageType);\n\t}", "public function createMessage(array $parameters = []);", "public function user_message_create() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\tif ($this->valide_userid () == false) {\n\t\t\treturn $this;\n\t\t}\n\t\t$message_created = $this->getObjetO365Wsclient ()\n\t\t\t->jsonPostMethod ( '/users/' . $this->getUserId () . '/messages', $this->getEmailContent () );\n\t\t$this->onDebug ( $message_created, 2 );\n\t\tif (isset ( $message_created->id ) && ! empty ( $message_created->id )) {\n\t\t\treturn $this->setO356MessageRef ( $message_created )\n\t\t\t\t->setMessageId ( $message_created->id );\n\t\t}\n\t\treturn $this->onError ( 'Pas d\\'ID durant la creation du message de O365', $message_created, 1 );\n\t}", "private function newMessage(array $data)\n {\n\n $message = Message::create([\n 'channel_id' => $data['channel_id'],\n 'user_id' => Auth::guard()->user()->id,\n 'message' => $data['message']\n ]);\n if ($message) {\n $this->notifyChannelUsers($data['channel_id']);\n }\n return $message;\n }", "public function initMessage() {}", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "private function createMessageObject(string $type, string $message): Notification\n {\n $msg = new Notification();\n\n $msg->setType($type);\n $msg->setMessage($message);\n\n $this->handler->add($msg);\n\n return $msg;\n }", "protected static function newFactory()\n {\n return MessageFactory::new();\n }", "public function message(mixed $data = null)\n {\n $message = new Message((string) $data);\n\n return $message;\n }", "public static function createFromString($raw)\n {\n $message = new self(array('raw' => $raw));\n return $message;\n }", "public static function create(string $text = null): GoogleChatMessage\n {\n $message = new static;\n\n if ($text) {\n $message->text($text);\n }\n\n return $message;\n }", "public function create() {\n\t\t$user = $this->current_user();\n\t\t$message = $this->discussion->create_message($this->message_data() + ['creator' => ['id' => $user->_id, 'name' => $user->name]]);\n\n\t\tif ($this->discussion->push_message($message)) {\n\t\t\treturn $this->redirect(['Discussions::show', 'id' => $this->discussion->_id, 'project_id' => $this->discussion->project_id]);\n\t\t}\n\n\t\treturn compact('message');\n\t}", "public static function createFromArray($fields) \n\t{\n\t\t$message = new Message();\n\t\tself::populate($message,$fields);\n\t\treturn $message;\n\t}", "public function addMessage()\n {\n if(null === $this->obj_message) {\n $this->obj_message = new Message();\n }\n return $this->obj_message;\n }", "public function createMimeMessage();", "public function testCreateMethodReturnsNewInstance(): void\n {\n $message = DiscordMessage::create();\n $this->assertInstanceOf(DiscordMessage::class, $message);\n }", "function createMessage($email) {\n $message = new Google_Service_Gmail_Message();\n $message->setRaw(base64_encode($email));\n return $message;\n}", "protected function createMessage(Swift_Message $message)\n {\n $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset());\n $mimeEntity->setChildren($message->getChildren());\n\n $messageHeaders = $mimeEntity->getHeaders();\n $messageHeaders->remove('Message-ID');\n $messageHeaders->remove('Date');\n $messageHeaders->remove('Subject');\n $messageHeaders->remove('MIME-Version');\n $messageHeaders->remove('To');\n $messageHeaders->remove('From');\n\n return $mimeEntity;\n }", "public function __construct($message)\n {\n // $this->message = $message;\n }", "function createMessage($object) {\n\tglobal $USER;\n\t\n\t$message = new \\core\\message\\message();\n\t$message->component = 'local_littlehelpers';\n\t$message->name = 'paragraph52notification';\n\t$message->userfrom = $USER;\n\t\n\t// Get user\n\t$message->userto = core_user::get_user($object->useridto);\n\t\n\t// force email sending\n\t$message->userto->emailstop = 0;\n\t\n\t$message->subject = $object->subject;\n\t$message->fullmessage = $object->fullmessage;\n\t$message->fullmessageformat = FORMAT_MARKDOWN;\n\t$message->fullmessagehtml = $object->fullmessagehtml;\n\t$message->smallmessage = $object->smallmessage;\n\t$message->notification = '0';\n\t\n\t$message->contexturl = 'https://moodle.tu-darmstadt.de/local/littlehelpers/paragraph52';\n\t$message->contexturlname = 'Paragraph52';\n\t$message->replyto = \"[email protected]\";\n\n\treturn $message;\n}", "public function __construct($message)\r\n {\r\n $this->message = $message;\r\n\r\n }", "public function createMessage($content, $options = array('content_type' => 'application/json', 'delivery_mode' => 2))\n {\n if (!empty($options['content_type']) && $options['content_type'] == 'application/json')\n $content = json_encode($content);\n return new AMQPMessage($content, $options);\n }", "public function __construct($message) {\n $this->message= $message;\n }", "public function __construct($msg)\n {\n $this->message = $msg;\n }", "public function __construct(Message $message)\n {\n parent::__construct($message);\n }", "public function __construct($messageDefinition)\n {\n $this->messageDefintion = $messageDefinition;\n }", "public function testCreateMessage()\n {\n $config = new Configuration();\n// $config->setHost(\"http://127.0.0.1:8080\");\n $apiInstance = new DaDaPushMessageApi(\n // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n // This is optional, `GuzzleHttp\\Client` will be used as default.\n new \\GuzzleHttp\\Client(),\n $config\n );\n\n $actions = [\n new Action($data = array(\"name\" => \"view\", \"url\" => \"https://www.dadapush.com/\", \"type\" => \"link\"))\n ];\n\n $body = new MessagePushRequest($data = array(\"title\" => \"Good News!\",\n \"content\" => \"Good News! DaDaPush releasing new version\",\n \"need_push\" => true,\n \"actions\" => $actions\n ));\n\n $channel_token = 'ctb3lwO6AeiZOwqZgp8BE8980FdNgp0cp6MCf';\n\n $result = $apiInstance->createMessage($body, $channel_token);\n print_r($result);\n self::assertTrue($result->getCode()==0);\n }", "public static function create( $msg, $code = null, array $data = null ) {\n\t\tif ( $msg instanceof IApiMessage ) {\n\t\t\treturn $msg;\n\t\t} elseif ( $msg instanceof RawMessage ) {\n\t\t\treturn new ApiRawMessage( $msg, $code, $data );\n\t\t} else {\n\t\t\treturn new ApiMessage( $msg, $code, $data );\n\t\t}\n\t}", "public static function create($message, $type = '', $title = '', $icon = '')\n {\n return new self($message, $type, $title, $icon);\n }", "public function newEntity(array $attributes = [])\n {\n return new MessageContent($attributes);\n }", "public function create()\n {\n return view('materialadmin::message.create');\n }", "public static function factory($raw_message = null, $class_name = null) {}", "public function __construct($message = null) {}", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public static function createFromFile($filename)\n {\n $message = new self(array('file' => $filename));\n\n return $message;\n }", "public function create()\n\t{\n\t\treturn View::make('messages.create');\n\t}", "public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function createMessage(InputInterface $input)\n {\n $message = new \\Swift_Message(\n $input->getOption('subject'),\n $input->getOption('body'),\n $input->getOption('content-type'),\n $input->getOption('charset')\n );\n $message->setFrom($input->getOption('from'));\n $message->setTo($input->getOption('to'));\n\n return $message;\n }", "public function test_message_can_be_created() {\n\n $this->assertInstanceOf(Message::class, $this->message);\n $this->assertDatabaseHasMessageWithPublicId($this->message->getPublicId());\n\n }", "protected function getMessage()\n {\n //return new \\Swift_Message('Test subject', 'Test body.');\n }", "public function testConstructorAndGetters() \r\n \t{\r\n \t\t// create a message with complete constructor args\r\n \t\t$message = new Message( Message::NORMAL, \r\n \t\t\t\t\t\t\t\t(object)array( 'testProp' => 'testval' ),\r\n \t\t\t\t\t\t\t\tsimplexml_load_string('<testMessage testAtt=\"Hello\" testAtt2=\"world\"/>'),\r\n \t\t\t\t\t\t\t\tMessage::PRIORITY_HIGH);\r\n \t\t\r\n \t\t// test assertions\r\n \t\t$this->assertTrue( $message instanceof Message, \"Expecting \\$message is Message\" );\r\n \t\t$this->assertTrue( $message->getType() == Message::NORMAL, \"Expecting \\$message->getType() == Message::NORMAL\" );\r\n \t\t$this->assertTrue( $message->getHeader()->testProp == 'testval', \"Expecting \\$message->getHeader()->testProp == 'testval'\" );\r\n \t\t$this->assertTrue( $message->getBody()->attributes()->testAtt == 'Hello', \"Expecting \\$message->getBody()->attributes()->testAtt == 'Hello'\" );\r\n \t\t$this->assertTrue( $message->getPriority() == Message::PRIORITY_HIGH, \"Expecting \\$message->getPriority() == Message::PRIORITY_HIGH\" );\r\n \t\t\r\n \t}", "public function __construct($data)\n {\n $this->message = $data;\n }", "public function __construct($data)\n {\n $this->message = $data;\n }", "public static function getInstance($messageClass = '\\PEIP\\Message\\GenericMessage')\n {\n return new self($messageClass);\n }", "public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }", "public static function createFromFile(string $path) : CommitMessage\n {\n if (!file_exists($path)) {\n throw new \\RuntimeException('Commit message file not found');\n }\n return new CommitMessage(file_get_contents($path));\n }", "public function testCreateWithoutId()\n {\n $faker = Factory::create();\n $messageAttributes = [\n 'body' => $faker->sentence(15),\n 'subject' => $faker->sentence(5),\n 'name' => $faker->name(),\n 'email' => $faker->email(),\n 'custom_info' => $faker->sentence(3)\n\n ];\n $response = $this->client->messages()->create($messageAttributes);\n $this->assertEquals($messageAttributes['body'], $response['message']['body']);\n $this->assertEquals($messageAttributes['subject'], $response['message']['subject']);\n\n return $response;\n }", "public function create(Message $message): void\n {\n $this->items[$message->getEventName()][$message->getId()] = $message;\n }", "public function __construct($message, $type)\n\t{\n\t\t$this->message = $message;\n\t\t$this->type = $type;\n\t}", "public function __construct(MimeMessage $message = null) {\n $this->htmlBody = new MimePart();\n $this->htmlBody->type = Mime::TYPE_HTML;\n $this->htmlBody->charset = 'utf-8';\n $this->htmlBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n\n $this->textBody = new MimePart();\n $this->textBody->type = Mime::TYPE_TEXT;\n $this->textBody->charset = 'utf-8';\n $this->textBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n }", "public function create(){}", "public function actionCreate() {\n if (isset($_POST['Message'])) {\n $resp = array(\n 'color' => '#FF6600',\n 'background_color' => '#FFFFCC',\n 'position' => 'top',\n 'removebutton' => 0,\n 'translation' => $_POST['Message']['translation']\n );\n $model = new Message();\n $model->setAttributes($_POST['Message']);\n if ($model->save()) {\n $resp['message'] = Yii::t('translate', 'Message successfully saved');\n $resp['id'] = $model->id;\n } else {\n $errors = $this->errors($model);\n $resp['message'] = Yii::t('translate', '<p>Unable to save the message. Something went wrong!<p/>' . implode('<br/>', $errors));\n }\n echo $this->je($resp);\n Yii::app()->end();\n }\n $id = (int)Yii::app()->request->getParam('id');\n $lang = Yii::app()->request->getParam('lang');\n if ($id && $lang) {\n $model = MessageSource::model()->findByPk($id);\n if ($model) {\n $message = $model->loadMessage();\n $message->id = $model->id;\n $message->language = $lang;\n $this->renderPartial('form', array(\n 'model' => $message\n ));\n } else throw new CHttpException(400);\n } else throw new CHttpException(404, 'The requested page does not exist.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "protected static function newFactory(): Factory\n {\n return MessageFactory::new();\n }", "public function __construct(string $message)\n {\n $this->message = $message;\n }", "public function create()\n {\n return view('message');\n }", "public function newAction()\n {\n $entity = new Message();\n $form = $this->createForm(new MessageType(), $entity);\n\n return $this->render('CoreMarketingBundle:Message:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "protected function createDocument(\\TYPO3\\Jobqueue\\Common\\Queue\\Message $message) {\n\t\t$properties = ObjectAccess::getGettableProperties($message);\n\t\t$messageDocument = new Message($message->getPayload(), $message->getIdentifier());\n\n\t\tforeach ($properties as $propertyName => $propertyValue) {\n\t\t\tObjectAccess::setProperty($messageDocument, $propertyName, $propertyValue);\n\t\t}\n\n\t\treturn $messageDocument;\n\t}", "public function __construct($message = '', $type = 'info') {\n $this->message = $message;\n }", "protected function render(): Message\n {\n $headers = '';\n foreach ($this->buildHeaders() as $header => $value) {\n $headers .= \"{$header}: {$value}\" . self::CRLF;\n }\n $message = implode(self::CRLF, $this->buildMessage());\n\n return new Message($headers, $message);\n }", "public function create()\n\t{\n\t\t$form = \\View::make('message.form');\n\t\t$form->project_id = \\Session::get('active_project');\n\t\t$form->action = array('action' => 'Toomdrix\\Pm\\MessageController@store', 'class'=>'form-signup');\n\t\treturn $form;\n\t}", "public static function getInstance($context=null) {\n return new Messages($context);\n }", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "public function getGeneratedMessage()\n {\n # Force the template to render\n (string) $this->prepareTemplate();\n\n $m = $this->template->__message;\n\n if (!$m->getFrom()) {\n trigger_error(\"You should add 'from' information.\", E_USER_WARNING);\n }\n\n if (!$m->getSubject()) {\n trigger_error(\"You should add 'subject'.\", E_USER_WARNING);\n }\n\n if (!$m->getHeader('To')) {\n trigger_error(\"You should add recipients.\", E_USER_WARNING);\n }\n\n foreach ($this->attachments as $attachment) {\n list($filename, $content, $type) = $attachment;\n $m->addAttachment($filename, $content, $type);\n }\n\n return $m;\n }", "public function __construct($message='1111222333',$type='2222')\n {\n $this->type = $type;\n $this->message = $message;\n }", "public static function new()\n {\n if ( ! empty($_REQUEST['mgb_rating_message']) ) Database::insert([\n 'message' => $_REQUEST['mgb_rating_message'],\n 'author' => self::author(),\n 'state' => (!json_decode($_REQUEST['mgb_rating_moderation'])) ? true : false\n ]);\n }", "public function create() {}", "public function compose() {\n return $this->createMessage();\n }", "public function create()\n {\n // die('here');\n return view('message.create');\n }", "public function create()\n {\n return view('messages.create');\n }", "public function create()\n {\n return view('messages.create');\n }", "public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save())\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public static function getInstanceFromMessage(\\PEIP\\INF\\Message\\Message $message)\n {\n return new self(get_class($message));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'body' => 'required|max:5000',\n 'user_id' => ['required', new NotSelfId(), 'exists:users,id'],\n ]);\n\n $message = Auth::user()->messages()->create([\n 'data' => [\n 'text' => request('body'),\n ],\n ]);\n\n Auth::user()->conversations()->attach($message, [\n 'contact_id' => $request->user_id,\n ]);\n\n if (!$this->isAuthUserBlockedToContact($request->user_id, Auth::user()->id)) {\n User::find($request->user_id)->conversations()->attach($message, [\n 'contact_id' => Auth::id(),\n ]);\n\n // broadcast the message to the other person\n event(new MessageCreated($message, $request->user_id, Auth::user()->id));\n }\n\n $message->owner = Auth::user();\n\n return new MessageResource($message);\n }", "public function create()\n {\n return view('admin.messages.create');\n }", "public function __construct($message) {\r\n parent::__construct($message);\r\n }", "public function __construct($messageData)\n {\n $this->messageData = $messageData;\n }" ]
[ "0.81376195", "0.7959614", "0.77619994", "0.7713793", "0.76559645", "0.7553059", "0.7458076", "0.71510184", "0.6852663", "0.68347865", "0.67154217", "0.6689976", "0.6683088", "0.6644564", "0.6628052", "0.6549025", "0.6514292", "0.6501647", "0.645071", "0.645071", "0.645071", "0.645071", "0.645071", "0.64457685", "0.63510966", "0.6340597", "0.633213", "0.6326836", "0.6310014", "0.6258695", "0.6234698", "0.62195796", "0.62077796", "0.620518", "0.6204953", "0.6198459", "0.6177945", "0.61717975", "0.617064", "0.6150332", "0.61301666", "0.6109668", "0.61057645", "0.60924155", "0.6081678", "0.60787344", "0.60670817", "0.6049224", "0.60457045", "0.60438704", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6026595", "0.6025895", "0.6022185", "0.6005734", "0.6002389", "0.6000802", "0.59941816", "0.59808266", "0.59808266", "0.59678143", "0.5966462", "0.59593695", "0.594777", "0.5938714", "0.5910345", "0.5893692", "0.5880708", "0.5878038", "0.58748907", "0.58748907", "0.58748907", "0.5873998", "0.5869665", "0.5864223", "0.5860705", "0.5858159", "0.5854505", "0.5845474", "0.5842933", "0.58327615", "0.58256036", "0.58199257", "0.58134514", "0.57909477", "0.5787155", "0.57835746", "0.5783115", "0.57801926", "0.57801926", "0.5779767", "0.57784975", "0.57596684", "0.5748547", "0.5746673", "0.57461363" ]
0.0
-1
Retrieve existing extension attributes object or create a new one.
public function getExtensionAttributes() { return $this->_getExtensionAttributes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes(): ?ItemRequestExtensionInterface;", "public function getExtensionAttributes(): ?ResultExtensionInterface;", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "public function getAdditionalAttributes() {}", "function getAdditionalAttributes() ;", "public function requiresExtendedAttributes($url) \n\t{\n\t\t$this->api->parseUrl($url);\n\t\treturn $this->api->call(['command' => 'GetExtAttributes'])->response();\n\t}", "private function getExtensionsObject()\n {\n if(!is_object($this->extObj) && !($this->extObj instanceof Extensions)) {\n $this->extObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Record\\\\Extensions', $this->confObj);\n }\n }", "public function loadAttributes()\n {\n if (! $this->_attributesLoaded) {\n // send the backend a list of attributes we already have, so the backend can possibly\n // skip re-loading them.\n $presentAttributeNames = array_keys($this->_attributes);\n $newAttributes = $this->_cache->getBackend()->getMissingAttributes($this, $presentAttributeNames);\n $this->_attributes = array_merge($this->_attributes, $newAttributes);\n $this->_attributesLoaded = true;\n }\n return $this;\n }", "public function get($slug)\n\t{\n\t\t// Get the extension.php info\n\t\t$extension = $this->get_extensionphp($slug);\n\n\t\t// If we were given a model, use it. Otherwise,\n\t\t// load it from the database. Either way,\n\t\t// update the extension file.\n\t\tif ($model = Extension::find($slug))\n\t\t{\n\t\t\t// Update the version and enabled flags for the extension.\n\t\t\t$extension['info']['version'] = $model['version'];\n\t\t\t$extension['info']['enabled'] = (bool) $model['enabled'];\n\t\t\t$extension['info']['installed'] = true;\n\t\t\t$extension['info']['has_update'] = $this->has_update($slug);\n\t\t}\n\n\t\tksort($extension['info']);\n\t\treturn $extension;\n\t}", "public function setExtensionAttributes(\\Magento\\Sales\\Api\\Data\\OrderExtensionInterface $extensionAttributes);", "public function testOrderGetExtensionAttributes(): void\n {\n $expectedTax = [\n 'code' => 'US-NY-*-Rate 1',\n 'type' => 'shipping'\n ];\n\n $result = $this->makeServiceCall(self::ORDER_INCREMENT_ID);\n\n $appliedTaxes = $result['extension_attributes']['applied_taxes'];\n self::assertEquals($expectedTax['code'], $appliedTaxes[0]['code']);\n $appliedTaxes = $result['extension_attributes']['item_applied_taxes'];\n self::assertEquals($expectedTax['type'], $appliedTaxes[0]['type']);\n self::assertNotEmpty($appliedTaxes[0]['applied_taxes']);\n self::assertTrue($result['extension_attributes']['converting_from_quote']);\n self::assertArrayHasKey('payment_additional_info', $result['extension_attributes']);\n self::assertNotEmpty($result['extension_attributes']['payment_additional_info']);\n }", "public abstract function getExtension();", "public function setExtensionAttributes(\\Magento\\Tax\\Api\\Data\\AppliedTaxExtensionInterface $extensionAttributes);", "public function getAdditionalAddAttributes(): ?array;", "function GetAttributes();", "protected function fetchAttributes()\n {\n $info = (array)$this->makeSignedRequest('https://api.vk.com/method/users.get.json', array(\n 'query' => array(\n 'uids' => $this->uid,\n //'fields' => '', // uid, first_name and last_name is always available\n 'fields' => 'nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, photo_rec',\n ),\n ));\n\n $info = $info['response'][0];\n\n $this->attributes['id'] = $info->uid;\n $this->attributes['name'] = $info->first_name . ' ' . $info->last_name;\n $this->attributes['url'] = 'http://vk.com/id' . $info->uid;\n\n if (!empty($info->nickname)) {\n $this->attributes['username'] = $info->nickname;\n } else {\n $this->attributes['username'] = 'id' . $info->uid;\n }\n\n $this->attributes['gender'] = $info->sex == 1 ? 'F' : 'M';\n\n $this->attributes['city'] = $info->city;\n $this->attributes['country'] = $info->country;\n\n $this->attributes['timezone'] = timezone_name_from_abbr('', $info->timezone * 3600, date('I'));;\n\n $this->attributes['photo'] = $info->photo;\n $this->attributes['photo_medium'] = $info->photo_medium;\n $this->attributes['photo_big'] = $info->photo_big;\n $this->attributes['photo_rec'] = $info->photo_rec;\n }", "public function getAttributes() {}", "public function getAttributes() {}", "function AddAttr() {\n $db = Core::GetDB();\n\n $title = urldecode(Core::GetFromPOST('title'));\n\n $res = $db->Query(\"SELECT data_xml_item_id FROM data_xml_items WHERE title = ? LIMIT 1\", array(\n array(1, $title, IDBController::PARAM_STR)\n ));\n $id = $res->FetchRow();\n $id = $id[0];\n\n $attrs = array(urldecode(Core::GetFromPOST('attr')));\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "public function setExtensionAttributes(\n \\Pugnet\\Weather\\Api\\Data\\WeatherExtensionInterface $extensionAttributes\n );", "public function getExtension() {\n if ( $this->getExtensionName() === false ) {\n return null;\n } else {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return new ezcReflectionExtension(\n $this->reflectionSource->getExtension()\n );\n } else {\n // using the name, since otherwhise the object would be treated like an\n // external reflection implementation and that would decrease performance\n return new ezcReflectionExtension( parent::getExtensionName() );\n }\n }\n }", "public static function supportedAttributes();", "public function update_extension(){}", "public function getNew($attributes = array());", "protected function _getOpenIdExt($extType, array $propertiesToRequest) {\n\n $ext = null;\n\n if ('ax' == $extType) {\n $ext = new My_OpenId_Extension_AttributeExchange($propertiesToRequest);\n } elseif ('sreg' == $extType) {\n $ext = new Zend_OpenId_Extension_Sreg($propertiesToRequest);\n }\n\n return $ext;\n }", "public function getAttributes() {\n\t\tif(NULL === $this->cachedAttributes) {\n\t\t\t$this->cachedAttributes = [];\n\t\t\tforeach($this->PDO->select(\"SELECT\n SKY_USER_ATTRIBUTE.id,\n valueType,\n SKY_USER_ATTRIBUTE.name,\n SKY_USER_ATTRIBUTE.description,\n icon,\n multiple,\n enabled,\n SKY_USER_ATTRIBUTE_GROUP.name as groupName,\n SKY_USER_ATTRIBUTE_GROUP.description as groupDescription,\n SKY_USER_ATTRIBUTE_GROUP.id as gid\nFROM SKY_USER_ATTRIBUTE\nLEFT JOIN SKY_USER_ATTRIBUTE_GROUP on attr_group = SKY_USER_ATTRIBUTE_GROUP.id\nORDER BY indexing, name\") as $record) {\n\t\t\t\t$attr = AbstractAttribute::create($record);\n\t\t\t\tif ($attr) {\n\t\t\t\t\t$this->cachedAttributes[$record[\"id\"] * 1] = $attr;\n\t\t\t\t\t$this->attributeName2ID[strtolower($record[\"name\"])] = $record[\"id\"] * 1;\n\n\t\t\t\t\tif($gid = $record[\"gid\"]) {\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"name\"] = $name = $record[\"groupName\"];\n\t\t\t\t\t\t$this->cachedAttributeGroups[$gid*1][\"description\"] = $record[\"groupDescription\"];\n\t\t\t\t\t\t$this->cachedAttributeGroupNames2ID[strtolower($name)] = $gid*1;\n\t\t\t\t\t\t$this->attribute2Group[$attr->getId()] = $gid*1;\n\t\t\t\t\t\t$this->group2Attribute[$gid*1][] = $attr->getId();\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\ttrigger_error(\"Can not create user attribute {$record[\"name\"]}\", E_USER_NOTICE);\n\t\t\t}\n\t\t}\n\t\treturn $this->cachedAttributes;\n\t}", "function _loadProductAttributesInfo()\n {\n global $zone;\n\n if ($this->_fBaseProductInfo == null)\n {\n $this->_loadBaseProductInfo();\n }\n $display_product_price_including_taxes = modApiFunc('Settings', 'getParamValue', 'TAXES_PARAMS', \"DISPLAY_PRICES_W_INCLUDED_TAXES\");\n\n $a = (int)$this->_fProductID;\n $b = (int)$this->_fBaseProductInfo[0]['p_type_id'];\n $c = $display_product_price_including_taxes == DB_TRUE ? 1 : 0;\n if (isset(self::$_cache_attr[$a][$b][$c])) {\n $this->_fProductAttributesInfo = self::$_cache_attr[$a][$b][$c];\n return;\n }\n\n $params = array('product_id' => (int)$this->_fProductID,\n 'product_type_id' => (int)$this->_fBaseProductInfo[0]['p_type_id']);\n $this->_fProductAttributesInfo = execQuery('SELECT_PRODUCT_ATTRIBUTES_INFO', $params);\n // SalePrice,\n // TaxClass.\n $tax_class_id = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'taxclass' )\n {\n $tax_class_id = $attribute['pa_value'];\n break;\n }\n }\n\n $price_including_included_taxes_if_any = NULL;\n foreach ($this->_fProductAttributesInfo as $index => $attribute)\n {\n if ( strtolower($attribute['a_view_tag']) == 'saleprice' )\n {\n if($zone == 'CustomerZone')\n {\n $membership = modApiFunc('Customer_Account','getCurrentSignedCustomerGroupID');\n $attribute['pa_value'] = modApiFunc('Quantity_Discounts','getFixedPrice',$this->_fProductID,1,$attribute['pa_value'],$membership);\n }\n\n $price_including_included_taxes_if_any = $attribute['pa_value'];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['a_view_tag'] = NULL;\n\n // TaxClass - , .\n if($tax_class_id !== NULL)\n {\n // .\n $price_excluding_taxes = modApiFunc(\"Catalog\", \"computePriceExcludingTaxes\", $attribute['pa_value'], $tax_class_id);\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_excluding_taxes;\n\n // _ _ 'salepriceexcludingtaxes':\n $this->_fProductAttributesInfo['salepriceexcludingtaxes']['pa_value'] = $price_excluding_taxes;\n }\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes'] = $this->_fProductAttributesInfo[$index];\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_id'] = NULL;\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['a_view_tag'] = NULL;\n\n if($tax_class_id !== NULL)\n {\n // .\n // _c_ 'salepriceexcludingtaxes':\n $price_including_taxes = $price_including_included_taxes_if_any;\n // ,\n // , \" \"\n //modApiFunc(\"Catalog\", \"computePriceIncludingTaxes\", $attribute['pa_value'], $tax_class_id);\n\n $this->_fProductAttributesInfo['salepriceincludingtaxes']['pa_value'] = $price_including_taxes;\n\n if($display_product_price_including_taxes == DB_TRUE)\n {\n $this->_fProductAttributesInfo[$index]['pa_value'] = $price_including_taxes;\n }\n }\n\n break;\n }\n }\n self::$_cache_attr[$a][$b][$c] = $this->_fProductAttributesInfo;\n }", "public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }", "function get_attribute($order_id, $param)\n{\n\n $email_order_attr = new order_attributes();\n $email_order_attr->order_id = $order_id;\n $email_order_attr->param = $param;\n $email_order_attr->get_latest();\n\n return $email_order_attr->value;\n}", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "function getAttributes()\n {\n }", "public function getAttributes(){ }", "public function getAttributes()\n {\n /* @var $attributes Mage_Catalog_Model_Resource_Eav_Resource_Product_Attribute_Collection */\n $attributes = $this->getData('attributes');\n if (is_null($attributes)) {\n $product = Mage::getModel('catalog/product');\n $attributes = Mage::getResourceModel('catalog/product_attribute_collection')\n ->addHasOptionsFilter()\n ->addDisplayInAdvancedSearchFilter()\n ->addStoreLabel(Mage::app()->getStore()->getId())\n ->setOrder('main_table.attribute_id', 'asc')\n ->load();\n foreach ($attributes as $attribute) {\n $attribute->setEntity($product->getResource());\n }\n $this->setData('attributes', $attributes);\n }\n return $attributes;\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "protected function assignExtensionSettings() {}", "public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }", "public function setExtensionAttributes(\n \\Magento\\Checkout\\Api\\Data\\PaymentDetailsExtensionInterface $extensionAttributes\n );", "public function getExtraAttribute()\n {\n return $this->config['extra'];\n }", "public function getExtension() {}", "public function getExtension() {}", "abstract protected function getModelAttributes();", "function atkClone($attribute)\n{\n\tif (intval(substr(phpversion(),0,1))<5)\n\t$attr = $attribute;\n\telse\n\t$attr = clone($attribute);\n\n\treturn $attr;\n}", "public function createCustomAttributes() {\n if ($this->customAttributesExists() === true) {\n return false;\n } else {\n // # Otherwise, get missing attributes...\n $missingAttributes = $this->customAttributesExists();\n\n // # ...and generate them\n foreach ($missingAttributes as $key => $value) {\n $this->post('custom-attributes', ['name' => $key, 'attributeType' => 'client', 'clientZoneVisible' => false]);\n }\n $attributes = $this->get('custom-attributes');\n\n // # They should exist now which returns true and should not be an array\n if ($this->customAttributesExists() === true) {\n return true;\n } else {\n return false;\n // # ...Log error if they don't\n $this->log->appendLog('failed to create custom attributes');\n }\n\n }\n }", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function setExtensionAttributes(\n \\Kashyap\\AttributeSplash\\Api\\Data\\AttributeSplashExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "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 get_extension()\n {\n }", "public function extensionMeta()\n {\n return $this->getConfigFromFile();\n }", "public function setExtensionAttributes(\n \\Affinity\\Catalogue\\Api\\Data\\CatalogueExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Magento\\GiftCard\\Api\\Data\\GiftCardOptionExtensionInterface $extensionAttributes\n );", "public function setExtended() {\n /* first cut out regular and unwanted fields */\n $excludeExtended = $this->controller->getProperty('excludeExtended','');\n $excludeExtended = explode(',',$excludeExtended);\n $profileFields = $this->profile->toArray();\n $userFields = $this->user->toArray();\n $extended = array();\n $fields = $this->dictionary->toArray();\n $fields = $this->filterAllowedFields($fields);\n $userGroupField = $this->controller->getProperty('usergroupsField','');\n foreach ($fields as $field => $value) {\n if (!isset($profileFields[$field])\n && !isset($userFields[$field])\n && $field != 'password_confirm'\n && $field != 'passwordconfirm'\n && $field != $userGroupField\n && !in_array($field,$excludeExtended)\n ) {\n $extended[$field] = $value;\n }\n }\n /* now set extended data */\n $this->profile->set('extended',$extended);\n }", "protected function getImageAttributes() {}", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "public function getCustomAttributes() {}", "public function extend()\n\t{\n\t\t$extensions = func_get_args();\n\n\t\tforeach ( $extensions as $extension )\n\t\t{\n\t\t\tif ( $extension instanceof self )\n\t\t\t\t$this->data = array_merge_recursive( $this->data, $extension->data );\n\t\t\telse\n\t\t\t\t$this->data = array_merge_recursive( $this->data, _A($extension)->data );\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getAttributes()\n {\n }", "public function getExtra();", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "protected function initUserAttributes()\n {\n return $this->api('people/~:(' . implode(',', $this->attributeNames) . ')', 'GET');\n }", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;" ]
[ "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.674368", "0.6168628", "0.6096815", "0.5797734", "0.5797318", "0.5797318", "0.57972354", "0.57957065", "0.57957065", "0.57957065", "0.57957065", "0.5793629", "0.57655543", "0.5482796", "0.5458299", "0.54310304", "0.53689635", "0.5349844", "0.5262055", "0.5200397", "0.516605", "0.51354253", "0.5127986", "0.5096549", "0.5095524", "0.50944793", "0.5077064", "0.50719595", "0.50697", "0.5066957", "0.5063808", "0.5063116", "0.5056179", "0.5043559", "0.50230473", "0.5018903", "0.5008922", "0.500088", "0.49905336", "0.49795708", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49775374", "0.49758956", "0.4945201", "0.49324632", "0.4904728", "0.48878765", "0.48870257", "0.48686567", "0.48600495", "0.48583633", "0.4852301", "0.4852301", "0.4852301", "0.48488203", "0.48414186", "0.4830584", "0.48275396", "0.48271292", "0.4823796", "0.48176935", "0.4811621", "0.4809796", "0.4809796", "0.48091686", "0.48029423", "0.48021194", "0.4794472", "0.47878858", "0.4780059", "0.476751", "0.47674885", "0.47674885", "0.47674885" ]
0.57117134
31
Set an extension attributes object.
public function setExtensionAttributes( \Loop\Tracker\Api\Data\ItemsExtensionInterface $extensionAttributes ) { return $this->_setExtensionAttributes($extensionAttributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAttributes();", "public function setExtensionAttributes(\\Magento\\Tax\\Api\\Data\\AppliedTaxExtensionInterface $extensionAttributes);", "public function setExtension($extension, $attributes = array()) {\n\t\t$this->connections [$this->active]->setExtension ( $extension, $attributes );\n\t}", "public function setExtensionAttributes(\\Magento\\Sales\\Api\\Data\\OrderExtensionInterface $extensionAttributes);", "public function setExtensionAttributes(\n \\Magento\\GiftCard\\Api\\Data\\GiftCardOptionExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Affinity\\Catalogue\\Api\\Data\\CatalogueExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Pugnet\\Weather\\Api\\Data\\WeatherExtensionInterface $extensionAttributes\n );", "public function setAttributes($attributes){ }", "public function setExtensionAttributes(\n \\Magento\\InventorySourceSelectionApi\\Api\\Data\\ItemRequestExtensionInterface $extensionAttributes\n ): void;", "public function setExtensionAttributes(\n \\Magento\\Checkout\\Api\\Data\\PaymentDetailsExtensionInterface $extensionAttributes\n );", "protected function assignExtensionSettings() {}", "public function setAttributes($attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttributes(array $attributes);", "public function setAttrs($attrs);", "public function setExtensionAttributes(\n \\Magento\\CompanyCredit\\Api\\Data\\CreditLimitExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Magento\\Directory\\Api\\Data\\RegionInformationExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Shurik\\QuickOrder\\Api\\Data\\StatusExtensionInterface $extensionAttributes\n );", "public function set_attributes($attributes)\n {\n }", "public function setExtensionAttributes(\n \\SpDev\\ProductOrderingInformation\\Api\\Data\\SalesInformationExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Kashyap\\AttributeSplash\\Api\\Data\\AttributeSplashExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function setExtensionAttributes(\n \\Aheadworks\\FaqFree\\Api\\Data\\CategoryExtensionInterface $extensionAttributes\n );", "public function setAttributes($attributes)\n {\n foreach($attributes as $key => $value) {\n $this->$key = $value;\n }\n }", "public function set()\n {\n $args = func_get_args();\n\n if ( count($args) == 2 )\n {\n $this->attributes[$args[0]] = $args[1];\n }\n elseif ( count($args) == 1 && is_array($args[0]) ) \n {\n $this->attributes = ( array_merge($this->attributes, $args[0]) );\n }\n\n return $this;\n }", "abstract public function setAttribute($key, $value);", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function __set($attrib, $value) {\r\n if (in_array($attrib, $this->commonAttribs)) {\r\n $this->$attrib = $value;\r\n }\r\n }", "public function setAttributes ($attributes)\n {\n\n $this->attributes = array_merge($this->attributes, $attributes);\n\n }", "public function setExtensionAttributes(\n \\MagePrakash\\ProductAttachment\\Api\\Data\\AttachmentExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public static function setAttributes(&$object, $attributes)\n {\n foreach ($attributes as $attr => $value) {\n if (is_array($value)) {\n static::setAttributes($object, $value);\n continue;\n }\n\n $attributeSetMethod = 'set' . SCT::toUpperCamelCase($attr);\n\n if (method_exists($object, $attributeSetMethod)) {\n $object->$attributeSetMethod($value);\n }\n }\n }", "public function setExtension($ext);", "public function setAttribute($key, $value);", "public function setAttribute($key, $value);", "public function setAttributes(array $attributes, $merge = false);", "public function __set($attri, $value) {\n if (in_array($attri, self::DYN_ATTRIBUTES)) {\n $this->{$attri} = $value;\n }\n }", "public function setAttrs($attrs) {\n\t\t$this->attrs = $attrs;\n\t}", "public function setExtension(?IExtension $extension): void\n {\n $this->extension = $extension;\n }", "public function setAllowedExtensions(array $extensions) {\n \t $this->allowedExtensions = $extensions;\n\t }", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "abstract public function setAttribute($name, $value, $domain = '');", "public function set($id, $attributes);", "public function setExtensionAttributes(\n \\Interview\\Kishore\\Api\\Data\\VideoExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function __set($name,$value)\n\t{\n\t\tif(in_array($name,$this->config_other_attributes))\n\t\t\t$this->list_other_attributes[$name]=$value;\n\t\telse \n\t\t\tparent::__set($name,$value);\n\t}", "public function setExtensionAttributes(\n \\Angel\\Payout\\Api\\Data\\PayoutExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function __set( $name, $value )\n\t{\n\t\t$this->attributes[$name] = $value;\n\t}", "public function __set($name, $value)\n\t{\n\t\t$this->attributes[$name] = $value;\n\t\t\n\t}", "function set_attrs($attrs)\n {\n foreach($attrs as $key => $value) {\n if ($key == \"meta_name\") { continue; }\n if ($key == \"vocab\") { continue; }\n if ($key == \"text\") { continue; }\n if ($key == \"lang\") { continue; }\n $this->attrs[$key] = $value; \n }\n }", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "protected function setAttributes($attributes) {\n $this->_formAttributes = $attributes;\n }", "private function setCustomAttributes(array $attributes = null)\n {\n if (!is_null($attributes)) {\n $this->customAttributes->mergeAttributes($attributes);\n }\n }", "public function setExtension($name, $baseVersion, $extensionLevel) {}", "public function setAttribute($name, $value);", "public function setAttribs($attribs) {\n\t\t$this->_attribs = $attribs;\n\t}", "public function __set($atrib, $value){\n\t\t$this->$atrib = $value;\n\t}", "public function setExtension(?string $value): void {\n $this->getBackingStore()->set('extension', $value);\n }", "public function __set($name, $value)\n {\n $this->_attributes[$name] = $value;\n }", "public function set_field_attributes( $attributes = array() ) {\n\t\n\t\t$this->field_attributes = $attributes;\n\t\n\t}", "public function __set($name, $value)\n {\n $this->attributes[$name] = $value;\n }", "public function set_attributes( $attributes = array(), $override = true ) {\n\t\n\t\tif ( true == $override ) {\n\t\t\t$this->attributes = array_merge( $this->attributes, $attributes );\n\t\t}\n\t\telse {\n\t\t\t$this->attributes = array_merge( $attributes, $this->attributes );\n\t\t}\n\t\n\t}", "public function setExtensions(array $extensions)\n {\n $this->extensions = array();\n\n foreach ($extensions as $extension) {\n $this->addExtension($extension);\n }\n }", "public function setAttr($attributes = array())\n {\n foreach ($attributes as $key => $value) {\n if (property_exists(get_class($this), $key))\n $this->$key = $value;\n }\n return $this;\n }", "public function setExtensionAttributes(MultipleWishlistItemExtensionInterface $extensionAttributes);", "protected function setAvailableExtensions() {}", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "public function setExtensions(array $extensions)\n {\n foreach ($extensions as $extension) {\n $this->addExtension($extension);\n }\n }", "protected function _prepareEnrtyForSave()\n {\n $object = $this->getObject();\n if (!($object instanceof Varien_Object)) {\n Mage::throwException(Mage::helper('googlebase')->__('Object model is not specified to save Google Base entry.'));\n }\n\n $this->_setUniversalData();\n\n $attributes = $this->getAttributeValues();\n if (is_array($attributes) && count($attributes)) {\n foreach ($attributes as $name => $data) {\n\n $name = $this->_normalizeString($name);\n $value = isset($data['value']) ? $data['value'] : '';\n $type = isset($data['type']) && $data['type'] ? $data['type'] : self::DEFAULT_ATTRIBUTE_TYPE;\n\n $customSetter = '_setAttribute' . ucfirst($name);\n if (method_exists($this, $customSetter)) {\n $this->$customSetter($name, $value, $type);\n } else {\n $this->_setAttribute($name, $value, $type);\n }\n }\n }\n return $this;\n }", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setExtension($extension)\n {\n $this->_extension = $extension;\n }", "public function setAttributes($item,$attributes) {\n\t\t$this->_properties[$item]['Attributes'] = ' '.$attributes;\n\t}", "public function setSchemaExtensionProperties($val)\n {\n $this->_propDict[\"properties\"] = $val;\n return $this;\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.extensionProperty');\n }", "protected static function setAttributes( Model &$object, array $attributes )\n\t{\n\t\tforeach($attributes as $key => $value)\n\t\t{\n\t\t\tif( array_search($key, static::$hidden) === false )\n\t\t\t{\n\t\t\t\t$object->attributes[$key] = $value;\n\t\t\t}\n\t\t}\n\t}", "public function update_extension(){}", "public function set_attribute($name, $value)\n {\n }", "public function setAttribute($attribute, $value)\n {\n }", "public function set_attrs($xml, $cloned=true)\n\t{\n\t\t$this->attrs['type'] = $xml->localName;\n\t\tparent::set_attrs($xml, $cloned);\n\n\t\t// set attrs[multiple] from attrs[options]\n\t\tif ($this->attrs['options'] > 1)\n\t\t{\n\t\t\t$this->setElementAttribute($this->id, 'multiple', true);\n\t\t}\n\t}", "public function __set($name, $value)\n { \n //set the attribute with the value\n $this->$name = $value;\n }", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "public function setExtension($ext)\n {\n if (!empty($ext)){\n $this->extension = $ext;\n }\n }", "public function setExtensionAttributes(\n \\Xigen\\Announce\\Api\\Data\\StatsExtensionInterface $extensionAttributes\n ) {\n return $this->_setExtensionAttributes($extensionAttributes);\n }", "public function setAttribute($key, $value = null);", "public function setExtension($extension) {\n $this->_extension = $extension;\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 }", "function setExtensionsPath($value)\r\n\t\t{\r\n\t\t\t$this->_extensionsPath = $value;\r\n\t\t}" ]
[ "0.69624007", "0.6806445", "0.67975146", "0.6626065", "0.655601", "0.65525913", "0.6545836", "0.6514346", "0.65032536", "0.6427793", "0.64174604", "0.64086866", "0.6383069", "0.6383069", "0.6383069", "0.6330351", "0.63235587", "0.62166697", "0.60595465", "0.6057609", "0.60486394", "0.6028557", "0.6015314", "0.5971883", "0.5958978", "0.59363264", "0.59221834", "0.59221834", "0.5901504", "0.5867041", "0.5819074", "0.579972", "0.5797489", "0.5783018", "0.5783018", "0.5782136", "0.5776633", "0.57572436", "0.57455146", "0.57090557", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.56880563", "0.5635152", "0.56228733", "0.55919623", "0.5589247", "0.5587657", "0.5584214", "0.5584072", "0.5581784", "0.5575144", "0.55731666", "0.555949", "0.5559037", "0.55543256", "0.5554161", "0.5544342", "0.55378574", "0.5530389", "0.55093026", "0.55074465", "0.5506509", "0.5500173", "0.54876924", "0.54727167", "0.546585", "0.5453024", "0.54384434", "0.5437005", "0.54322773", "0.54322773", "0.5422544", "0.5420665", "0.54130185", "0.540768", "0.54069155", "0.54067665", "0.54044247", "0.53990144", "0.53953815", "0.5393135", "0.53893006", "0.5378051", "0.53749007", "0.5372161", "0.537016", "0.5365441", "0.53548217" ]
0.61463314
18
Create a new command instance.
public function __construct() { parent::__construct(); // No DB logging. DB::connection()->disableQueryLog(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create() {}", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function getCommand(string $command);", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function generateCommand($singleCommandDefinition);", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function testCommand()\n {\n $response = (new Command())->testCommand(Command::class);\n\n $this->assertInstanceOf(Builder::class, $response, 'A call to command() should dispatch an instance of the command and return a builder.');\n $this->assertInstanceOf(Command::class, $response->toBase(), 'The builder should wrap the command passed to command().');\n }", "public function setCommand(Command $command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8011161", "0.73343915", "0.7261552", "0.7165296", "0.7159216", "0.7138823", "0.6750306", "0.6720341", "0.6718429", "0.6696386", "0.6678263", "0.6645555", "0.65633243", "0.65445185", "0.6482728", "0.64691955", "0.6429075", "0.638223", "0.63785976", "0.6376661", "0.6314948", "0.6249643", "0.62434417", "0.61938816", "0.60825413", "0.60762966", "0.6070407", "0.6069925", "0.60548484", "0.6028387", "0.601559", "0.60133815", "0.60112303", "0.59691864", "0.59607065", "0.5955552", "0.59398437", "0.5939091", "0.59278655", "0.59093857", "0.59064996", "0.5892909", "0.5892909", "0.5892909", "0.58713746", "0.5866861", "0.5866395", "0.5865867", "0.5853559", "0.584886", "0.5840551", "0.584005", "0.58146715", "0.5805411", "0.5798146", "0.5779678", "0.576463", "0.57639825", "0.57559055", "0.575489", "0.5744276", "0.5737695", "0.57334465", "0.57241297", "0.57031834", "0.56873924", "0.5684195", "0.5683107", "0.5676946", "0.56689453", "0.56631494", "0.5660086", "0.5657196", "0.5653958", "0.5633795", "0.5627939", "0.5627448", "0.5625154", "0.5609369", "0.56074566", "0.56073374", "0.5602317", "0.5600253", "0.5599117", "0.55600405", "0.55600405", "0.5558002", "0.55555284", "0.55553657", "0.55503356", "0.5544225", "0.55379087", "0.55298764", "0.5529589", "0.55272996", "0.5525536", "0.5525536", "0.5525536", "0.5525536", "0.5525536", "0.5525536" ]
0.0
-1
Execute the console command.
public function fire() { $this->info('Starting Import'); // Import data. $this->_import_eod_options_data(); $this->info('Ending Import'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Import end of day options data.
private function _import_eod_options_data() { // Clear database. DB::statement('TRUNCATE TABLE OptionsEod'); // Setup our models. $symbols_model = App::make('App\Models\Symbols'); $optionseod_model = App::make('App\Models\OptionsEod'); // Lets get an index of all the underlying symbols. $symbol_index = $symbols_model->get_index(); // Loop through the different files and import foreach($this->_get_option_eod_summary_files() AS $file) { $this->info('Importing ' . $file); // Batch var $batch = []; // Do the CSV magic. $reader = Reader::createFromFileObject(new SplFileObject($file)); foreach($reader->query() AS $key => $row) { // Skip of the row is empty. if((! isset($row[0])) || (! isset($row[1]))) { continue; } // Skip the first row. if($row[0] == 'underlying') { continue; } // See if we have an entry in the Symbols table for this symbol if(! isset($symbol_index[strtoupper($row[0])])) { $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]); $symbol_index = $symbols_model->get_index(); } else { $sym_id = $symbol_index[strtoupper($row[0])]; } // We insert in batches. $batch[] = [ 'OptionsEodSymbolId' => $sym_id, 'OptionsEodSymbolLast' => $row[1], 'OptionsEodType' => $row[5], 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])), 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])), 'OptionsEodStrike' => $row[8], 'OptionsEodLast' => $row[9], 'OptionsEodBid' => $row[10], 'OptionsEodAsk' => $row[11], 'OptionsEodVolume' => $row[12], 'OptionsEodOpenInterest' => $row[13], 'OptionsEodImpliedVol' => $row[14], 'OptionsEodDelta' => $row[15], 'OptionsEodGamma' => $row[16], 'OptionsEodTheta' => $row[17], 'OptionsEodVega' => $row[18], 'OptionsEodCreatedAt' => date('Y-m-d H:i:s') ]; // Insert the data into the OptionsEod table. We insert 1000 at a time. if(count($batch) >= 1000) { DB::table('OptionsEod')->insert($batch); $batch = []; } } // Catch any left over. if(count($batch) > 0) { DB::table('OptionsEod')->insert($batch); } } // Now import all the data we collected daily. $this->_import_daily_eod_options_data($symbol_index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_end_options(): void {\n Simply_Static\\Options::instance()\n ->set('additional_files', Utils::array_to_option_string($this->files))\n ->set('additional_urls', Utils::array_to_option_string($this->urls))\n ->set('archive_end_time', Simply_Static\\Util::formatted_datetime())\n ->save();\n }", "private function _import_daily_eod_options_data($symbol_index)\n\t{\n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $db_filesystem = new Filesystem($adapter); \t\n \t$files = $db_filesystem->listContents('/', true);\n \t\n foreach($files AS $key => $row)\n {\n $toast = false;\n \n // Only want files.\n if($row['type'] != 'file')\n {\n continue;\n }\n \n // Only want zipfiles with daily\n if($row['extension'] != 'zip')\n {\n continue;\n }\n \n // Only want a certain type of file.\n if(! strpos($row['path'], 'alloptions/Daily/options_'))\n {\n continue;\n }\n \n // See if we need to download it or not.\n if(is_file('/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path']))\n {\n $file = '/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path'];\n } else\n {\n $toast = true;\n $file = '/tmp/' . basename($row['path']);\n $this->info('Dropbox: Downloading ' . $row['path']);\n file_put_contents($file, $db_filesystem->read($row['path']));\n }\n \t\n // Unzip the file.\n $filesystem = new Filesystem(new ZipArchiveAdapter($file));\n $list = $filesystem->listContents('/'); \n \n // File the file we want to import.\n foreach($list AS $key => $row)\n {\n // Just want the file with the options data.\n if(strpos($row['path'], 'ptions_'))\n {\n // Write the CSV file to the tmp dir.\n $this->info('Importing: ' . $row['path']);\n file_put_contents('/tmp/' . $row['path'], $filesystem->read($row['path']));\n \n // Now that we have the CSV lets start the import.\n $this->_import_from_daily_csv_file('/tmp/' . $row['path'], $symbol_index);\n }\n }\n \n // Toast temp file\n if($toast)\n {\n unlink($file);\n }\n }\n\t}", "public function setEndDate( KCommandContext $context )\n {\n $data = $context->data;\n \n if( $data->day || $data->month || $data->year )\n { \n $date = new KDate();\n \n $date->day( (int) $data->day );\n \n $date->month( (int) $data->month );\n \n $date->year( (int) $data->year );\n \n $data->endDate = $date;\n }\n }", "function erp_process_import_export() {\n if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'erp-import-export-nonce' ) ) {\n return;\n }\n\n $is_crm_activated = erp_is_module_active( 'crm' );\n $is_hrm_activated = erp_is_module_active( 'hrm' );\n\n $departments = $is_hrm_activated ? erp_hr_get_departments_dropdown_raw() : [];\n $designations = $is_hrm_activated ? erp_hr_get_designation_dropdown_raw() : [];\n\n $field_builder_contact_options = get_option( 'erp-contact-fields' );\n $field_builder_contacts_fields = [];\n\n if ( ! empty( $field_builder_contact_options ) ) {\n foreach ( $field_builder_contact_options as $field ) {\n $field_builder_contacts_fields[] = $field['name'];\n }\n }\n\n $field_builder_company_options = get_option( 'erp-company-fields' );\n $field_builder_companies_fields = [];\n\n if ( ! empty( $field_builder_company_options ) ) {\n foreach ( $field_builder_company_options as $field ) {\n $field_builder_companies_fields[] = $field['name'];\n }\n }\n\n $field_builder_employee_options = get_option( 'erp-employee-fields' );\n $field_builder_employees_fields = array();\n\n if ( ! empty( $field_builder_employee_options ) ) {\n foreach ( $field_builder_employee_options as $field ) {\n $field_builder_employees_fields[] = $field['name'];\n }\n }\n\n if ( isset( $_POST['erp_import_csv'] ) ) {\n define( 'ERP_IS_IMPORTING', true );\n\n $fields = ! empty( $_POST['fields'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) ) : [];\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n\n if ( empty( $type ) ) {\n return;\n }\n\n $csv_file = isset( $_FILES['csv_file'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['csv_file'] ) ) : [];\n\n $data = [ 'type' => $type, 'fields' => $fields, 'file' => $csv_file ];\n\n do_action( 'erp_tool_import_csv_action', $data );\n\n if ( ! in_array( $type, [ 'contact', 'company', 'employee' ] ) ) {\n return;\n }\n\n $employee_fields = [\n 'work' => [\n 'designation',\n 'department',\n 'location',\n 'hiring_source',\n 'hiring_date',\n 'date_of_birth',\n 'reporting_to',\n 'pay_rate',\n 'pay_type',\n 'type',\n 'status',\n ],\n 'personal' => [\n 'photo_id',\n 'user_id',\n 'first_name',\n 'middle_name',\n 'last_name',\n 'other_email',\n 'phone',\n 'work_phone',\n 'mobile',\n 'address',\n 'gender',\n 'marital_status',\n 'nationality',\n 'driving_license',\n 'hobbies',\n 'user_url',\n 'description',\n 'street_1',\n 'street_2',\n 'city',\n 'country',\n 'state',\n 'postal_code',\n ]\n ];\n\n require_once WPERP_INCLUDES . '/lib/parsecsv.lib.php';\n\n $csv = new ParseCsv();\n $csv->encoding( null, 'UTF-8' );\n $csv->parse( $csv_file['tmp_name'] );\n\n if ( empty( $csv->data ) ) {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import\" ) );\n exit;\n }\n\n $csv_data = [];\n\n $csv_data[] = array_keys( $csv->data[0] );\n\n foreach ( $csv->data as $data_item ) {\n $csv_data[] = array_values( $data_item );\n }\n\n if ( ! empty( $csv_data ) ) {\n $count = 0;\n\n foreach ( $csv_data as $line ) {\n if ( empty( $line ) ) {\n continue;\n }\n\n $line_data = [];\n\n if ( is_array( $fields ) && ! empty( $fields ) ) {\n foreach ($fields as $key => $value) {\n\n if (!empty($line[$value]) && is_numeric($value)) {\n if ($type == 'employee') {\n if (in_array($key, $employee_fields['work'])) {\n if ($key == 'designation') {\n $line_data['work'][$key] = array_search($line[$value], $designations);\n } else if ($key == 'department') {\n $line_data['work'][$key] = array_search($line[$value], $departments);\n } else {\n $line_data['work'][$key] = $line[$value];\n }\n\n } else if (in_array($key, $employee_fields['personal'])) {\n $line_data['personal'][$key] = $line[$value];\n } else {\n $line_data[$key] = $line[$value];\n }\n } else {\n $line_data[$key] = isset($line[$value]) ? $line[$value] : '';\n $line_data['type'] = $type;\n }\n }\n }\n }\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n if ( ! isset( $line_data['work']['status'] ) ) {\n $line_data['work']['status'] = 'active';\n }\n\n\n $item_insert_id = erp_hr_employee_create( $line_data );\n\n if ( is_wp_error( $item_insert_id ) ) {\n continue;\n }\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $contact_owner = isset( $_POST['contact_owner'] ) ? absint( $_POST['contact_owner'] ) : erp_crm_get_default_contact_owner();\n $line_data['contact_owner'] = $contact_owner;\n $people = erp_insert_people( $line_data, true );\n\n if ( is_wp_error( $people ) ) {\n continue;\n } else {\n $contact = new \\WeDevs\\ERP\\CRM\\Contact( absint( $people->id ), 'contact' );\n $life_stage = isset( $_POST['life_stage'] ) ? sanitize_key( $_POST['life_stage'] ) : '';\n\n if ( ! $people->exists ) {\n $contact->update_life_stage( $life_stage );\n\n } else {\n if ( ! $contact->get_life_stage() ) {\n $contact->update_life_stage( $life_stage );\n }\n }\n\n if ( ! empty( $_POST['contact_group'] ) ) {\n $contact_group = absint( $_POST['contact_group'] );\n\n $existing_data = \\WeDevs\\ERP\\CRM\\Models\\ContactSubscriber::where( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id\n ] )->first();\n\n if ( empty( $existing_data ) ) {\n $hash = sha1( microtime() . 'erp-subscription-form' . $contact_group . $people->id );\n\n erp_crm_create_new_contact_subscriber( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id,\n 'status' => 'subscribe',\n 'subscribe_at' => current_time( 'mysql' ),\n 'unsubscribe_at' => null,\n 'hash' => $hash\n ] );\n }\n }\n\n\n if ( ! empty( $field_builder_contacts_fields ) ) {\n foreach ( $field_builder_contacts_fields as $field ) {\n if ( isset( $line_data[ $field ] ) ) {\n erp_people_update_meta( $people->id, $field, $line_data[ $field ] );\n }\n }\n }\n }\n }\n\n ++ $count;\n }\n\n }\n\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import&imported=$count\" ) );\n exit;\n }\n\n if ( isset( $_POST['erp_export_csv'] ) ) {\n if ( ! empty( $_POST['type'] ) && ! empty( $_POST['fields'] ) ) {\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n $fields = array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) );\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n $args = [\n 'number' => - 1,\n 'status' => 'all'\n ];\n\n $items = erp_hr_get_employees( $args );\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $args = [\n 'type' => $type,\n 'count' => true,\n ];\n $total_items = erp_get_peoples( $args );\n\n $args = [\n 'type' => $type,\n 'offset' => 0,\n 'number' => - 1,\n ];\n $items = erp_get_peoples( $args );\n }\n\n //@todo do_action()\n $csv_items = [];\n\n $x = 0;\n foreach ( $items as $item ) {\n\n if ( empty( $fields ) ) {\n continue;\n }\n\n foreach ( $fields as $field ) {\n if ( $type == 'employee' ) {\n\n if ( in_array( $field, $field_builder_employees_fields ) ) {\n $csv_items[ $x ][ $field ] = get_user_meta( $item->id, $field, true );\n } else {\n switch ( $field ) {\n case 'department':\n $csv_items[ $x ][ $field ] = $item->get_department_title();\n break;\n\n case 'designation':\n $csv_items[ $x ][ $field ] = $item->get_job_title();\n break;\n\n default:\n $csv_items[ $x ][ $field ] = $item->{$field};\n break;\n }\n }\n\n } else {\n if ( $type == 'contact' ) {\n if ( in_array( $field, $field_builder_contacts_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n if ( $type == 'company' ) {\n if ( in_array( $field, $field_builder_companies_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n }\n }\n\n $x ++;\n }\n\n $file_name = 'export_' . date( 'd_m_Y' ) . '.csv';\n\n erp_make_csv_file( $csv_items, $file_name );\n\n } else {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=export\" ) );\n exit();\n }\n }\n}", "public function hideEndDateWhenEmpty(DataContainer $dc)\r\n {\r\n $date = $this->Database->prepare(\"SELECT id, start_date FROM tl_ausschreibung WHERE start_date!='' AND end_date=''\")->execute();\r\n while ($row = $date->next())\r\n {\r\n $end_date = $this->Database->prepare(\"UPDATE tl_ausschreibung SET end_date = ? WHERE id = ?\");\r\n $end_date->execute($row->start_date, $row->id);\r\n }\r\n //Wenn end-datum leer ist, wird es ausgeblendet, das ist der Fall beim Erstellen neuer Anlaesse\r\n if ($dc->id != \"\" && $this->Input->get('mode') != 'csv_import')\r\n {\r\n\r\n $date = $this->Database->prepare(\"SELECT start_date FROM tl_ausschreibung WHERE id = ?\")->execute($dc->id);\r\n $date->fetchAssoc();\r\n if ($date->start_date == \"\")\r\n {\r\n $GLOBALS['TL_DCA']['tl_ausschreibung']['palettes']['default'] = 'start_date, art, ort, wettkampfform; zeit, trainer; kommentar; phase, trainingsstunden';\r\n }\r\n }\r\n\r\n }", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }", "public function saveData()\n {\n $newSku = $this->_entityModel->getNewSku();\n while ($bunch = $this->_entityModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n if (!$this->_entityModel->isRowAllowedToImport($rowData, $rowNum)) {\n continue;\n }\n\n if (version_compare($this->_entityModel->getProductMetadata()->getVersion(), '2.2.0', '>=')) {\n $rowSku = strtolower($rowData[ImportProduct::COL_SKU]);\n } else {\n $rowSku = $rowData[ImportProduct::COL_SKU];\n }\n $productData = $newSku[$rowSku];\n $this->parseOptions($rowData, $productData[$this->getProductEntityLinkField()]);\n }\n if (!empty($this->cachedOptions['sample']) || !empty($this->cachedOptions['link'])) {\n $this->saveOptions();\n $this->clear();\n }\n }\n return $this;\n }", "function cs_theme_option_import_export() {\n\t$a = unserialize(base64_decode($_POST['theme_option_data']));\n\tupdate_option( \"cs_theme_option\", $a );\n\techo \"Otions Imported\";\n\tdie();\n}", "private function get_options($post){\n\t\t//Build array of user import fields\n\t\t$importFields = array();\n\t\t\n\t\t$fileType = $post['file_type'];\n\t\t$fileFeed = $post['feed'];\n\t\t$filePath = $post['xpath'];\n\t\t\n\t\tif($fileType=='xml'):\n\t\t\t$fileData = file_get_contents($fileFeed);\n\t\t\t\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->loadXML($fileData);\n\t\t\t$xmlArray = $this->xml_to_array($dom);\n\t\t\t\n\t\t\t$importFields = $this->get_xpath($xmlArray, $filePath);\n\t\t\t$importFields = $this->get_keys($importFields);\n\t\t\t\n\t\telseif($fileType=='csv'):\n\t\t\t$row = 1;\n\t\t\tif (($handle = fopen($fileFeed, 'r')) !== FALSE):\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, ',')) !== FALSE):\n\t\t\t\t\t//get first line column names and break\n\t\t\t\t\t$importFields = $data;\n\t\t\t\t\tbreak;\n\t\t\t\tendwhile;\n\t\t\t\t\n\t\t\t\tfclose($handle);\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\t//create import fields drop down\n\t\t$options = array();\n\t\tforeach($importFields as $field):\n\t\t\t//$options .= '<option vlaue=\"'.$field.'\">'.$field.'</option>';\n\t\t\t$options[$field] = $field;\n\t\tendforeach;\n\t\t\n\t\treturn $options;\n\t}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function finish_database_export() {\n $this->importer->finish_database_import();\n }", "public function getEndDate()\n {\n if ( ! $this->getData('end_date'))\n {\n return \"-\";\n }\n\n return $this->getData('end_date');\n }", "public function away_mode_end_time() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 6:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Hour Field\n\t\t$content = '<select name=\"itsec_away_mode[away_end][hour]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 1; $i <= 12; $i ++ ) {\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'g', $end ), $i, false ) . '>' . $i . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//Minute Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][minute]\" id=\"itsec_away_mode_away_mod_end_time\">';\n\n\t\tfor ( $i = 0; $i <= 59; $i ++ ) {\n\n\t\t\t$content .= '<option value=\"' . sprintf( '%02d', $i ) . '\" ' . selected( date( 'i', $end ), sprintf( '%02d', $i ), false ) . '>' . sprintf( '%02d', $i ) . '</option>';\n\t\t}\n\n\t\t$content .= '</select>';\n\n\t\t//AM/PM Field\n\t\t$content .= '<select name=\"itsec_away_mode[away_end][sel]\" id=\"itsec_away_mode\">';\n\t\t$content .= '<option value=\"am\" ' . selected( date( 'a', $end ), 'am', false ) . '>' . __( 'am', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '<option value=\"pm\" ' . selected( date( 'a', $end ), 'pm', false ) . '>' . __( 'pm', 'it-l10n-ithemes-security-pro' ) . '</option>';\n\t\t$content .= '</select><br>';\n\t\t$content .= '<label for=\"itsec_away_mode_away_mod_end_time\"> ' . __( 'Set the time at which the admin dashboard should become available again.', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "private function _get_data_from_dropbox()\n {\n $tmp = '/tmp/market_data/';\n \n // tmp/market_data/\n if(! is_dir($tmp))\n {\n mkdir($tmp);\n }\n\n // data/optionsendofday/IWM\n if(! is_dir($tmp . '/data/OptionsEndOfDay/IWM'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/IWM', 0777, true);\n }\n\n // data/optionsendofday/SPY\n if(! is_dir($tmp . '/data/OptionsEndOfDay/SPY'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/SPY', 0777, true);\n }\n \n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $filesystem = new Filesystem($adapter); \n\n // Loop through and download the data\n foreach($this->eod_option_summary_files AS $key => $row)\n {\n if(is_file($tmp . $row))\n {\n $this->info('Dropbox Already Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files));\n continue;\n }\n \n // Download and store.\n file_put_contents($tmp . $row, $filesystem->read($row));\n $this->info('Dropbox Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files)); \n }\n }", "public function testExportWithMultipleOptions(): void\n {\n $expectedCount = 1;\n $resultsFilename = 'export_results.csv';\n $this->model->setWriter(\n $this->objectManager->create(\n \\Magento\\ImportExport\\Model\\Export\\Adapter\\Csv::class\n )\n );\n $exportData = $this->model->export();\n\n $varDirectory = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class)\n ->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::VAR_DIR);\n $varDirectory->writeFile($resultsFilename, $exportData);\n /** @var \\Magento\\Framework\\File\\Csv $csv */\n $csv = $this->objectManager->get(\\Magento\\Framework\\File\\Csv::class);\n $data = $csv->getData($varDirectory->getAbsolutePath($resultsFilename));\n $actualCount = count($data) - 1;\n\n $this->assertSame($expectedCount, $actualCount);\n }", "private function _import_from_daily_csv_file($file, $symbol_index)\n {\n $batch = [];\n \n // Do the CSV magic.\n $reader = Reader::createFromFileObject(new SplFileObject($file));\n \n // symbols model\n $symbols_model = App::make('App\\Models\\Symbols');\n \n // Loop through the option data.\n foreach($reader->query() AS $key => $row) \n {\t\n // Only care about some symbols\n if(! in_array(strtolower($row[0]), $this->eod_option_daily_symbols))\n {\n continue;\n }\n \n // See if we have an entry in the Symbols table for this symbol\n if(! isset($symbol_index[strtoupper($row[0])]))\n {\n $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n $symbol_index = $symbols_model->get_index();\n } else\n {\n $sym_id = $symbol_index[strtoupper($row[0])];\n } \n \n // We insert in batches.\n DB::table('OptionsEod')->insert([\n 'OptionsEodSymbolId' => $sym_id,\n 'OptionsEodSymbolLast' => $row[1],\n 'OptionsEodType' => $row[5],\n 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n 'OptionsEodStrike' => $row[8],\n 'OptionsEodLast' => $row[9],\n 'OptionsEodBid' => $row[10],\n 'OptionsEodAsk' => $row[11],\n 'OptionsEodVolume' => $row[12],\n 'OptionsEodOpenInterest' => $row[13],\n 'OptionsEodImpliedVol' => $row[14],\n 'OptionsEodDelta' => $row[15],\n 'OptionsEodGamma' => $row[16],\n 'OptionsEodTheta' => $row[17],\n 'OptionsEodVega' => $row[18],\n 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\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 ]);\n }\n \n // Delete tmp file.\n unlink($file); \n }", "public function set_location_trading_hour_days(){}", "static function add_bod_voting_end(): void {\r\n\t\tself::add_acf_inner_field(self::bods, self::bod_voting_end, [\r\n\t\t\t'label' => 'Voting period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 29 @ 6 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::bod_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "public function setEndDate($date)\n\t\t{\n\t\t\t$this->end_date = $date;\n\t\t}", "public function finish_database_export() {\n }", "function setEndDate($end_date = \"\") \n\t{\n\t\t$this->end_date = $end_date;\n\t}", "function &getEndorsments() {\n $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');\n return $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->getArticleId(), SUPP_FILE_ENDORSMENT, $this->getId());\n\t}", "protected function importDatabaseData() {}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n $start_date = strtotime($start_date);\n $this->setData(\"start_date\", date(\"Y-m-d\", $start_date));\n\n // We only need to do end dates if they are provided.\n if ($end_date = $this->getData(\"end_date\"))\n {\n $end_date = strtotime($end_date);\n $this->setData(\"end_date\", date(\"Y-m-d\", $end_date));\n }\n else\n {\n $this->setData(\"end_date\", NULL);\n }\n\n parent::save();\n }", "public function exportTiendasToCsv(){\n $Fecha = date('d-m-Y');\n #$Hora = date('H:i:s');\n #$fechahora = \"(\".$Fecha.\"-\".$Hora.\")\";\n\n $consulta = $this->db->prepare(\"\n SELECT\n 'COD_TIENDA'\n ,'COD_BTK'\n ,'TIENDA_NAME'\n ,'DIRECCION'\n ,'COD_CLIENTE'\n ,'CLIENTE_NAME'\n ,'COD_REGION'\n ,'REGION_NAME'\n ,'COD_CIUDAD'\n ,'CIUDAD_NAME'\n ,'COD_COMUNA'\n ,'COMUNA_NAME'\n ,'COD_ZONA'\n ,'ZONA_NAME'\n ,'COD_TIPO'\n ,'TIPO_NAME'\n ,'COD_AGRUPACION'\n ,'AGRUPACION_NAME'\n ,'COD_ESTADO'\n ,'ESTADO_NAME'\n UNION ALL\n SELECT \n TI.COD_TIENDA,\n TI.COD_BTK,\n TI.NOM_TIENDA,\n IFNULL(TI.DIREC_TIENDA,'') AS DIRECCION,\n CL.COD_CLIENTE,\n CL.NOM_CLIENTE,\n IFNULL(RG.COD_REGION, '') AS COD_REGION,\n IFNULL(RG.NOM_REGION, '') AS NOM_REGION,\n IFNULL(CT.COD_CIUDAD, '') AS COD_CIUDAD,\n IFNULL(CT.NOM_CIUDAD, '') AS NOM_CIUDAD,\n IFNULL(CM.COD_COMUNA, '') AS COD_COMUNA,\n IFNULL(CM.NOM_COMUNA, '') AS NOM_COMUNA,\n IFNULL(ZN.COD_ZONA, '') AS COD_ZONA,\n IFNULL(ZN.NOM_ZONA, '') AS NOM_ZONA,\n IFNULL(TT.COD_TIPO, '') AS COD_TIPO,\n IFNULL(TT.NOM_TIPO, '') AS NOM_TIPO,\n IFNULL(AG.COD_AGRUPACION, '') AS COD_AGRUPACION,\n IFNULL(AG.NOM_AGRUPACION, '') AS NOM_AGRUPACION,\n IFNULL(ET.COD_ESTADO, '') AS COD_ESTADO,\n IFNULL(ET.NOM_ESTADO, '') AS NOM_ESTADO\n FROM T_TIENDA TI\n LEFT OUTER JOIN T_CLIENTE CL ON CL.COD_CLIENTE = TI.CLIENTE_COD_CLIENTE\n LEFT OUTER JOIN T_TIENDA_ESTADO ET ON ET.COD_ESTADO = TI.ESTADO_COD_ESTADO\n LEFT OUTER JOIN T_COMUNA CM ON (CM.COD_COMUNA = TI.COMUNA_COD_COMUNA)\n AND (CM.CIUDAD_COD_CIUDAD = TI.COMUNA_CIUDAD_COD_CIUDAD)\n AND (CM.CIUDAD_REGION_COD_REGION = TI.COMUNA_CIUDAD_REGION_COD_REGION)\n LEFT OUTER JOIN T_CIUDAD CT ON CT.COD_CIUDAD = CM.CIUDAD_COD_CIUDAD\n LEFT OUTER JOIN T_REGION RG ON RG.COD_REGION = CM.CIUDAD_REGION_COD_REGION\n LEFT OUTER JOIN T_TIENDA_ZONA ZN ON ZN.COD_ZONA = TI.ZONA_COD_ZONA\n LEFT OUTER JOIN T_TIPO_TIENDA TT ON TT.COD_TIPO = TI.TIPO_TIENDA_COD_TIPO\n LEFT OUTER JOIN T_AGRUPACION AG ON AG.COD_AGRUPACION = TI.AGRUPACION_COD_AGRUPACION \n WHERE TI.COD_TIENDA NOT LIKE '%N/A%'\n AND TI.COD_BTK NOT LIKE '%N/A%'\n INTO OUTFILE '\".$this->apache.$this->root.\"views/tmp/SOM_TIENDAS_\".$Fecha.\".csv'\n CHARACTER SET latin1\n FIELDS TERMINATED BY ';'\n LINES TERMINATED BY '\\n'\");\n \n //OPTIONALLY ENCLOSED BY '\\\"'\n \n $consulta->execute();\n\n // hold & go to be sure\n sleep(2);\n \n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"SOM_TIENDAS_'.$Fecha.'.csv\"');\n header('Cache-Control: max-age=0');\n \n readfile(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n unlink(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n \n// $error = $consulta->errorInfo();\n// echo $error[2];\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "function ExportData() {\n\t\tglobal $archv_finished;\n\t\t$utf8 = FALSE;\n\t\t$bSelectLimit = FALSE;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->lTotalRecs = $archv_finished->SelectRecordCount();\n\t\t} else {\n\t\t\tif ($rs = $this->LoadRecordset())\n\t\t\t\t$this->lTotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->lStartRec = 1;\n\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t// Set the last record to display\n\t\tif ($this->lDisplayRecs < 0) {\n\t\t\t$this->lStopRec = $this->lTotalRecs;\n\t\t} else {\n\t\t\t$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;\n\t\t}\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\t$XmlDoc = new cXMLDocument(EW_XML_ENCODING);\n\t\t\t$XmlDoc->AddRoot();\n\t\t} else {\n\t\t\t$ExportDoc = new cExportDocument($archv_finished, \"v\");\n\t\t\t$ExportDoc->ExportHeader();\n\t\t\tif ($ExportDoc->Horizontal) { // Horizontal format, write header\n\t\t\t\t$ExportDoc->BeginExportRow();\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->ID);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strjrfnum);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strquarter);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strmon);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->stryear);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdate);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strtime);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strusername);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strusereadd);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcompany);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdepartment);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strloc);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strposition);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strtelephone);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcostcent);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strsubject);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strnature);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdescript);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strarea);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strattach);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strpriority);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strduedate);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strstatus);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strlastedit);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strcategory);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strassigned);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strdatecomplete);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strwithpr);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->strremarks);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->sap_num);\n\t\t\t\t$ExportDoc->ExportCaption($archv_finished->work_days);\n\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t}\n\t\t}\n\n\t\t// Move to first record\n\t\t$this->lRecCnt = $this->lStartRec - 1;\n\t\tif (!$rs->EOF) {\n\t\t\t$rs->MoveFirst();\n\t\t\tif (!$bSelectLimit && $this->lStartRec > 1)\n\t\t\t\t$rs->Move($this->lStartRec - 1);\n\t\t}\n\t\twhile (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {\n\t\t\t$this->lRecCnt++;\n\t\t\tif (intval($this->lRecCnt) >= intval($this->lStartRec)) {\n\t\t\t\t$this->LoadRowValues($rs);\n\n\t\t\t\t// Render row\n\t\t\t\t$archv_finished->CssClass = \"\";\n\t\t\t\t$archv_finished->CssStyle = \"\";\n\t\t\t\t$archv_finished->RowType = EW_ROWTYPE_VIEW; // Render view\n\t\t\t\t$this->RenderRow();\n\t\t\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\t\t\t$XmlDoc->AddRow();\n\t\t\t\t\t$XmlDoc->AddField('ID', $archv_finished->ID->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strjrfnum', $archv_finished->strjrfnum->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strquarter', $archv_finished->strquarter->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strmon', $archv_finished->strmon->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('stryear', $archv_finished->stryear->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdate', $archv_finished->strdate->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strtime', $archv_finished->strtime->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strusername', $archv_finished->strusername->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strusereadd', $archv_finished->strusereadd->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcompany', $archv_finished->strcompany->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdepartment', $archv_finished->strdepartment->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strloc', $archv_finished->strloc->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strposition', $archv_finished->strposition->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strtelephone', $archv_finished->strtelephone->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcostcent', $archv_finished->strcostcent->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strsubject', $archv_finished->strsubject->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strnature', $archv_finished->strnature->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdescript', $archv_finished->strdescript->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strarea', $archv_finished->strarea->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strattach', $archv_finished->strattach->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strpriority', $archv_finished->strpriority->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strduedate', $archv_finished->strduedate->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strstatus', $archv_finished->strstatus->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strlastedit', $archv_finished->strlastedit->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strcategory', $archv_finished->strcategory->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strassigned', $archv_finished->strassigned->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strdatecomplete', $archv_finished->strdatecomplete->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strwithpr', $archv_finished->strwithpr->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('strremarks', $archv_finished->strremarks->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('sap_num', $archv_finished->sap_num->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t\t$XmlDoc->AddField('work_days', $archv_finished->work_days->ExportValue($archv_finished->Export, $archv_finished->ExportOriginalValue));\n\t\t\t\t} else {\n\t\t\t\t\t$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->ID);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strjrfnum);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strquarter);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strmon);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->stryear);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdate);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strtime);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strusername);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strusereadd);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcompany);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdepartment);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strloc);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strposition);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strtelephone);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcostcent);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strsubject);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strnature);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdescript);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strarea);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strattach);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strpriority);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strduedate);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strstatus);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strlastedit);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strcategory);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strassigned);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strdatecomplete);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strwithpr);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->strremarks);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->sap_num);\n\t\t\t\t\t$ExportDoc->ExportField($archv_finished->work_days);\n\t\t\t\t\t$ExportDoc->EndExportRow();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\tif ($archv_finished->Export <> \"xml\")\n\t\t\t$ExportDoc->ExportFooter();\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write BOM if utf-8\n\t\tif ($utf8 && !in_array($archv_finished->Export, array(\"email\", \"xml\")))\n\t\t\techo \"\\xEF\\xBB\\xBF\";\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\tif ($archv_finished->Export == \"xml\") {\n\t\t\theader(\"Content-Type: text/xml\");\n\t\t\techo $XmlDoc->XML();\n\t\t} elseif ($archv_finished->Export == \"email\") {\n\t\t\t$this->ExportEmail($ExportDoc->Text);\n\t\t\t$this->Page_Terminate($archv_finished->ExportReturnUrl());\n\t\t} else {\n\t\t\techo $ExportDoc->Text;\n\t\t}\n\t}", "private function export_options ( $export ) {\n\t\t\t\n\t\t\t$properties = $export->addChild( 'extended-properties' );\n\t\t\t\n\t\t\t$options = DB::get_results( 'select name, value, type from {options}' );\n\t\t\tforeach ( $options as $option ) {\n\t\t\t\t\n\t\t\t\t$property = $properties->addChild( 'property' );\n\t\t\t\t$property->addAttribute( 'name', $option->name );\n\t\t\t\t$property->addAttribute( 'value', $option->value );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function run_endo_importer() {\n\t$plugin = new Endo_Importer();\n\t$plugin->run();\n}", "public function setEndDate(DrupalDateTime $end_date = NULL);", "function import_end() {\n\t\t//wp_import_cleanup( $this->id );\n\n\t\twp_cache_flush();\n\t\tforeach ( get_taxonomies() as $tax ) {\n\t\t\tdelete_option( \"{$tax}_children\" );\n\t\t\t_get_term_hierarchy( $tax );\n\t\t}\n\n\t\twp_defer_term_counting( false );\n\t\twp_defer_comment_counting( false );\n\n\t\techo '<p>导入成功.' . ' <a href=\"' . admin_url() . '\">Have fun!</a>' . '</p>';\n\n\t\tdo_action( 'import_end' );\n\t}", "function clients_importDisplaySelectValues($data) {\n\tglobal $gSession;\n\t\n\t$current_group = intval($_GET['group']);\n\t$update = intval($_GET['update']);\n\t\n\t## setup the template\n\t$file = ENGINE.\"modules/clients/interface/import_asssign_fields.tpl\";\n\t$select_template = new Template();\n\t$select_template->set_templatefile(array(\"body\" => $file,'column'=>$file));\n\n\t$select_template->set_var('language_inputhead','Match the file with your subscriber fields');\n\t$select_template->set_var('language_inputbody',\"For each column, select the field it corresponds to in 'Belongs to'. Click the 'Next' button when you're do\");\n\t$select_template->set_var('element_desc',' ');\n\t\n\t$targetURL = \"module.php?cmd=import&step=4&group=\".$current_group.'&update='.$update;\n\t$targetURL = $gSession->url($targetURL);\n\t$select_template->set_var('actionURL',$targetURL);\t\n\t\n\t## prepare the select element wiht all available fields\n\t$wt = new ctlparser(MATRIX_BASEDIR.'settings/modules/'.$GLOBALS['_MODULE_DATAOBJECTS_NAME'].'/base.xml');\n\t$wt->parse();\t\t\n\t$elements = $wt->getElements();\t\n\t\n\t$allowed_types = array('text','email','copytext','tags','selectbox','date');\n\t$field_selector = '<option label=\"\" value=\"-1\">Skip This Column</option><option label=\"\" value=\"-1\"></option>';\n\tforeach($elements as $current_row) {\n\t\tforeach($current_row as $current_element) {\n\t\t\t$type = strtolower($current_element['TYPE']);\n\t\t\t$identifier = strtolower($current_element['IDENTIFIER']);\n\t\t\t\n\t\t\tif(in_array($type,$allowed_types)) {\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(MATRIX_BASEDIR.\"/matrix_engine/modules/clients/attributetypes/\".$type.\"/attribute.php\");\t\t\t\n\t\t\t\tif(function_exists(\"clients_\".$type.\"_getData\")) {\n\t\t\t\t\t$field_selector .= '<option label=\"'.$current_element['NAME'].'\" value=\"'.$identifier.'\">'.$current_element['NAME'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\t\n\t## now we will output each colum recoginzed by the system\n\t$output = '';\n\t$counter = 0;\n\n\tforeach($data as $key=>$value) {\n\t\t$current_selector = '<select name=\"COLUMN_'.$counter.'\">'.$field_selector.'</select>';\n\t\n\t\t$select_template->set_var('COLUMN_NAME',$key);\n\t\t$select_template->set_var('COLUMN_SELECTOR',$current_selector);\n\t\t\n\t\t$output .= $select_template->fill_block(\"column\");\n\t\t$counter++;\n\t}\n\t\n\t## prpeare the hidden fields\n\t$hiddenfields = '<input name=\"column_count\" id=\"column_count\" type=\"hidden\" value=\"'.($counter-1).'\">';\n\t\n\t$select_template->set_var('COLUMNS',$output);\t\n\t$select_template->set_var('hiddenfields',$hiddenfields);\n\t\n\t$select_template->pfill_block(\"body\");\n\t\n}", "function export_date_options($post_type = 'post')\n {\n }", "private function load_options()\n\t\t{\n\t\t\t$options = NULL;\n\n\t\t\t// load from persistent store\n\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t// reading from database\n\t\t\t\t$options = get_option( $this->option_name, $this->defaults );\n\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t// reading from filesystem\n\t\t\t\tif ( file_exists( $this->filename ) ) {\n\t\t\t\t\t$data = file_get_contents( $this->filename );\n\t\t\t\t\t$options = json_decode( $data, TRUE );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// TODO: add capability to store in DS specific table\n\n\t\t\t// this ensures we have *something*, even if it's an empty array\n\t\t\tif ( NULL === $options )\n\t\t\t\t$options = $this->defaults;\n\n\t\t\t$this->_options = array_merge( $this->defaults, $options );\n\t\t}", "private static function _addThreedsOptions()\n {\n global $db;\n\n $challengeIndicators = EMerchantPayCommon::buildSettingsDropDownOptions(\n EmpCheckoutSettings::getChallengeIndicators()\n );\n\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, use_function, date_added)\n values\n ('Enable 3DSv2',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'THREEDS_ALLOWED'\n ) . \"',\n 'true', 'Enable 3DSv2 optional parameters.',\n '6', '4', 'emp_zfg_draw_toggle(',\n 'emp_zfg_get_toggle_value', now())\"\n );\n $db->Execute(\n 'insert into ' . TABLE_CONFIGURATION . \"\n (configuration_title, configuration_key, configuration_value,\n configuration_description, configuration_group_id, sort_order,\n set_function, date_added)\n values\n ('3DSv2 Challenge',\n '\" . EmpCheckoutSettings::getCompleteSettingKey(\n 'THREEDS_CHALLENGE_INDICATOR'\n ) . \"', 'no_preference', \n 'The value has weight and might impact the decision whether a \n challenge will be required for the transaction or not.',\n '6', '4', 'emp_zfg_select_drop_down_single({$challengeIndicators},',\n now())\"\n );\n }", "public function setEndDate(string $date);", "public function away_mode_end_date() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 12:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Date Field\n\t\t$content = '<input class=\"end_date_field\" type=\"text\" id=\"itsec_away_mode_end_date\" name=\"itsec_away_mode[away_end][date]\" value=\"' . date( 'm/d/y', $end ) . '\"/><br>';\n\t\t$content .= '<label class=\"end_date_field\" for=\"itsec_away_mode_end_date\"> ' . __( 'Set the date at which the admin dashboard should become available', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "function import_data(){\r\n\r\n\tglobal $cfg;\r\n\t\r\n\t$action = get_get_var('action');\r\n\techo '<h4>Import Data</h4>';\r\n\r\n\t$mount_point = get_post_var('mount_point');\r\n\t// validate this\r\n\tif ($mount_point != \"\" && $mount_point{0} != '/'){\r\n\t\t$action = \"\";\r\n\t\tonnac_error(\"Invalid mount point specified! Must start with a '/'\");\r\n\t}\r\n\t\r\n\tif ($action == \"\"){\r\n\t\r\n\t\t$option = \"\";\r\n\t\t$result = db_query(\"SELECT url from $cfg[t_content] ORDER BY url\");\r\n\t\t\r\n\t\t// first, assemble three arrays of file information\r\n\t\tif (db_has_rows($result)){\r\n\t\t\r\n\t\t\t$last_dir = '/';\r\n\t\t\r\n\t\t\twhile ($row = db_fetch_row($result)){\r\n\t\t\t\r\n\t\t\t\t// directory names, without trailing /\r\n\t\t\t\t$dirname = dirname($row[0] . 'x');\r\n\t\t\t\tif ($dirname == '\\\\' || $dirname == '/')\r\n\t\t\t\t\t$dirname = '';\r\n\t\t\t\t\r\n\t\t\t\tif ($last_dir != $dirname){\r\n\t\t\t\t\tif ($last_dir != '')\r\n\t\t\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\r\n\t\t\t\t\r\n\t\t\t\t\t$last_dir = $dirname;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($last_dir != '')\r\n\t\t\t\t$option .= \"\\t\\t<option value=\\\"\" . htmlentities($last_dir) . '\">' . htmlentities($last_dir) . \"</option>\\n\";\t\t\r\n\t\t}\r\n\t\r\n\t\t?>\r\n\t\t\r\n<form name=\"import\" action=\"##pageroot##/?mode=import&action=import\" enctype=\"multipart/form-data\" method=\"post\">\r\n\t<table>\r\n\t\t<tr><td>File to import:</td><td><input name=\"data\" type=\"file\" size=\"40\"/></td></tr>\r\n\t\t<tr><td>*Mount point:</td><td><input name=\"mount_point\" type=\"text\" size=\"40\" value=\"/\" /></td></tr>\r\n\t\t<tr><td><em>==&gt;&gt; Choose a directory</em></td><td><select onchange=\"document.import.mount_point.value = document.import.directory.options[document.import.directory.selectedIndex].value;\" name=\"directory\"><?php echo $option; ?></select></td></tr>\r\n\t</table>\r\n\t<input type=\"submit\" value=\"Import\" /><br/>\r\n\t<em>* Mount point is a value that is prefixed to all file names, including content, banner, and menu data. It is the root directory in which the data is based.</em>\r\n</form>\r\n<?php\r\n\t\r\n\t}else if ($action == \"import\"){\r\n\t\t\r\n\t\t$filename = \"\";\r\n\t\t\r\n\t\t// get the contents of the uploaded file\r\n\t\tif (isset($_FILES['data']) && is_uploaded_file($_FILES['data']['tmp_name'])){\r\n\t\t\t$filename = $_FILES['data']['tmp_name'];\r\n\t\t}\r\n\t\t\r\n\t\t$imported = get_import_data($filename,false);\r\n\t\t\r\n\t\tif ($imported !== false){\r\n\t\t\r\n\t\t\t// check to see if we need to ask the user to approve anything\r\n\t\t\t$user_approved = false;\r\n\t\t\tif (get_post_var('user_approved') == 'yes')\r\n\t\t\t\t$user_approved = true;\r\n\t\t\r\n\t\t\t// take care of SQL transaction up here\r\n\t\t\t$ret = false;\r\n\t\t\tif ($user_approved && !db_begin_transaction())\r\n\t\t\t\treturn onnac_error(\"Could not begin SQL transaction!\");\r\n\t\t\r\n\t\t\t// automatically detect import type, and do it!\r\n\t\t\tif ($imported['dumptype'] == 'content' || $imported['dumptype'] == 'all'){\r\n\t\t\t\t$ret = import_content($imported,$user_approved,false);\r\n\t\t\t}else if ($imported['dumptype'] == 'templates'){\r\n\t\t\t\t$ret = import_templates($imported,$user_approved,false);\r\n\t\t\t}else{\r\n\t\t\t\techo \"Invalid import file!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($ret && $user_approved && db_is_valid_result(db_commit_transaction()))\r\n\t\t\t\techo \"All imports successful!\";\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\techo \"Error importing data!<p><a href=\\\"##pageroot##/?mode=import\\\">Back</a></p>\";\r\n\t\t}\r\n\t\t\t\r\n\t}else{\r\n\t\theader(\"Location: $cfg[page_root]?mode=import\");\t\r\n\t}\t\r\n\t\r\n\t// footer\r\n\techo \"<p><a href=\\\"##pageroot##/\\\">Return to main administrative menu</a></p>\";\r\n\t\r\n}", "public function endRun(): void\n {\n $file = $this->getLogDir() . 'timeReport.json';\n $data = is_file($file) ? json_decode(file_get_contents($file), true) : [];\n $data = array_replace($data, $this->timeList);\n file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT));\n }", "function export_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->export_data( $sync_tables );\n\t\t$this->db_tools->echo_export_data();\n\t}", "public function prepare_data_for_chart_by_days_acumulated($start, $end) {\n\t\t// sort and order the array here.\n\t\tglobal $wpdb;\n\t\t\n\t\t$sql = \"SELECT * FROM `\" . $wpdb->prefix . \"tr_characters`;\";\n\t\t\n\t\t$characters = $wpdb->get_results ( \"$sql\", ARRAY_A );\n\t\t\n\t\tif ($characters != null) {\n\t\t\t\n\t\t\t$chars_by_days = null;\n\t\t\t\n\t\t\tforeach ( $characters as $char ) {\n\t\t\t\t// run trough each char and create this array of date->amount for selected time period FOR EACH DAY WITHIN\n\t\t\t\t$character_data = $this->prepare_character_data_by_days_for_chart_acumulating ( $start, $end, $char ['owner_id'] );\n\t\t\t\tif ($character_data != null) {\n\t\t\t\t\t$chars_by_days [$char ['ownerName2']] = $character_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($chars_by_days == false) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * data should be sorted by main chars here.\n\t\t\t */\n\t\t\t$chars_by_days = $this->calculate_chart_data_by_mains ( $chars_by_days );\n\t\t\t\n\t\t\t$prepared_array = null;\n\t\t\t// add first row of the array\n\t\t\t$prepared_array [0] [0] = 'Date';\n\t\t\tforeach ( $chars_by_days as $key => $value ) {\n\t\t\t\t// echo $key;\n\t\t\t\t$prepared_array [0] [] = $key;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$start2 = new DateTime ( $start );\n\t\t\t$end2 = date ( \"Y-m-d H:i:s\", strtotime ( $end . \" +1 day\" ) );\n\t\t\t$end3 = new DateTime ( $end2 );\n\t\t\t\n\t\t\t$interval = DateInterval::createFromDateString ( '1 day' );\n\t\t\t\n\t\t\t$period = new DatePeriod ( $start2, $interval, $end3 );\n\t\t\t\n\t\t\t$a = 1;\n\t\t\t// run trough all dates\n\t\t\tforeach ( $period as $dt ) {\n\t\t\t\t$date = $dt->format ( \"Y-m-d\" );\n\t\t\t\t// add a date in begining\n\t\t\t\t$prepared_array [$a] [] = $date;\n\t\t\t\t// run trough each char and add a value from current day\n\t\t\t\tforeach ( $chars_by_days as $char ) {\n\t\t\t\t\t$prepared_array [$a] [] = $char [$date];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$a ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $prepared_array;\n\t}", "public function setEndDate($end_date)\n {\n $this->json()->end_date = $this->dateToString($end_date);\n }", "public function shutdown() \n\t{\n\t\tforeach ($this->data as $option_key => $option_value)\n\t\t{\n\t\t\t$is_new = true;\n\t\t\t$id = null;\n\t\t\t$checksum = '';\n\t\t\t\n\t\t\tif (array_key_exists($option_key, $this->key_map))\n\t\t\t{\n\t\t\t\t$is_new = false;\n\t\t\t\textract($this->key_map[$option_key]);\n\t\t\t}\n\n\t\t\t$value = serialize($option_value);\n\n\t\t\tif ($checksum === md5($value))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tDB::select('name')->from($this->table_name)->where('name', '=', $option_key)->execute();\n\n\t\t\tif (true === $is_new and DB::count_last_query() < 1)\n\t\t\t{\n\t\t\t\tDB::insert($this->table_name)->set(array(\n\t\t\t\t\t'name' => $option_key,\n\t\t\t\t\t'value' => $value,\n\t\t\t\t))->execute();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tDB::update($this->table_name)->set(array(\n\t\t\t\t\t'value' => $value,\n\t\t\t\t))->where('id', '=', $id)->execute(); \n\t\t\t}\n\t\t}\n\t}", "public function dataexportAction()\n {\n $dumpDirectory = $this->dataImport->dumpDirectory;\n $executeDumpExportFile = $dumpDirectory . self::executeExportDump;\n if (!file_exists($executeDumpExportFile) && $fileHandle = fopen($executeDumpExportFile, \"w\")) {\n $txt = '';\n if ($this->securityContext->canBeInitialized()) {\n if ($account = $this->securityContext->getAccount()) {\n $jobOwner = $this->bearbeiterRepository->findOneByAccount($account);\n $txt = 'Dieser Export wurde angelegt von ' . $jobOwner;\n }\n }\n fwrite($fileHandle, $txt);\n fclose($fileHandle);\n $currentTimeMinutes = date('i');\n $minutesFraction = substr($currentTimeMinutes, 1, 1);\n $nextImportDumpExecution = 10 - $minutesFraction;\n echo 'Die nächste Veröffentlichung wird in ' . $nextImportDumpExecution . ' Minuten durchgeführt.' . '<br>';\n echo 'Sie dauert ca. 5 Minuten.' . '<br>';\n }\n elseif (file_exists($executeDumpExportFile)) {\n echo \"Die Veröffentlichung ist bereits vorgemerkt.\";\n }\n else {\n echo \"Der Veröffentlichung-Job konnte leider nicht angelegt werden.\";\n }\n exit;\n }", "function erp_import_export_javascript() {\n global $current_screen;\n $hook = str_replace( sanitize_title( __( 'ERP Settings', 'erp' ) ), 'erp-settings', $current_screen->base );\n if ( 'wp-erp_page_erp-tools' !== $current_screen->base ) {\n return;\n }\n\n if ( ! isset( $_GET['tab'] ) || ! in_array( $_GET['tab'], [ 'import', 'export' ] ) ) {\n return;\n }\n\n $erp_fields = erp_get_import_export_fields();\n ?>\n <script type=\"text/javascript\">\n jQuery(document).ready(function ($) {\n\n function erp_str_title_case(string) {\n var str = string.replace(/_/g, ' ');\n\n return str.toLowerCase().split(' ').map(function (word) {\n return (word.charAt(0).toUpperCase() + word.slice(1));\n }).join(' ');\n }\n\n function erp_csv_field_mapper(file_selector, fields_selector) {\n var file = file_selector.files[0];\n\n var reader = new FileReader();\n\n var first5000 = file.slice(0, 5000);\n reader.readAsText(first5000);\n\n reader.onload = function (e) {\n var csv = reader.result;\n // Split the input into lines\n lines = csv.split('\\n'),\n // Extract column names from the first line\n columnNamesLine = lines[0];\n columnNames = columnNamesLine.split(',');\n\n var html = '';\n\n html += '<option value=\"\">&mdash; Select Field &mdash;</option>';\n columnNames.forEach(function (item, index) {\n item = item.replace(/\"/g, \"\");\n\n html += '<option value=\"' + index + '\">' + item + '</option>';\n });\n\n if (html) {\n $(fields_selector).html(html);\n\n var field, field_label;\n $(fields_selector).each(function () {\n field_label = $(this).parent().parent().find('label').text();\n\n var options = $(this).find('option');\n var targetOption = $(options).filter(function () {\n var option_text = $(this).html();\n\n var re = new RegExp(field_label, 'i');\n\n return re.test(option_text);\n });\n\n if (targetOption) {\n $(options).removeAttr(\"selected\");\n $(this).val($(targetOption).val());\n }\n });\n }\n };\n }\n\n function erp_csv_importer_field_handler(file_selector) {\n $('#fields_container').show();\n\n var fields_html = '';\n\n var type = $('form#import_form #type').val();\n\n fields = erp_fields[type] ? erp_fields[type].fields : [];\n required_fields = erp_fields[type] ? erp_fields[type].required_fields : [];\n\n var required = '';\n var red_span = '';\n for (var i = 0; i < fields.length; i++) {\n\n if (required_fields.indexOf(fields[i]) !== -1) {\n required = 'required';\n red_span = ' <span class=\"required\">*</span>';\n } else {\n required = '';\n red_span = '';\n }\n\n fields_html += `\n <tr>\n <th>\n <label for=\"fields[` + fields[i] + `]\" class=\"csv_field_labels\">` + erp_str_title_case(fields[i]) + red_span + `</label>\n </th>\n <td>\n <select name=\"fields[` + fields[i] + `]\" class=\"csv_fields\" ` + required + `>\n </select>\n </td>\n </tr>`;\n }\n\n $('#fields_container').html(fields_html);\n\n erp_csv_field_mapper(file_selector, '.csv_fields');\n }\n\n var fields = [];\n var required_fields = [];\n\n var erp_fields = <?php echo json_encode( $erp_fields ); ?>;\n\n var type = $('form#export_form #type').val();\n\n fields = erp_fields[type] ? erp_fields[type].fields : [];\n\n var html = '<ul class=\"erp-list list-inline\">';\n for (var i = 0; i < fields.length; i++) {\n html += '<li><label><input type=\"checkbox\" name=\"fields[]\" value=\"' + fields[i] + '\"> ' + erp_str_title_case(fields[i]) + '</label></li>';\n }\n\n html += '<ul>';\n\n if (html) {\n $('#fields').html(html);\n }\n\n $('form#export_form #type').on('change', function (e) {\n e.preventDefault();\n $(\"#export_form #selecctall\").prop('checked', false);\n var type = $(this).val();\n fields = erp_fields[type] ? erp_fields[type].fields : [];\n\n html = '<ul class=\"erp-list list-inline\">';\n for (var i = 0; i < fields.length; i++) {\n html += '<li><label><input type=\"checkbox\" name=\"fields[]\" value=\"' + fields[i] + '\"> ' + erp_str_title_case(fields[i]) + '</label></li>';\n }\n\n html += '<ul>';\n\n if (html) {\n $('form#export_form #fields').html(html);\n }\n });\n\n $('form#import_form #csv_file').on('change', function (e) {\n e.preventDefault();\n\n if (!this) {\n return;\n }\n\n erp_csv_importer_field_handler(this);\n });\n\n if ($('form#import_form').find('#type').val() == 'employee') {\n $('form#import_form').find('#crm_contact_lifestage_owner_wrap').hide();\n } else {\n $('form#import_form').find('#crm_contact_lifestage_owner_wrap').show();\n }\n\n $('form#import_form #type').on('change', function (e) {\n $('#fields_container').html('');\n $('#fields_container').hide();\n\n if ($(this).val() == 'employee') {\n $('form#import_form').find('#crm_contact_lifestage_owner_wrap').hide();\n } else {\n $('form#import_form').find('#crm_contact_lifestage_owner_wrap').show();\n }\n\n var sample_csv_url = $('form#import_form').find('#download_sample_wrap input').val();\n $('form#import_form').find('#download_sample_wrap a').attr('href', sample_csv_url + '&type=' + $(this).val());\n\n if ($('form#import_form #csv_file').val() == \"\") {\n return;\n } else {\n erp_csv_importer_field_handler($('form#import_form #csv_file').get(0));\n }\n });\n\n $(\"#export_form #selecctall\").change(function (e) {\n e.preventDefault();\n\n $(\"#export_form #fields input[type=checkbox]\").prop('checked', $(this).prop(\"checked\"));\n });\n\n $(\"#users_import_form\").on('submit', function (e) {\n e.preventDefault();\n statusDiv = $(\"div#import-status-indicator\");\n\n statusDiv.show();\n\n var form = $(this),\n submit = form.find('input[type=submit]');\n submit.attr('disabled', 'disabled');\n\n var data = {\n 'action': 'erp_import_users_as_contacts',\n 'user_role': $(this).find('select[name=user_role]').val(),\n 'contact_owner': $(this).find('select[name=contact_owner]').val(),\n 'life_stage': $(this).find('select[name=life_stage]').val(),\n 'contact_group': $(this).find('select[name=contact_group]').val(),\n '_wpnonce': $(this).find('input[name=_wpnonce]').val()\n };\n\n var total_items = 0, left = 0, imported = 0, exists = 0, percent = 0, type = 'success', message = '';\n\n $.post(ajaxurl, data, function (response) {\n if (response.success) {\n total_items = response.data.total_items;\n left = response.data.left;\n exists = response.data.exists;\n imported = total_items - left;\n done = imported - exists;\n\n if (imported > 0 || total_items > 0) {\n percent = Math.floor((100 / total_items) * (imported));\n\n type = 'success';\n message = 'Successfully imported all users!';\n } else {\n message = 'No users found to import!';\n type = 'error';\n }\n\n statusDiv.find('#progress-total').html(percent + '%');\n statusDiv.find('#progressbar-total').val(percent);\n statusDiv.find('#completed-total').html('Imported ' + done + ' out of ' + response.data.total_items);\n if (exists > 0) {\n statusDiv.find('#failed-total').html('Already Exist ' + exists);\n }\n\n if (response.data.left > 0) {\n form.submit();\n return;\n } else {\n submit.removeAttr('disabled');\n\n swal({\n title: '',\n text: message,\n type: type,\n confirmButtonText: 'OK',\n confirmButtonColor: '#008ec2'\n });\n }\n }\n });\n });\n\n });\n </script>\n <?php\n}", "function ExportData() {\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\n\t\t$bSelectLimit = $this->UseSelectLimit;\n\n\t\t// Load recordset\n\t\tif ($bSelectLimit) {\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\n\t\t} else {\n\t\t\tif (!$this->Recordset)\n\t\t\t\t$this->Recordset = $this->LoadRecordset();\n\t\t\t$rs = &$this->Recordset;\n\t\t\tif ($rs)\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\n\t\t}\n\t\t$this->StartRec = 1;\n\n\t\t// Export all\n\t\tif ($this->ExportAll) {\n\t\t\tset_time_limit(EW_EXPORT_ALL_TIME_LIMIT);\n\t\t\t$this->DisplayRecs = $this->TotalRecs;\n\t\t\t$this->StopRec = $this->TotalRecs;\n\t\t} else { // Export one page only\n\t\t\t$this->SetUpStartRec(); // Set up start record position\n\n\t\t\t// Set the last record to display\n\t\t\tif ($this->DisplayRecs <= 0) {\n\t\t\t\t$this->StopRec = $this->TotalRecs;\n\t\t\t} else {\n\t\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\n\t\t\t}\n\t\t}\n\t\tif ($bSelectLimit)\n\t\t\t$rs = $this->LoadRecordset($this->StartRec-1, $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs);\n\t\tif (!$rs) {\n\t\t\theader(\"Content-Type:\"); // Remove header\n\t\t\theader(\"Content-Disposition:\");\n\t\t\t$this->ShowMessage();\n\t\t\treturn;\n\t\t}\n\t\t$this->ExportDoc = ew_ExportDocument($this, \"h\");\n\t\t$Doc = &$this->ExportDoc;\n\t\tif ($bSelectLimit) {\n\t\t\t$this->StartRec = 1;\n\t\t\t$this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\n\t\t} else {\n\n\t\t\t//$this->StartRec = $this->StartRec;\n\t\t\t//$this->StopRec = $this->StopRec;\n\n\t\t}\n\n\t\t// Call Page Exporting server event\n\t\t$this->ExportDoc->ExportCustom = !$this->Page_Exporting();\n\t\t$ParentTable = \"\";\n\t\t$sHeader = $this->PageHeader;\n\t\t$this->Page_DataRendering($sHeader);\n\t\t$Doc->Text .= $sHeader;\n\t\t$this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, \"\");\n\t\t$sFooter = $this->PageFooter;\n\t\t$this->Page_DataRendered($sFooter);\n\t\t$Doc->Text .= $sFooter;\n\n\t\t// Close recordset\n\t\t$rs->Close();\n\n\t\t// Call Page Exported server event\n\t\t$this->Page_Exported();\n\n\t\t// Export header and footer\n\t\t$Doc->ExportHeaderAndFooter();\n\n\t\t// Clean output buffer\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\n\t\t\tob_end_clean();\n\n\t\t// Write debug message if enabled\n\t\tif (EW_DEBUG_ENABLED)\n\t\t\techo ew_DebugMsg();\n\n\t\t// Output data\n\t\t$Doc->Export();\n\t}", "function ExportData() {\r\n\t\t$utf8 = (strtolower(EW_CHARSET) == \"utf-8\");\r\n\t\t$bSelectLimit = FALSE;\r\n\r\n\t\t// Load recordset\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->TotalRecs = $this->SelectRecordCount();\r\n\t\t} else {\r\n\t\t\tif (!$this->Recordset)\r\n\t\t\t\t$this->Recordset = $this->LoadRecordset();\r\n\t\t\t$rs = &$this->Recordset;\r\n\t\t\tif ($rs)\r\n\t\t\t\t$this->TotalRecs = $rs->RecordCount();\r\n\t\t}\r\n\t\t$this->StartRec = 1;\r\n\t\t$this->SetUpStartRec(); // Set up start record position\r\n\r\n\t\t// Set the last record to display\r\n\t\tif ($this->DisplayRecs <= 0) {\r\n\t\t\t$this->StopRec = $this->TotalRecs;\r\n\t\t} else {\r\n\t\t\t$this->StopRec = $this->StartRec + $this->DisplayRecs - 1;\r\n\t\t}\r\n\t\tif (!$rs) {\r\n\t\t\theader(\"Content-Type:\"); // Remove header\r\n\t\t\theader(\"Content-Disposition:\");\r\n\t\t\t$this->ShowMessage();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->ExportDoc = ew_ExportDocument($this, \"v\");\r\n\t\t$Doc = &$this->ExportDoc;\r\n\t\tif ($bSelectLimit) {\r\n\t\t\t$this->StartRec = 1;\r\n\t\t\t$this->StopRec = $this->DisplayRecs <= 0 ? $this->TotalRecs : $this->DisplayRecs;\r\n\t\t} else {\r\n\r\n\t\t\t//$this->StartRec = $this->StartRec;\r\n\t\t\t//$this->StopRec = $this->StopRec;\r\n\r\n\t\t}\r\n\r\n\t\t// Call Page Exporting server event\r\n\t\t$this->ExportDoc->ExportCustom = !$this->Page_Exporting();\r\n\t\t$ParentTable = \"\";\r\n\t\t$sHeader = $this->PageHeader;\r\n\t\t$this->Page_DataRendering($sHeader);\r\n\t\t$Doc->Text .= $sHeader;\r\n\t\t$this->ExportDocument($Doc, $rs, $this->StartRec, $this->StopRec, \"view\");\r\n\r\n\t\t// Export detail records (observacion_tutor)\r\n\t\tif (EW_EXPORT_DETAIL_RECORDS && in_array(\"observacion_tutor\", explode(\",\", $this->getCurrentDetailTable()))) {\r\n\t\t\tglobal $observacion_tutor;\r\n\t\t\tif (!isset($observacion_tutor)) $observacion_tutor = new cobservacion_tutor;\r\n\t\t\t$rsdetail = $observacion_tutor->LoadRs($observacion_tutor->GetDetailFilter()); // Load detail records\r\n\t\t\tif ($rsdetail && !$rsdetail->EOF) {\r\n\t\t\t\t$ExportStyle = $Doc->Style;\r\n\t\t\t\t$Doc->SetStyle(\"h\"); // Change to horizontal\r\n\t\t\t\tif ($this->Export <> \"csv\" || EW_EXPORT_DETAIL_RECORDS_FOR_CSV) {\r\n\t\t\t\t\t$Doc->ExportEmptyRow();\r\n\t\t\t\t\t$detailcnt = $rsdetail->RecordCount();\r\n\t\t\t\t\t$observacion_tutor->ExportDocument($Doc, $rsdetail, 1, $detailcnt);\r\n\t\t\t\t}\r\n\t\t\t\t$Doc->SetStyle($ExportStyle); // Restore\r\n\t\t\t\t$rsdetail->Close();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$sFooter = $this->PageFooter;\r\n\t\t$this->Page_DataRendered($sFooter);\r\n\t\t$Doc->Text .= $sFooter;\r\n\r\n\t\t// Close recordset\r\n\t\t$rs->Close();\r\n\r\n\t\t// Call Page Exported server event\r\n\t\t$this->Page_Exported();\r\n\r\n\t\t// Export header and footer\r\n\t\t$Doc->ExportHeaderAndFooter();\r\n\r\n\t\t// Clean output buffer\r\n\t\tif (!EW_DEBUG_ENABLED && ob_get_length())\r\n\t\t\tob_end_clean();\r\n\r\n\t\t// Write debug message if enabled\r\n\t\tif (EW_DEBUG_ENABLED && $this->Export <> \"pdf\")\r\n\t\t\techo ew_DebugMsg();\r\n\r\n\t\t// Output data\r\n\t\t$Doc->Export();\r\n\t}", "public function finish()\n {\n // make sure the datetime column isn't blank\n $columns = $this->get_argument( 'columns' );\n if( !array_key_exists( 'datetime', $columns ) || 0 == strlen( $columns['datetime'] ) )\n throw lib::create( 'exception\\notice', 'The date/time cannot be left blank.', __METHOD__ );\n \n foreach( $columns as $column => $value ) $this->get_record()->$column = $value;\n \n // do not include the user_id if this is a site appointment\n if( 0 < $this->get_record()->address_id ) $this->get_record()->user_id = NULL;\n \n if( !$this->get_record()->validate_date() )\n throw lib::create( 'exception\\notice',\n sprintf(\n 'The participant is not ready for a %s appointment.',\n 0 < $this->get_record()->address_id ? 'home' : 'site' ), __METHOD__ );\n \n // no errors, go ahead and make the change\n parent::finish();\n }", "static function add_eb_nom_end(): void {\r\n\t\tself::add_acf_inner_field(self::ebs, self::eb_nom_end, [\r\n\t\t\t'label' => 'Nomination period end',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'e.g. March 26 @ 11 p.m.',\r\n\t\t\t'required' => 1,\r\n\t\t\t'conditional_logic' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'field' => self::qualify_field(self::eb_finished),\r\n\t\t\t\t\t\t'operator' => '!=',\r\n\t\t\t\t\t\t'value' => '1',\r\n\t\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t]);\r\n\t}", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function getEndDate() {\n\n return $this->end_date;\n }", "protected function initData()\n {\n foreach (['data', 'uploads'] as $option) {\n $value = $this->option($option);\n if ($value) {\n $this->info[$option] = explode(',', $value);\n }\n }\n }", "public function getEndDate()\n {\n return $this->stringToDate((string) $this->json()->end_date);\n }", "public function run()\n {\n DB::table('options')->truncate();\n\t\tOption::create(array(\n\t\t\t'name' => 'Lĩnh vực',\n\t\t));\n\t\t\n\t\tOption::create(array(\n\t\t\t'name' => 'Package',\n\t\t));\n\n\t\tOption::create(array(\n\t\t\t'name' => 'Card level',\n\t\t));\n\n\t\tOption::create(array(\n\t\t\t'name' => 'Card chops chops',\n\t\t));\n\t\t\n\t\tOption::create(array(\n\t\t\t'name' => 'Month',\n\t\t));\n }", "public function export_entries()\n {\n }", "protected function postImport(){\n foreach(MigrateDestinationFieldGroup::getFieldGroupModes() as $mode){\n $group = field_group_load_field_group('group_misc', 'taxonomy_term', $this->vocabulary->machine_name, $mode);\n if($group){\n $group->children = array_merge($group->children, $this->destination->getFieldsCreated());\n field_group_group_save($group);\n }\n }\n }", "public function getEndDate()\r\n\t\t{\r\n\t\t\treturn $this->end_date;\r\n\t\t}", "protected function uploadOptions( &$reader, $incremental ) {\n\t\t$data = $reader->getSheetByName( 'Options' );\n\t\tif ($data==null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// find the installed languages\n\t\t$languages = $this->getLanguages();\n\n\t\t// if not incremental then delete all old options\n\t\tif (!$incremental) {\n\t\t\t$this->deleteOptions();\n\t\t}\n\n\t\t// load the worksheet cells and store them to the database\n\t\t$first_row = array();\n\t\t$i = 0;\n\t\t$k = $data->getHighestRow();\n\t\tfor ($i=0; $i<$k; $i+=1) {\n\t\t\tif ($i==0) {\n\t\t\t\t$max_col = PHPExcel_Cell::columnIndexFromString( $data->getHighestColumn() );\n\t\t\t\tfor ($j=1; $j<=$max_col; $j+=1) {\n\t\t\t\t\t$first_row[] = $this->getCell($data,$i,$j);\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$j = 1;\n\t\t\t$option_id = trim($this->getCell($data,$i,$j++));\n\t\t\tif ($option_id=='') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$type = $this->getCell($data,$i,$j++,'');\n\t\t\t$sort_order = $this->getCell($data,$i,$j++,'0');\n\t\t\t$names = array();\n\t\t\twhile (($j<=$max_col) && $this->startsWith($first_row[$j-1],\"name(\")) {\n\t\t\t\t$language_code = substr($first_row[$j-1],strlen(\"name(\"),strlen($first_row[$j-1])-strlen(\"name(\")-1);\n\t\t\t\t$name = $this->getCell($data,$i,$j++);\n\t\t\t\t$name = htmlspecialchars( $name );\n\t\t\t\t$names[$language_code] = $name;\n\t\t\t}\n\t\t\t$option = array();\n\t\t\t$option['option_id'] = $option_id;\n\t\t\t$option['type'] = $type;\n\t\t\t$option['sort_order'] = $sort_order;\n\t\t\t$option['names'] = $names;\n\t\t\tif ($incremental) {\n\t\t\t\t$this->deleteOption( $option_id );\n\t\t\t}\n\t\t\t$this->moreOptionCells( $i, $j, $data, $option );\n\t\t\t$this->storeOptionIntoDatabase( $option, $languages );\n\t\t}\n\t}", "function admin_import_episodes($id=NULL) \r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n\t\t$data['title'] = \"Import Episodes\";\r\n\t\t$data['form_purpose'] = \t\"new_export\";\r\n\r\n\t\t$data['current_db']\t\t\t=\t$this->db->database; \t\t\r\n $data['now_id'] = time();\r\n\t\t// define directory path\r\n\t\t//$data['directory'] = '/var/www/thirra-uploads/imports_consult';\r\n $data['baseurl'] = base_url();\r\n $data['exploded_baseurl'] = explode('/', $data['baseurl'], 4);\r\n $data['app_folder'] = substr($data['exploded_baseurl'][3], 0, -1);\r\n $data['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'];\r\n if(substr($data['DOCUMENT_ROOT'],-1) === \"/\"){\r\n // Do nothing\r\n } else {\r\n // Add a slash\r\n $data['DOCUMENT_ROOT'] = $data['DOCUMENT_ROOT'].'/';\r\n }\r\n $data['app_path'] = $data['DOCUMENT_ROOT'].$data['app_folder'];\r\n $data['import_path'] = $data['app_path'].\"-uploads/imports_consult\";\r\n\t\t$data['directory'] = $data['import_path'];\r\n\t\t// get directory contents as an array\r\n\t\t$data['fileList'] = scandir($data['directory']) or die (\"Not a directory\");\r\n\t\t// print file names and sizes\r\n\t\t//$data['unsynched_list'] =\tarray('0' => array('filename' => 'patient_demo.xml','export_date' => '2010-01-20'));\r\n\t\t//$data['unsynched_list'] = $this->madmin_rdb->get_unsynched_patients();\r\n\t\t$data['synched_list'] = $this->madmin_rdb->get_unsynched_patients(TRUE);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_emr_wap\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_wap\";\r\n $new_body = \"ehr/emr_newpage_wap\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_import_episodes_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n }", "function add_day() {\n\t\t\t$date = new DateTime($this->entry_date);\n\t\t\t\n\t\t\t$qry = sprintf(\"INSERT INTO %s (tkr_id, entry_date, open, high, low, close, volume, adj_close) \n\t\t\t\t\tVALUES (%d,'%s',%8.2f,%8.2f,%8.2f,%8.2f,%d,%8.2f)\",\n\t\t\t\t\tmysql_real_escape_string(HISTORICAL_TBL), $this->tkr_id, mysql_real_escape_string($date->format('Y-m-d')),\n\t\t\t\t\t$this->open, $this->high, $this->low, $this->close, $this->vol, $this->adj_close);\n\t\t\tmysql_query($qry) or die(mysql_error());\n\t\t\t}", "public function setEndDate($date)\n {\n\t\tif($date==null){\n\t\t\t$this->complete_at = null;\n\t\t\t$this->save();\n\t\t\t$this->fireModelEvent('end-refreshed');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif($this->complete_at){\n\t\t\tif($model->complete_at->greaterThan($date)){\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-delayed');\n\t\t\t}else{\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-forwarded');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->complete_at = $date;\n \t$this->save();\n\t\t\t$this->fireModelEvent('end-inited');\n\t\t}\n }", "public function run()\n {\n DB::table('options')->truncate();\n DB::table('options')\n ->insert([\n ['option_key' => 'date_format', 'option_value' => 'F j, Y'],\n ['option_key' => 'time_format', 'option_value' => 'g:i A'],\n ['option_key' => 'logo_settings', 'option_value' => 'show_site_name'],\n ['option_key' => 'verification_email_after_registration', 'option_value' => '1'],\n ['option_key' => 'site_name', 'option_value' => 'LaraBid'],\n ['option_key' => 'site_title', 'option_value' => 'The Best Auction Website'],\n ['option_key' => 'email_address', 'option_value' => '[email protected]'],\n ['option_key' => 'default_timezone', 'option_value' => 'America/New_York'],\n ['option_key' => 'date_format_custom', 'option_value' => 'F j, Y'],\n ['option_key' => 'time_format_custom', 'option_value' => 'g:i A'],\n ['option_key' => 'currency_sign', 'option_value' => 'USD'],\n ['option_key' => 'ads_moderation', 'option_value' => 'need_moderation'],\n ['option_key' => 'ads_price_plan', 'option_value' => 'regular_ads_free_premium_paid'],\n ['option_key' => 'enable_related_ads', 'option_value' => '1'],\n ['option_key' => 'regular_ads_price', 'option_value' => NULL],\n ['option_key' => 'premium_ads_price', 'option_value' => '5'],\n ['option_key' => 'urgent_ads_price', 'option_value' => '8'],\n ['option_key' => 'number_of_urgent_ads_in_home', 'option_value' => '5'],\n ['option_key' => 'number_of_premium_ads_in_home', 'option_value' => '5'],\n ['option_key' => 'number_of_free_ads_in_home', 'option_value' => '12'],\n ['option_key' => 'ads_per_page', 'option_value' => '20'],\n ['option_key' => 'number_of_premium_ads_in_listing', 'option_value' => NULL],\n ['option_key' => 'premium_ads_max_impressions', 'option_value' => NULL],\n ['option_key' => 'number_of_last_days_premium_ads', 'option_value' => NULL],\n ['option_key' => 'enable_paypal', 'option_value' => '1'],\n ['option_key' => 'enable_stripe', 'option_value' => '1'],\n ['option_key' => 'enable_paypal_sandbox', 'option_value' => '1'],\n ['option_key' => 'paypal_receiver_email', 'option_value' => '[email protected]'],\n ['option_key' => 'stripe_test_secret_key', 'option_value' => 'sk_test_tJeAdA1KbhiYV8I8bfPmJcOL'],\n ['option_key' => 'stripe_test_publishable_key', 'option_value' => 'pk_test_P3TFmKrvT7l29Zpyy1f4pwk8'],\n ['option_key' => 'stripe_live_secret_key', 'option_value' => NULL],\n ['option_key' => 'stripe_live_publishable_key', 'option_value' => NULL],\n ['option_key' => 'default_storage', 'option_value' => 'public'],\n ['option_key' => 'amazon_key', 'option_value' => NULL],\n ['option_key' => 'amazon_secret', 'option_value' => NULL],\n ['option_key' => 'amazon_region', 'option_value' => NULL],\n ['option_key' => 'bucket', 'option_value' => NULL],\n ['option_key' => 'stripe_test_mode', 'option_value' => '1'],\n ['option_key' => 'currency_position', 'option_value' => 'left'],\n ['option_key' => 'google_map_api_key', 'option_value' => 'AIzaSyCQuDQmtiHkS7CcriyEiYXWja3ODrG4vFI'],\n ['option_key' => 'enable_google_maps', 'option_value' => '1'],\n ['option_key' => 'enable_comments', 'option_value' => '1'],\n ['option_key' => 'enable_fb_comments', 'option_value' => '1'],\n ['option_key' => 'facebook_url', 'option_value' => '#'],\n ['option_key' => 'twitter_url', 'option_value' => '#'],\n ['option_key' => 'linked_in_url', 'option_value' => '#'],\n ['option_key' => 'dribble_url', 'option_value' => '#'],\n ['option_key' => 'google_plus_url', 'option_value' => '#'],\n ['option_key' => 'youtube_url', 'option_value' => '#'],\n ['option_key' => 'countries_usage', 'option_value' => 'all_countries'],\n ['option_key' => 'enable_social_login', 'option_value' => '1'],\n ['option_key' => 'enable_facebook_login', 'option_value' => '1'],\n ['option_key' => 'fb_app_id', 'option_value' => '807346162754117'],\n ['option_key' => 'fb_app_secret', 'option_value' => '6b93030d5c4f2715aa9d02be93256fbd'],\n ['option_key' => 'google_client_id', 'option_value' => '62019812075-0sp3u7h854tp7aknl1m8q7ens0pm4im0.apps.googleusercontent.com'],\n ['option_key' => 'google_client_secret', 'option_value' => 'xK8SHn-ds4GJtVSL95ExTzw3'],\n ['option_key' => 'enable_google_login', 'option_value' => '1'],\n ['option_key' => 'enable_twitter_login', 'option_value' => '1'],\n ['option_key' => 'twitter_consumer_key', 'option_value' => 'cOiq6W7Ot8HQH1GAfGd2pGZy8'],\n ['option_key' => 'twitter_client_secret', 'option_value' => 'XItViEyIRVMrhexIqg9S9DSZQdsOHGDvQush3BAgqdm5M1ivHx'],\n ['option_key' => 'twitter_consumer_secret', 'option_value' => 'XItViEyIRVMrhexIqg9S9DSZQdsOHGDvQush3BAgqdm5M1ivHx'],\n ['option_key' => 'logo', 'option_value' => '1515332341evaib-logo.png'],\n ['option_key' => 'logo_storage', 'option_value' => 'public'],\n ['option_key' => 'enable_language_switcher', 'option_value' => '1'],\n ['option_key' => 'recaptcha_site_key', 'option_value' => '6LfSyyMUAAAAAPA6f8iIP7WB51Bw3xKipBHlvdz_'],\n ['option_key' => 'recaptcha_secret_key', 'option_value' => '6LfSyyMUAAAAAHeMy-PyshlTJcbE3sbsddOGw6gk'],\n ['option_key' => 'enable_recaptcha_login', 'option_value' => '0'],\n ['option_key' => 'enable_recaptcha_registration', 'option_value' => '0'],\n ['option_key' => 'enable_recaptcha_post_ad', 'option_value' => '0'],\n ['option_key' => 'google_map_embedded_code', 'option_value' => '<iframe src=\\\"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2867.3732463742!2d-73.98604123059546!3d40.75928510320901!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89c25855b8fb3083%3A0xa0f9aef176042a5c!2sTheater+District%2C+New+York%2C+NY%2C+USA!5e0!3m2!1sen!2sbd!4v1515333304629\\\" width=\\\"600\\\" height=\\\"450\\\" frameborder=\\\"0\\\" style=\\\"border:0\\\" allowfullscreen></iframe>'],\n ['option_key' => 'footer_address', 'option_value' => 'Times Square, Manhattan, New York, NY, USA'],\n ['option_key' => 'site_phone_number', 'option_value' => '+10099234534'],\n ]);\n }", "public function exportData(): void\n\t{\n\t\t$entries = [];\n\t\tif (!$this->exportColumns && $this->quickExport && $this->queryOptions['viewname']) {\n\t\t\t[$headers, $entries] = $this->getEntriesForQuickExport();\n\t\t} else {\n\t\t\t[$headers, $entries] = $this->getEntriesExport();\n\t\t}\n\t\t$this->output($headers, $entries);\n\t}", "public function test_force_import_option () {\n\n // Need to add users into the system.\n $user = new stdClass();\n $user->firstname = 'Anne';\n $user->lastname = 'Able';\n $user->email = '[email protected]';\n $user->id_number = 1;\n $user1 = $this->getDataGenerator()->create_user($user);\n $user = new stdClass();\n $user->firstname = 'Bobby';\n $user->lastname = 'Bunce';\n $user->email = '[email protected]';\n $user->id_number = 2;\n $user2 = $this->getDataGenerator()->create_user($user);\n\n // Create a new grade item.\n $params = array(\n 'itemtype' => 'manual',\n 'itemname' => 'Grade item 1',\n 'gradetype' => GRADE_TYPE_VALUE,\n 'courseid' => $this->courseid\n );\n $gradeitem = new grade_item($params, false);\n $gradeitemid = $gradeitem->insert();\n\n $importcode = 001;\n $verbosescales = 0;\n\n // Form data object.\n $formdata = new stdClass();\n $formdata->mapfrom = 5;\n $formdata->mapto = 'useremail';\n $formdata->mapping_0 = 0;\n $formdata->mapping_1 = 0;\n $formdata->mapping_2 = 0;\n $formdata->mapping_3 = 0;\n $formdata->mapping_4 = 0;\n $formdata->mapping_5 = 0;\n $formdata->mapping_6 = $gradeitemid;\n $formdata->mapping_7 = 'feedback_2';\n $formdata->mapping_8 = 0;\n $formdata->mapping_9 = 0;\n $formdata->map = 1;\n $formdata->id = 2;\n $formdata->iid = $this->iid;\n $formdata->importcode = $importcode;\n $formdata->forceimport = false;\n\n // Add last download from this course column to csv content.\n $exportdate = time();\n $newcsvdata = str_replace('{exportdate}', $exportdate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertTrue($dataloaded);\n\n // We must update the last modified date.\n grade_import_commit($this->courseid, $importcode, false, false);\n\n // Test using force import disabled and a date in the past.\n $pastdate = strtotime('-1 day', time());\n $newcsvdata = str_replace('{exportdate}', $pastdate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('gradealreadyupdated', 'grades', fullname($user1)));\n\n // Test using force import enabled and a date in the past.\n $formdata->forceimport = true;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertTrue($dataloaded);\n\n // Test importing using an old exported file (2 years ago).\n $formdata->forceimport = false;\n $twoyearsago = strtotime('-2 year', time());\n $newcsvdata = str_replace('{exportdate}', $twoyearsago, $this->csvtext);\n $this->csv_load($newcsvdata);\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n\n // Test importing using invalid exported date.\n $baddate = '0123A56B89';\n $newcsvdata = str_replace('{exportdate}', $baddate, $this->csvtext);\n $this->csv_load($newcsvdata);\n $formdata->mapping_6 = $gradeitemid;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n\n // Test importing using date in the future.\n $oneyearahead = strtotime('+1 year', time());\n $oldcsv = str_replace('{exportdate}', $oneyearahead, $this->csvtext);\n $this->csv_load($oldcsv);\n $formdata->mapping_6 = $gradeitemid;\n $testobject = new phpunit_gradeimport_csv_load_data();\n $dataloaded = $testobject->prepare_import_grade_data($this->columns, $formdata, $this->csvimport,\n $this->courseid, '', '', $verbosescales);\n $this->assertFalse($dataloaded);\n $errors = $testobject->get_gradebookerrors();\n $this->assertEquals($errors[0], get_string('invalidgradeexporteddate', 'grades'));\n }", "protected function _treatEndReadingKeyOption( $endReadingKey = null )\n {\n if ( null === $endReadingKey ) {\n // exit and use the default value\n return null;\n }\n\n $valid = (\n is_string( $endReadingKey )\n && strlen( $endReadingKey ) === 1\n && in_array( $endReadingKey, Streamwide_Engine_Dtmf_Handler::getAllDtmfsList() )\n );\n\n if ( $valid ) {\n $this->_options[self::OPT_END_READING_KEY] = $endReadingKey;\n } else {\n trigger_error( sprintf( 'Option \"%s\" was provided with an invalid value. Using default value', self::OPT_END_READING_KEY ) );\n }\n }", "private function _get_option_eod_summary_files()\n {\n $files = [];\n \n if(is_dir('/Users/spicer/Dropbox/Apps/Stockpeer'))\n {\n $base = '/Users/spicer/Dropbox/Apps/Stockpeer/';\n } else\n {\n $base = '/tmp/market_data/';\n $this->_get_data_from_dropbox();\n }\n \n foreach($this->eod_option_summary_files AS $key => $row)\n {\n $files[] = $base . $row; \n }\n \n return $files;\n }", "abstract public function bootEndTabSet();", "public function test_end_date_format_type()\n {\n // show actiual errors without handling\n ////$this->withoutExceptionHandling();\n \n $this->json('POST', '/', array_merge($this->data(),['end_date'=>'abc']))\n ->seeJson([\n 'end_date' => [\"The end date does not match the format Y-m-d.\",\"The end date is not a valid date.\",\"The end date must be a date after or equal to start date.\",\"The end date must be a date before or equal to today.\"]\n ]);\n }", "public function setEndDate($endDate='')\r\n\t\t{\r\n\t\t\tif ($endDate != '')\r\n\t\t\t{\r\n\t\t\t\t$this->end_date = $endDate;\r\n\t\t\t}\r\n\t\t}", "public function prepare_data_to_import($import_data, $form_data, $batch_offset, $is_last_batch) {\n \n $this->found_action = !empty($form_data['advanced_form_data']['wt_iew_found_action']) ? $form_data['advanced_form_data']['wt_iew_found_action'] : 'skip'; \n $this->id_conflict = !empty($form_data['advanced_form_data']['wt_iew_id_conflict']) ? $form_data['advanced_form_data']['wt_iew_id_conflict'] : 'skip'; \n $this->merge_empty_cells = !empty($form_data['advanced_form_data']['wt_iew_merge_empty_cells']) ? 1 : 0; \n $this->skip_new = !empty($form_data['advanced_form_data']['wt_iew_skip_new']) ? 1 : 0; \n\n \n// $this->merge = !empty($form_data['advanced_form_data']['wt_iew_merge']) ? 1 : 0; \n// $this->use_same_id = !empty($form_data['advanced_form_data']['wt_iew_use_same_id']) ? 1 : 0;\n\n \n $this->delete_existing = !empty($form_data['advanced_form_data']['wt_iew_delete_existing']) ? 1 : 0;\n\n $this->ord_link_using_sku = !empty($form_data['advanced_form_data']['wt_iew_ord_link_using_sku']) ? 1 : 0;\n $this->create_user = !empty($form_data['advanced_form_data']['wt_iew_create_user']) ? 1 : 0;\n $this->notify_customer = !empty($form_data['advanced_form_data']['wt_iew_notify_customer']) ? 1 : 0; \n $this->status_mail = !empty($form_data['advanced_form_data']['wt_iew_status_mail']) ? 1 : 0;\n \n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Preparing for import.\");\n\n $success = 0;\n $failed = 0;\n $msg = 'Order imported successfully.';\n \n foreach ($import_data as $key => $data) { \n $row = $batch_offset+$key+1;\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Parsing item.\");\n $parsed_data = $this->parse_data($data); \n if (!is_wp_error($parsed_data)){\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Processing item.\");\n $result = $this->process_item($parsed_data);\n if(!is_wp_error($result)){\n if($this->is_order_exist){\n $msg = 'Order updated successfully.';\n }\n $this->import_results[$row] = array('row'=>$row, 'message'=>$msg, 'status'=>true, 'post_id'=>$result['id']); \n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - \".$msg); \n $success++; \n }else{\n $this->import_results[$row] = array('row'=>$row, 'message'=>$result->get_error_message(), 'status'=>false, 'post_id'=>'');\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Processing failed. Reason: \".$result->get_error_message()); \n $failed++;\n } \n }else{\n $this->import_results[$row] = array('row'=>$row, 'message'=>$parsed_data->get_error_message(), 'status'=>false, 'post_id'=>'');\n Wt_Import_Export_For_Woo_Logwriter::write_log($this->parent_module->module_base, 'import', \"Row :$row - Parsing failed. Reason: \".$parsed_data->get_error_message()); \n $failed++; \n } \n }\n \n if($is_last_batch && $this->delete_existing){\n $this->delete_existing(); \n } \n \n $this->clean_after_import();\n \n $import_response=array(\n 'total_success'=>$success,\n 'total_failed'=>$failed,\n 'log_data'=>$this->import_results,\n );\n\n return $import_response;\n }", "function getEndDate() \n\t{\n\t\treturn (strlen($this->end_date)) ? $this->end_date : NULL;\n\t}", "public static function get_export_options() {\n\n\t\t$order_statuses = wc_get_order_statuses();\n\t\t$product_categories = array();\n\n\t\tforeach ( get_terms( 'product_cat' ) as $term ) {\n\t\t\t$product_categories[ $term->term_id ] = $term->name;\n\t\t}\n\n\t\t$options = array(\n\n\t\t\t'export_section_title' => array(\n\t\t\t\t'name' => __( 'Export', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'title',\n\t\t\t),\n\n\t\t\t'type' => array(\n\t\t\t\t'id' => 'type',\n\t\t\t\t'name' => __( 'Export Type', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'radio',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'orders' => __( 'Orders', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t\t'customers' => __( 'Customers', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t\t'default' => 'orders',\n\t\t\t),\n\n\t\t\t'export_section_end' => array( 'type' => 'sectionend' ),\n\n\t\t\t'export_options_section_title' => array(\n\t\t\t\t'name' => __( 'Export Options', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'title',\n\t\t\t),\n\n\t\t\t'statuses' => array(\n\t\t\t\t'id' => 'statuses',\n\t\t\t\t'name' => __( 'Order Statuses', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc_tip' => __( 'Orders with these statuses will be included in the export.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => $order_statuses,\n\t\t\t\t'default' => '',\n\t\t\t\t'class' => 'wc-enhanced-select show_if_orders',\n\t\t\t\t'css' => 'min-width: 250px',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'data-placeholder' => __( 'Leave blank to export orders with any status.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'product_categories' => array(\n\t\t\t\t'id' => 'product_categories',\n\t\t\t\t'name' => __( 'Product Categories', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc_tip' => __( 'Orders with products in these categories will be included in the export.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => $product_categories,\n\t\t\t\t'default' => '',\n\t\t\t\t'class' => 'wc-enhanced-select show_if_orders',\n\t\t\t\t'css' => 'min-width: 250px',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'data-placeholder' => __( 'Leave blank to export orders with products in any category.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'products' => array(\n\t\t\t\t'id' => 'products',\n\t\t\t\t'name' => __( 'Products', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc_tip' => __( 'Orders with these products will be included in the export.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'csv_product_search',\n\t\t\t\t'default' => '',\n\t\t\t\t'class' => 'wc-product-search show_if_orders',\n\t\t\t\t'css' => 'min-width: 250px',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'data-multiple' => 'true',\n\t\t\t\t\t'data-action' => 'woocommerce_json_search_products_and_variations',\n\t\t\t\t\t'data-placeholder' => __( 'Leave blank to export orders with any products.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'coupon_product_categories' => array(\n\t\t\t\t'id' => 'coupon_product_categories',\n\t\t\t\t'name' => __( 'Product Categories', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc_tip' => __( 'Coupons that apply to these categories will be included in the export.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => $product_categories,\n\t\t\t\t'default' => '',\n\t\t\t\t'class' => 'wc-enhanced-select show_if_coupons',\n\t\t\t\t'css' => 'min-width: 250px',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'data-placeholder' => __( 'Leave blank to export coupons that apply to any category.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'coupon_products' => array(\n\t\t\t\t'id' => 'coupon_products',\n\t\t\t\t'name' => __( 'Products', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc_tip' => __( 'Coupons that apply to these products will be included in the export.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'csv_product_search',\n\t\t\t\t'default' => '',\n\t\t\t\t'class' => 'wc-product-search show_if_coupons',\n\t\t\t\t'css' => 'min-width: 250px',\n\t\t\t\t'custom_attributes' => array(\n\t\t\t\t\t'data-multiple' => 'true',\n\t\t\t\t\t'data-action' => 'woocommerce_json_search_products_and_variations',\n\t\t\t\t\t'data-placeholder' => __( 'Leave blank to export coupons that apply to any products.', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t'start_date' => array(\n\t\t\t\t'id' => 'start_date',\n\t\t\t\t'name' => __( 'Start Date', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc' => __( 'Start date of customers or orders to include in the exported file, in the format <code>YYYY-MM-DD.</code>', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\n\t\t\t'end_date' => array(\n\t\t\t\t'id' => 'end_date',\n\t\t\t\t'name' => __( 'End Date', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc' => __( 'End date of customers or orders to include in the exported file, in the format <code>YYYY-MM-DD.</code>', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\n\t\t\t'export_options_section_end' => array( 'type' => 'sectionend' ),\n\n\t\t);\n\n\t\t// add Coupons to export types only if enabled\n\t\tif ( wc_customer_order_csv_export()->is_coupon_export_enabled() ) {\n\t\t\t$options['type']['options']['coupons'] = __( 'Coupons', 'woocommerce-customer-order-csv-export' );\n\t\t}\n\n\t\tif ( wc_customer_order_csv_export()->is_plugin_active( 'woocommerce-subscriptions.php' ) ) {\n\n\t\t\t$options['subscription_options_section_title'] = array(\n\t\t\t\t'name' => __( 'Subscriptions Options', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'title',\n\t\t\t);\n\n\t\t\t$options['subscription_orders'] = array(\n\t\t\t\t'id' => 'subscription_orders',\n\t\t\t\t'title' => __( 'Export Subscriptions Orders Only', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'desc' => __( 'Export subscription orders', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'checkboxgroup' => 'start',\n\t\t\t);\n\n\t\t\t$options['subscription_renewals'] = array(\n\t\t\t\t'id' => 'subscription_renewals',\n\t\t\t\t'desc' => __( 'Export renewal orders', 'woocommerce-customer-order-csv-export' ),\n\t\t\t\t'type' => 'checkbox',\n\t\t\t\t'checkboxgroup' => 'end',\n\t\t\t);\n\n\t\t\t$options['subscription_options_section_end'] = array( 'type' => 'sectionend' );\n\n\t\t}\n\n\n\t\t/**\n\t\t * Allow actors to add or remove options from the CSV export page.\n\t\t *\n\t\t * @since 4.0.0\n\t\t * @param array $options an array of options for the export tab\n\t\t */\n\t\treturn apply_filters( 'wc_customer_order_csv_export_options', $options );\n\t}", "protected function uploadInstrumentOptions( &$reader, $incremental, &$available_instrument_ids ) {\n\t\t$data = $reader->getSheetByName( 'InstrumentOptions' );\n\t\tif ($data==null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// if incremental then find current instrument IDs else delete all old instrument options\n\t\tif ($incremental) {\n\t\t\t$unlisted_instrument_ids = $available_instrument_ids;\n\t\t} else {\n\t\t\t$this->deleteInstrumentOptions();\n\t\t}\n\n\t\tif (!$this->config->get( 'export_import_settings_use_option_id' )) {\n\t\t\t$option_ids = $this->getOptionIds();\n\t\t}\n\n\t\t// load the worksheet cells and store them to the database\n\t\t$old_instrument_option_ids = array();\n\t\t$previous_instrument_id = 0;\n\t\t$i = 0;\n\t\t$k = $data->getHighestRow();\n\t\tfor ($i=0; $i<$k; $i+=1) {\n\t\t\t$j = 1;\n\t\t\tif ($i==0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$instrument_id = trim($this->getCell($data,$i,$j++));\n\t\t\tif ($instrument_id=='') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($this->config->get( 'export_import_settings_use_option_id' )) {\n\t\t\t\t$option_id = $this->getCell($data,$i,$j++,'');\n\t\t\t} else {\n\t\t\t\t$option_name = $this->getCell($data,$i,$j++);\n\t\t\t\t$option_id = isset($option_ids[$option_name]) ? $option_ids[$option_name] : '';\n\t\t\t}\n\t\t\tif ($option_id=='') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$option_value = $this->getCell($data,$i,$j++,'');\n\t\t\t$required = $this->getCell($data,$i,$j++,'0');\n\t\t\t$instrument_option = array();\n\t\t\t$instrument_option['instrument_id'] = $instrument_id;\n\t\t\t$instrument_option['option_id'] = $option_id;\n\t\t\t$instrument_option['option_value'] = $option_value;\n\t\t\t$instrument_option['required'] = $required;\n\t\t\tif (($incremental) && ($instrument_id != $previous_instrument_id)) {\n\t\t\t\t$old_instrument_option_ids = $this->deleteInstrumentOption( $instrument_id );\n\t\t\t\tif (isset($unlisted_instrument_ids[$instrument_id])) {\n\t\t\t\t\tunset($unlisted_instrument_ids[$instrument_id]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->moreInstrumentOptionCells( $i, $j, $data, $instrument_option );\n\t\t\t$this->storeInstrumentOptionIntoDatabase( $instrument_option, $old_instrument_option_ids );\n\t\t\t$previous_instrument_id = $instrument_id;\n\t\t}\n\t\tif ($incremental) {\n\t\t\t$this->deleteUnlistedInstrumentOptions( $unlisted_instrument_ids );\n\t\t}\n\t}", "private function fetchList($end = 7500)\n {\n $end +=5; //Offset for the start of XLS\n $file = 'ipo_data.xls';\n $url = \"http://www.ipomonitor.com/pages/ipo-filings.html?start=0&max=$end&export=excel\";\n\n $fileName = $this->dataFile($file, $url);\n $excelReader = PHPExcel_IOFactory::createReaderForFile($fileName);\n //if we dont need any formatting on the data\n $excelReader->setReadDataOnly();\n //the default behavior is to load all sheets\n $excelReader->setLoadAllSheets();\n\n $excelObj = $excelReader->load($fileName);\n $excelLoaded = $excelObj->getActiveSheet()->rangeToArray(\"E5:G$end\");\n $results = array();\n\n foreach ($excelLoaded as $key => $row) {\n if($row[0] != NULL)\n {\n $results[] = [$row[0], $row[2]];\n }\n }\n\n return $results;\n }", "public function setEndDateAttribute($date)\n {\n $this->attributes['end_date'] = $date ? Carbon::parse($date) : null;\n }", "public function setEnd(ilDateTime $a_date = null)\n\t{\n\t\t$this->end = $a_date;\n\t}", "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 importdinst()\n {\n\n // $start_week = DB::select(\"SELECT startweek FROM pmanagers WHERE name = 'inst'\");\n\n // $start_week = $start_week[0]->startweek; // Semana de inicio de la curva, viene de Pmanager\n\n // $hinsts_total = DB::select(\"SELECT CURDATE() AS date, 'TOTAL' AS area, SUM(total_progress) AS progress FROM pinsts_view\");\n // $progress_inst = DB::select(\"SELECT DISTINCT total_pinsthours FROM total_pinsts_view\"); \n\n // $current_date = date('Y-m-d'); // Para echar una semana atrás\n\n // if (!is_null($progress_inst[0]->total_pinsthours)){ // valido existencia de progreso, si no hay es que pertenece a la carga inicial por lo que no inserta en historia\n\n\n // $sweek_validate = DB::select(\"SELECT * FROM hinsts WHERE area='TOTAL'\"); \n\n\n // if(count($sweek_validate)==0){ // Este proceso solo se realiza la primera vez y es para cargar campos dummy en la curva\n\n\n // for ($i = 1; $i <= ($start_week-1); $i++) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>'TOTAL',\n // 'progress' =>0,\n\n // ]);\n // }\n\n // } // fin proceso\n\n\n \n\n\n // foreach ($hinsts_total as $hinsts_totals) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_totals->area,\n // 'progress' =>$hinsts_totals->progress,\n\n // ]);\n // }\n\n\n // // HISTORIAL PROGRESO instPOS POR AREA \n\n // $units=DB::select(\"SELECT DISTINCT units_id FROM pinsts_view\");\n // foreach ($units as $unitss) {\n\n // DB::statement(DB::raw(\"SET @area_id=\".$unitss->units_id));\n\n // $hinsts_area = DB::select(\"SELECT DISTINCT CURDATE() AS date, (SELECT units.name FROM units WHERE units.id=@area_id) as area, ((SELECT SUM(total_progress_area) FROM pinsts_view WHERE units_id=@area_id)*100) as progress FROM pinsts_view;\");\n\n\n // foreach ($hinsts_area as $hinsts_areas) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_areas->area,\n // 'progress' =>$hinsts_areas->progress,\n\n // ]);\n // }\n // }\n\n // }\n\n // //}\n\n\n \n \n DB::table('dinstsnews')->truncate();\n\n Excel::load('e3dreports\\StatusReport-Inst.csv', function($reader) {\n \n\n \n\n \n foreach ($reader->get() as $dinst) {\n\n if($dinst->progress){\n \n $progress = DB::select(\"SELECT * FROM pinsts WHERE percentage=\".$dinst->progress);\n $progress= $progress[0]->percentage; \n $progress_id= $progress[0]->id; \n\n }else{\n\n $progress=0;\n\n }\n\n if($dinst->unit){\n \n $units_id = DB::select(\"SELECT id FROM units WHERE name=\".\"'\".$dinst->unit.\"'\");\n $units_id = $units_id[0]->id;\n\n }else{\n\n\n $units_id=0; \n\n }\n\n // CUSTOM PARA IQOXE\n // $areas_id = DB::select(\"SELECT id FROM areas WHERE name=\".\"'\".$dinst->area.\"'\");\n // $areas_id = $areas_id[0]->id; \n\n if ((strlen(strstr($dinst->area,'30'))>0) OR (strlen(strstr($dinst->area,'63'))>0)) { \n\n $areas_id=0; \n\n }else{\n\n $areas_id=1;\n\n }\n\n // FIN CUSTOM \n\n $tinsts_id = DB::select(\"SELECT id FROM tinsts WHERE code=\".\"'\".$dinst->type.\"'\");\n \n\n if(count($tinsts_id)==0) {\n\n $tinsts_id=999;\n\n }else{\n\n $tinsts_id = $tinsts_id[0]->id;\n\n }\n\n $pinsts_id = DB::select(\"SELECT id FROM pinsts WHERE percentage=\".$dinst->progress);\n $pinsts_id = $pinsts_id[0]->id;\n\n echo $dinst->area.\"-\";\n\n \n Dinstsnew::create([\n 'units_id' =>$units_id,\n 'areas_id' =>$areas_id,\n 'tinsts_id' =>$tinsts_id,\n 'tag' =>$dinst->tag,\n 'pinsts_id' =>$pinsts_id,\n ]);\n \n \n \n\n }\n\n\n // Gráfica de progreso\n\n // Se comprueba el peso deseado (BUDGET/AREAS)\n $weight_total= DB::select(\"SELECT weight_total FROM pmanagers WHERE name='inst'\");\n\n if ($weight_total[0]->weight_total==0){\n\n $total_weight= DB::select(\"SELECT SUM(weight*qty) AS weight FROM einstsfullview;\");\n\n }else{\n\n $total_weight= DB::select(\"SELECT weight FROM pmanagers WHERE name='inst'\");\n\n }\n // FIN DE LA COMPROBACIÓN (BUDGET/AREAS) \n\n if ($total_weight[0]->weight!=0) {\n\n $total_progress = DB::select(\"SELECT SUM((weight*progress)/\".$total_weight[0]->weight.\") as total_progress FROM dinstsfullview;\");\n $total_progress=$total_progress[0]->total_progress;\n\n }else{\n\n $total_progress = 0;\n\n }\n\n $week = DB::select(\"SELECT COUNT(*)+1 AS week FROM hinsts\");\n $week = $week[0]->week; \n\n Hinst::create([\n \n 'week' =>$week,\n 'date' =>date('Y-m-d'),\n 'area' => 'TOTAL', \n 'progress' =>$total_progress,\n\n ]);\n\n });\n \n return Dinstsnew::all();\n }", "function bfa_import_settings_now() {\r\n\tcheck_ajax_referer( \"import_bfa_settings\" );\r\n\t$new_options = maybe_unserialize(bfa_file_get_contents($_FILES['userfile']['tmp_name']));\r\n\tupdate_option('bfa_new_test', $new_options);\r\n\tdie();\r\n}", "function set_end($end)\n {\n $this->set_default_property(self :: PROPERTY_END, $end);\n }", "public function finish()\n {\n parent::finish();\n \n foreach( $this->get_record_list() as $record )\n {\n $db_site = $record->get_site();\n $db_region = $record->get_region();\n\n // assemble the row for this record\n $this->add_row( $record->id,\n array( 'site.name' => $db_site ? $db_site->name : 'any',\n 'city' => $record->city ? $record->city : 'any',\n 'region.name' => $db_region ? $db_region->name : 'any',\n 'postcode' => $record->postcode ? $record->postcode : 'any' ) );\n }\n\n $this->finish_setting_rows();\n }", "public function prepare_data_for_chart_by_days($start, $end) {\n\t\tglobal $wpdb;\n\t\t\n\n\t\t$sql = \"SELECT * FROM `\" . $wpdb->prefix . \"tr_characters`\";\n\t\t$characters = $wpdb->get_results ( \"$sql\", ARRAY_A );\n\t\t\n\t\tif ($characters != null) {\n\t\t\t\n\t\t\t$chars_by_days = null;\n\t\t\t\n\t\t\tforeach ( $characters as $char ) {\n\t\t\t\t// run trough each char and create this array of date->amount for selected time period FOR EACH DAY WITHIN\n\t\t\t\t$character_data = $this->prepare_character_data_by_days_for_chart ( $start, $end, $char ['owner_id'] );\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($character_data != null) {\n\t\t\t\t //BY CHAR ID NOT NAME\n\t\t\t\t\t$chars_by_days [$char ['ownerName2']] = $character_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t * data should be sorted by main chars here.\n\t\t\t */\n\t\t\t\n\t\t\t$chars_by_days = $this->calculate_chart_data_by_mains ( $chars_by_days );\n\t\t\t\n\t\t\tif ($chars_by_days == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * mold the array in a sutable format for google charts\n\t\t\t */\n\t\t\t$prepared_array = null;\n\t\t\t// add first row of the array\n\t\t\t$prepared_array [0] [0] = 'Date';\n\t\t\t\n\t\t\tforeach ( $chars_by_days as $key => $value ) {\n\t\t\t\t// echo $key;\n\t\t\t\t$prepared_array [0] [] = $key;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$start2 = new DateTime ( $start );\n\t\t\t$end2 = date ( \"Y-m-d H:i:s\", strtotime ( $end . \" +1 day\" ) );\n\t\t\t$end3 = new DateTime ( $end2 );\n\t\t\t\n\t\t\t$interval = DateInterval::createFromDateString ( '1 day' );\n\t\t\t\n\t\t\t$period = new DatePeriod ( $start2, $interval, $end3 );\n\t\t\t\n\t\t\t$a = 1;\n\t\t\t// run trough all dates\n\t\t\tforeach ( $period as $dt ) {\n\t\t\t\t$date = $dt->format ( \"Y-m-d\" );\n\t\t\t\t// add a date in begining\n\t\t\t\t$prepared_array [$a] [] = $date;\n\t\t\t\t// run trough each char and add a value from current day\n\t\t\t\tforeach ( $chars_by_days as $char ) {\n\t\t\t\t\t$prepared_array [$a] [] = $char [$date];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$a ++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $prepared_array;\n\t\n\t}", "public function quota_import()\n {\n $targets = array('縣市議員', '直轄市議員', '鄉鎮市民代表', '直轄市山地原住民區民代表');\n $importPath = __DIR__ . '/data/2014_quota';\n $sql = array(\n 'UPDATE elections SET quota = 1;'\n );\n foreach ($targets as $target) {\n $importFile = \"{$importPath}/{$target}.csv\";\n if (file_exists($importFile)) {\n $fh = fopen($importFile, 'r');\n fgetcsv($fh, 512);\n while ($line = fgetcsv($fh, 2048)) {\n if (!empty($line[3])) {\n $sql[] = \"UPDATE elections SET quota = {$line[1]}, quota_women = {$line[2]} WHERE id = '{$line[3]}';\";\n }\n }\n fclose($fh);\n }\n }\n file_put_contents(TMP . 'quota.sql', implode(\"\\n\", $sql));\n }", "public function day()\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$disable = array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$params = array(\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'category',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'site_id',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'integer',\n\t\t\t\t'min_value'\t\t\t=> 1,\n\t\t\t\t'multi'\t\t\t\t=> TRUE,\n\t\t\t\t'default'\t\t\t=> $this->data->get_site_id()\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'calendar_id',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'calendar_name',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'event_id',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'event_name',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'event_limit',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'integer'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'status',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'multi'\t\t\t\t=> TRUE,\n\t\t\t\t'default'\t\t\t=> 'open'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'date_range_start',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'date'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'time_range_start',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'time',\n\t\t\t\t'default'\t\t\t=> '0000'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'time_range_end',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'time',\n\t\t\t\t'default'\t\t\t=> '2400'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name'\t\t\t\t=> 'enable',\n\t\t\t\t'required'\t\t\t=> FALSE,\n\t\t\t\t'type'\t\t\t\t=> 'string',\n\t\t\t\t'default'\t\t\t=> '',\n\t\t\t\t'multi'\t\t\t\t=> TRUE,\n\t\t\t\t'allowed_values' \t=> $disable\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// Define parameters specific to this calendar view\n\t\t// -------------------------------------\n\n\t\t$this->P->set('date_range_end', $this->P->params['date_range_start']['value']);\n\t\t$this->P->set('pad_short_weeks', FALSE);\n\t\t$this->P->set('first_day_of_week', $this->first_day_of_week);\n\n\t\t// -------------------------------------\n\t\t// Define our tagdata\n\t\t// -------------------------------------\n\n\t\t$find = array(\n\t\t\t'EVENTS_PLACEHOLDER',\n\t\t\t'{/',\n\t\t\t'{',\n\t\t\t'}'\n\t\t);\n\n\t\t$replace = array(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tLD . T_SLASH,\n\t\t\tLD,\n\t\t\tRD\n\t\t);\n\n\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t$find,\n\t\t\t$replace,\n\t\t\t$this->view(\n\t\t\t\t'day.html',\n\t\t\t\tarray(),\n\t\t\t\tTRUE,\n\t\t\t\t$this->sc->addon_theme_path . 'templates/day.html'\n\t\t\t)\n\t\t);\n\n\t\t// -------------------------------------\n\t\t// Tell TMPL what we're up to\n\t\t// -------------------------------------\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'events'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['events'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_hour'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_hour'] = TRUE;\n\t\t}\n\n\t\tif (strpos(ee()->TMPL->tagdata, LD.'display_each_day'.RD) !== FALSE)\n\t\t{\n\t\t\tee()->TMPL->var_pair['display_each_day'] = TRUE;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// If you build it, they will know what's going on.\n\t\t// -------------------------------------\n\n\t\t$this->parent_method = __FUNCTION__;\n\n\t\treturn $this->build_calendar();\n\t}", "public function run()\n {\n DB::table('options')->insert([\n 'start_id' => 1,\n 'next_id' => 11,\n 'dialog' => 'Мислех, че сънувам, очите се въртят към звездите',\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 1,\n 'next_id' => 11,\n 'dialog' => 'Ти: Идвам, само да си вземя бухалката от колата.',\n 'trust' => 1,\n 'energy' => -2,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 1,\n 'next_id' => 11,\n 'dialog' => 'Бягай оттука, че ще почна и аз!',\n 'trust' => -1,\n 'energy' => 0\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 21,\n 'next_id' => 31,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n \n DB::table('options')->insert([\n 'start_id' => 31,\n 'next_id' => 41,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'dialog' => 'Ти: Изпращам отряд, който ще го убие.\n Това са паразити, момче, трябва да бъдат отстранени...',\n 'start_id' => 41,\n 'next_id' => 51,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'dialog' => 'Ти: Искам още малко да проучиш къде всъщност се произвеждат тези вещества.',\n 'start_id' => 41,\n 'next_id' => 61,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 61,\n 'next_id' => 71,\n 'trust' => -1,\n 'energy' => -1,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 71,\n 'next_id' => 81,\n 'trust' => -3,\n 'energy' => -3,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 81,\n 'next_id' => 91,\n 'dialog' => 'Ти: Започваме систематично изтребление на производителите!',\n 'trust' => -3,\n 'energy' => -3,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 81,\n 'next_id' => 101,\n 'dialog' => 'Ти: Ще ги заловим и ще ги накажем...',\n 'trust' => -3,\n 'energy' => -3,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 81,\n 'next_id' => 101,\n 'dialog' => 'Ти: Изчезвай, нямам времето, нито ресурсите да се занимавам с теб.',\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 111,\n 'next_id' => 121,\n 'trust' => 2,\n 'energy' => -1,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 121,\n 'next_id' => 131,\n 'dialog' => 'Ти: Ти нямаш ли друга работа?!? Я не ме занимавй и си ходи при изродските родители!',\n 'trust' => -2,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 121,\n 'next_id' => 141,\n 'dialog' => 'Ти: Добре. Изпращам екип за разследване на сектата. Скоро твоите родители дори няма да могат да те докоснат.',\n 'trust' => 1,\n 'energy' => -1,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 121,\n 'next_id' => 151,\n 'dialog' => 'Ти: Отиваш в приют! Трябва да се социализираш с другите!',\n 'trust' => -3,\n 'energy' => -3,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 141,\n 'next_id' => 151,\n 'trust' => -5,\n 'energy' => 3,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 141,\n 'next_id' => 161,\n 'trust' => 3,\n 'energy' => 2,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 61,\n 'next_id' => 171,\n 'trust' => -3,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 171,\n 'next_id' => 181,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 191,\n 'next_id' => 201,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 201,\n 'next_id' => 211,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 211,\n 'next_id' => 221,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 201,\n 'next_id' => 231,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 231,\n 'next_id' => 241,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 201,\n 'next_id' => 251,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 251,\n 'next_id' => 261,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 271,\n 'next_id' => 281,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 281,\n 'next_id' => 291,\n 'trust' => -20,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 291,\n 'next_id' => 301,\n 'trust' => -1,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 281,\n 'next_id' => 311,\n 'trust' => 18,\n 'energy' => -2,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 311,\n 'next_id' => 321,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 321,\n 'next_id' => 331,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 331,\n 'next_id' => 341,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 341,\n 'next_id' => 351,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 351,\n 'next_id' => 361,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n\n DB::table('options')->insert([\n 'start_id' => 361,\n 'next_id' => 371,\n 'trust' => 0,\n 'energy' => 0,\n ]);\n }", "public function register_end()\n {\n echo \"Ended the Action \";\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $jsondecode = file_get_contents($this->save);\n $decoded = json_decode($jsondecode, true);\n for ($i = 0; $i < count($decoded); $i++) {\n if ($decoded[$i][0]['Endtime'] == NULL) {\n $decoded[$i][0]['Endtime'] = $timeRN;\n $encoded = json_encode($decoded);\n file_put_contents($this->save, $encoded);\n }\n }\n }", "function emb_save_options() {\n\t}", "public function handle()\n {\n \t$file_name = file_get_contents('http://goloption.ru/Files/CME_Reports2/dataWD.txt');\n\n \tif ($file_name)\n\t {\n\t \t$data_info_array = explode('_', $file_name);\n\t \t\n\t \tif (count($data_info_array) === 4)\n\t\t {\n\t\t \t$parse_date = Carbon::createFromTimestamp(strtotime($data_info_array[2] . ' ' . str_replace(['-', '.csv'], [':', ''], $data_info_array[3])))\n\t\t\t\t ->subHours(3)\n\t\t\t\t ->format('Y-m-d H:i:s');\n\n\t\t \t$data = file_get_contents('http://goloption.ru/Files/CME_Reports2/wednesday.csv');\n\t\t \t$data_array = explode(\"\\n\", $data);\n\n\t\t \t$result = [];\n\t\t \tif (count($data_array) !== 0)\n\t\t\t {\n\t\t\t \t$pair = '';\n\t\t\t \t$prefix = '';\n\t\t\t \t$expire = '';\n\t\t\t \tforeach ($data_array as $row)\n\t\t\t\t {\n\t\t\t\t \tif ($row !== '')\n\t\t\t\t\t {\n\t\t\t\t\t \t\n\t\t\t\t\t \tif (strpos($row, ';') === false)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \tif (strpos($row, 'EXPW') !== false)\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t$row_array = explode(' ', $row);\n\t\t\t\t\t\t\t \t$expire = date('Y-m-d', strtotime(trim($row_array[2])));\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t elseif (in_array(trim($row), ['CALL', 'PUTS']))\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t$prefix = strtolower(trim($row));\n\t\t\t\t\t\t\t }\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$pair = trim($row);\n\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$row_array = explode(';', $row);\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['symbol'] = $pair;\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['expire'] = $expire;\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['parse_date'] = $parse_date;\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['option_type'] = OptionStrikes::TYPES_WEDNESDAY;\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['strike'] = $row_array[0];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['odr'] = 0;\n\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['type'] = $prefix;\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['open_interest'] = (float) $row_array[1];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['volume'] = (float) $row_array[2];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['premia'] = (float) $row_array[3];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['spros_1'] = (float) $row_array[4];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['spros_2'] = (float) $row_array[5];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['predlojenie_1'] = (float) $row_array[6];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['predlojenie_2'] = (float) $row_array[7];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['prirost_tekushiy'] = (float) $row_array[8];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['prirost_predydushiy'] = (float) $row_array[9];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['money_obshiy'] = (float) $row_array[10];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['money_tekushiy'] = (float) $row_array[11];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['balance_of_day'] = $prefix === OptionStrikeCallsPuts::TYPES_CALL ? (float) $row_array[0] * 0.001 + (float) $row_array[3] : (float) $row_array[0] * 0.001 - (float) $row_array[3];\n\t\t\t\t\t\t\t $result[$pair][$expire][$row_array[0]]['calls_puts'][$prefix]['is_balance'] = false;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t if (count($result))\n\t\t\t {\n\t\t\t\t foreach ($result as $symbol)\n\t\t\t\t {\n\t\t\t\t\t $week_number = 0;\n\t\t\t\t\t foreach ($symbol as $expire_date)\n\t\t\t\t\t {\n\t\t\t\t\t\t $week_number++;\n\t\t\t\t\t\t foreach ($expire_date as $strike)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \tforeach ($strike['calls_puts'] as $option_type => $item)\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t$insert = [\n\t\t\t\t\t\t\t 'parse_date' => $strike['parse_date'],\n\t\t\t\t\t\t\t\t 'symbol' => $strike['symbol'],\n\t\t\t\t\t\t\t\t 'expire' => $strike['expire'],\n\t\t\t\t\t\t\t\t 'option_type' => $strike['option_type'] . $week_number,\n\t\t\t\t\t\t\t\t 'strike' => $strike['strike'],\n\t\t\t\t\t\t\t\t 'type' => $item['type'],\n\t\t\t\t\t\t\t\t 'open_interest' => $item['open_interest'],\n\t\t\t\t\t\t\t\t 'volume' => $item['volume'],\n\t\t\t\t\t\t\t\t 'premia' => $item['premia'],\n\t\t\t\t\t\t\t\t 'spros_1' => $item['spros_1'],\n\t\t\t\t\t\t\t\t 'spros_2' => $item['spros_2'],\n\t\t\t\t\t\t\t\t 'predlojenie_1' => $item['predlojenie_1'],\n\t\t\t\t\t\t\t\t 'predlojenie_2' => $item['predlojenie_2'],\n\t\t\t\t\t\t\t\t 'prirost_tekushiy' => $item['prirost_tekushiy'],\n\t\t\t\t\t\t\t\t 'prirost_predydushiy' => $item['prirost_predydushiy'],\n\t\t\t\t\t\t\t\t 'money_obshiy' => $item['money_obshiy'],\n\t\t\t\t\t\t\t\t 'money_tekushiy' => $item['money_tekushiy'],\n\t\t\t\t\t\t\t\t 'balance_of_day' => $item['balance_of_day'],\n\t\t\t\t\t\t\t\t 'is_balance' => $item['is_balance'],\n\t\t\t\t\t\t\t\t ];\n\n\t\t\t\t\t\t\t \t$exists = DB::table(OptionStrikes::TYPES_WEDNESDAY . $week_number . '_option_parse')\n\t\t\t\t\t\t\t\t\t ->where([\n\t\t\t\t\t\t\t\t\t \t['parse_date', $insert['parse_date']],\n\t\t\t\t\t\t\t\t\t\t ['symbol', $insert['symbol']],\n\t\t\t\t\t\t\t\t\t\t ['expire', $insert['expire']],\n\t\t\t\t\t\t\t\t\t\t ['strike', $insert['strike']],\n\t\t\t\t\t\t\t\t\t\t ['type', $insert['type']],\n\t\t\t\t\t\t\t\t\t\t ['option_type', $insert['option_type']]\n\t\t\t\t\t\t\t\t\t ])\n\t\t\t\t\t\t\t\t\t ->first();\n\n\t\t\t\t\t\t\t \tif (!$exists)\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t \tDB::table(OptionStrikes::TYPES_WEDNESDAY . $week_number . '_option_parse')\n\t\t\t\t\t\t\t\t\t\t ->insert($insert);\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n }", "public function testV1ImportDaysPost()\n {\n }", "public function import($options){\n return $this->validateAndSave($options, false);\n }", "function options(&$options) {\r\n parent::options($options);\r\n $options['date_fields'] = array();\r\n $options['year_range'] = '-3:+3';\r\n $options['date_method'] = 'OR';\r\n $options['granularity'] = 'month';\r\n }", "function set_file_options(&$form_state) {\n $files = node_import_list_files();\n $file = $files[$form_state['storage']['fid']];\n\n if (!isset($form_state['storage']['file_options'])) {\n $form_state['storage']['file_options'] = node_import_autodetect($file->filepath);\n }\n if (!isset($form_state['storage']['has_headers'])) {\n $form_state['storage']['has_headers'] = 1;\n }\n\n // If the user has chosen a predefined format, make sure\n // all options are correct.\n if ($form_state['storage']['file_options']['file_format'] != '') {\n $file_formats = node_import_format_options('file formats');\n $form_state['storage']['file_options'] = array_merge($form_state['storage']['file_options'], $file_formats[$form_state['storage']['file_options']['file_format']]);\n }\n\n\n if (!isset($form_state['storage']['samples']) and !isset($form_state['storage']['headers'])) {\n // Read some sample data with current settings.\n $samples = array();\n\n $i = variable_get('node_import:number_of_samples', 5);\n $num_cols = 0;\n $file_offset = 0;\n $data = array();\n while ($i > 0 && is_array($data)) {\n $i--;\n list($file_offset, $data) = node_import_read_from_file($file->filepath, $file_offset, $form_state['storage']['file_options']);\n if (is_array($data)) {\n $samples[] = $data;\n $num_cols = max($num_cols, count($data));\n }\n }\n if (!$form_state['storage']['has_headers']) {\n $header = array();\n while ($num_cols > 0) {\n $header[] = t('Column @number', array('@number' => $num_cols));\n $num_cols--;\n }\n $header = array_reverse($header);\n array_unshift($samples, $header);\n }\n $form_state['storage']['samples'] = $samples;\n $form_state['storage']['headers'] = $samples[0]; //TODO: what happens if no data?\n }\n}", "public function mysql2solrExportAction()\n {\n $this->dataImport->initializeLogger(self::exportLogFile);\n $jobOwnerFileContent = file_get_contents($this->dataImport->dumpDirectory . self::executeExportDump);\n $this->dataImport->importExportLogger->log($jobOwnerFileContent);\n $start = date('d.m.Y H:i:s');\n $date1 = new \\DateTime($start);\n $this->dataImport->importExportLogger->log('Start am ' . $start);\n if (file_exists($this->dataImport->dumpDirectory . self::executeExportDump)) {\n unlink($this->dataImport->dumpDirectory . self::executeExportDump);\n }\n $klosterData = $this->klosterListAllAction();\n $klosterArr = $klosterData[0];\n $klosterstandortArr = $klosterData[1];\n $klosterordenArr = $klosterData[2];\n $standort_ordenArr = $klosterData[3];\n $update = $this->client->createUpdate();\n $docs = [];\n foreach ($klosterArr as $k => $v) {\n $doc = $update->createDocument();\n foreach ($v as $i => $v1) {\n $doc->$i = $v1;\n }\n array_push($docs, $doc);\n }\n foreach ($klosterstandortArr as $k => $v) {\n foreach ($v as $k1 => $v1) {\n $doc = $update->createDocument();\n foreach ($v1 as $k2 => $v2) {\n $doc->$k2 = $v2;\n }\n array_push($docs, $doc);\n }\n }\n foreach ($klosterordenArr as $k => $v) {\n foreach ($v as $k1 => $v1) {\n $doc = $update->createDocument();\n foreach ($v1 as $k2 => $v2) {\n $doc->$k2 = $v2;\n }\n array_push($docs, $doc);\n }\n }\n foreach ($standort_ordenArr as $k => $v) {\n foreach ($v as $k1 => $v1) {\n foreach ($v1 as $k2 => $v2) {\n $doc = $update->createDocument();\n foreach ($v2 as $k3 => $v3) {\n $doc->$k3 = $v3;\n }\n array_push($docs, $doc);\n }\n }\n }\n $update->addDocuments($docs);\n $update->addCommit();\n $this->deleteAction();\n /** @var \\Solarium\\Core\\Query\\Result\\ResultInterface $result */\n $result = $this->client->execute($update);\n $logMessage = 'Data export completed in ' . round($result->getQueryTime() / 100) . ' seconds.';\n $this->logger->log($logMessage);\n $end = date('d.m.Y H:i:s');\n $date2 = new \\DateTime($end);\n $this->dataImport->importExportLogger->log('Ende am ' . $end);\n $this->dataImport->importExportLogger->log('Dauer ' . $date1->diff($date2)->i . \" Minuten und \" . $date1->diff($date2)->s . ' Sekunden');\n return $logMessage;\n }", "public function setupOptions()\n {\n $action = new Action('generate', 'Generate fake data');\n //output adapter\n $option = new Option('o', 'output', 'Specify output adapter. Available outputs: db.[orm|odm], file.[csv|json|xml]');\n $option->setRequired(true);\n $action->addOption($option);\n\n $option = new Option('d', 'dest', 'Specify the destination point. It might be a file, or database collection or table');\n $option->setRequired(true);\n $action->addOption($option);\n\n //data specification\n $option = new Option('s', 'spec', 'Specify the file path containing data specification in JSON format');\n $option->setRequired(true);\n $action->addOption($option);\n\n //count of data\n $option = new Option('c', 'count', 'Specify the count of data to generate');\n $option->setRequired(true);\n $action->addOption($option);\n\n $this->addTaskAction($action);\n }", "protected function getOptions()\n {\n return [\n ['file', 'f', InputOption::VALUE_OPTIONAL, 'file name for import, default is base_stations.csv.'],\n ];\n }", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "public function options_load();" ]
[ "0.6324207", "0.5772403", "0.53170556", "0.51526564", "0.5148073", "0.5027425", "0.50140834", "0.5002238", "0.496932", "0.4896738", "0.48954314", "0.4885654", "0.47373962", "0.47163844", "0.47014284", "0.4681895", "0.4670022", "0.46614787", "0.46241546", "0.46133116", "0.4609446", "0.46060383", "0.45794213", "0.45744455", "0.456016", "0.45571342", "0.4553179", "0.45414788", "0.4538277", "0.45328146", "0.4530056", "0.45234266", "0.45077154", "0.44908857", "0.4490736", "0.44750914", "0.44703883", "0.44573113", "0.44572127", "0.44553113", "0.44551072", "0.44435585", "0.44301754", "0.4426708", "0.44036946", "0.43941674", "0.43896416", "0.43876368", "0.43811578", "0.4375338", "0.43736416", "0.4368219", "0.4365475", "0.4362918", "0.43576497", "0.43563086", "0.4346797", "0.4344453", "0.43334958", "0.4331064", "0.43260247", "0.43255123", "0.4323187", "0.43160373", "0.43157753", "0.4309286", "0.43078187", "0.42909998", "0.42867458", "0.427893", "0.42786208", "0.4273123", "0.42671615", "0.42624515", "0.42564356", "0.42551062", "0.4253491", "0.4247059", "0.42429078", "0.4241984", "0.42393836", "0.42383155", "0.42350742", "0.42341298", "0.42335856", "0.423163", "0.42271847", "0.42249906", "0.42222196", "0.42217967", "0.421444", "0.4214301", "0.42136392", "0.4212697", "0.42119542", "0.4210141", "0.42096087", "0.42067254", "0.42045814", "0.41942447" ]
0.6520106
0
Import data we have gotten on a daily baises from EOD Options.
private function _import_daily_eod_options_data($symbol_index) { // Query dropbox and list files. $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY')); $adapter = new DropboxAdapter($client); $db_filesystem = new Filesystem($adapter); $files = $db_filesystem->listContents('/', true); foreach($files AS $key => $row) { $toast = false; // Only want files. if($row['type'] != 'file') { continue; } // Only want zipfiles with daily if($row['extension'] != 'zip') { continue; } // Only want a certain type of file. if(! strpos($row['path'], 'alloptions/Daily/options_')) { continue; } // See if we need to download it or not. if(is_file('/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path'])) { $file = '/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path']; } else { $toast = true; $file = '/tmp/' . basename($row['path']); $this->info('Dropbox: Downloading ' . $row['path']); file_put_contents($file, $db_filesystem->read($row['path'])); } // Unzip the file. $filesystem = new Filesystem(new ZipArchiveAdapter($file)); $list = $filesystem->listContents('/'); // File the file we want to import. foreach($list AS $key => $row) { // Just want the file with the options data. if(strpos($row['path'], 'ptions_')) { // Write the CSV file to the tmp dir. $this->info('Importing: ' . $row['path']); file_put_contents('/tmp/' . $row['path'], $filesystem->read($row['path'])); // Now that we have the CSV lets start the import. $this->_import_from_daily_csv_file('/tmp/' . $row['path'], $symbol_index); } } // Toast temp file if($toast) { unlink($file); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _import_eod_options_data()\n\t{\n // Clear database.\n DB::statement('TRUNCATE TABLE OptionsEod'); \t\n \t\n\t\t// Setup our models.\n\t\t$symbols_model = App::make('App\\Models\\Symbols');\n\t\t$optionseod_model = App::make('App\\Models\\OptionsEod');\n\t\t\n\t\t// Lets get an index of all the underlying symbols.\n\t\t$symbol_index = $symbols_model->get_index(); \t\n \t \t\n // Loop through the different files and import\n foreach($this->_get_option_eod_summary_files() AS $file)\n {\n $this->info('Importing ' . $file);\n \n // Batch var\n $batch = []; \n \n // Do the CSV magic.\n\t\t\t$reader = Reader::createFromFileObject(new SplFileObject($file));\n\t\t\t\n\t\t\tforeach($reader->query() AS $key => $row) \n\t\t\t{\t\n\t\t\t\t// Skip of the row is empty.\n\t\t\t\tif((! isset($row[0])) || (! isset($row[1])))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// Skip the first row.\n\t\t\t\tif($row[0] == 'underlying')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// See if we have an entry in the Symbols table for this symbol\n\t\t\t\tif(! isset($symbol_index[strtoupper($row[0])]))\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n\t\t\t\t\t$symbol_index = $symbols_model->get_index();\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$sym_id = $symbol_index[strtoupper($row[0])];\n\t\t\t\t}\n\t\t\t\t\n // We insert in batches.\n $batch[] = [\n \t\t\t 'OptionsEodSymbolId' => $sym_id,\n \t\t\t 'OptionsEodSymbolLast' => $row[1],\n \t\t\t 'OptionsEodType' => $row[5],\n \t\t\t 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n \t\t\t 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n \t\t\t 'OptionsEodStrike' => $row[8],\n \t\t\t 'OptionsEodLast' => $row[9],\n \t\t\t 'OptionsEodBid' => $row[10],\n \t\t\t 'OptionsEodAsk' => $row[11],\n \t\t\t 'OptionsEodVolume' => $row[12],\n \t\t\t 'OptionsEodOpenInterest' => $row[13],\n \t\t\t 'OptionsEodImpliedVol' => $row[14],\n \t\t\t 'OptionsEodDelta' => $row[15],\n \t\t\t 'OptionsEodGamma' => $row[16],\n \t\t\t 'OptionsEodTheta' => $row[17],\n \t\t\t 'OptionsEodVega' => $row[18],\n \t\t\t 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\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\t\t];\n\t\t\t\n\t\t\t\t// Insert the data into the OptionsEod table. We insert 1000 at a time.\n\t\t\t\tif(count($batch) >= 1000)\n\t\t\t\t{\n\t\t\t\t DB::table('OptionsEod')->insert($batch);\n\t\t\t\t $batch = [];\t\n }\n \t\t}\n \t\t\n // Catch any left over.\n if(count($batch) > 0)\n {\n DB::table('OptionsEod')->insert($batch);\n }\t\n }\n \n // Now import all the data we collected daily.\n $this->_import_daily_eod_options_data($symbol_index);\n\t}", "protected function importData()\n\t{\n\t\t// get events\n\t\tinclude_once \"Services/ADN/EP/classes/class.adnExaminationEvent.php\";\n\t\t$events = adnExaminationEvent::getAllEvents($this->filter, $this->archived);\n\t\t\n\t\t// value mapping (to have correct sorting)\n\t\tif(sizeof($events))\n\t\t{\n\t\t\tinclude_once \"Services/ADN/EP/classes/class.adnAssignment.php\";\n\t\t\tinclude_once \"Services/ADN/ED/classes/class.adnSubjectArea.php\";\n\t\t\tforeach($events as $idx => $item)\n\t\t\t{\n\t\t\t\t$date = new ilDate($item[\"date_from\"]->get(IL_CAL_DATE), IL_CAL_DATE);\n\t\t\t\t$events[$idx][\"date_display\"] = ilDatePresentation::formatDate($date);\n\t\t\t\t$events[$idx][\"date\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'Y-m-d');\n\t\t\t\t$events[$idx][\"time_from\"] = $item[\"date_from\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"time_to\"] = $item[\"date_to\"]->get(IL_CAL_FKT_DATE, 'H:i');\n\t\t\t\t$events[$idx][\"type\"] = $this->filter_options[\"type\"][$item[\"subject_area\"]];\n\t\t\t\t$events[$idx][\"type_color\"] = adnSubjectArea::getColorForArea($item[\"subject_area\"]);\n\n\t\t\t\t// we cannot use filter options because of archived values\n\t\t\t\t$events[$idx][\"facility\"] = adnExamFacility::lookupCity($item[\"md_exam_facility_id\"]);\n\n\t\t\t\tswitch($this->mode)\n\t\t\t\t{\n\t\t\t\t\tcase self::MODE_ASSIGNMENT:\n\t\t\t\t\t\t$users = adnAssignment::getAllAssignments(array(\"event_id\"=>$item[\"id\"]));\n\t\t\t\t\t\t$events[$idx][\"assigned\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\tcase self::MODE_INVITATION:\n\t\t\t\t\t\t$users = adnAssignment::getAllInvitations($item[\"id\"]);\n\t\t\t\t\t\t$events[$idx][\"invitations\"] = sizeof($users);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase self::MODE_ATTENDANCE:\n\t\t\t\t\t\tinclude_once './Services/ADN/Report/classes/class.adnReportAttendanceList.php';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$events[$idx]['attendance'] = '';\n\t\t\t\t\t\tif(adnReportAttendanceList::lookupLastFile($item['id']) instanceof ilDateTime)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$events[$idx][\"attendance\"] = \n\t\t\t\t\t\t\t\tilDatePresentation::formatDate(\n\t\t\t\t\t\t\t\t\tadnReportAttendanceList::lookupLastFile($item['id']));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->setData($events);\n\t\t$this->setMaxCount(sizeof($events));\n\t}", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "protected function importDatabaseData() {}", "public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "private function _import_from_daily_csv_file($file, $symbol_index)\n {\n $batch = [];\n \n // Do the CSV magic.\n $reader = Reader::createFromFileObject(new SplFileObject($file));\n \n // symbols model\n $symbols_model = App::make('App\\Models\\Symbols');\n \n // Loop through the option data.\n foreach($reader->query() AS $key => $row) \n {\t\n // Only care about some symbols\n if(! in_array(strtolower($row[0]), $this->eod_option_daily_symbols))\n {\n continue;\n }\n \n // See if we have an entry in the Symbols table for this symbol\n if(! isset($symbol_index[strtoupper($row[0])]))\n {\n $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]);\n $symbol_index = $symbols_model->get_index();\n } else\n {\n $sym_id = $symbol_index[strtoupper($row[0])];\n } \n \n // We insert in batches.\n DB::table('OptionsEod')->insert([\n 'OptionsEodSymbolId' => $sym_id,\n 'OptionsEodSymbolLast' => $row[1],\n 'OptionsEodType' => $row[5],\n 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])),\n 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])),\n 'OptionsEodStrike' => $row[8],\n 'OptionsEodLast' => $row[9],\n 'OptionsEodBid' => $row[10],\n 'OptionsEodAsk' => $row[11],\n 'OptionsEodVolume' => $row[12],\n 'OptionsEodOpenInterest' => $row[13],\n 'OptionsEodImpliedVol' => $row[14],\n 'OptionsEodDelta' => $row[15],\n 'OptionsEodGamma' => $row[16],\n 'OptionsEodTheta' => $row[17],\n 'OptionsEodVega' => $row[18],\n 'OptionsEodCreatedAt' => date('Y-m-d H:i:s')\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 ]);\n }\n \n // Delete tmp file.\n unlink($file); \n }", "public function importAction()\n {\n \n $directory = 'data/officialstations/es/json/latest';\n $country = 'ES';\n \n $request = $this->getRequest();\n $filename = $request->getParam('filename', false);\n $verbose = $request->getParam('verbose', false) || $request->getParam('v', false);\n\n $fueltypes = array(\n 'BIE.json'=>9,\n 'BIO.json'=>7,\n 'G95.json'=>8,\n 'G98.json'=>2,\n 'GLP.json'=>10,\n 'GNC.json'=>11,\n 'GOA.json'=>3,\n 'GOB.json'=>5,\n 'GOC.json'=>6,\n 'GPR.json'=>1,\n 'NGO.json'=>4\n );\n \n // purge cache for every configuration\n if ($filename)\n {\n// $result = $this->priceMapper->truncate();\n $this->priceMapper->countChanges = 0;\n $this->priceMapper->cycleFailsFilename();\n \n // echo $iterator->getFilename() . \"\\n\";\n echo $filename . \"\\n\";\n if($filename == 'All')\n {\n foreach($fueltypes as $file => $id)\n {\n echo $file.\"\\n\";\n $content = file_get_contents($directory.'/'.$file);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n// $value['created'] = '2014-06-14';\n $result = $this->stationMapper->save($value); \n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$file]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n }\n else \n {\n // $content = file_get_contents($directory.'/'.$iterator->getFilename());\n $content = file_get_contents($directory.'/'.$filename);\n $content = json_decode($content);\n foreach($content as $key => $value)\n {\n $result = $this->stationMapper->save($value);\n $price = array('idoffstation'=>$result,\n 'price'=>$value->price,\n 'idfueltype'=>$fueltypes[$filename]\n );\n $result = $this->priceMapper->save($price);\n }\n }\n echo $this->priceMapper->countChanges;\n }\n\n $this->output('Collecting all assets...', $verbose);\n $this->output(sprintf('Importing finished...', $verbose));\n }", "protected function importData()\n\t{\n\t\tinclude_once \"./Services/ADN/ED/classes/class.adnSubobjective.php\";\n\t\t$subobjectives = adnSubobjective::getAllSubobjectives($this->objective_id);\n\n\t\t$this->setData($subobjectives);\n\t\t$this->setMaxCount(sizeof($subobjectives));\n\t}", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function importdinst()\n {\n\n // $start_week = DB::select(\"SELECT startweek FROM pmanagers WHERE name = 'inst'\");\n\n // $start_week = $start_week[0]->startweek; // Semana de inicio de la curva, viene de Pmanager\n\n // $hinsts_total = DB::select(\"SELECT CURDATE() AS date, 'TOTAL' AS area, SUM(total_progress) AS progress FROM pinsts_view\");\n // $progress_inst = DB::select(\"SELECT DISTINCT total_pinsthours FROM total_pinsts_view\"); \n\n // $current_date = date('Y-m-d'); // Para echar una semana atrás\n\n // if (!is_null($progress_inst[0]->total_pinsthours)){ // valido existencia de progreso, si no hay es que pertenece a la carga inicial por lo que no inserta en historia\n\n\n // $sweek_validate = DB::select(\"SELECT * FROM hinsts WHERE area='TOTAL'\"); \n\n\n // if(count($sweek_validate)==0){ // Este proceso solo se realiza la primera vez y es para cargar campos dummy en la curva\n\n\n // for ($i = 1; $i <= ($start_week-1); $i++) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>'TOTAL',\n // 'progress' =>0,\n\n // ]);\n // }\n\n // } // fin proceso\n\n\n \n\n\n // foreach ($hinsts_total as $hinsts_totals) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_totals->area,\n // 'progress' =>$hinsts_totals->progress,\n\n // ]);\n // }\n\n\n // // HISTORIAL PROGRESO instPOS POR AREA \n\n // $units=DB::select(\"SELECT DISTINCT units_id FROM pinsts_view\");\n // foreach ($units as $unitss) {\n\n // DB::statement(DB::raw(\"SET @area_id=\".$unitss->units_id));\n\n // $hinsts_area = DB::select(\"SELECT DISTINCT CURDATE() AS date, (SELECT units.name FROM units WHERE units.id=@area_id) as area, ((SELECT SUM(total_progress_area) FROM pinsts_view WHERE units_id=@area_id)*100) as progress FROM pinsts_view;\");\n\n\n // foreach ($hinsts_area as $hinsts_areas) {\n // DB::table('hinsts')->insert([\n // 'date' =>date('Y-m-d',strtotime($current_date.\"- 1 week\")),// Para echar una semana atrás\n // 'area' =>$hinsts_areas->area,\n // 'progress' =>$hinsts_areas->progress,\n\n // ]);\n // }\n // }\n\n // }\n\n // //}\n\n\n \n \n DB::table('dinstsnews')->truncate();\n\n Excel::load('e3dreports\\StatusReport-Inst.csv', function($reader) {\n \n\n \n\n \n foreach ($reader->get() as $dinst) {\n\n if($dinst->progress){\n \n $progress = DB::select(\"SELECT * FROM pinsts WHERE percentage=\".$dinst->progress);\n $progress= $progress[0]->percentage; \n $progress_id= $progress[0]->id; \n\n }else{\n\n $progress=0;\n\n }\n\n if($dinst->unit){\n \n $units_id = DB::select(\"SELECT id FROM units WHERE name=\".\"'\".$dinst->unit.\"'\");\n $units_id = $units_id[0]->id;\n\n }else{\n\n\n $units_id=0; \n\n }\n\n // CUSTOM PARA IQOXE\n // $areas_id = DB::select(\"SELECT id FROM areas WHERE name=\".\"'\".$dinst->area.\"'\");\n // $areas_id = $areas_id[0]->id; \n\n if ((strlen(strstr($dinst->area,'30'))>0) OR (strlen(strstr($dinst->area,'63'))>0)) { \n\n $areas_id=0; \n\n }else{\n\n $areas_id=1;\n\n }\n\n // FIN CUSTOM \n\n $tinsts_id = DB::select(\"SELECT id FROM tinsts WHERE code=\".\"'\".$dinst->type.\"'\");\n \n\n if(count($tinsts_id)==0) {\n\n $tinsts_id=999;\n\n }else{\n\n $tinsts_id = $tinsts_id[0]->id;\n\n }\n\n $pinsts_id = DB::select(\"SELECT id FROM pinsts WHERE percentage=\".$dinst->progress);\n $pinsts_id = $pinsts_id[0]->id;\n\n echo $dinst->area.\"-\";\n\n \n Dinstsnew::create([\n 'units_id' =>$units_id,\n 'areas_id' =>$areas_id,\n 'tinsts_id' =>$tinsts_id,\n 'tag' =>$dinst->tag,\n 'pinsts_id' =>$pinsts_id,\n ]);\n \n \n \n\n }\n\n\n // Gráfica de progreso\n\n // Se comprueba el peso deseado (BUDGET/AREAS)\n $weight_total= DB::select(\"SELECT weight_total FROM pmanagers WHERE name='inst'\");\n\n if ($weight_total[0]->weight_total==0){\n\n $total_weight= DB::select(\"SELECT SUM(weight*qty) AS weight FROM einstsfullview;\");\n\n }else{\n\n $total_weight= DB::select(\"SELECT weight FROM pmanagers WHERE name='inst'\");\n\n }\n // FIN DE LA COMPROBACIÓN (BUDGET/AREAS) \n\n if ($total_weight[0]->weight!=0) {\n\n $total_progress = DB::select(\"SELECT SUM((weight*progress)/\".$total_weight[0]->weight.\") as total_progress FROM dinstsfullview;\");\n $total_progress=$total_progress[0]->total_progress;\n\n }else{\n\n $total_progress = 0;\n\n }\n\n $week = DB::select(\"SELECT COUNT(*)+1 AS week FROM hinsts\");\n $week = $week[0]->week; \n\n Hinst::create([\n \n 'week' =>$week,\n 'date' =>date('Y-m-d'),\n 'area' => 'TOTAL', \n 'progress' =>$total_progress,\n\n ]);\n\n });\n \n return Dinstsnew::all();\n }", "public function startImport()\n {\n if (get_field('xcap_daily_cron', 'option') === true || empty(get_field('xcap_daily_cron', 'option'))) {\n $xcapUrl = 'http://kulturkortet.se/calendar/listEvents.action' .\n '?month=&date=&categoryPermaLink=&q=&p=&feedType=ICAL_XML';\n new \\HbgEventImporter\\Parser\\Xcap($xcapUrl);\n }\n }", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "public function import(): void\n\t{\n\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\tif (\n\t\t\t!$this->lastScan['start_date']\n\t\t\t|| (0 === $this->lastScan['id'] && $this->lastScan['start_date'] === $this->lastScan['end_date'])\n\t\t) {\n\t\t\t$this->config->setScan('import' . $this->name);\n\t\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('Start import ' . $this->name, [\n\t\t\t\t'lastScan' => $this->lastScan,\n\t\t\t]);\n\t\t}\n\t\t$i = 0;\n\t\ttry {\n\t\t\t$page = $this->lastScan['page'] ?? 1;\n\t\t\t$load = true;\n\t\t\t$finish = false;\n\t\t\t$limit = $this->config->get(self::LIMIT_NAME);\n\t\t\twhile ($load) {\n\t\t\t\tif ($rows = $this->getFromApi('Customer/GetAll?&page=' . $page . '&' . $this->getFromApiCond())) {\n\t\t\t\t\tforeach ($rows as $id => $row) {\n\t\t\t\t\t\tif ('JEDNORAZOWY' === $row['knt_Akronim']) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->importItem($row);\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'id', $id);\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\t\t\t\t\t++$page;\n\t\t\t\t\tif (\\is_callable($this->controller->bathCallback)) {\n\t\t\t\t\t\t$load = \\call_user_func($this->controller->bathCallback, 'import' . $this->name);\n\t\t\t\t\t}\n\t\t\t\t\tif ($limit !== \\count($rows)) {\n\t\t\t\t\t\t$finish = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$finish = true;\n\t\t\t\t}\n\t\t\t\tif ($finish || !$load) {\n\t\t\t\t\t$load = false;\n\t\t\t\t\tif ($finish) {\n\t\t\t\t\t\t$this->config->setEndScan('import' . $this->name, $this->lastScan['start_date']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'page', $page);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->logError('import ' . $this->name, null, $ex);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('End import ' . $this->name, ['imported' => $i]);\n\t\t}\n\t}", "public function importFrom(array $data);", "public function run()\n {\n $items = $this->getPaysFromCsv();\n foreach($items as $item){\n DB::table('countries')->insert([\n 'code_2' => $item[0],\n 'code_3' => $item[1],\n 'title' => utf8_encode($item[2]),\n 'content' => utf8_encode($item[3]),\n 'prefixPhone' => $item[4],\n 'created_at' => date(\"Y-m-d H:i:s\"),\n ]);\n }\n }", "public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }", "public function run()\n {\n $filename = storage_path('imports/car_serie.csv');\n Excel::import(new CarSerieImport, $filename);\n }", "public function dailyInsert()\n {\n $request = new Request;\n $doc = $this->doc;\n foreach ($this->insertSupplierList as $supplierlist) {\n $file_path = storage_path(\"app/{$supplierlist}/*.txt\");\n foreach (glob($file_path) as $file) {\n //特定文件\n if ($doc != 'DefaultAllDoc') {\n $value = !str_contains($file, $doc);\n if ($value) {\n continue;\n }\n }\n $Unit = new SupplierFileImportControlUnit;\n \n $Unit->insertFromArray(\n [\n $Unit::INPUT_FILE_FULL_NAME => $file,\n $Unit::INPUT_INSERT_OR_NOT => true,\n ]\n );\n $Unit->run();\n }\n }\n }", "public function importOldDatabase(DataContainer $dc)\n\t{\n\t\t$link = mysql_connect(\"localhost\", \"hschottm\", \".haibin.\") or die(\"Keine Verbindung möglich: \" . mysql_error());\n\t\tmysql_select_db(\"Pop\") or die(\"Auswahl der Datenbank fehlgeschlagen\");\n\n\t\t$result = mysql_query('SET NAMES utf8') or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\n\t\t$query = \"SELECT * FROM tkeyabenteuer ORDER BY idAbenteuer\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$q2 = sprintf(\"SELECT dtDatum FROM tkeysendung WHERE dtAbenteuer = %s ORDER BY dtDatum\",\n\t\t\t\t$line['idAbenteuer']\n\t\t\t);\n\t\t\t$q2result = mysql_query($q2) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t$first = \"\";\n\t\t\t$last = \"\";\n\t\t\twhile ($l = mysql_fetch_array($q2result, MYSQL_ASSOC)) \n\t\t\t{\n\t\t\t\tif (!strlen($first)) $first = $l['dtDatum'];\n\t\t\t\t$last = $l['dtDatum'];\n\t\t\t}\n\t\t\t$d1 = 0; $d2 = 0;\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $first, $matches);\n\t\t\t$d1 = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $last, $matches);\n\t\t\t$d2 = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_adventure (tstamp, title, description, numbering, alias, firstbroadcast, lastbroadcast) VALUES (?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\ttime(),\n\t\t\t\t\t$line['dtTitel'],\n\t\t\t\t\t$line['dtBeschreibung'],\n\t\t\t\t\t$line['idAbenteuer'],\n\t\t\t\t\t'abenteuer'.$line['idAbenteuer'],\n\t\t\t\t\t$d1,\n\t\t\t\t\t$d2\n\t\t\t\t);\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\t$adventures = array();\n\t\t$objAdv = $this->Database->prepare('SELECT * FROM tl_adventure')->executeUncached();\n\t\twhile ($objAdv->next())\n\t\t{\n\t\t\t$row = $objAdv->row();\n\t\t\t$adventures[$row['numbering']] = $row['id'];\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeyprovider\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_provider (tstamp, initials, name, email, homepage) VALUES (?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\ttime(),\n\t\t\t\t\t$line['dtShortcut'],\n\t\t\t\t\t$line['dtName'],\n\t\t\t\t\t$line['dtMail'],\n\t\t\t\t\t($line['dtHome']) ? $line['dtHome'] : ''\n\t\t\t\t);\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\t$query = \"SELECT * FROM tkeysendung ORDER BY dtAbenteuer, dtKapitel, dtDatum, dtStunde\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t$lastadv = -1;\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\tif ($lastadv != $line['dtAbenteuer'])\n\t\t\t{\n\t\t\t\t$sort = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sort = $sort+10;\n\t\t\t}\n\t\t\t$lastadv = $line['dtAbenteuer'];\n\t\t\t$providers = array();\n\t\t\t\n\t\t\t$filequery = \"SELECT * FROM broadcastptwfiles WHERE fiBroadcast = \" . $line['idSendung'];\n\t\t\t$fileresult = mysql_query($filequery) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t$filedata = mysql_fetch_array($fileresult, MYSQL_ASSOC);\n\t\t\t$files = null;\n\t\t\tif (is_array($filedata) && strlen($filedata['filename']))\n\t\t\t{\n\t\t\t\t$filename = 'files/auriga/recordings/ptw/' . sprintf(\"%03d\", $line['dtAbenteuer']) . '/' . $filedata['filename'];\n\t\t\t\t$files ='a:1:{i:0;s:' . (strlen($filename)) . ':\"' . $filename . '\";}';\n\t\t\t}\n\n\t\t\t$proid = $this->getProviderId($line['dtProvider']); if ($proid) array_push($providers, $proid);\n\t\t\t$proid = $this->getProviderId($line['dtProvider2']); if ($proid) array_push($providers, $proid);\n\t\t\t$proid = $this->getProviderId($line['dtProvider3']); if ($proid) array_push($providers, $proid);\n\t\t\t$date = preg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $line['dtDatum'], $matches);\n\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast (tstamp, sorting, title, `date`, hour, pid, chapter, \" .\n\t\t\t\t\"story, special, length, complete, providers, files, frequency, samplerate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t->executeUncached(\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t$sort,\n\t\t\t\t\t\t($line['dtInhalt']) ? $line['dtInhalt'] : '', \n\t\t\t\t\t\tmktime(0, 0, 0, $matches[2], $matches[3], $matches[1]), \n\t\t\t\t\t\t($line['dtStunde']) ? $line['dtStunde'] : '',\n\t\t\t\t\t\t($adventures[$line['dtAbenteuer']] > 0) ? $adventures[$line['dtAbenteuer']] : 0,\n\t\t\t\t\t\t($line['dtKapitel']) ? $line['dtKapitel'] : '',\n\t\t\t\t\t\t($line['dtStory']) ? '1' : '0',\n\t\t\t\t\t\t($line['dtSondersendung']) ? '1' : '0',\n\t\t\t\t\t\t($line['dtDauer']) ? $line['dtDauer'] : '',\n\t\t\t\t\t\t($line['dtComplete']) ? '1' : '0',\n\t\t\t\t\t\t(count($providers)) ? serialize($providers) : null,\n\t\t\t\t\t\t$files,\n\t\t\t\t\t\t($line['dtFrequency']) ? $line['dtFrequency'] : '',\n\t\t\t\t\t\t($line['dtSamplerate']) ? $line['dtSamplerate'] : ''\n\t\t\t\t\t);\n\t\t\t$insertid = $objResult->insertId;\n\t\t\t/*\n\t\t\tif ($insertid > 0)\n\t\t\t{\n\t\t\t\t$queryfiles = sprintf(\"SELECT * FROM broadcastPTWfiles WHERE fiBroadcast = %s\", $line['idSendung']);\n\t\t\t\t$resultfiles = mysql_query($queryfiles) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t\t\twhile ($linefile = mysql_fetch_array($resultfiles, MYSQL_ASSOC)) \n\t\t\t\t{\n\t\t\t\t\tif (strlen($linefile['filename']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_file (pid, tstamp, filename) VALUES (?, ?, ?)\")\n\t\t\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\t\t\t\t$insertid,\n\t\t\t\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t\t\t\t$linefile['filename']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeytitelliste\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\t\t$genres = array();\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\t$genres[$line['dtMusiktyp1']]++;\n\t\t\t$genres[$line['dtMusiktyp2']]++;\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\tforeach (array_keys($genres) as $genre)\n\t\t{\n\t\t\tif (strlen(trim($genre)))\n\t\t\t{\n\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_genre (tstamp, name) VALUES (?, ?)\")\n\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\ttime(),\n\t\t\t\t\t\ttrim($genre)\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$genres = array();\n\t\t$objResult = $this->Database->prepare(\"SELECT * FROM tl_genre\")\n\t\t\t->executeUncached();\n\t\twhile ($objResult->next())\n\t\t{\n\t\t\t$row = $objResult->row();\n\t\t\t$genres[$row['name']] = $row['id'];\n\t\t}\n\n\t\t$query = \"SELECT * FROM tkeytitelliste\";\n\t\t$result = mysql_query($query) or die(\"Anfrage fehlgeschlagen: \" . mysql_error());\n\n\t\twhile ($line = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t\t{\n\t\t\tpreg_match(\"/(\\\\d{4})-(\\\\d{2})-(\\\\d{2})/\", $line['dtDatum'], $matches);\n\t\t\t$date = mktime(0, 0, 0, $matches[2], $matches[3], $matches[1]);\n\t\t\t$bid = $this->getBroadcastId($date, ($adventures[$line['dtAbenteuer']] > 0) ? $adventures[$line['dtAbenteuer']] : 0, ($line['dtKapitel']) ? $line['dtKapitel'] : '', ($line['dtStunde']) ? $line['dtStunde'] : '');\n\t\t\tif ($bid && $line['fiMusiktypPTW'] != 3)\n\t\t\t{\n\t\t\t\t$foundgenres = array();\n\t\t\t\tif ($genres[$line['dtMusiktyp1']]) array_push($foundgenres, $genres[$line['dtMusiktyp1']]);\n\t\t\t\tif ($genres[$line['dtMusiktyp2']]) array_push($foundgenres, $genres[$line['dtMusiktyp2']]);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider2']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$proid = $this->getProviderId($line['dtProvider3']); if ($proid) array_push($providers, $proid);\n\t\t\t\t$objResult = $this->Database->prepare(\"INSERT INTO tl_broadcast_song (tstamp, pid, sorting, title, artist, album, year, \" .\n\t\t\t\t\t\"labelcode, genres, songtype, length, composer, sequence) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\")\n\t\t\t\t\t->executeUncached(\n\t\t\t\t\t\t\ttime(),\n\t\t\t\t\t\t\t($bid) ? $bid : 0,\n\t\t\t\t\t\t\t($line['dtSong']) ? $line['dtSong'] : 0,\n\t\t\t\t\t\t\t($line['dtSongtitel']) ? $line['dtSongtitel'] : '', \n\t\t\t\t\t\t\t($line['dtInterpret']) ? $line['dtInterpret'] : '', \n\t\t\t\t\t\t\t($line['dtAlbumtitel']) ? $line['dtAlbumtitel'] : '', \n\t\t\t\t\t\t\t($line['dtJahr']) ? $line['dtJahr'] : '', \n\t\t\t\t\t\t\t($line['dtLCN']) ? $line['dtLCN'] : '', \n\t\t\t\t\t\t\t(count($foundgenres)) ? serialize($foundgenres) : null,\n\t\t\t\t\t\t\t($line['fiMusiktypPTW']) ? $line['fiMusiktypPTW'] : '',\n\t\t\t\t\t\t\t($line['dtZeit']) ? $line['dtZeit'] : '',\n\t\t\t\t\t\t\t($line['dtKomponist']) ? $line['dtKomponist'] : '',\n\t\t\t\t\t\t\t($line['dtSong']) ? $line['dtSong'] : 0\n\t\t\t\t\t\t);\n\t\t\t} else if ($line['fiSendungTitel'] == 1) {\n\t\t\t\t$this->log('Import: No broadcast found for ' . print_r($line, true), 'importOldDatabase', 5);\n\t\t\t}\n\n\t\t}\n\t\tmysql_free_result($result);\n\n\t\tmysql_close($link);\n\t}", "public function run()\n {\n \t$datas = Excel::import(new CargoImport, 'database/seeds/cargos.xlsx', null, \\Maatwebsite\\Excel\\Excel::XLSX);\n }", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function run() {\n\t\t//php artisan db:seed --class=CitiesTablesSeed\n\t\tset_time_limit( 3600 );\n\t\t$start = microtime( true );\n\t\t$filename = 'cities.csv';\n\t\t$this->command->info( \"*** Iniciando o Upload (\" . $filename . \") ***\" );\n\n\t\t$file = storage_path( 'import' . DIRECTORY_SEPARATOR . $filename );\n\t\t$this->command->info( \"*** Upload completo em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\n\t\t$rows = Excel::load( $file, function ( $reader ) {\n\t\t\t$reader->toArray();\n\t\t\t$reader->noHeading();\n\t\t} )->get();\n\t\tforeach ( $rows as $row ) {\n\t\t\t$data = [\n\t\t\t\t'id' => $row[0],\n\t\t\t\t'name' => $row[1],\n\t\t\t\t'idstate' => $row[2],\n\t\t\t];\n\t\t\t\\App\\Models\\Configs\\CepCities::create( $data );\n\t\t\techo( '(' . $data['id'] . ') - ' );\n\t\t}\n\t\t$this->command->info( \"*** Importacao IMPORTSEEDER realizada com sucesso em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\n\t}", "public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnCharacter.php\";\n\t\t$characters = adnCharacter::getAllCharacters($this->wmo_id);\n\n\t\t$this->setData($characters);\n\t\t$this->setMaxCount(sizeof($characters));\n\t}", "public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}", "public function run()\n {\n $rows = DB::table('enderecos_copy')->get();\n\n foreach ($rows as $row){\n DB::table('enderecos')->insert([\n 'logradouro' => $row->logradouro,\n 'bairro' => $row->bairro,\n 'regional' => $row->regional,\n ]);\n }\n }", "public function importcccost(){\n// dd();\n $data = Excel::load('../couriers/clubcourierprices.xlsx', function($reader) {\n })->get();\n if(!empty($data) && $data->count()){\n foreach ($data as $key => $value) {\n if(!empty($value->from)){\n\n $fromId = 0;\n $toId = 0;\n $existingRegion = $this->checkCCregionexist($value->from);\n if(count($existingRegion)>0){\n $fromId = $existingRegion[0]->id;\n }else{\n $fromId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->from]\n );\n }\n $existingRegion = $this->checkCCregionexist($value->to);\n if(count($existingRegion)>0){\n $toId = $existingRegion[0]->id;\n }else{\n $toId = DB::table($this->DBTables['CCRegion'])->insertGetId(\n ['region' => $value->to]\n );\n }\n $CostInsertId = DB::table($this->DBTables['CCCost'])->insertGetId(\n ['from_region_id' => $fromId, 'to_region_id'=>$toId, 'small_bag_cost'=>$value->small_bag_rrp,'standard_bag_cost'=>$value->standard_bag_rrp,'large_bag_cost'=>$value->large_bag_rrp,'transit_days'=>$value->transit_time_days]\n );\n }\n }\n }\n }", "public function import() {\n\t\t$exchangeRateImporter = new EcbExchangeRateImporter();\n\t\t$exchangeRateImporter->import();\n\n\t\t$event = new CakeEvent('ExchangeRateImport.completed', $this);\n\t\tCakeEventManager::instance()->dispatch($event);\n\t}", "function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }", "public function run()\n {\n $municipios = Excel::import(new MunicipioImport, 'database/seeds/Imports/municipios.xlsx');\n }", "public function prepareImport();", "public function import_file(){\n\t\t$this->load->model(\"payment/M_pa_payment\",\"payment\");\n\t\t\n\t\t$this->data[\"rs_year_exam\"] = $this->payment->get_year_exam();\n\t\t\n\t\t$this->output(\"Payment/v_import_excel\",$this->data);\n\t}", "function post_eventos()\n\t{\n\t\tif ($this->disparar_importacion_efs ) {\n\t\t\tif (isset($this->s__importacion_efs['datos_tabla'])) {\n\t\t\t\t$clave = array('proyecto' => toba_editor::get_proyecto_cargado(),\n\t\t\t\t\t\t\t\t\t\t\t'componente' => $this->s__importacion_efs['datos_tabla']);\n\t\t\t\t$dt = toba_constructor::get_info($clave, 'toba_datos_tabla');\n\t\t\t\t$this->s__importacion_efs = $dt->exportar_datos_efs($this->s__importacion_efs['pk']);\n\t\t\t\tforeach ($this->s__importacion_efs as $ef) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (! $this->get_tabla()->existe_fila_condicion(array($this->campo_clave => $ef[$this->campo_clave]))) {\n\t\t\t\t\t\t\t$this->get_tabla()->nueva_fila($ef);\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch(toba_error $e) {\n\t\t\t\t\t\ttoba::notificacion()->agregar(\"Error agregando el EF '{$ef[$this->campo_clave]}'. \" . $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->disparar_importacion_efs = false;\n\t\t}\n\t}", "function resource_import($doFilter) {\n\techo 'importing ' . $doFilter;\n\tif ($doFilter) {\n\t\tlog_event('checking last day');\n\t\t$today = new DateTime();\n\t\t$opt = get_option('check_interval ',24);//gets the current time interval for automatic check\n\t\t$daysToCheck = ceil($opt/24);\n\t\t$start = new DateTime();\n\t\t$interval = new DateInterval('P'.$daysToCheck.'D');\n\t\t$start->sub($interval);\n\t\t$filter = 'dcterms:created ?date.\n\t\t FILTER (?date > \"'.$start->format('Y-m-d').'\"^^xsd:date)\n\t\t FILTER (?date < \"'. $today->format('Y-m-d').'\"^^xsd:date)';\n\t} else $filter = 'dcterms:created ?date;';\n\t$sparql = new EasyRdf_Sparql_Client(esc_attr(get_option( 'endpoint')));\n\tlog_event('creating query for ' . $filter);\n\t//Get the resources\n\t$result = $sparql->query(\n 'SELECT COUNT(?s) as ?totalRecords {\n\t\t ?s rdf:type <http://schema.org/CreativeWork>;\n\t\t \n\t\t '.$filter.'\n\t\t}'\n );\n\t$urls = array();\n\t//import each page of results...\n\tforeach ($result as $row) {\n echo intval($row->totalRecords->getValue()) . ' records to import ';\n\t get_urls(intval($row->totalRecords->getValue()), 0, $urls, $filter);\n }\n\techo ' import completed';\n\tlog_event('import completed');\n}", "private function importCsv($params) {\n\n $conn = $this->container->get('doctrine.dbal.default_connection');\n\n // set content in file handler\n $fiveMBs = 5 * 1024 * 1024;\n $fp = fopen(\"php://temp/maxmemory:$fiveMBs\", 'r+');\n fputs($fp, $params['data']);\n rewind($fp);\n\n // get array from CSV\n $data = array();\n while (($row = fgetcsv($fp, 1000, \",\")) !== FALSE) {\n $data[] = $row;\n }\n fclose($fp);\n\n // let's check how the CSV is structured. There can be 3 options\n\n // Option 1.\n // date, value\n // date2, value2\n\n // Option 2.\n // x, date1, date2\n // source_title, value11, value12\n // source_title2, value21, value22\n\n // so let's check the first field to see if it's a date\n $firstField = $data[0][0];\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($firstField);\n\n $dataToInsert = array();\n $sourcesToInsert = array();\n\n // it's a date, so Option 1\n if ( $dateAr ) {\n\n $sourceHash = md5($params['title']);\n\n $sourcesToInsert[] = '('\n . $conn->quote(trim($params['title']), 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // the data is already on the desired format\n $dataToInsert[ $sourceHash ] = $data;\n }\n // Option 2.\n else {\n\n // get dates which are on the first line\n $dates = array_slice($data[0], 1);\n $avoidFirst = true;\n foreach ($data as $lineData) {\n\n // do not insert first line\n if ( $avoidFirst ) {\n $avoidFirst = false;\n continue;\n }\n\n // source title\n $titleSuffix = $lineData[0];\n $sourceTitle = trim($params['title']) . ' - ' . trim($titleSuffix);\n $sourceHash = md5($sourceTitle);\n\n $sourcesToInsert[] = '('\n . $conn->quote($sourceTitle, 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // values\n $values = array_slice($lineData, 1);\n\n $dataToInsert[ $sourceHash ] = array_combine($dates, $values);\n }\n }\n\n $now = date('Y-m-d H:m:s');\n\n // insert masivo de sources\n $r = $conn->executeUpdate('INSERT INTO source (title, hash, unit, link, created_at, updated_at)\n VALUES '.join(',', $sourcesToInsert));\n\n // get all sources\n $results = $conn->fetchAll(\"SELECT id, hash FROM source where created_at > ?\", array($now));\n\n // create array that identifies source\n $sources = array();\n foreach ($results as $r) {\n $sources[ $r['hash'] ] = $r['id'];\n }\n unset($results);\n\n $insert = array();\n foreach ($dataToInsert as $sourceCode => $data) {\n\n foreach ($data as $date => $value ) {\n\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($date);\n\n $date = $dateAr['date'];\n $dateType = $dateAr['dateType'];\n\n $insert[] = '('.$sources[ $sourceCode ].', '\n .$conn->quote($date, 'string').', '\n .$conn->quote($dateType, 'string').', '\n .$conn->quote($value, 'string').', now(), now())';\n }\n }\n\n $offset = 0;\n $MAX = 10000;\n $total = count($insert);\n\n //$this->output->writeln('Hay '.$total.' data points');\n\n while ( $offset < $total ) {\n\n $insertNow = array_slice($insert, $offset, $MAX);\n\n // hacer insert masivo\n $r = $conn->executeUpdate('INSERT INTO data (source_id, date, date_type, value, created_at, updated_at)\n VALUES '.join(',', $insertNow));\n\n $offset += $MAX;\n\n //$this->output->writeln(' ...añadidos '.$offset);\n }\n }", "private function importDateContents($contents) : void\n {\n //==============================================================================\n // Import Date\n if (!empty($contents[\"date\"])) {\n if ($contents[\"date\"] instanceof DateTime) {\n $this->setRefreshAt($contents[\"date\"]);\n } elseif (is_scalar($contents[\"date\"])) {\n $this->setRefreshAt(new DateTime((string) $contents[\"date\"]));\n }\n }\n }", "private function _get_data_from_dropbox()\n {\n $tmp = '/tmp/market_data/';\n \n // tmp/market_data/\n if(! is_dir($tmp))\n {\n mkdir($tmp);\n }\n\n // data/optionsendofday/IWM\n if(! is_dir($tmp . '/data/OptionsEndOfDay/IWM'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/IWM', 0777, true);\n }\n\n // data/optionsendofday/SPY\n if(! is_dir($tmp . '/data/OptionsEndOfDay/SPY'))\n {\n mkdir($tmp . '/data/OptionsEndOfDay/SPY', 0777, true);\n }\n \n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $filesystem = new Filesystem($adapter); \n\n // Loop through and download the data\n foreach($this->eod_option_summary_files AS $key => $row)\n {\n if(is_file($tmp . $row))\n {\n $this->info('Dropbox Already Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files));\n continue;\n }\n \n // Download and store.\n file_put_contents($tmp . $row, $filesystem->read($row));\n $this->info('Dropbox Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files)); \n }\n }", "function import($onDuplicate, &$values) {\n $response = $this->summary($values);\n $this->_params = $this->getActiveFieldParams(true);\n $this->formatDateParams();\n $this->_params['skipRecentView'] = TRUE;\n $this->_params['check_permissions'] = TRUE;\n\n if(count($this->_importQueueBatch) >= $this->getImportQueueBatchSize()) {\n $this->addBatchToQueue();\n }\n $this->addToBatch($this->_params, $values);\n\n }", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function import()\n {\n \n }", "public function import()\n\t{\n\t\tinclude APPPATH . 'third_party/PHPExcel/PHPExcel.php';\n\n\t\t$excelreader = new PHPExcel_Reader_Excel2007();\n\t\t$loadexcel = $excelreader->load('excel/' . $this->filename . '.xlsx'); // Load file yang telah diupload ke folder excel\n\t\t$sheet = $loadexcel->getActiveSheet()->toArray(null, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true);\n\n\t\t// Buat sebuah variabel array untuk menampung array data yg akan kita insert ke database\n\t\t$data = array();\n\n\t\t$numrow = 3;\n\t\t$kosong = 0;\n\t\tforeach ($sheet as $row) {\n\t\t\t// Cek $numrow apakah lebih dari 1\n\t\t\t// Artinya karena baris pertama adalah nama-nama kolom\n\t\t\t// Jadi dilewat saja, tidak usah diimport\n\t\t\tif ($numrow > 3) {\n\t\t\t\t// Kita push (add) array data ke variabel data\n\t\t\t\tarray_push($data, array(\n\t\t\t\t\t'cabang' => $row['B'],\n\t\t\t\t\t'temuan' => $row['C'],\n\t\t\t\t\t'nilai_amanah' => $row['D'],\n\t\t\t\t\t'level' => $row['E'],\n\t\t\t\t\t'tingkat' => $row['F'],\n\t\t\t\t\t'avail' => $row['G'],\n\t\t\t\t\t'util' => $row['H'],\n\t\t\t\t\t'nilai_kompeten' => $row['I'],\n\t\t\t\t\t'kaloborasi' => $row['J'],\n\t\t\t\t\t'nilai_harmonis' => $row['K'],\n\t\t\t\t\t'revenue' => $row['L'],\n\t\t\t\t\t'efisiensi' => $row['M'],\n\t\t\t\t\t'nilai_loyal' => $row['N'],\n\t\t\t\t\t'koreksi' => $row['O'],\n\t\t\t\t\t'modul' => $row['P'],\n\t\t\t\t\t'nilai_adaptif' => $row['Q'],\n\t\t\t\t\t'realisasi_kpi' => $row['R'],\n\t\t\t\t\t'realisasi_pkm' => $row['S'],\n\t\t\t\t\t'nilai_kolab' => $row['T'],\n\t\t\t\t\t'nilai_total' => $row['U'],\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t$numrow++; // Tambah 1 setiap kali looping\n\t\t}\n\n\t\t// Panggil fungsi insert_multiple yg telah kita buat sebelumnya di model\n\t\t$this->RaporModel->insert_multiple($data);\n\n\t\tredirect(\"/rapor\"); // Redirect ke halaman awal (ke controller rapor fungsi index)\n\t}", "function importFromOutside($data)\r\n {\r\n\r\n $sql = $data;\r\n \r\n if(!empty($sql)){\r\n\r\n $sql = explode(';', $_POST['return']);\r\n\r\n foreach ($sql as $query) {\r\n $result = $this->onlineDB->prepare(\"$query\");\r\n try {\r\n $result->execute();\r\n } catch (Exception $e) {\r\n echo $e;\r\n }\r\n }\r\n\r\n }else\r\n echo 'there is no database';\r\n\r\n }", "public function import_data()\r\n\t{\r\n\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_queries` WHERE `enabled`>='1'\";\r\n\t\t$mls_queries = wpl_db::select($query);\r\n\t\t$rets_objects = array();\r\n\t\t$connection = 0;\r\n \r\n\t\tforeach($mls_queries as $mls_query)\r\n\t\t{\r\n\t\t\t$query = \"SELECT * FROM `#__wpl_addon_mls_data` WHERE `mls_query_id` = '{$mls_query->id}' AND `imported` = 0 ORDER BY `date` LIMIT {$mls_query->import_limit}\";\r\n\t\t\t$mls_data = wpl_db::select($query);\r\n\t\t\tif(!$mls_data) continue;\r\n\t\t\t$results = array();\r\n\t\t\t$ids = array();\r\n\r\n\t\t\tforeach($mls_data as $data)\r\n\t\t\t{\r\n\t\t\t\t$results[$data->unique_value] = (array)json_decode(base64_decode($data->content));\r\n\t\t\t\t$ids[] = $data->id;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/** load rets object **/\r\n\t\t\tif($rets_objects[$mls_query->mls_server_id]) $wplrets = $rets_objects[$mls_query->mls_server_id];\r\n\t\t\telse $wplrets = new wpl_addon_mls($mls_query->mls_server_id);\r\n\r\n\t\t\tif(trim($wplrets->mls_server_data->mls_unique_field) == '') continue;\r\n\t\t\t\r\n\t\t\t/** set to rets objects **/\r\n\t\t\t$rets_objects[$mls_query->mls_server_id] = $wplrets;\r\n\r\n\t\t\t/** connect **/\r\n\t\t\tif(!$connection) $connection = $wplrets->connect();\r\n\r\n\t\t\t/** map data **/\r\n\t\t\t$mapped = $wplrets->map($results, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** import properties **/\r\n\t\t\t$pids = $wplrets->import_mapped_data($mapped, $mls_query->id);\r\n\t\t\t\r\n\t\t\t/** download images **/\r\n\t\t\tif(trim($mls_query->images)) $wplrets->import_properties_images($pids, $mls_query->mls_server_id, $mls_query->images, false);\r\n\t\t\t\r\n\t\t\t/** finalizing properties **/\r\n\t\t\tforeach($pids as $pid) $wplrets->finalize($pid);\r\n\t\t\r\n\t\t\t/** update imported field **/\r\n\t\t\twpl_db::q(\"UPDATE `#__wpl_addon_mls_data` SET `imported` = '1' WHERE `id` IN ('\".implode(\"','\", $ids).\"')\");\r\n\t\t}\r\n\r\n\t\tif(wpl_request::getVar('rets_import_cron_job') == 1) exit;\r\n\t}", "public function testV1ImportDaysPost()\n {\n }", "function import(array $data);", "function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }", "public function acfedu_create_fill_db() {\n\t\t\t\t$this->acfedu_check_table();\n\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\tob_start();\n\t\t\t\tglobal $wpdb;\n //require_once( 'lib/import_nl.php' );\n //require_once( 'lib/import_be.php' );\n //require_once( 'lib/import_lux.php' );\n require_once( 'lib/import_id.php' );\n\t\t\t\t$sql = ob_get_clean();\n\t\t\t\tdbDelta( $sql );\n\t\t\t}", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbtv.json\");\n $this->_db = json_decode($json_string, true);\n $this->_ep_list = $this->_flatten_episodes();\n }", "public function quota_import()\n {\n $targets = array('縣市議員', '直轄市議員', '鄉鎮市民代表', '直轄市山地原住民區民代表');\n $importPath = __DIR__ . '/data/2014_quota';\n $sql = array(\n 'UPDATE elections SET quota = 1;'\n );\n foreach ($targets as $target) {\n $importFile = \"{$importPath}/{$target}.csv\";\n if (file_exists($importFile)) {\n $fh = fopen($importFile, 'r');\n fgetcsv($fh, 512);\n while ($line = fgetcsv($fh, 2048)) {\n if (!empty($line[3])) {\n $sql[] = \"UPDATE elections SET quota = {$line[1]}, quota_women = {$line[2]} WHERE id = '{$line[3]}';\";\n }\n }\n fclose($fh);\n }\n }\n file_put_contents(TMP . 'quota.sql', implode(\"\\n\", $sql));\n }", "public function load() {\n $importItemsTempManager = ImportItemsTempManager::getInstance();\n $categoryHierarchyManager = CategoryHierarchyManager::getInstance();\n $categoryManager = CategoryManager::getInstance();\n $companyManager = CompanyManager::getInstance();\n $company_id = $_REQUEST['company_id'];\n $companyDto = $companyManager->selectByPK($company_id);\n $this->addParam('companyDto', $companyDto);\n $used_columns_indexes_array = array(2/* name */, 1/* model */, 9/* brand */, 3/* dealer price $ */, 4/* $dealer price amd */, 5/* vat $ */, 6/* vat amd */, 7/* warranty */); //explode(',', $_REQUEST['used_columns_indexes']);\n\n $customerLogin = $this->getCustomerLogin();\n $priceRowsDtos = $importItemsTempManager->getUserCurrentPriceNewRows($customerLogin);\n foreach ($priceRowsDtos as $dto) {\n $itemModel = $dto->getModel();\n if (empty($itemModel)) {\n $model = $importItemsTempManager->findModelFromItemTitle($dto->getDisplayName());\n if (!empty($model)) {\n $dto->setSupposedModel($model);\n }\n } else {\n $dto->setSupposedModel($itemModel);\n }\n }\n\n\n $columnNames = ImportPriceManager::getColumnNamesMap($used_columns_indexes_array);\n\n $rootDto = $categoryManager->getRoot();\n $firstLevelCategoriesHierarchyDtos = $categoryHierarchyManager->getCategoryChildren($rootDto->getId());\n $firstLevelCategoriesNamesDtos = $categoryHierarchyManager->getCategoriesNamesByParentCategoryId($rootDto->getId());\n\n\n $firstLevelCategoriesIds = array();\n foreach ($firstLevelCategoriesHierarchyDtos as $key => $category) {\n $firstLevelCategoriesIds[] = $category->getChildId();\n }\n $firstLevelCategoriesNames = array();\n foreach ($firstLevelCategoriesNamesDtos as $key => $category) {\n $firstLevelCategoriesNames[] = $category->getDisplayName();\n }\n\n $this->addParam('columnNames', $columnNames);\n $this->addParam('priceRowsDtos', $priceRowsDtos);\n $this->addParam('firstLevelCategoriesNames', $firstLevelCategoriesNames);\n $this->addParam('firstLevelCategoriesIds', $firstLevelCategoriesIds);\n\n if (isset($_REQUEST['new_items_row_ids'])) {\n $this->addParam('new_items_row_ids', explode(',', $_REQUEST['new_items_row_ids']));\n }\n }", "function run_endo_importer() {\n\t$plugin = new Endo_Importer();\n\t$plugin->run();\n}", "function erp_process_import_export() {\n if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'erp-import-export-nonce' ) ) {\n return;\n }\n\n $is_crm_activated = erp_is_module_active( 'crm' );\n $is_hrm_activated = erp_is_module_active( 'hrm' );\n\n $departments = $is_hrm_activated ? erp_hr_get_departments_dropdown_raw() : [];\n $designations = $is_hrm_activated ? erp_hr_get_designation_dropdown_raw() : [];\n\n $field_builder_contact_options = get_option( 'erp-contact-fields' );\n $field_builder_contacts_fields = [];\n\n if ( ! empty( $field_builder_contact_options ) ) {\n foreach ( $field_builder_contact_options as $field ) {\n $field_builder_contacts_fields[] = $field['name'];\n }\n }\n\n $field_builder_company_options = get_option( 'erp-company-fields' );\n $field_builder_companies_fields = [];\n\n if ( ! empty( $field_builder_company_options ) ) {\n foreach ( $field_builder_company_options as $field ) {\n $field_builder_companies_fields[] = $field['name'];\n }\n }\n\n $field_builder_employee_options = get_option( 'erp-employee-fields' );\n $field_builder_employees_fields = array();\n\n if ( ! empty( $field_builder_employee_options ) ) {\n foreach ( $field_builder_employee_options as $field ) {\n $field_builder_employees_fields[] = $field['name'];\n }\n }\n\n if ( isset( $_POST['erp_import_csv'] ) ) {\n define( 'ERP_IS_IMPORTING', true );\n\n $fields = ! empty( $_POST['fields'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) ) : [];\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n\n if ( empty( $type ) ) {\n return;\n }\n\n $csv_file = isset( $_FILES['csv_file'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_FILES['csv_file'] ) ) : [];\n\n $data = [ 'type' => $type, 'fields' => $fields, 'file' => $csv_file ];\n\n do_action( 'erp_tool_import_csv_action', $data );\n\n if ( ! in_array( $type, [ 'contact', 'company', 'employee' ] ) ) {\n return;\n }\n\n $employee_fields = [\n 'work' => [\n 'designation',\n 'department',\n 'location',\n 'hiring_source',\n 'hiring_date',\n 'date_of_birth',\n 'reporting_to',\n 'pay_rate',\n 'pay_type',\n 'type',\n 'status',\n ],\n 'personal' => [\n 'photo_id',\n 'user_id',\n 'first_name',\n 'middle_name',\n 'last_name',\n 'other_email',\n 'phone',\n 'work_phone',\n 'mobile',\n 'address',\n 'gender',\n 'marital_status',\n 'nationality',\n 'driving_license',\n 'hobbies',\n 'user_url',\n 'description',\n 'street_1',\n 'street_2',\n 'city',\n 'country',\n 'state',\n 'postal_code',\n ]\n ];\n\n require_once WPERP_INCLUDES . '/lib/parsecsv.lib.php';\n\n $csv = new ParseCsv();\n $csv->encoding( null, 'UTF-8' );\n $csv->parse( $csv_file['tmp_name'] );\n\n if ( empty( $csv->data ) ) {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import\" ) );\n exit;\n }\n\n $csv_data = [];\n\n $csv_data[] = array_keys( $csv->data[0] );\n\n foreach ( $csv->data as $data_item ) {\n $csv_data[] = array_values( $data_item );\n }\n\n if ( ! empty( $csv_data ) ) {\n $count = 0;\n\n foreach ( $csv_data as $line ) {\n if ( empty( $line ) ) {\n continue;\n }\n\n $line_data = [];\n\n if ( is_array( $fields ) && ! empty( $fields ) ) {\n foreach ($fields as $key => $value) {\n\n if (!empty($line[$value]) && is_numeric($value)) {\n if ($type == 'employee') {\n if (in_array($key, $employee_fields['work'])) {\n if ($key == 'designation') {\n $line_data['work'][$key] = array_search($line[$value], $designations);\n } else if ($key == 'department') {\n $line_data['work'][$key] = array_search($line[$value], $departments);\n } else {\n $line_data['work'][$key] = $line[$value];\n }\n\n } else if (in_array($key, $employee_fields['personal'])) {\n $line_data['personal'][$key] = $line[$value];\n } else {\n $line_data[$key] = $line[$value];\n }\n } else {\n $line_data[$key] = isset($line[$value]) ? $line[$value] : '';\n $line_data['type'] = $type;\n }\n }\n }\n }\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n if ( ! isset( $line_data['work']['status'] ) ) {\n $line_data['work']['status'] = 'active';\n }\n\n\n $item_insert_id = erp_hr_employee_create( $line_data );\n\n if ( is_wp_error( $item_insert_id ) ) {\n continue;\n }\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $contact_owner = isset( $_POST['contact_owner'] ) ? absint( $_POST['contact_owner'] ) : erp_crm_get_default_contact_owner();\n $line_data['contact_owner'] = $contact_owner;\n $people = erp_insert_people( $line_data, true );\n\n if ( is_wp_error( $people ) ) {\n continue;\n } else {\n $contact = new \\WeDevs\\ERP\\CRM\\Contact( absint( $people->id ), 'contact' );\n $life_stage = isset( $_POST['life_stage'] ) ? sanitize_key( $_POST['life_stage'] ) : '';\n\n if ( ! $people->exists ) {\n $contact->update_life_stage( $life_stage );\n\n } else {\n if ( ! $contact->get_life_stage() ) {\n $contact->update_life_stage( $life_stage );\n }\n }\n\n if ( ! empty( $_POST['contact_group'] ) ) {\n $contact_group = absint( $_POST['contact_group'] );\n\n $existing_data = \\WeDevs\\ERP\\CRM\\Models\\ContactSubscriber::where( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id\n ] )->first();\n\n if ( empty( $existing_data ) ) {\n $hash = sha1( microtime() . 'erp-subscription-form' . $contact_group . $people->id );\n\n erp_crm_create_new_contact_subscriber( [\n 'group_id' => $contact_group,\n 'user_id' => $people->id,\n 'status' => 'subscribe',\n 'subscribe_at' => current_time( 'mysql' ),\n 'unsubscribe_at' => null,\n 'hash' => $hash\n ] );\n }\n }\n\n\n if ( ! empty( $field_builder_contacts_fields ) ) {\n foreach ( $field_builder_contacts_fields as $field ) {\n if ( isset( $line_data[ $field ] ) ) {\n erp_people_update_meta( $people->id, $field, $line_data[ $field ] );\n }\n }\n }\n }\n }\n\n ++ $count;\n }\n\n }\n\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=import&imported=$count\" ) );\n exit;\n }\n\n if ( isset( $_POST['erp_export_csv'] ) ) {\n if ( ! empty( $_POST['type'] ) && ! empty( $_POST['fields'] ) ) {\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n $fields = array_map( 'sanitize_text_field', wp_unslash( $_POST['fields'] ) );\n\n if ( $type == 'employee' && $is_hrm_activated ) {\n $args = [\n 'number' => - 1,\n 'status' => 'all'\n ];\n\n $items = erp_hr_get_employees( $args );\n }\n\n if ( ( $type == 'contact' || $type == 'company' ) && $is_crm_activated ) {\n $args = [\n 'type' => $type,\n 'count' => true,\n ];\n $total_items = erp_get_peoples( $args );\n\n $args = [\n 'type' => $type,\n 'offset' => 0,\n 'number' => - 1,\n ];\n $items = erp_get_peoples( $args );\n }\n\n //@todo do_action()\n $csv_items = [];\n\n $x = 0;\n foreach ( $items as $item ) {\n\n if ( empty( $fields ) ) {\n continue;\n }\n\n foreach ( $fields as $field ) {\n if ( $type == 'employee' ) {\n\n if ( in_array( $field, $field_builder_employees_fields ) ) {\n $csv_items[ $x ][ $field ] = get_user_meta( $item->id, $field, true );\n } else {\n switch ( $field ) {\n case 'department':\n $csv_items[ $x ][ $field ] = $item->get_department_title();\n break;\n\n case 'designation':\n $csv_items[ $x ][ $field ] = $item->get_job_title();\n break;\n\n default:\n $csv_items[ $x ][ $field ] = $item->{$field};\n break;\n }\n }\n\n } else {\n if ( $type == 'contact' ) {\n if ( in_array( $field, $field_builder_contacts_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n if ( $type == 'company' ) {\n if ( in_array( $field, $field_builder_companies_fields ) ) {\n $csv_items[ $x ][ $field ] = erp_people_get_meta( $item->id, $field, true );\n } else {\n $csv_items[ $x ][ $field ] = $item->{$field};\n }\n }\n }\n }\n\n $x ++;\n }\n\n $file_name = 'export_' . date( 'd_m_Y' ) . '.csv';\n\n erp_make_csv_file( $csv_items, $file_name );\n\n } else {\n wp_redirect( admin_url( \"admin.php?page=erp-tools&tab=export\" ) );\n exit();\n }\n }\n}", "public function import(Request $request){\n\n // get file \n $upload = $request -> file('upload_file');\n if ( $upload == null){\n $error = \"Please select CSV file\";\n return view(\"welcome\")->with('error',$error);\n }\n $filePath = $upload-> getRealPath();\n \n \n // open and read file \n $file = fopen($filePath, 'r');\n\n $header = fgetcsv($file);\n \n // validate file \n \n // loop throgh other colums\n $importData_arr = array();\n $i = 0;\n while( $filedata = fgetcsv($file))\n {\n $num = count($filedata );\n if($i == 0){\n $i++;\n continue; \n }\n for ($c=0; $c < $num; $c++) {\n $importData_arr[$i][] = $filedata [$c];\n }\n $i++;\n\n }\n // Insert to MySQL database\n foreach($importData_arr as $importData){\n\n $insertData = array(\n \"date\"=>$importData[0],\n \"category\"=>$importData[1],\n \"lot_title\"=>$importData[2],\n \"lot_location\"=>$importData[3],\n \"lot_condition\"=>$importData[4],\n \"pretax_amount\"=>$importData[5],\n \"tax_name\"=>$importData[6],\n \"tax_amount\"=>$importData[7],\n\n );\n \n Auction::insertData($insertData);\n\n }\n \n $data = DB::table('auctions')->get();\n return view(\"welcome\")->with('allAuctionData',$data);\n\n }", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "public function exportTiendasToCsv(){\n $Fecha = date('d-m-Y');\n #$Hora = date('H:i:s');\n #$fechahora = \"(\".$Fecha.\"-\".$Hora.\")\";\n\n $consulta = $this->db->prepare(\"\n SELECT\n 'COD_TIENDA'\n ,'COD_BTK'\n ,'TIENDA_NAME'\n ,'DIRECCION'\n ,'COD_CLIENTE'\n ,'CLIENTE_NAME'\n ,'COD_REGION'\n ,'REGION_NAME'\n ,'COD_CIUDAD'\n ,'CIUDAD_NAME'\n ,'COD_COMUNA'\n ,'COMUNA_NAME'\n ,'COD_ZONA'\n ,'ZONA_NAME'\n ,'COD_TIPO'\n ,'TIPO_NAME'\n ,'COD_AGRUPACION'\n ,'AGRUPACION_NAME'\n ,'COD_ESTADO'\n ,'ESTADO_NAME'\n UNION ALL\n SELECT \n TI.COD_TIENDA,\n TI.COD_BTK,\n TI.NOM_TIENDA,\n IFNULL(TI.DIREC_TIENDA,'') AS DIRECCION,\n CL.COD_CLIENTE,\n CL.NOM_CLIENTE,\n IFNULL(RG.COD_REGION, '') AS COD_REGION,\n IFNULL(RG.NOM_REGION, '') AS NOM_REGION,\n IFNULL(CT.COD_CIUDAD, '') AS COD_CIUDAD,\n IFNULL(CT.NOM_CIUDAD, '') AS NOM_CIUDAD,\n IFNULL(CM.COD_COMUNA, '') AS COD_COMUNA,\n IFNULL(CM.NOM_COMUNA, '') AS NOM_COMUNA,\n IFNULL(ZN.COD_ZONA, '') AS COD_ZONA,\n IFNULL(ZN.NOM_ZONA, '') AS NOM_ZONA,\n IFNULL(TT.COD_TIPO, '') AS COD_TIPO,\n IFNULL(TT.NOM_TIPO, '') AS NOM_TIPO,\n IFNULL(AG.COD_AGRUPACION, '') AS COD_AGRUPACION,\n IFNULL(AG.NOM_AGRUPACION, '') AS NOM_AGRUPACION,\n IFNULL(ET.COD_ESTADO, '') AS COD_ESTADO,\n IFNULL(ET.NOM_ESTADO, '') AS NOM_ESTADO\n FROM T_TIENDA TI\n LEFT OUTER JOIN T_CLIENTE CL ON CL.COD_CLIENTE = TI.CLIENTE_COD_CLIENTE\n LEFT OUTER JOIN T_TIENDA_ESTADO ET ON ET.COD_ESTADO = TI.ESTADO_COD_ESTADO\n LEFT OUTER JOIN T_COMUNA CM ON (CM.COD_COMUNA = TI.COMUNA_COD_COMUNA)\n AND (CM.CIUDAD_COD_CIUDAD = TI.COMUNA_CIUDAD_COD_CIUDAD)\n AND (CM.CIUDAD_REGION_COD_REGION = TI.COMUNA_CIUDAD_REGION_COD_REGION)\n LEFT OUTER JOIN T_CIUDAD CT ON CT.COD_CIUDAD = CM.CIUDAD_COD_CIUDAD\n LEFT OUTER JOIN T_REGION RG ON RG.COD_REGION = CM.CIUDAD_REGION_COD_REGION\n LEFT OUTER JOIN T_TIENDA_ZONA ZN ON ZN.COD_ZONA = TI.ZONA_COD_ZONA\n LEFT OUTER JOIN T_TIPO_TIENDA TT ON TT.COD_TIPO = TI.TIPO_TIENDA_COD_TIPO\n LEFT OUTER JOIN T_AGRUPACION AG ON AG.COD_AGRUPACION = TI.AGRUPACION_COD_AGRUPACION \n WHERE TI.COD_TIENDA NOT LIKE '%N/A%'\n AND TI.COD_BTK NOT LIKE '%N/A%'\n INTO OUTFILE '\".$this->apache.$this->root.\"views/tmp/SOM_TIENDAS_\".$Fecha.\".csv'\n CHARACTER SET latin1\n FIELDS TERMINATED BY ';'\n LINES TERMINATED BY '\\n'\");\n \n //OPTIONALLY ENCLOSED BY '\\\"'\n \n $consulta->execute();\n\n // hold & go to be sure\n sleep(2);\n \n header('Content-Type: application/vnd.ms-excel');\n header('Content-Disposition: attachment;filename=\"SOM_TIENDAS_'.$Fecha.'.csv\"');\n header('Cache-Control: max-age=0');\n \n readfile(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n unlink(''.$this->apache.$this->root.'views/tmp/SOM_TIENDAS_'.$Fecha.'.csv');\n \n// $error = $consulta->errorInfo();\n// echo $error[2];\n }", "function WriteForexDataFromFile()\n{\n\t$uscny_sql = new UscnyHistorySql();\n\t$hkcny_sql = new HkcnyHistorySql();\n $file = fopen('/debug/cny2018.csv', 'r');\n// $file = fopen('/debug/cny2017.csv', 'r');\n// $file = fopen('/debug/cny2016.csv', 'r');\n// $file = fopen('/debug/cny2015.csv', 'r');\n// $file = fopen('/debug/cny2014.csv', 'r');\n if ($file == false)\n {\n \tDebugString('Can not open read file');\n \treturn;\n }\n \n while (!feof($file))\n {\n $strLine = fgets($file);\n $arWord = explode(',', $strLine);\n if (count($arWord) >= 5)\n {\n \t$strDate = $arWord[0];\n \t$strUSD = $arWord[1];\n \t$strHKD = $arWord[4];\n// \tDebugString($strDate.' '.$strUSD.' '.$strHKD);\n \t\n \t\t$uscny_sql->Write($strDate, $strUSD);\n \t\t$hkcny_sql->Write($strDate, $strHKD);\n }\n }\n fclose($file);\n}", "function ieconfig_saisies_import() {\n\tif (!_request('_code_yaml') or _request('annuler') or _request('importer')) {\n\t\t$saisies = array(\n\t\t\tarray(\n\t\t\t\t'saisie' => 'fieldset',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'nom' => 'ieconfig_import_choix_fichier',\n\t\t\t\t\t'label' => '<:ieconfig:label_ieconfig_import_choix_fichier:>',\n\t\t\t\t\t'icone' => 'img/ieconfig-import.png',\n\t\t\t\t),\n\t\t\t\t'saisies' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'saisie' => 'input',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t\t\t'nom' => 'ieconfig_import_fichier',\n\t\t\t\t\t\t\t'label' => '<:ieconfig:label_ieconfig_import_fichier:>',\n\t\t\t\t\t\t\t'explication' => '<:ieconfig:explication_ieconfig_import_fichier:>',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'saisie' => 'selection',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'type' => 'selection',\n\t\t\t\t\t\t\t'nom' => 'ieconfig_import_local',\n\t\t\t\t\t\t\t'label' => '<:ieconfig:label_ieconfig_import_local:>',\n\t\t\t\t\t\t\t'explication' => '<:ieconfig:explication_ieconfig_import_local:>',\n\t\t\t\t\t\t\t'datas' => ieconfig_config_locales(),\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// Options d'importations\n\t} else {\n\t\tinclude_spip('inc/yaml');\n\t\t$config = yaml_decode(_request('_code_yaml'));\n\t\t$texte_explication = '<b>' . _T('ieconfig:texte_nom') . '</b> ' . _T_ou_typo($config['nom']);\n\t\tif (!empty($config['description'])) {\n\t\t\t$texte_explication .= '<br /><b>' . _T('ieconfig:texte_description') . '</b> ' . _T_ou_typo($config['description']);\n\t\t}\n\t\t// On identifie les entrées ne correspondant pas à un plugin\n\t\t// Ou bien non déclarées dans ieconfig_metas\n\t\t// Convention : les clés du tableau de config correspondent aux préfixes des plugins\n\t\t$entrees = $config;\n\t\tunset($entrees['nom']);\n\t\tunset($entrees['description']);\n\t\tunset($entrees['necessite']);\n\t\t$entrees = array_map('strtolower', array_keys($entrees));\n\t\t$plugins = array_map('strtolower', array_keys(unserialize($GLOBALS['meta']['plugin'])));\n\t\t$entrees_prises_en_charge = array_merge(array_keys(pipeline('ieconfig_metas', array())), $plugins);\n\t\t$plugins_manquants = array_diff($entrees, $entrees_prises_en_charge);\n\t\tif (count($plugins_manquants) > 0) {\n\t\t\t$texte_explication .= '<p class=\"reponse_formulaire reponse_formulaire_erreur\">' . _T('ieconfig:texte_plugins_manquants', array('plugins' => implode(', ', $plugins_manquants))) . '</p>';\n\t\t}\n\n\t\t$saisies = array(\n\t\t\tarray(\n\t\t\t\t'saisie' => 'explication',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'nom' => 'import_details',\n\t\t\t\t\t'texte' => $texte_explication,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// Gestion des plugins utilisant le pipeline ieconfig_metas\n\t\t$ieconfig_metas = array();\n\t\tforeach (pipeline('ieconfig_metas', array()) as $prefixe => $data) {\n\t\t\tif (isset($config[$prefixe])) {\n\t\t\t\tif (isset($data['icone'])) {\n\t\t\t\t\t$icone = chemin_image($data['icone']);\n\t\t\t\t\tif (!$icone) {\n\t\t\t\t\t\t$icone = find_in_path($data['icone']);\n\t\t\t\t\t}\n\t\t\t\t\tif ($icone) {\n\t\t\t\t\t\t$icone = '<img src=\"' . $icone . '\" alt=\"\" style=\"margin-left:0px; margin-right:0.5em;\" />';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$icone = '';\n\t\t\t\t}\n\t\t\t\t$ieconfig_metas[$prefixe] = $icone . (isset($data['titre']) ? $data['titre'] : $prefixe);\n\t\t\t}\n\t\t}\n\t\tif (count($ieconfig_metas) > 0) {\n\t\t\t$saisies[] = array(\n\t\t\t\t'saisie' => 'fieldset',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'nom' => 'metas_fieldset',\n\t\t\t\t\t'label' => _T('ieconfig:label_importer_metas'),\n\t\t\t\t\t'icone' => 'config-export-16.png',\n\t\t\t\t),\n\t\t\t\t'saisies' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'saisie' => 'checkbox',\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'nom' => 'import_metas',\n\t\t\t\t\t\t\t'label' => _T('ieconfig:label_importer'),\n\t\t\t\t\t\t\t'tout_selectionner' => 'oui',\n\t\t\t\t\t\t\t'datas' => $ieconfig_metas,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t// On passe via le pipeline ieconfig\n\t\t$saisies = pipeline('ieconfig', array(\n\t\t\t'args' => array(\n\t\t\t\t'action' => 'form_import',\n\t\t\t\t'config' => $config,\n\t\t\t),\n\t\t\t'data' => $saisies,\n\t\t));\n\t}\n\n\treturn $saisies;\n}", "public function run()\n {\n Excel::import(new Countries, base_path('public/countries.xls'));\n }", "public function import()\n {\n $itemTypeId = $this->_insertItemType();\n \n // Insert the Omeka collection.\n $collectionOmekaId = $this->_insertCollection();\n \n // Insert an Omeka item for every Sept11 object.\n foreach ($this->_fetchCollectionObjectsSept11() as $object) {\n \n $metadata = array('item_type_id' => $itemTypeId);\n \n // Set the story.\n $xml = new SimpleXMLElement($object['OBJECT_ABSOLUTE_PATH'], null, true);\n $elementTexts = array(\n ElementSet::ITEM_TYPE_NAME => array(\n 'SEIU Story: Story' => array(array('text' => $xml->STORY, 'html' => false)), \n 'SEIU Story: Local Union' => array(array('text' => $xml->LOCAL_UNION, 'html' => false)), \n )\n );\n \n $itemId = $this->_insertItem($collectionOmekaId, $object, $metadata, $elementTexts);\n }\n }", "public function run()\n {\n DB::table('holidays')->delete();\n\n $holidays = \\Excel::load(base_path().'/resources/assets/NEWHolidays.csv')\n \t\t->get()->toArray();\n\n $locs = Location::lists('id','city');\n\n foreach ($holidays as $key => $location) { \n $data=[\n 'date'=> $location['date'],\n 'weekDay'=>$location['day_of_week'],\n 'isWorkDay'=>($location['affect'] === 'Work Day')? true : false,\n 'affectedSupplyChain'=>$location['affected_supply_chain'],\n 'description'=>$location['description'],\n 'year' => (int) '20'. trim(explode('/', $location['date'])[2], '20')\n ];\n\n $newHolidays = $this->commandBus->execute(new AddHolidayCommand($data, $locs[$location['country']]));\n }\n\n echo 'Holidays created';\n }", "function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }", "public function index()\n\t{\n\t\t/* $input = array_except(Input::all(), '_method');\n\t\t$file_path = $input['excel_file']; */\n\t\t\n\t\t/* $target_dir = public_path().\"\\uploads\\eod_data\\\\\";\n\t\t$target_file = $target_dir . basename($_FILES[\"excel_file\"][\"name\"]); */\n\t\t//$target_file = 'C:\\xampp\\htdocs\\sharemarket_app\\uploads\\eod_data\\Copy (2) of fo28AUG2015bhav.csv';\n\t\t$target_file = 'uploads/eod_data/fo28AUG2015bhav - Copy (2).csv';\n\t\t//$target_file = 'C:\\xampp\\htdocs\\sharemarket_app\\uploads\\eod_data\\fo28AUG2015bhav - Copy.csv';\n\t\t\n\t\t/* if (move_uploaded_file($_FILES[\"excel_file\"][\"tmp_name\"], $target_file)) {\n\t\t\techo \"The file \". basename( $_FILES[\"excel_file\"][\"name\"]). \" has been uploaded.\";\n\t\t} else {\n\t\t\techo \"Sorry, there was an error uploading your file.\";\n\t\t\tdie;\n\t\t} */\n\t\t\n\t\tset_time_limit(6000);\n\t\t$data = array();\n\t\t\\Excel::filter('chunk')->load($target_file)->chunk(250, function($results) use (&$data){\n\t\t\t$results_array = $results->toArray();\n\t\t\t//print_r($results_array);\n\t\t\t$i=1;\n\t\t\tforeach ($results_array as $row) {\n\t\t\t\t//print_r($row);die;\n\t\t\t\t$datetime = strtotime($row['expiry_dt']);\n\t\t\t\t$datetime *= 1000;\n\t\t\t\t$data[] = \"[$datetime, $row[open], $row[high], $row[low], $row[close]]\";\n\t\t\t\t//print_r($data);die;\n\t\t\t}\n\t\t\t//print_r($data);die;\n\t\t});\t\t\n\t\t//print_r($data);\n\t\t//die;\n\t\treturn View::make('eod.index')->with('data', $data);\n\t}", "public function import()\n {\n //then by the element set name\n if(!$this->record) {\n $this->record = $this->db->getTable('ElementSet')->findByName($this->responseData['name']);\n }\n\n if(!$this->record) {\n $this->record = new ElementSet;\n }\n //set new value if element set exists and override is set, or if it is brand new\n if( ($this->record->exists() && get_option('omeka_api_import_override_element_set_data')) || !$this->record->exists()) {\n $this->record->description = $this->responseData['description'];\n $this->record->name = $this->responseData['name'];\n $this->record->record_type = $this->responseData['record_type'];\n }\n\n try {\n $this->record->save(true);\n $this->addOmekaApiImportRecordIdMap();\n } catch(Exception $e) {\n _log($e);\n }\n }", "public function run()\n {\n\n\n //sm_bcd_categories\n DB::table('sm_bcd_categories')->truncate();\n $file = new SplFileObject('database/csv/sm_bcd_categories.csv');\n $file->setFlags(\n \\SplFileObject::READ_CSV |\n \\SplFileObject::READ_AHEAD |\n \\SplFileObject::SKIP_EMPTY |\n \\SplFileObject::DROP_NEW_LINE\n );\n $list = [];\n foreach($file as $line) {\n $list[] = [\n \"id\" => $line[0],\n \"name\" => $line[1],\n ];\n }\n DB::table(\"sm_bcd_categories\")->insert($list);\n\n //sm_bcds\n DB::table('sm_bcds')->truncate();\n $file = new SplFileObject('database/csv/sm_bcds.csv');\n $file->setFlags(\n \\SplFileObject::READ_CSV |\n \\SplFileObject::READ_AHEAD |\n \\SplFileObject::SKIP_EMPTY |\n \\SplFileObject::DROP_NEW_LINE\n );\n $list = [];\n foreach($file as $line) {\n $list[] = [\n \"id\" => $line[0],\n \"sm_bcd_category_id\" => $line[1],\n \"name\" => $line[2],\n ];\n }\n DB::table(\"sm_bcds\")->insert($list);\n\n }", "public function processBudgetData()\n {\n $directory=\"data/budget_data\";\n set_time_limit(160);\n \n\n $files = File::allFiles($directory);\n\n foreach ($files as $file) {\n $file_exists=File_load::where('file_name', $file)\n ->where('type', 18)\n ->exists();\n if(!$file_exists){\n $count_insert=0;\n $count_update=0;\n Budget_data::truncate();\n \n $data = Excel::load($file)->toArray();\n \n foreach ($data as $row) {\n \n $data_value=$row;\n\n //Insert Profile\n Budget_data::create([\n 'job_number' => $data_value['jobnumber'], \n 'budget_hours' => $data_value['budgethours'], \n 'budget_dollars' => $data_value['budgetdollars'],\n 'fica' => $data_value['fica'],\n 'futa' => $data_value['futa'],\n 'suta' => $data_value['suta'], \n 'workmans_compensation' => $data_value['workmanscompensation'], \n 'medicare' => $data_value['medicare'], \n 'total' => ($data_value['budgetdollars']+$data_value['fica']+$data_value['futa']+$data_value['suta']+$data_value['workmanscompensation']+$data_value['medicare']),\n 'period' => $data_value['period'], \n ]); \n $count_insert++; \n }\n\n File_load::create([\n 'file_name' => $file,\n 'type' => 18, \n 'count_insert'=> $count_insert,\n 'count_update'=> $count_update,\n ]);\n }\n } \n\n return \"Data Inserted\";\n }", "public function run()\n\t{\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tfor ($i=0;$i<20;$i++) {\n\t\t\t// create import\n\t\t\t$import = new Import;\n\t\t\t$import->countrycode = 'DE';\n\t\t\t$import->salutation = $faker->randomElement(['Herr', 'Frau', 'Firma']);\n\t\t\t$import->firstname = $faker->firstName;\n\t\t\t$import->lastname = $faker->lastName;\n\t\t\t$import->lastWorkshopVisit = $faker->date();\n\t\t\t$import->export = true;\n\n\t\t\t$import->save();\n\t\t}\n\t}", "private function importCommune(array $data, array &$context): void {\n try {\n foreach (self::CSV_MAPPING_COMMUNE_FROM_ALL_CP as $key => $value) {\n $dataEntity[$key] = $data[$value];\n }\n\n $dataEntity['department'] = self::DEPARTEMENT_LIMITER;\n\n // New entry.\n if (empty($entity = $this->storage->loadByProperties(['insee' => $dataEntity['insee']]))) {\n $context['message'] = $this->translator->translate('Creating commune: @commune', ['@commune' => $dataEntity['name']]);\n /** @var \\Drupal\\epci\\Entity\\Commune $newEntity */\n $newEntity = $this->storage->create($dataEntity);\n\n if ($newEntity->save()) {\n BatchImporter::addToResultsByKey('created', $context);\n $this->created[$newEntity->id()] = $newEntity->getName();\n\n return;\n }\n }\n\n // Already imported. Just report.\n BatchImporter::addToResultsByKey('conflict', $context);\n }\n catch (\\Exception $exception) {\n BatchImporter::addToResultsByKey('error', $context);\n $this->getLogger('epci')->error($exception->getMessage());\n }\n }", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }", "public function run()\n {\n \tDB::beginTransaction();\n\n Excel::import(new PageImport, storage_path('imports/pages.xls'));\n Excel::import(new PageItemImport, storage_path('imports/page_items.xls'));\n\n DB::commit();\n }", "public function consultarDadosAnexoIExcel($dados) {\n\n $ano = $dados['ano'];\n $campo = $dados['mes'];\n\n $ignorarUG = array(90032, 90009, 90000);\n $implodeUG = implode(', ', $ignorarUG);\n\n // $mes = $dados['mes'];\n switch ($dados['mes']) {\n case 'IMPO_VL_TOTAL_JAN':\n $mes = '01';\n break;\n case 'IMPO_VL_TOTAL_FEV':\n $mes = '02';\n break;\n case 'IMPO_VL_TOTAL_MAR':\n $mes = '03';\n break;\n case 'IMPO_VL_TOTAL_ABR':\n $mes = '04';\n break;\n case 'IMPO_VL_TOTAL_MAI':\n $mes = '05';\n break;\n case 'IMPO_VL_TOTAL_JUN':\n $mes = '06';\n break;\n case 'IMPO_VL_TOTAL_JUL':\n $mes = '07';\n break;\n case 'IMPO_VL_TOTAL_AGO':\n $mes = '08';\n break;\n case 'IMPO_VL_TOTAL_SET':\n $mes = '09';\n break;\n case 'IMPO_VL_TOTAL_OUT':\n $mes = '10';\n break;\n case 'IMPO_VL_TOTAL_NOV':\n $mes = '11';\n break;\n case 'IMPO_VL_TOTAL_DEZ':\n $mes = '12';\n break;\n }\n\n $sql = \"\n\n SELECT\n INCI_ID_INCISO, INCI_VL_INCISO, INCI_DS_INCISO,\n ALIN_ID_ALINEA, ALIN_VL_ALINEA, ALIN_DS_ALINEA,\n SUM($campo) AS TOTAL\n\n FROM CEO_TB_INCI_INCISO\n\n INNER JOIN CEO_TB_ALIN_ALINEA ON INCI_ID_INCISO = ALIN_ID_INCISO\n\n LEFT JOIN CEO_TB_REGC_REGRA_CNJ ON REGC_ID_ALINEA = ALIN_ID_ALINEA\n\n LEFT JOIN CEO_TB_IMPO_IMPORTACAO\n ON REGC_ID_ALINEA = ALIN_ID_ALINEA\n AND IMPO_CD_UG NOT IN ({$implodeUG})\n\n LEFT JOIN CEO_TB_IMPA_IMPORTAR_ARQUIVO\n ON IMPA_ID_IMPORT_ARQUIVO = IMPO_ID_IMPORT_ARQUIVO\n --AND IMPA_IC_MES = {$mes} \n AND IMPA_AA_IMPORTACAO = {$ano}\n AND REGC_AA_REGRA = IMPA_AA_IMPORTACAO\n \n GROUP BY\n INCI_ID_INCISO, INCI_VL_INCISO, INCI_DS_INCISO,\n ALIN_ID_ALINEA, ALIN_VL_ALINEA, ALIN_DS_ALINEA\n \";\n\n $db = Zend_Db_Table::getDefaultAdapter();\n $retorno = $db->fetchAll($sql);\n\n return $retorno;\n }", "public function metaImport($data);", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "public function run()\n {\n $records = Reader::createFromPath(database_path('seeds/csv/laporanharian.csv'), 'r');\n $records->setDelimiter(',');\n $records->setHeaderOffset(0);\n\n foreach ($records as $record) {\n DB::table('laporanharian')->insert([\n 'id' => $record['id'],\n 'tanggal' => $record['tanggal'],\n 'kasus_id' => $record['kasus_id'],\n 'kriteria_id' => $record['kriteria_id'],\n 'suhu' => $record['suhu'] == 'NULL' ? null : $record['suhu'],\n 'catatan_its' => $record['catatan_its'],\n 'catatan_eksternal' => $record['catatan_eksternal'],\n 'gejala' => $record['gejala'],\n 'keterangan' => $record['keterangan'],\n 'pemantau_id' => $record['pemantau_id'],\n ]);\n }\n }", "public function run()\n {\n \t$ipsPath = storage_path('ips.csv');\n $pdo = \\DB::connection()->getPdo();\n $pdo->exec(\"\n\t\t\tLOAD DATA LOCAL\n\t\t\t\tINFILE '\" . $ipsPath . \"'\n\t\t\tINTO TABLE\n\t\t\t\t`ip_addresses`\n\t\t\tFIELDS TERMINATED BY ','\n\t\t\tENCLOSED BY '\\\"'\n\t\t\tLINES TERMINATED BY '\\r\\n'\n\t\t\tIGNORE 0 LINES;\n \");\n }", "public function run()\n {\n $str = File::get('database/seeds/data/phieubangiao.json');\n $data = json_decode($str, true);\n foreach ($data as $item) {\n if (array_key_exists('NgayBanGiao', $item)) {\n $item['NgayBanGiao'] = Carbon::createFromFormat('m/d/y', $item['NgayBanGiao'])->format('Y/m/d');\n }\n DB::table('PhieuBanGiao')->insert($item);\n }\n }", "public function run()\n {\n \n\n $row = 1;\n if (($handle = fopen(\"2013_pensio_invalidesa_2013.csv\", \"r\")) !== FALSE) {\n $columnes = fgetcsv($handle, 1000, \",\");\n \n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $num = count($data);\n // echo \"[REG:$num] \";\n $row++;\n for ($c=2; $c < $num; $c++) {\n //echo $data[$c] . \"\\t\";\n $invalidesa = new Invalidesa;\n $invalidesa->dte=$data[0];\n $invalidesa->barri=$data[1];\n $invalidesa->invalids=$data[2];\n $invalidesa->save();\n }\n \n }\n fclose($handle);\n }\n }", "protected function import(): void {\n\t\t\t$sections = $this->load_and_decode_file();\n\n\t\t\tif ( empty( $sections ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tforeach ( $sections as $section ) {\n\t\t\t\tLearnDash_Settings_Section::set_section_settings_all(\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$section['fields']\n\t\t\t\t);\n\n\t\t\t\t$this->processed_items_count++;\n\t\t\t\t$this->imported_items_count++;\n\t\t\t}\n\t\t}", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "function file_import_execute() {\n\t\t$this->load->library('excel_reader');\n\n\t\t// Set output Encoding.\n\t\t$this->excel_reader->setOutputEncoding('CP1251');\n\n\t\t$this->excel_reader->read($this->session->userdata('file_upload'));\n\n\t\t// Sheet 1\n\t\t$excel = $this->excel_reader->sheets[0] ;\n\n\t\t// is it employee shift template file?\n\t\tif($excel['cells'][1][1] == 'NIK') {\n\n\t\t\t$longshift_nik = $this->m_sync_attendance->sync_final_get_long_shift();\n\t\t\t$this->db->trans_start();\n\n\t\t\tfor($j = 1; $j <= $excel['numCols']; $j++) {\n\n\t\t\t\t$date = $excel['cells'][1][$j+1];\n\t\t\t\t$date_int[$j] = $this->convertexceltime($date);\n\n\t\t\t\t$eod = $this->m_employee->eod_select_last();\n\t\t\t\t$eod_int = strtotime($eod);\n\n\t\t\t\tif($eod_int < $date_int[$j]) {\n\t\t\t\t\t$date_arr[$j] = date(\"Y-m-d\", $date_int[$j]);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor ($i = 2; $i <= $excel['numRows']; $i++) {\n\n\t\t\t\t// cek apakah NIK ada isinya?\n\t\t\t\tif(!empty($excel['cells'][$i][1])) {\n\n\t\t\t\t\t$employee = $this->m_employee->employee_select_by_nik($excel['cells'][$i][1]);\n\t\t\t\t\t$employee_check = $this->m_employee->employee_check($employee['employee_id']);\n\n\t\t\t\t\tif($employee_check) {\n\n\t\t\t\t\t\t$employee_shift['shift_emp_id'] = $employee['employee_id'];\n\n\t\t\t\t\t\tfor($j = 1; $j <= $excel['numCols']+1; $j++) {\n\n\t\t\t\t\t\t\tif(strtotime($employee['tanggal_masuk']) <= $date_int[$j]) {\n\n\t\t\t\t\t\t\t\tif(!empty($date_arr[$j])) {\n\n\t\t\t\t\t\t\t\t\t$employee_shift['shift_date'] = $date_arr[$j];\n\t\t\t\t\t\t\t\t\t$shift_code_check = $this->m_employee_shift->shift_code_check($excel['cells'][$i][$j+1], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\tif($shift_code_check) {\n\n\t\t\t\t\t\t\t\t\t\t$employee_shift['shift_code'] = $excel['cells'][$i][$j+1];\n\n\t\t\t\t\t\t\t\t\t\tif($this->m_employee_shift->shift_add_update($employee_shift,$longshift_nik)) {\n\t\t\t\t\t\t\t\t\t\t\t/*$shift = $this->m_employee_shift->shift_code_select($employee_shift['shift_code'], $this->session->userdata['ADMIN']['hr_plant_code']);\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['cabang'] = $this->session->userdata['ADMIN']['hr_plant_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['tanggal'] = $employee_shift['shift_date'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['nik'] = $employee['nik'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift'] = $shift['shift_code'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['kd_shift'] = $shift['shift_code'];\n\n if ($this->m_upload_absent->employee_absent_select($absent)==FALSE) {\n \t\t\t\t\t\t\t\t$absent['kd_aktual'] = 'A';\n \t\t\t\t\t\t\t\t$absent['kd_aktual_temp'] = 'A';\n }\n\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_in'] = $shift['duty_on'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_out'] = $shift['duty_off'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_in'] = $shift['break_in'];\n\t\t\t\t\t\t\t\t\t\t\t$absent['shift_break_out'] = $shift['break_out'];\n\n \t\t\t $this->m_upload_absent->employee_absent_add_update($absent);*/\n\n\t\t\t\t\t\t\t\t\t\t\t$berhasil = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$this->db->trans_complete();\n\n\t\t\t$object['refresh'] = 7;\n\t\t\t$object['refresh_text'] = 'Data Shift Karyawan berhasil di-upload';\n\t\t\t$object['refresh_url'] = 'employee_shift';\n\n\t\t\t//redirect('member_browse');\n\n\t\t\t$this->template->write_view('content', 'refresh', $object);\n\t\t\t$this->template->render();\n\n\t\t} else {\n\n\t\t\t\t$object['refresh_text'] = 'File Excel yang Anda upload bukan file Shift Karyawan atau file tersebut rusak. Umumnya karena di dalam file diberi warna baik pada teks maupun cell. Harap periksa kembali file Excel Anda.<br><br>SARAN: Coba pilih semua teks dan ubah warna menjadi \"Automatic\". Sebaiknya tidak ada warna pada teks, kolom dan baris dalam file Excel Anda.';\n\t\t\t\t$object['refresh_url'] = 'employee_shift/browse_result';\n\t\t\t\t$object['jag_module'] = $this->jagmodule;\n\t\t\t\t$object['error_code'] = '002';\n\t\t\t\t$object['page_title'] = 'Error '.strtoupper($object['jag_module']['web_module']).': '.$object['jag_module']['web_trans'];\n\t\t\t\t$this->template->write_view('content', 'errorweb', $object);\n\t\t\t\t$this->template->render();\n\n\t\t}\n\n\t}", "public function import(array $data): void;", "public function ambilData() {\n // read file & get the data (file_get_contents)\n $data = file_get_contents($this->file);\n $this->daftar_barang = json_decode($data, true);\n $this->daftar_barang = array_values($this->daftar_barang);\n }", "public function run()\n {\n DB::table('configurations')->insert([\n 'data_inicio' => Carbon::create(2020,02,13,15),\n 'data_fim' => Carbon::create(2020,02,13,18),\n 'intervalo' => 20,\n 'quantidade_atendentes' => 5\n ],[\n 'data_inicio' => Carbon::create(2020,02,14,8),\n 'data_fim' => Carbon::create(2020,02,14,12),\n 'intervalo' => 20,\n 'quantidade_atendentes' => 5\n ],[\n 'data_inicio' => Carbon::create(2020,02,21,8),\n 'data_fim' => Carbon::create(2020,02,21,12),\n 'intervalo' => 20,\n 'quantidade_atendentes' => 5\n ]);\n }", "public function testV1ImportReprocessDaysSourceIdYearPost()\n {\n }", "public function run()\n {\n DB::table('etapas')->insert([\n 'inicio' => Carbon::now(),\n 'final' => Carbon::now()->addDays(70),\n 'estado' => 1,\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n DB::table('etapas')->insert([\n 'inicio' => Carbon::now()->addDays(80),\n 'final' => Carbon::now()->addDays(130),\n 'estado' => 1,\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n }", "public function importEvents( $deptid ) {\n\t\t\n\t\tif( !is_numeric( $deptid )) {\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\t$rows = $this->source_db->get_results( $this->source_db->prepare(\"SELECT DISTINCT * from eventslookup WHERE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdepartment = '%s' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND active_ind = 'A'\n\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY eventstart_dtm ASC\" , $deptid));\n\t\t\n\t\tforeach( $rows as $currow ) {\n\t\t\t$agenda_append = \"\";\n\t\t\t$post_check = get_page_by_title($currow->eventtitle,OBJECT,'post');\n\t\t\t$categoryArray = array( get_cat_id('Event'));\n\t\t\t$duplicate = false;\n\t\t\t\n\t\t\tif( isset($post_check->ID ) && strtotime( $post_check->post_date ) == strtotime( $currow->eventstart_dtm) ) {\n\t\t\t\t$post_id = $post_check->ID;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$post_id = '';\n\t\t\t}\n\t\t\t\n\t\t\t$post_id = '';\n\t\t\t\n\t\t\t$post_content = $currow->eventdesc;\n\t\t\t\n\t\t\t// Check for agenda\n\t\t\tif( trim( $currow->agenda ) != \"\" || trim( $currow->agenda_filename ) != \"\" ) {\n\t\t\t\t\n\t\t\t\tif( $currow->attachment_type != '1' ) {\n\t\t\t\t\t$agenda_append = '<div class=\"agendaLink\"><h3>Agenda:</h3>';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$agenda_append = '<div class=\"agendaLink\"><h3>Attachment:</h3>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( $currow->attachment_type != '1' ) {\n\t\t\t\t\t$categoryArray[] = get_cat_id( 'Agenda' );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( trim ($currow->agenda) != \"\") {\n\t\t\t\t\t$agenda_append .= $this->clean_html(wpautop( wptexturize( stripslashes($currow->agenda) ) ));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( trim( $currow->agenda_filename) != \"\" ) {\n\t\t\t\t\t$agenda_append .= '<a href=\"http://' . $this->site_url . '/_attachments/'.stripslashes($currow->agenda_filename).'\">';\n\t\n\t\t\t\t\tif( $currow->attachment_type != '1' ) {\n\t\t\t\t\t\t$agenda_append .= 'Read Agenda ';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$agenda_append .= 'Download ';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$agenda_append .= '></a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$agenda_append .= '</div>';\n\t\t\t\t$post_content .= $agenda_append;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Check for minutes\n\t\t\tif( trim( $currow->minutes_filename ) != \"\" ) {\n\t\t\t\t$agenda_append = '<div class=\"minutesLink\"><h3>Minutes:</h3>';\n\t\t\t\t$categoryArray[] = get_cat_id( 'Minutes' );\n\t\t\t\t\n\t\t\t\tif( trim( $currow->minutes_filename) != \"\" ) {\n\t\t\t\t\t$agenda_append .= \"<a href=\\\"http://' . $this->site_url .'/_attachments/\".stripslashes($currow->minutes_filename).\"\\\">Read Minutes ></a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$agenda_append .= '</div>';\n\t\n\t\t\t\t$post_content .= $agenda_append;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Check for eventurl\n\t\t\tif( trim( $currow->eventurl) != \"\" ) {\n\t\t\t\t$post_content = '<div class=\"event-external-url\"><a href=\"'. trim( $currow->eventurl ) .'\">More Information ></a></div>' . $post_content;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$attr = array(\n\t\t\t\t\t\t\t'ID' => $post_id,\n\t\t\t\t\t\t\t'post_content' => $this->clean_html(wpautop( wptexturize( stripslashes($post_content) ) )),\n\t\t\t\t\t\t\t'post_title' => stripslashes( $currow->eventtitle),\n\t\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t\t\t\t'post_date' => $currow->added_on,\n\t\t\t\t\t\t\t'post_category' => $categoryArray\n\t\t\t);\n\t\t\t\n\t\t\t// Check to see if this has already been entered...\n\t\t\t$returnedPosts = get_page_by_title( $attr['post_title']);\n\t\t\t\n\t\t\tif( count( $returnedPosts )) {\n\t\t\t\tforeach( $returnedPosts as $returnedPost) {\n\t\t\t\t\tif( strtotime(get_field('start_date', $returnedPost->ID)) == strtotime( $currow->eventstart_dtm ) ) {\n\t\t\t\t\t\t$duplicate = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $duplicate ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$post_insert = wp_insert_post( $attr, false );\n\t\n\t\t\tif( $post_insert == 0 ) {\n\t\t\t\tadd_error( 'Unable to insert event ' . $currow->eventtitle );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( $currow->eventimage != '' ) {\n\t\t\t\t\t$this->add_featuredimage( $post_insert, \"http://\" . $this->site_url . \"/images/events/\" . $currow->eventimage );\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Set other custom fields\n\t\t\t\t// Start date\n\t\t\t\t// End date\n\t\t\t\t// All day event\n\t\t\t\t// Event location\n\t\t\t\tupdate_field('field_54b5c2d19f04f', $currow->eventstart_dtm, $post_insert);\t\t// Start date/time\n\t\t\t\tupdate_field('field_54b5c3189f050', $currow->eventend_dtm, $post_insert);\t\t// End date/time\n\t\t\t\t\n\t\t\t\tif( date('H:i:s',strtotime( $currow->eventstart_dtm)) == '00:00:00' &&\n\t\t\t\t\tdate('H:i:s',strtotime( $currow->eventend_dtm)) == '00:00:00') {\n\t\t\t\t\t\tupdate_field('field_54b72bad18811', 'Yes', $post_insert);\t\t\t\t\t\t\t// All day event\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( strlen( $currow->eventcontact )) {\n\t\t\t\t\tupdate_field('field_54b5c3339f051', stripslashes($currow->eventcontact), $post_insert); // Location\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Create redirects...\n\t\t\t\t$this->redirects[] = '/events/view-event.php?id='.$currow->eventid . ' ' .\n\t\t\t\t\t\t\tget_the_permalink($post_insert);\n\t\n\t\t\t}\n\t\t\tob_flush();\n\t\t}\n\t\t\n\n\t\treturn;\n\t}", "function convertCSVOldFDS($directory) {\n\t\t//erase data\n\t\t$query = \"TRUNCATE TABLE old_fds\";\n\t\tmysql_query($query);\n\t\t//load file\n\t\t$files = array();\n\t\t$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));\n\t\twhile($it->valid()) {\n\t\t if (!$it->isDot()) {\n\t $files[] = $it->getSubPathName();; //add file name to array\n\t\t }\n\t\t $it->next();\n\t\t}\n\t\t//loop\n\t\t$j=1; //number\n\t\techo '= Importing transaction ='.PHP_EOL;\n\t\tfor($i=0;$i<sizeof($files);$i++) {\n\t echo $files[$i].PHP_EOL;\n\t \t\t$file = fopen($directory.$files[$i], \"r\");\n\t $emapData = fgetcsv($file, 10000, \",\");\n\t\t\twhile (($emapData = fgetcsv($file, 10000, \",\")) != false) {\n\t \t\t//solve ReDi date problem\n\t\t \t$Date_Time = $emapData[1];\n\t\t \t$Date_Time = toTimeStamp2($Date_Time);\n\t\t \t$Customer_Name = mysql_real_escape_string($emapData[4]); //biar bisa baca (')\n\t\t \t$Cust_ = explode(',', $Customer_Name);\n\t\t \t$CustomerLastName = mysql_real_escape_string($Cust_[0]);\n\t\t \t$Billing_Address = mysql_real_escape_string($emapData[18]); //biar bisa baca (')\n\t\t \t$IPID_State = mysql_real_escape_string($emapData[24]); //biar bisa baca (')\n\t\t \t$CurrentStatus = $emapData[33];\n\t\t \tif($CurrentStatus == 'NoScore') {\n\t\t \t\t$CurrentStatus = 'Deny';\n\t\t \t}\n\t\t \t$query = \"INSERT INTO old_fds (No, TxnTime, TxnId, CustomerName, CustomerEmailAddress, TxnValue, CardType, BillingAddress, BillingCountry, ShipZip, ShippingCountry, CustIPID, IPIDState, IPIDCountry, BINCountry, CurrentStatus, SubClient, CustomerLastName, ChargebackStatus, CompareStatus) VALUES ('$j', '$Date_Time', '$emapData[2]', '$Customer_Name', '$emapData[5]', '$emapData[6]', '$emapData[13]', '$Billing_Address', '$emapData[19]', '$emapData[20]', '$emapData[22]', '$emapData[23]', '$IPID_State', '$emapData[25]', '$emapData[26]', '$CurrentStatus', '$emapData[34]','$CustomerLastName', '$CurrentStatus', '-')\";\n\t\t \tif (!mysql_query($query)) {\n\t\t \t\techo 'Problem with '.$files[$i].' ';\n\t die(mysql_error()).PHP_EOL;\n\t }\n\t \t\t$j++;\n\t \t}\n\t\t}\n\t //DELETE NULL VALUE\n\t\tdeleteNullRecords('old_fds');\n\t echo 'Done'.PHP_EOL;\n\t}", "function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }", "public function import();", "public function process(): void\n {\n foreach ($this->connection->list() as $filename) {\n $localFile = 'import_' .\n uniqid((string)\\Magento\\Framework\\Math\\Random::getRandomNumber(), true) .\n time() . '.' .\n pathinfo($filename, PATHINFO_EXTENSION);\n\n if ($this->connection->read($filename, $this->tmpDirectory->getAbsolutePath($localFile))) {\n if (!$this->tmpDirectory->isWritable($localFile)) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Cannot create a target file for reading.')\n );\n }\n }\n\n $source = $this->getSourceAdapter($this->tmpDirectory->getAbsolutePath($localFile));\n\n foreach ($source as $line) {\n $data = array_values($line);\n $this->stockImport->import($data);\n }\n }\n }", "public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n \n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sWhere = \"o70_instit in ({$sListaInstit})\";\n $iAnoUsu = (db_getsession(\"DB_anousu\")-1);\n $sDataIni = $iAnoUsu.\"-01-01\";\n $sDataFim = $iAnoUsu.\"-12-31\";\n $sSqlBalAnterior = db_receitasaldo(11, 1, 3, true, $sWhere, $iAnoUsu, $sDataIni, $sDataFim, true);\n \n $sSqlAgrupado = \"select case when fc_conplano_grupo($iAnoUsu, substr(o57_fonte,1,1) || '%', 9000 ) is false \"; \n $sSqlAgrupado .= \" then substr(o57_fonte,2,14) else substr(o57_fonte,1,15) end as o57_fonte, \";\n $sSqlAgrupado .= \" o57_descr, \";\n $sSqlAgrupado .= \" saldo_inicial, \";\n $sSqlAgrupado .= \" saldo_arrecadado_acumulado, \"; \n $sSqlAgrupado .= \" x.o70_codigo, \";\n $sSqlAgrupado .= \" x.o70_codrec, \";\n $sSqlAgrupado .= \" coalesce(o70_instit,0) as o70_instit, \";\n $sSqlAgrupado .= \" fc_nivel_plano2005(x.o57_fonte) as nivel \"; \n $sSqlAgrupado .= \" from ({$sSqlBalAnterior}) as x \";\n $sSqlAgrupado .= \" left join orcreceita on orcreceita.o70_codrec = x.o70_codrec and o70_anousu={$iAnoUsu} \";\n $sSqlAgrupado .= \" order by o57_fonte \"; \n $rsBalancete = db_query($sSqlAgrupado);\n $iTotalLinhas = pg_num_rows($rsBalancete);\n for ($i = 1; $i < $iTotalLinhas; $i++) {\n \n $oReceita = db_utils::fieldsMemory($rsBalancete, $i);\n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n \n $oReceitaRetorno = new stdClass();\n \n $oReceitaRetorno->braCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oReceitaRetorno->braMesAnoMovimento = $sDiaMesAno;\n $oReceitaRetorno->braContaReceita = str_pad($oReceita->o57_fonte, 20, 0, STR_PAD_RIGHT);\n $oReceitaRetorno->braCodigoOrgaoUnidadeOrcamentaria = str_pad($oInstituicao->codtrib, 4, \"0\", STR_PAD_LEFT);\n $nSaldoInicial = $oReceita->saldo_inicial;\n $oReceita->saldo_inicial = str_pad(number_format(abs($oReceita->saldo_inicial),2,\".\",\"\"), 13,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaOrcada = $oReceita->saldo_inicial;\n $oReceita->saldo_arrecadado_acumulado = str_pad(number_format(abs($oReceita->saldo_arrecadado_acumulado) \n ,2,\".\",\"\"), 12,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaRealizada = $oReceita->saldo_arrecadado_acumulado;\n $oReceitaRetorno->braCodigoRecursoVinculado = str_pad($oReceita->o70_codigo, 4, \"0\", STR_PAD_LEFT); \n $oReceitaRetorno->braDescricaoContaReceita = substr($oReceita->o57_descr, 0, 255); \n $oReceitaRetorno->braTipoNivelConta = ($oReceita->o70_codrec==0?'S':'A'); \n $oReceitaRetorno->braNumeroNivelContaReceita = $oReceita->nivel;\n $this->aDados[] = $oReceitaRetorno; \n }\n return true;\n }", "public function import(){\n if(\\Storage::disk('local')->exists('/public/universidades.xlsx')){\n Excel::load('public/storage/universidades.xlsx', function($reader) {\n foreach ($reader->get() as $book) {\n $universidad = new University();\n $universidad->nombre = $book->nombre;\n $universidad->save();\n }\n });\n\n \\Alert::message('Universidades importadas exitosamente', 'success');\n return redirect('/universidades');\n }else{\n \\Alert::message('El archivo universidades.csv no existe, importalo por favor', 'danger');\n return redirect('/universidades');\n }\n }", "function pudla_ocdi_import_files() {\n return array(\n array(\n 'import_file_name' => 'Demo',\n 'import_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla.wordpress.xml',\n 'import_widget_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla-widgets.wie',\n 'import_customizer_file_url' => 'http://demo.awaikenthemes.com/pudla/dummy-data/pudla-export.dat',\n 'preview_url' => 'http://demo.awaikenthemes.com/pudla/',\n ),\n );\n}", "public function hideEndDateWhenEmpty(DataContainer $dc)\r\n {\r\n $date = $this->Database->prepare(\"SELECT id, start_date FROM tl_ausschreibung WHERE start_date!='' AND end_date=''\")->execute();\r\n while ($row = $date->next())\r\n {\r\n $end_date = $this->Database->prepare(\"UPDATE tl_ausschreibung SET end_date = ? WHERE id = ?\");\r\n $end_date->execute($row->start_date, $row->id);\r\n }\r\n //Wenn end-datum leer ist, wird es ausgeblendet, das ist der Fall beim Erstellen neuer Anlaesse\r\n if ($dc->id != \"\" && $this->Input->get('mode') != 'csv_import')\r\n {\r\n\r\n $date = $this->Database->prepare(\"SELECT start_date FROM tl_ausschreibung WHERE id = ?\")->execute($dc->id);\r\n $date->fetchAssoc();\r\n if ($date->start_date == \"\")\r\n {\r\n $GLOBALS['TL_DCA']['tl_ausschreibung']['palettes']['default'] = 'start_date, art, ort, wettkampfform; zeit, trainer; kommentar; phase, trainingsstunden';\r\n }\r\n }\r\n\r\n }", "protected function migrarDados()\n {\n $serviceDemanda = $this->getService('OrdemServico\\Service\\DemandaFile');\n try {\n $serviceDemanda->begin();\n $arrUsuario = $this->getService('OrdemServico\\Service\\UsuarioFile')->fetchPairs([], 'getNoUsuario', 'getIdUsuario');\n $OrdemSevicoSevice = $this->getService('OrdemServico\\Service\\OrdemServicoDemandaFile');\n $arrDemanda = $serviceDemanda->findBy([], ['id_demanda' => 'asc']);\n $serviceDemanda::setFlush(false);\n foreach ($arrDemanda as $demanda) {\n $intIdUsuario = $arrUsuario[$demanda->getNoExecutor()];\n if ($intIdUsuario) {\n $demanda->setVlComplexidade(null)\n ->setVlImpacto(null)\n ->setVlCriticidade(null)\n ->setVlFatorPonderacao(null)\n ->setVlFacim(null)\n ->setVlQma(null)\n ->setIdUsuario($intIdUsuario);\n $serviceDemanda->getEntityManager()->persist($demanda);\n $arrDemandaServico = $OrdemSevicoSevice->findBy(['id_demanda' => $demanda->getIdDemanda()]);\n if ($arrDemandaServico) {\n $ordemServicoDemanda = reset($arrDemandaServico);\n $ordemServicoDemanda->setIdUsuarioAlteracao($demanda->getIdUsuario())\n ->setDtAlteracao(Date::convertDateTemplate($demanda->getDtAbertura()));\n $OrdemSevicoSevice->getEntityManager()->persist($demanda);\n }\n }\n }\n $serviceDemanda::setFlush(true);\n $serviceDemanda->commit();\n } catch (\\Exception $exception) {\n $serviceDemanda->rollback();\n var_dump($exception->getMessage());\n die;\n }\n }", "public function testV1ImportSourceIdDaysPost()\n {\n }", "public function uploadNormaInsentivePanen($params = array()) {\n $sql = \"SELECT EXTRACT(YEAR FROM PERIOD_BUDGET) AS YEAR_PERIODE, PERIOD_BUDGET FROM TM_PERIOD WHERE STATUS = 'OPEN'\";\n $periode = $this->_db->fetchRow($sql);\n\n if ($_FILES['file']['size'] > 0) {\n //get the csv file\n $data = array();\n $file = $_FILES['file']['tmp_name'];\n $handle = fopen($file,\"r\");\n\n $total_rec = 0; $r = 0; \n $line_error = array(); $data_inserted = 0;\n $message = array(); $single_row_data = array();\n\n $uniq_code_file = $this->_global->genFileName();\n $filename = $uniq_code_file.'_'.$params['ba_code'].'_NORMA_INSENTIVE_PANEN';\n $this->_global->createSqlFile($filename, \"START : \".date(\"Y-m-d H:i:s\").\"\\n\"); //start create file\n\n do {\n if ($r>1) {\n $row = array(\n 'PERIOD_BUDGET' => 'TO_DATE(\\''.$this->_period.'\\',\\'DD-MM-RRRR\\')',\n 'BA_CODE' => addslashes($data[1]),\n 'PERCENTAGE_INCENTIVE_1' => addslashes($data[3]),\n 'INCENTIVE_1' => addslashes($data[4]),\n 'PERCENTAGE_INCENTIVE_2' => addslashes($data[5]),\n 'INCENTIVE_2' => addslashes($data[6]),\n 'PERCENTAGE_INCENTIVE_3' => addslashes($data[7]),\n 'INCENTIVE_3' => addslashes($data[8]),\n // 'FLAG_TEMP' => 'Y', // Flag temporary data\n 'INSERT_USER' => $this->_userName,\n 'INSERT_TIME' => 'SYSDATE',\n );\n\n $single_row_data = array_merge($row);\n\n $array_keys = array_keys($single_row_data);\n\n $ex = \"SELECT count(*) EXIST from TN_INSENTIVE_PANEN where PERIOD_BUDGET = TO_DATE('\".$this->_period.\"','DD-MM-RRRR') and BA_CODE = '\".addslashes($data[1]).\"'\";\n $exists = $this->_db->fetchRow($ex);\n\n if(intval($exists['EXIST']) != 0) {\n $exclude_key = array('PERIOD_BUDGET', 'BA_CODE', 'INSERT_USER', 'INSERT_TIME');\n foreach ($exclude_key as $key) {\n unset($row[$key]);\n }\n\n $sql = 'UPDATE TN_INSENTIVE_PANEN SET ';\n foreach ($row as $key => $value) {\n $sql .= \"$key = '$value', \";\n }\n $sql .= \"UPDATE_USER = '\".$this->_userName.\"', UPDATE_TIME = SYSDATE \";\n $sql .= \"WHERE BA_CODE = '\".addslashes($data[1]).\"' AND PERIOD_BUDGET = TO_DATE('\".$this->_period.\"','DD-MM-RRRR')\";\n\n } else {\n $sql = 'INSERT INTO TN_INSENTIVE_PANEN ('.implode(', ', $array_keys).') VALUES (';\n foreach($array_keys as $key) {\n if($key == 'INSERT_TIME' || $key == 'PERIOD_BUDGET') {\n $sql .= \"$single_row_data[$key], \";\n } else {\n $sql .= \"'$single_row_data[$key]', \";\n }\n }\n $sql = substr($sql, 0, -2).')';\n \n }\n\n try {\n $this->_db->query($sql);\n $this->_db->commit();\n $this->_global->createSqlFile($filename, \"$sql\".\";\\n\");\n $data_inserted++;\n } catch (Exception $e) {\n $line_error[] = 'Data error pada baris '.$r.', detail messagenya. '.$e->getMessage();\n }\n\n $total_rec++;\n }\n $r++;\n \n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n $this->_global->createSqlFile($filename, \"COMMIT; \");\n $this->_global->createSqlFile($filename, date('Y-m-d H:i:s').\"\\n\");\n \n $message = array(\n 'data_count' => '<strong>Jumlah Data:</strong> '.$total_rec,\n 'data_inserted' => '<strong>Data Inserted:</strong> '.$data_inserted,\n 'data_failed' => '<strong>Data Failed:</strong> '.count($line_error),\n );\n if(count($line_error) > 0) {\n $message['error_message'] = '<strong>Error Message:</strong></p><p><ul><li>'. implode(\"</li><li>\", $line_error) .'</li>';\n }\n }\n return $message;\n }", "public function run()\n {\n $faker = Faker\\Factory::create('es_VE');\n $faker->addProvider(new \\Faker\\Provider\\Fakecar($faker));\n\n $clientes = $this->fetchAll('SELECT * FROM clientes');\n $vehiculos = $this->fetchAll('SELECT placa FROM vehiculos');\n $fecha = Carbon::now()->startOfMonth();\n\n $data = [];\n\n for($i=0; $i<200; $i++){\n $cliente_id = $faker->numberBetween($min = 1, $max = 398);\n $vehiculo_id = $faker->numberBetween($min = 1, $max = 200);\n //$fecha_reserva = $faker->dateTime();\n $fecha = Carbon::now()->subMonths(2);\n $fecha_reserva = $fecha->copy()->addDays($faker->numberBetween($min = 1, $max = 14));\n $fecha_regreso = $fecha->copy()->addDays($faker->numberBetween($min = 15, $max = 30));\n\n $data[] = [\n 'identificacion_cliente' => $clientes[$cliente_id]['cedula'],\n 'placa_vehiculo' => $vehiculos[$vehiculo_id]['placa'],\n 'fecha_reserva' => $fecha_reserva->toDateTimeString(),\n 'fecha_regreso' => $fecha_regreso->toDateTimeString(),\n 'seguro_vehiculo_id' => $faker->numberBetween($min = 1, $max = 3)\n ];\n }\n\n $this->insert('clientes_vehiculos', $data);\n \n }", "function import(){\n\t \tglobal $sess;\n\t \t$total = count($this->events);\n\t \tif($total<1) return false;\n\t\techo '<h2>Importing '.$total.' elements</h2>';\n\t\t$db = $sess->db();\n\t\t\n\t\t// Prepare queries\n\t\t$eventsQuery = $db->db->prepare(\"\n\t\t\tINSERT INTO\n\t\t\t\tevents(entity, refers, type, date, title, lang)\n\t\t\tVALUES\n\t\t\t\t(:entity, :refers, :type, :date, :title, :lang)\"\n\t\t);\n\t\t$relationsQuery = $db->db->prepare(\"\n\t\t\tINSERT INTO\n\t\t\t\trelations(eventId, entityId)\n\t\t\tVALUES\n\t\t\t\t(:eventId, :entityId)\"\n\t\t);\n\t\t\n\t\t$inserted = 0; // Counter\n\t\t$lastID = NULL;\n\t\t$context = array(); // References to IDs in context table\n\t\t\n\t\tfor($i=0;$i<$total;$i++){\n\t\t\t$refer = NULL;\n\t\t\t\n\t\t\t// Check if event doesnt exist yet\n\t\t\t$exists = $db->preparedQuery(\"SELECT id FROM events WHERE title LIKE '?' LIMIT 1\",array($this->events[$i]['name']));\n\t\t\tif($db->numRows($exists)>0) continue;\n\t\t\t\n\t\t\t// Begin importing the elements\n\t\t\t$element = array(\n\t\t\t\t':entity' => $this->entityID($this->events[$i]['entity']),\n\t\t\t\t':refers' => $refer,\n\t\t\t\t':type' => $this->events[$i]['type'],\n\t\t\t\t':date' => $this->events[$i]['date'],\n\t\t\t\t':title' => $this->events[$i]['name'],\n\t\t\t\t':lang' => 'en'\n\t\t\t);\n\t\t\ttry{\n\t\t\t\t$eventsQuery->execute($element);\n\t\t\t\t// Get last inserted ID\n\t\t\t\t$eventId = $db->lastInsertedId();\n\t\t\t\tif($eventId>0){\n\t\t\t\t\t$inserted++;\n\t\t\t\t\t$lastID = $eventId;\n\t\t\t\t\t// Add tags if any\n\t\t\t\t\t$tags = count($this->events[$i]['tags']);\n\t\t\t\t\tif($tags>0){\n\t\t\t\t\t\t// Add the tags\n\t\t\t\t\t\tfor($a=0;$a<$tags;$a++){\n\t\t\t\t\t\t\t$ent = $this->entityID($this->events[$i]['tags'][$a]);\n\t\t\t\t\t\t\t$relation = array(\n\t\t\t\t\t\t\t\t':eventId' => $eventId,\n\t\t\t\t\t\t\t\t':entityId' => $ent\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$relationsQuery->execute($relation);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$lastID = NULL;\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\tif($e->getCode()!=='23000'){\n\t\t\t\t\techo \"\\n\\tError 1 [{$e->getCode()}]: {$e->getMessage()}\";\n\t\t\t\t}\n\t\t\t\techo $log;\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\t\techo '<br />Imported '.$inserted.' elements in a total of '.$sess->execTime();\n\t\techo '<hr /><h3>Profiling</h3>';\n\t\t$this->times['import'] = $sess->execTime() - $this->times['import'];\n\t\t$totalTime = $sess->execTime();\n\t\techo \"<pre>\n\t\t\t\tTotal:\t\t\t$totalTime\n\t\t\t\tDownloading:\t\t{$this->times['process']}\n\t\t\t \tParsing:\t\t{$this->times['download']}\n\t\t\t \tImporting:\t\t{$this->times['import']}</pre>\";\n\t\t// -------------------------------------------------------- //\n\t\t// Generate next iteration date\n\t\t$maxDays = array(31,29,31,30,31,30,31,31,30,31,30,31);\n\t\t$this->day++;\n\t\tif($this->day > $maxDays[$this->month - 1]){\n\t\t\t$this->day = 1;\n\t\t\t$this->month++;\n\t\t\tif($this->month > 12) die('DONE');\n\t\t}\n\t\techo 'Redirecting to: '.ucfirst(date(\"F\", mktime(0, 0, 0, $this->month, 10))).'_'.$this->day;\n\t\techo '<script>\n\t\t\twindow.location = \"dayParser.php\";\n\t\t</script>';\n\t\t// Next iteration\n\t\t$_SESSION['day'] = $this->day;\n\t\t$_SESSION['month'] = $this->month;\n\t}", "public function importData($file, $dbTable)\n {\n $query = \"\n LOAD DATA LOCAL INFILE '{$file}'\n INTO TABLE {$dbTable} \n FIELDS TERMINATED BY '|'\n (service_no, c, ptp, @person_type_name, member_name, \n s, service_name, rank_rate, pg, occ, occupation_name,\n birth_date, g, hor_city, hor_county, hor_cntry, \n hor_st, state_prv_nm, marital_status, religion_name, \n l, race_name, ethnic_name, race_omb, ethnic_group_name, \n cas_circumstances, cas_city, cas_st, cas_ctry, cas_region_code,\n country_or_water_name, unit_name, d, process_dt, death_dt,\n year, wc, oitp, oi_name, oi_location, close_dt, aircraft, \n h, casualty_type_name, casualty_category, casualty_reason_name, \n csn, body, casualty_closure_name, wall, incident_category,\n i_status_dt, i_csn, i_h, i_aircraft, @created_at, @updated_at)\n SET created_at=NOW(), updated_at=null, person_type_name=LOWER(person_type_name)\";\n\n DB::connection()->getpdo()->exec($query);\n }" ]
[ "0.7269885", "0.6336099", "0.6263408", "0.6158965", "0.6039248", "0.60306394", "0.60063887", "0.5749182", "0.57326597", "0.5624004", "0.54702735", "0.54525226", "0.5452295", "0.5443806", "0.53924406", "0.5351593", "0.53510046", "0.5343794", "0.533978", "0.5308475", "0.52679145", "0.5244547", "0.5241718", "0.5193319", "0.5191118", "0.5179463", "0.51788074", "0.5177701", "0.5176329", "0.5176089", "0.51669866", "0.51384956", "0.5130047", "0.50921005", "0.5075674", "0.5070455", "0.50623643", "0.5055402", "0.5053326", "0.5048011", "0.5046373", "0.5039072", "0.5027573", "0.50189406", "0.5016942", "0.5016135", "0.5016043", "0.4994918", "0.4983519", "0.49774525", "0.49714136", "0.49625123", "0.49579537", "0.4947716", "0.49475884", "0.494637", "0.4941166", "0.49405476", "0.4939037", "0.4933925", "0.49208945", "0.49203193", "0.49181357", "0.49119607", "0.49065658", "0.49006855", "0.49006143", "0.48874518", "0.4882206", "0.48768157", "0.48699948", "0.48693213", "0.4861918", "0.48523942", "0.48472562", "0.484588", "0.48395315", "0.48350704", "0.48318633", "0.4831671", "0.48316386", "0.4828295", "0.48280925", "0.48193213", "0.48185763", "0.4812892", "0.4810863", "0.4810068", "0.48082", "0.4806103", "0.48049378", "0.48026994", "0.4799782", "0.47936684", "0.47921008", "0.47915208", "0.4786262", "0.47835454", "0.47831854", "0.47828218" ]
0.6765243
1
Import just one day's data from the unziped CSV file.
private function _import_from_daily_csv_file($file, $symbol_index) { $batch = []; // Do the CSV magic. $reader = Reader::createFromFileObject(new SplFileObject($file)); // symbols model $symbols_model = App::make('App\Models\Symbols'); // Loop through the option data. foreach($reader->query() AS $key => $row) { // Only care about some symbols if(! in_array(strtolower($row[0]), $this->eod_option_daily_symbols)) { continue; } // See if we have an entry in the Symbols table for this symbol if(! isset($symbol_index[strtoupper($row[0])])) { $sym_id = $symbols_model->insert([ 'SymbolsShort' => strtoupper($row[0]) ]); $symbol_index = $symbols_model->get_index(); } else { $sym_id = $symbol_index[strtoupper($row[0])]; } // We insert in batches. DB::table('OptionsEod')->insert([ 'OptionsEodSymbolId' => $sym_id, 'OptionsEodSymbolLast' => $row[1], 'OptionsEodType' => $row[5], 'OptionsEodExpiration' => date('Y-m-d', strtotime($row[6])), 'OptionsEodQuoteDate' => date('Y-m-d', strtotime($row[7])), 'OptionsEodStrike' => $row[8], 'OptionsEodLast' => $row[9], 'OptionsEodBid' => $row[10], 'OptionsEodAsk' => $row[11], 'OptionsEodVolume' => $row[12], 'OptionsEodOpenInterest' => $row[13], 'OptionsEodImpliedVol' => $row[14], 'OptionsEodDelta' => $row[15], 'OptionsEodGamma' => $row[16], 'OptionsEodTheta' => $row[17], 'OptionsEodVega' => $row[18], 'OptionsEodCreatedAt' => date('Y-m-d H:i:s') ]); } // Delete tmp file. unlink($file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionImportFromCsv()\n {\n HBackup::importDbFromCsv($this->csvFile);\n }", "public function importcsv()\n\t{\n\t\tif( $this->import_start() )\n\t\t{\n\t\t\t// Reads the content which has been uploaded to the tmp file into a text var\n\t\t\t$content = file_get_contents($this->file['tmp_name']);\n\t\t\tunlink($this->file['tmp_name']);\t\t\t\t//delete tmp file\n\n\t\t\t$rows\t\t= $this->cvs2array($content, ';');\n\t\t\t$model\t\t= $this->getModel('HelloImport');\t\t//for db read/write\n\t\t\t$this->ok\t= $model->importItems($rows);\n\t\t}\n\t\t$this->import_finish();\n\t}", "function importAll() {\n $row = 1;\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) {\n \n if ($row == 1 || $row == 2) { $row++; continue; } //skip rows 1 and 2.\n \n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n $row++;\n }\n fclose($GLOBALS[\"handle\"]);\n } else {\n return 0; //error read file\n }\n return $data;\n}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "public function importCsv()\n {\n $file = fopen($_FILES['csvFile']['tmp_name'], \"r\");\n $payments = array();\n while (!feof($file)) {\n $row = fgetcsv($file, 0, \"\\t\");\n if (count($row) == 14 && $row[0] != \"Kirjauspäivä\") {\n $dateOfPayment = new \\DateTime($row[2]);\n $values = array(\n 'date_of_payment' => $dateOfPayment->format('Y-m-d H:i:s'),\n 'amount' => $this->makeFloat($row[3]),\n 'reference_number' => $row[8],\n 'amount_left' => 0,\n );\n $payments[] = new Payment($values);\n }\n }\n fclose($file);\n $insert = $this->paymentRepository->insert($payments);\n if ($insert !== true) {\n $message = \"Maksujen kirjaamisessa tapahtui virhe.<br />\" . $insert;\n $error = array(\"error\" => $message);\n ErrorService::setErrors($error);\n return;\n }\n Redirect::to(\"/maksut/syotto\", array(\"success\" => \"Maksut kirjattu onnistuneesti.\"));\n\n }", "public function import(){\n if(\\Storage::disk('local')->exists('/public/universidades.xlsx')){\n Excel::load('public/storage/universidades.xlsx', function($reader) {\n foreach ($reader->get() as $book) {\n $universidad = new University();\n $universidad->nombre = $book->nombre;\n $universidad->save();\n }\n });\n\n \\Alert::message('Universidades importadas exitosamente', 'success');\n return redirect('/universidades');\n }else{\n \\Alert::message('El archivo universidades.csv no existe, importalo por favor', 'danger');\n return redirect('/universidades');\n }\n }", "function import_csv()\n {\n $msg = 'OK';\n $path = JPATH_ROOT.DS.'tmp'.DS.'com_condpower.csv';\n if (!$this->_get_file_import($path))\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_UPLOAD_IMPORT_CSV_FILE'));\n }\n// $_data = array(); \n if ($fp = fopen($path, \"r\"))\n {\n while (($data = fgetcsv($fp, 1000, ';', '\"')) !== FALSE) \n {\n unset($_data);\n $_data['virtuemart_custom_id'] = $data[0];\n $_data['virtuemart_product_id'] = $data[1];\n $id = $this->_find_id($_data['virtuemart_custom_id'],$_data['virtuemart_product_id']);\n if((int)$id>0)\n {\n $_data['id'] = $id;\n }\n// $_data['intvalue'] = iconv('windows-1251','utf-8',$data[3]);\n $_data['intvalue'] = str_replace(',', '.', iconv('windows-1251','utf-8',$data[3]));\n if(!$this->_save($_data))\n {\n $msg = 'ERROR';\n }\n }\n fclose($fp);\n }\n else\n {\n return array(FALSE, JTEXT::_('COM_CONDPOWER_ERROR_OPEN_TO_IMPORT'));\n }\n return array(TRUE,$msg);\n }", "function bit_admin_import_csv( $playid ) {\n}", "public function importData(){\n $status = false;\n\n // rtrim(); for arrays (removes empty values) from the end\n $rtrim = function($array = [], $lengthMin = false){\n $length = key(array_reverse(array_diff($array, ['']), 1))+1;\n $length = $length < $lengthMin ? $lengthMin : $length;\n return array_slice($array, 0, $length);\n };\n\n if(static::$enableDataImport){\n $filePath = $this->getF3()->get('EXPORT') . 'csv/' . $this->getTable() . '.csv';\n\n if(is_file($filePath)){\n $handle = @fopen($filePath, 'r');\n $keys = array_map('lcfirst', fgetcsv($handle, 0, ';'));\n $keys = $rtrim($keys);\n\n if(count($keys) > 0){\n $tableData = [];\n while (!feof($handle)) {\n $tableData[] = array_combine($keys, $rtrim(fgetcsv($handle, 0, ';'), count($keys)));\n }\n // import row data\n $status = $this->importStaticData($tableData);\n $this->getF3()->status(202);\n }else{\n $this->getF3()->error(500, 'File could not be read');\n }\n }else{\n $this->getF3()->error(404, 'File not found: ' . $filePath);\n }\n }\n\n return $status;\n }", "public function importCityDataCommand($sourcePathAndFilename)\n {\n if (is_file($sourcePathAndFilename)) {\n $handle = fopen($sourcePathAndFilename, 'r');\n $i = 0;\n $messages = array();\n $messages[] = 'Importiere Daten aus Datei ' . $sourcePathAndFilename . LF;\n while (($data = fgetcsv($handle, 0, ';')) !== FALSE) {\n $i++;\n if ($i == 1) {\n continue;\n }\n if ($data[4] === 'LI') {\n // Ignore Fürstentum Liechtenstein\n continue;\n }\n if (empty($data[4])) {\n // Don't import cities without Kanton\n continue;\n }\n $existingCity = $this->cityRepository->findOneByNamePostalCodeMunicipality(utf8_encode($data[0]), $data[1], utf8_encode($data[3]));\n if ($existingCity instanceof \\Visol\\Easyvote\\Domain\\Model\\City) {\n /** @var $existingCity \\Visol\\Easyvote\\Domain\\Model\\City */\n $existingCity->setLongitude($data[5]);\n $existingCity->setLatitude($data[6]);\n /** @var \\Visol\\Easyvote\\Domain\\Model\\Kanton $kanton */\n $kanton = $this->kantonRepository->findOneByAbbreviation($data[4]);\n if ($kanton instanceof \\Visol\\Easyvote\\Domain\\Model\\Kanton) {\n $kanton->addCity($existingCity);\n $existingCity->setKanton($kanton);\n $this->kantonRepository->update($kanton);\n } else {\n $messages[] = '!!! Kein Kanton gefunden für Gemeinde ' . $existingCity->getName() . '.' . LF;\n }\n $this->cityRepository->update($existingCity);\n $messages[] = 'Gemeinde ' . $existingCity->getName() . ' aktualisiert.' . LF;\n\n } else {\n $city = new \\Visol\\Easyvote\\Domain\\Model\\City;\n $city->setName(utf8_encode($data[0]));\n $city->setPostalCode($data[1]);\n $city->setMunicipality(utf8_encode($data[3]));\n $city->setLongitude($data[5]);\n $city->setLatitude($data[6]);\n if (!empty($data[4])) {\n /** @var \\Visol\\Easyvote\\Domain\\Model\\Kanton $kanton */\n $kanton = $this->kantonRepository->findOneByAbbreviation(utf8_encode($data[4]));\n $kanton->addCity($city);\n $city->setKanton($kanton);\n $this->kantonRepository->update($kanton);\n } else {\n $messages[] = '!!! Kein Kanton gefunden für Gemeinde ' . $city->getName() . '.' . LF;\n }\n $this->cityRepository->add($city);\n $messages[] = 'Gemeinde ' . $city->getName() . ' importiert.' . LF;\n\n }\n\n $this->persistenceManager->persistAll();\n\n }\n\n $this->response->setContent(implode($messages));\n\n\n } else {\n $this->response->setContent('File \"' . $sourcePathAndFilename . '\" not found' . LF);\n $this->response->setExitCode(2);\n }\n\n }", "function processCSV($date, $ID, $columns) {\n\tglobal $DATA_DIR;\n\t$dir_handle = @opendir($DATA_DIR.$ID) or die(\"Error: Cannot open the data folder for detector id: \".$ID); \n\t$handle = fopen($DATA_DIR.$ID.'/'.$date.'.csv',\"r\");\n\t\n\t$skipFirstHeader = TRUE;\n\t$useSecondHeaderInput = TRUE;\n\twhile($data = fgetcsv($handle, 0)) {\n\t\tif ($skipFirstHeader)\n\t\t\t$skipFirstHeader = FALSE;\n\t\telse {\n\t\t\tforeach($columns as $value) {\n\t\t\t\t$outputData[] = $data[$value];\n\t\t\t}\n\t\t\t$output = implode(',', $outputData);\n\t\t\t$meta[\"data\"][] = $output;\n\t\t\tif ($useSecondHeaderInput) {\n\t\t\t\t$useSecondHeaderInput = FALSE;\n\t\t\t\t$meta[\"time\"][] = \"Time in UTC\";\n\t\t\t}\n\t\t\telse\n\t\t\t\t$meta[\"time\"][] = date(\"Y-m-d H:i\", strtotime($data[0]));\n\t\t\tunset($outputData);\n\t\t}\n\t}\n\tfclose($handle);\n\treturn $meta;\n\t\n}", "function exeAddTimelogs() {\n if(($handle = fopen(\"timereport/timelogs.csv\",\"r\")) !== false){\n while(($data = fgetcsv($handle,8000,\",\")) !== false){ \n $exeAddLogs = $this->db->query(\"INSERT INTO timelogs\n SET emp_id = \".$this->db->escape($data[0]).\", \n timein = \".$this->db->escape($data[1]).\", \n timeout = \".$this->db->escape($data[2]).\",\n created_date = \".$this->db->escape($data[3]).\" \");\n \n \n }\n }\n \n fclose($handle);\n }", "public function loadCsvFile($file)\n {\n $data = [];\n\n if (file_exists($file)) {\n $data = array_map('str_getcsv', file($file));\n\n array_walk($data, function(&$row) use ($data) {\n $row = array_combine($data[0], $row);\n });\n\n array_shift($data);\n }\n else {\n wp_die(__('Import file does not exist.'));\n }\n\n $this->data = $data;\n }", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "public function startImport()\n {\n if (get_field('xcap_daily_cron', 'option') === true || empty(get_field('xcap_daily_cron', 'option'))) {\n $xcapUrl = 'http://kulturkortet.se/calendar/listEvents.action' .\n '?month=&date=&categoryPermaLink=&q=&p=&feedType=ICAL_XML';\n new \\HbgEventImporter\\Parser\\Xcap($xcapUrl);\n }\n }", "function fatherly_fcr_populate_data()\n{\n global $wpdb;\n $table_name = $wpdb->prefix . 'feed_content_recirculation_posts';\n $csv_file = __DIR__ . '/inc/data/popular_posts.csv';\n $csv_file_data = array_map('str_getcsv', file($csv_file));\n\n foreach ($csv_file_data as $csv_file_datum) {\n $wpdb->insert($table_name, array('post_url' => $csv_file_datum[0], 'post_id' => $csv_file_datum[1]));\n }\n}", "public function import()\n {\n $importer = app('importers-'.$this->type);\n\n // Delete events from previous imports.\n $this->events()->delete();\n\n // Retrieve and store events from calendar.\n $this->events()->saveMany($importer->get($this->url, $this->start_date, $this->end_date));\n }", "public function importFromCsvFile($file)\n {\n if (!isset($file['tmp_name'])) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid file upload attempt.'));\n }\n\t\tset_time_limit(0);//Added to avoid time out error\n\t\tini_set('memory_limit', '2G');//Set memory limit to avoid memory exhaust\n $couponRawData = $this->csvProcessor->getData($file['tmp_name']);\n // first row of file represents headers\n $fileFields = $couponRawData[0];\t\t\n $validFields = $this->_filterFileFields($fileFields);\n $invalidFields = array_diff_key($fileFields, $validFields);\n $couponsData = $this->_filterCouponData($couponRawData, $invalidFields, $validFields);\n\t\t/** REMOVE AFTER IMPLEMENTATION **/\n\t\t//$this->_deleteExistingRules();\n\t\t/** EOF REMOVE RULE **/\n foreach ($couponsData as $rowIndex => $dataRow) {\n // skip headers\n if ($rowIndex == 0) {\n continue;\n }\n $regionsCache = $this->_importCoupon($dataRow);\n }\n\t\tini_restore('max_execution_time');//restore the default time out\n }", "public function importCsv($uploadedFile)\n {\n //read the file, check validation and insert into db at once.\n Excel::import(new PostsImport, $uploadedFile);\n\n //save the uploaded file.\n //get just extension.\n $ext = $uploadedFile->getClientOriginalExtension();\n //make the file name.\n $filename = Auth::id() . '_' . date(\"Y-m-d_H-i-s\") . '.' . $ext;\n //save the file.\n $uploadedFile->storeAs('public/upload_file', $filename);\n }", "private function importCSV($filename)\n\t{\n\t\t$path = $this->localdir . \"/\" . $filename;\n\t\tif (file_exists($path)) {\n\t\t\t$files = $this->csv_to_array($path, $this->separator);\n// \t\t\tVideodeskCall::importCsv($files, $this->shop->id);\n\t\t\tVideodeskCall::importCsv($files, 1);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private function importManyFiles()\n {\n $path = storage_path(\"data/*.csv\");\n\n // run 2 loops at a time\n foreach (array_slice(glob($path), 0, 2) as $file) {\n // read the data into an array\n $data = array_map('str_getcsv', file($file));\n\n // loop over the data\n foreach ($data as $row) {\n // insert the record or update if the email already exists\n // User::updateOrCreate(\n // ['email' => $row[6]],\n // ['email' => $row[6]]\n // );\n }\n\n // delete the file\n unlink($file);\n }\n }", "protected function initCSV() {}", "private function importSales()\n {\n $sales = new Sales();\n $userid = Auth::user()->id;\n\n if (($handle = fopen($_FILES['import_file']['tmp_name'], \"r\")) !== FALSE) {\n $i = 0;\n while (($row = fgets($handle, 4096)) !== FALSE) {\n $i++;\n if ($i == 1) continue;\n\n $csvRow = str_getcsv($row, \"\\n\");\n foreach($csvRow as &$row){\n $row = str_getcsv($row, \";\");\n\n if (count($row) < 7){\n echo \"<span style='color: red'>Záznam nemá správny formát</span><br>\" . count($row);\n continue;\n }\n\n $products = '';\n if (isset($row[7])){\n $products = $row[7];\n }\n\n try{\n $store = $sales->create([\n 'user_id' => $userid,\n 'company_id' => session('selectedCompany'),\n 'products' => $products,\n 'total_price' => $row[0],\n 'fik' => $row[1],\n 'bkp' => $row[2],\n 'receiptNumber' => $row[3],\n 'premiseId' => $row[5],\n 'cash_register' => $row[6],\n 'receipt_time' => $row[4],\n 'not_sent' => 0,\n ]);\n echo \"<span style='color: green'>Záznam \" . implode(\";\",$row) . \" sa úspešne naimportoval.</span><br>\";\n }\n catch (\\Illuminate\\Database\\QueryException $e){\n echo \"<span style='color: red'>Záznam \" . implode(\";\",$row) . \" sa nepodarilo importovať.</span><br>\";\n }\n }\n }\n fclose($handle);\n }\n\n echo 'hotovo';\n }", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n usermoodle::TABLE => elispm::file('tests/fixtures/user_moodle.csv')\n ));\n $this->loadDataSet($dataset);\n }", "function oak_import_csv() {\n global $wpdb;\n\n $table = $_POST['table'];\n $rows = $_POST['rows'];\n $single_name = $_POST['single_name'];\n\n $table_name = $table;\n if ( $_POST['wellDefinedTableName'] == 'false' ) :\n $table_name = $wpdb->prefix . 'oak_' . $table;\n if ( $single_name == 'term' ) :\n $table_name = $wpdb->prefix . 'oak_taxonomy_' . $table;\n elseif( $single_name == 'object' ) :\n $table_name = $wpdb->prefix . 'oak_model_' . $table;\n endif;\n endif;\n\n foreach( $rows as $key => $row ) :\n if ( $key != 0 && !is_null( $row[1] ) ) :\n $arguments = [];\n foreach( $rows[0] as $property_key => $property ) :\n if ( $property != 'id' && $property_key < count( $rows[0] ) && $property != '' ) :\n $arguments[ $property ] = $this->oak_filter_word( $row[ $property_key ] );\n endif;\n if ( strpos( $property, '_trashed' ) != false ) :\n $arguments[ $_POST['single_name'] . '_trashed' ] = $row[ $property_key ];\n endif;\n endforeach;\n $result = $wpdb->insert(\n $table_name,\n $arguments\n );\n endif;\n endforeach;\n\n wp_send_json_success();\n }", "private function reedImportFile()\n {\n $reader = IOFactory::createReader('Xlsx');\n\n $reader->setReadDataOnly(true);\n\n $spreadsheet = $reader->load($this->getFullPathToUploadFile());\n\n $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true);\n\n $this->resultReedImportFile = $sheetData;\n }", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "function add_stream2()\n {\n //$this->load->view('import_data');\n if (isset($_POST[\"submit\"])) {\n $file = $_FILES['file']['tmp_name'];\n $handle = fopen($file, \"r\");\n $c = 0; //\n while (($filesop = fgetcsv($handle, 1000, \",\")) !== false) {\n $names = $filesop[0];\n $class = $filesop[1];\n $stream = $filesop[3];\n $year = $filesop[4];\n if ($c <> 0) { //SKIP THE FIRST ROW\n $this->Excel_import_model->saverecords($names, $class, $stream, $year);\n }\n $c = $c + 1;\n }\n echo \"Stream imported sucessfully\";\n }\n }", "public function import(Request $request){\n\n // get file \n $upload = $request -> file('upload_file');\n if ( $upload == null){\n $error = \"Please select CSV file\";\n return view(\"welcome\")->with('error',$error);\n }\n $filePath = $upload-> getRealPath();\n \n \n // open and read file \n $file = fopen($filePath, 'r');\n\n $header = fgetcsv($file);\n \n // validate file \n \n // loop throgh other colums\n $importData_arr = array();\n $i = 0;\n while( $filedata = fgetcsv($file))\n {\n $num = count($filedata );\n if($i == 0){\n $i++;\n continue; \n }\n for ($c=0; $c < $num; $c++) {\n $importData_arr[$i][] = $filedata [$c];\n }\n $i++;\n\n }\n // Insert to MySQL database\n foreach($importData_arr as $importData){\n\n $insertData = array(\n \"date\"=>$importData[0],\n \"category\"=>$importData[1],\n \"lot_title\"=>$importData[2],\n \"lot_location\"=>$importData[3],\n \"lot_condition\"=>$importData[4],\n \"pretax_amount\"=>$importData[5],\n \"tax_name\"=>$importData[6],\n \"tax_amount\"=>$importData[7],\n\n );\n \n Auction::insertData($insertData);\n\n }\n \n $data = DB::table('auctions')->get();\n return view(\"welcome\")->with('allAuctionData',$data);\n\n }", "private function parse()\n {\n $this->info('Start profiles refresh...');\n // Load the file and\n // parse the csv format\n $path = storage_path(config('constants.stations_infos_path'));\n\n if (($pointer = fopen($path, 'r')))\n {\n DB::beginTransaction();\n $first = true;\n $this->info('Parsing CSV profiles...');\n while (($line = fgetcsv($pointer, 0, ';')))\n {\n // Ignore the first header line\n if (! $first)\n {\n $this->refresh($line);\n }\n $first = false;\n }\n fclose($pointer);\n\n if ($this->commit)\n {\n $this->info('Done. Saving changes...');\n DB::commit();\n }\n else\n {\n $this->info('Error, rollback changes!');\n DB::rollBack();\n }\n }\n }", "function Quick_CSV_import($file_name=\"\")\r\n {\r\n $this->file_name = $file_name;\r\n\t\t$this->source = '';\r\n $this->arr_csv_columns = array();\r\n $this->use_csv_header = true;\r\n $this->field_separate_char = \",\";\r\n $this->field_enclose_char = \"\\\"\";\r\n $this->field_escape_char = \"\\\\\";\r\n $this->table_exists = false;\r\n }", "public function importPointsFromCSV() {\n $usernames = array();\n if (($handle = fopen ( public_path () . '/top.csv', 'r' )) !== FALSE) {\n while ( ($data = fgetcsv ( $handle, 1000, ',' )) !== FALSE ) {\n\n array_push($usernames, $data );\n\n }\n fclose ( $handle );\n }\n\n $user_points = array();\n foreach ($usernames as $key => $user) {\n $name = $user[0];\n $point_count = $usernames[$key][1];\n $user = DB::table('end_users')->where('nick', $name)->first();\n\n if(!$user) {\n\n } else {\n $point = new Point;\n $point->end_user_id = $user->id;\n $point->campaign_id = 1;\n $point->source = 'old points';\n $point->count = $point_count;\n\n if($point->save()) {\n array_push($user_points, [$name, $point_count]);\n }\n }\n\n }\n\n\n }", "public function import($csv)\n {\n $this->em->getFilters()->disable('softdeleteable');\n\n $csv = preg_replace('#[\\n\\r]+#', '#', $csv);\n\n $lines = explode('#', $csv);\n\n $ids = array();\n\n foreach($lines as $line){\n $info = explode(';', $line);\n $student = new Student();\n $student->setId($info[0]);\n $student->setLastName($info[1]);\n $student->setFirstName($info[2]);\n if(isset($info[3]) && $info[3] != '') $student->setClass(preg_replace('#^[0-9]+_(.+)$#', '$1', $info[3]));\n if(isset($info[4]) && $info[4] != '') $student->setEmail($info[4]);\n #$student->setIsContributor(false);\n\n if($this->em->getRepository('FerusStudentBundle:Student')->isIdAvailable($student->getId())){\n $this->em->persist($student);\n $this->em->flush();\n\n $this->success++;\n }\n else{\n $student = $this->em->getRepository('FerusStudentBundle:Student')->findOneById($student->getId());\n $student->setLastName($info[1]);\n $student->setFirstName($info[2]);\n $student->setEmail(null);\n $student->setDeletedAt(null);\n if(isset($info[3]) && $info[3] != '') $student->setClass(preg_replace('#^[0-9]+_(.+)$#', '$1', $info[3]));\n if(isset($info[4]) && $info[4] != '') $student->setEmail($info[4]);\n $this->em->persist($student);\n $this->em->flush();\n\n $this->error++;\n }\n\n $ids[] = $info[0];\n }\n\n #Softdelete any missing student from the CSV\n $students = $this->em->getRepository('FerusStudentBundle:Student')->findByNotDeleted();\n $date = new \\DateTime();\n foreach($students as $student){\n if(!in_array($student->getId(), $ids)){\n if($student->hasFairpay()){\n if($student->getAccount()->getBalance() != \"0.00\"){\n $class = $student->getClass();\n $newClass = preg_replace('#^E[1-5](.*)$#', \"E6$1\", $class);\n if($newClass === $class) $student->setClass('E6');\n else $student->setClass($newClass);\n }\n else{\n $student->getAccount()->setDeletedAt($date);\n $student->setDeletedAt($date);\n }\n }\n else{\n $student->setDeletedAt($date);\n }\n\n $student->setIsContributor(false);\n $this->em->persist($student);\n $this->em->flush();\n\n $this->error++;\n }\n }\n\n return $this->success . ' étudiants créés et '.$this->error.' mis à jour.';\n }", "public function import(): void\n\t{\n\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\tif (\n\t\t\t!$this->lastScan['start_date']\n\t\t\t|| (0 === $this->lastScan['id'] && $this->lastScan['start_date'] === $this->lastScan['end_date'])\n\t\t) {\n\t\t\t$this->config->setScan('import' . $this->name);\n\t\t\t$this->lastScan = $this->config->getLastScan('import' . $this->name);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('Start import ' . $this->name, [\n\t\t\t\t'lastScan' => $this->lastScan,\n\t\t\t]);\n\t\t}\n\t\t$i = 0;\n\t\ttry {\n\t\t\t$page = $this->lastScan['page'] ?? 1;\n\t\t\t$load = true;\n\t\t\t$finish = false;\n\t\t\t$limit = $this->config->get(self::LIMIT_NAME);\n\t\t\twhile ($load) {\n\t\t\t\tif ($rows = $this->getFromApi('Customer/GetAll?&page=' . $page . '&' . $this->getFromApiCond())) {\n\t\t\t\t\tforeach ($rows as $id => $row) {\n\t\t\t\t\t\tif ('JEDNORAZOWY' === $row['knt_Akronim']) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->importItem($row);\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'id', $id);\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\t\t\t\t\t++$page;\n\t\t\t\t\tif (\\is_callable($this->controller->bathCallback)) {\n\t\t\t\t\t\t$load = \\call_user_func($this->controller->bathCallback, 'import' . $this->name);\n\t\t\t\t\t}\n\t\t\t\t\tif ($limit !== \\count($rows)) {\n\t\t\t\t\t\t$finish = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$finish = true;\n\t\t\t\t}\n\t\t\t\tif ($finish || !$load) {\n\t\t\t\t\t$load = false;\n\t\t\t\t\tif ($finish) {\n\t\t\t\t\t\t$this->config->setEndScan('import' . $this->name, $this->lastScan['start_date']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->config->setScan('import' . $this->name, 'page', $page);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Throwable $ex) {\n\t\t\t$this->logError('import ' . $this->name, null, $ex);\n\t\t}\n\t\tif ($this->config->get('log_all')) {\n\t\t\t$this->controller->log('End import ' . $this->name, ['imported' => $i]);\n\t\t}\n\t}", "public function run()\n {\n $filename = storage_path('imports/car_serie.csv');\n Excel::import(new CarSerieImport, $filename);\n }", "public function import($fileName, $blfName) {\n\t\t$this->_blfName = $blfName;\n\t\t$this->fileName = $fileName;\n\t\t$missionId = - 1;\n\t\t$this->loadingStep = 0;\n\t\t\n\t\tini_set ( \"memory_limit\", \"1024M\" );\n\t\t\n\t\tset_time_limit ( 1000 );\n\t\t\n\t\tif (! $this->uploaded) {\n\t\t\t$file = sfConfig::get ( 'app_import_data_stack_log' );\n\t\t\t$csv_file = sfConfig::get ( 'app_import_path_stack_log' ) . DIRECTORY_SEPARATOR . $this->year . DIRECTORY_SEPARATOR . $this->month . DIRECTORY_SEPARATOR . $this->day . DIRECTORY_SEPARATOR . $file;\n\t\t} else {\n\t\t\t$csv_file = sfConfig::get ( 'sf_upload_dir' ) . '/' . $fileName;\n\t\t}\n\t\t\n\t\tif (file_exists ( $csv_file )) {\n\t\t\t$handle = fopen ( $csv_file, \"r\" );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Print error to STDERR and exit the whole script.\n\t\t\t */\n\t\t\tfwrite ( STDERR, \"[\" . date ( 'Y-m-d H:i:s' ) . \"] [stack] Csv-file from \" . date ( 'Y-m-d', $this->calendar_date ) . \" not found.\\n\" );\n\t\t\t\n\t\t\treturn $missionId;\n\t\t}\n\t\t\n\t\t// start working on the file\n\t\tif ($handle) {\n\t\t\t\n\t\t\t/*\n\t\t\t * Read csv-file and put contents to the associative array $import_data\n\t\t\t */\n\t\t\t$import_data = array ();\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t// get field names - column headers\n\t\t\t$fieldnames = fgetcsv ( $handle, 4096, \",\" );\n\t\t\t// $this->printArray($fieldnames);\n\t\t\t\n\t\t\t$dateTimeRow = null;\n\t\t\t\n\t\t\twhile ( ($line = fgets ( $handle )) !== FALSE ) {\n\t\t\t\t$rowData = $this->getCsvWoWhiteSpace ( $line );\n\t\t\t\t\n\t\t\t\t$row ++;\n\t\t\t\t$number_of_columns = count ( $rowData );\n\t\t\t\t\n\t\t\t\tfor($i = 0; $i < $number_of_columns; $i ++) {\n\t\t\t\t\t$trimmed = trim ( $rowData [$i] );\n\t\t\t\t\t$import_data [$fieldnames [$i]] = $trimmed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// $this->printArray($import_data);die();\n\t\t\t\t$this->padData ( $import_data );\n\t\t\t\t$this->_currentRowDateTime = $import_data [LoggerFields::Data_Time_UTC];\n\t\t\t\t$this->analyzeRecord ( $import_data );\n\t\t\t}\n\t\t\t\n\t\t\tfclose ( $handle );\n\t\t\t$this->missionEnded ();\n\t\t\t// echo \"mission endede\";//debug\n\t\t\t$number_of_entries = $row;\n\t\t}\n\t\t// echo \"import done\"; die();\n\t\treturn $this->_mission;\n\t}", "protected function importDatabaseData() {}", "private function csvTaskLoad($csv){\n $multiCsvArr = [];\n if(($handle = fopen(\"{$csv}\", \"r\")) !== false){\n while(($dataRow = fgetcsv($handle, 1000, \",\")) !== false){\n $multiCsvArr[] = $dataRow;\n }\n }\n fclose($handle);\n return $multiCsvArr;\n }", "public function indexImport()\n\t{\n\t\t$this->commons->isAdmin();\n\t\t$filename = $_FILES[\"file\"][\"tmp_name\"];\n\t\t$data = '';\n\t\t$row = 0;\n\t\t$expire = date('Y-m-d', strtotime('+1 years'));\n\t\tif ($_FILES[\"file\"][\"size\"] > 0) {\n\t\t\t$file = fopen($filename, \"r\");\n\t\t\twhile (($getData = fgetcsv($file, 10000, \",\")) !== FALSE) {\n\t\t\t\tif ($row == 0 && $getData[0] !== 'Salutation' && $getData[1] !== 'First Name' && $getData[2] !== 'Last Name' && $getData[3] !== 'Company' && $getData[4] !== 'Email Address' && $getData[5] !== 'Phone Number' && $getData[6] !== 'Website' && $getData[7] !== 'Address Line 1' && $getData[8] !== 'Address Line 2' && $getData[9] !== 'City' && $getData[10] !== 'State' && $getData[11] !== 'Country' && $getData[12] !== 'Postal Code') {\n\t\t\t\t\techo 0;\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\tif ($row > 0) {\n\t\t\t\t\t$temp = array('address1' => $getData[7], 'address2' => $getData[8], 'city' => $getData[9], 'state' => $getData[10], 'country' => $getData[11], 'pin' => $getData[12], 'phone1' => '', 'fax' => '');\n\t\t\t\t\t$data .= \"('\" . $getData[0] . \"','\" . $getData[1] . \"','\" . $getData[2] . \"','\" . $getData[3] . \"','\" . $getData[4] . \"','\" . $getData[5] . \"','\" . $getData[6] . \"','\" . json_encode($temp) . \"','\" . $getData[11] . \"','\" . $expire . \"'),\";\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t\t$data = rtrim($data, ',');\n\t\t$result = $this->contactModel->importContact($data);\n\t\tif ($result) {\n\t\t\techo 1;\n\t\t} else {\n\t\t\techo 0;\n\t\t}\n\t}", "public function import($csv)\n {\n // convert to UTF-8\n $head = substr($csv, 0, 4096);\n $charset = rcube_charset::detect($head, RCUBE_CHARSET);\n $csv = rcube_charset::convert($csv, $charset);\n $csv = preg_replace(array('/^[\\xFE\\xFF]{2}/', '/^\\xEF\\xBB\\xBF/', '/^\\x00+/'), '', $csv); // also remove BOM\n $head = '';\n $prev_line = false;\n\n $this->map = array();\n $this->gmail_map = array();\n\n // Parse file\n foreach (preg_split(\"/[\\r\\n]+/\", $csv) as $line) {\n if (!empty($prev_line)) {\n $line = '\"' . $line;\n }\n\n $elements = $this->parse_line($line);\n\n if (empty($elements)) {\n continue;\n }\n\n // Parse header\n if (empty($this->map)) {\n $this->parse_header($elements);\n if (empty($this->map)) {\n break;\n }\n }\n // Parse data row\n else {\n // handle multiline elements (e.g. Gmail)\n if (!empty($prev_line)) {\n $first = array_shift($elements);\n\n if ($first[0] == '\"') {\n $prev_line[count($prev_line)-1] = '\"' . $prev_line[count($prev_line)-1] . \"\\n\" . substr($first, 1);\n }\n else {\n $prev_line[count($prev_line)-1] .= \"\\n\" . $first;\n }\n\n $elements = array_merge($prev_line, $elements);\n }\n\n $last_element = $elements[count($elements)-1];\n if ($last_element[0] == '\"') {\n $elements[count($elements)-1] = substr($last_element, 1);\n $prev_line = $elements;\n continue;\n }\n $this->csv_to_vcard($elements);\n $prev_line = false;\n }\n }\n }", "function csvimport($tpl = null)\n\t{\n\t\tif (JVersion::isCompatible(\"1.6.0\"))\n\t\t\tJHTML::stylesheet('administrator/components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css');\n\t\telse\n\t\t\tJHTML::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');\n\n\t\t$document = & JFactory::getDocument();\n\t\t$document->setTitle(JText::_( 'CSV_IMPORT' ));\n\n\t\t// Set toolbar items for the page\n\t\tJToolBarHelper::title(JText::_( 'CSV_IMPORT' ), 'jevents');\n\n\t\tJToolBarHelper::cancel('icalevent.list');\n\n\t\t$this->_hideSubmenu();\n\n\t\tJSubMenuHelper::addEntry(JText::_( 'CONTROL_PANEL' ), 'index.php?option=' . JEV_COM_COMPONENT, true);\n\n\t\t$params = JComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t//$section = $params->getValue(\"section\",0);\n\n\t\tJHTML::_('behavior.tooltip');\n\n\t}", "public function run() {\n\t\t//php artisan db:seed --class=CitiesTablesSeed\n\t\tset_time_limit( 3600 );\n\t\t$start = microtime( true );\n\t\t$filename = 'cities.csv';\n\t\t$this->command->info( \"*** Iniciando o Upload (\" . $filename . \") ***\" );\n\n\t\t$file = storage_path( 'import' . DIRECTORY_SEPARATOR . $filename );\n\t\t$this->command->info( \"*** Upload completo em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\n\t\t$rows = Excel::load( $file, function ( $reader ) {\n\t\t\t$reader->toArray();\n\t\t\t$reader->noHeading();\n\t\t} )->get();\n\t\tforeach ( $rows as $row ) {\n\t\t\t$data = [\n\t\t\t\t'id' => $row[0],\n\t\t\t\t'name' => $row[1],\n\t\t\t\t'idstate' => $row[2],\n\t\t\t];\n\t\t\t\\App\\Models\\Configs\\CepCities::create( $data );\n\t\t\techo( '(' . $data['id'] . ') - ' );\n\t\t}\n\t\t$this->command->info( \"*** Importacao IMPORTSEEDER realizada com sucesso em \" . round( ( microtime( true ) - $start ), 3 ) . \"s ***\" );\n\n\t}", "public function import_sample_data($index) {\n\t\t\t$row = 0;\n\t\t\t\n\t\t\tif (($handle = fopen(\"sample.csv\", \"r\")) !== FALSE) {\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t\t$row++;\n\t\t\t\t\t\n\t\t\t\t\tif( $row > 1 ) {\n\t\t\t\t\t\t$page \t\t = $data[0];\n\t\t\t\t\t\t$pageviews \t = $data[1];\n\t\t\t\t\t\t$unique \t = $data[2];\n\t\t\t\t\t\t$averagetime = $data[3];\n\t\t\t\t\t\t$bouncerate = $data[4];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$jsonstring = array (\"page\" => $page, 'pageviews' => $pageviews, 'unique' => $unique, 'averagetime' => $averagetime, 'bouncerate' => $bouncerate );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$jsonstring = json_encode($jsonstring);\n\t\t\t\t\t\t$this->push_data($index, $jsonstring);\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"$row \\n\"; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}", "private function _import_daily_eod_options_data($symbol_index)\n\t{\n // Query dropbox and list files.\n $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY'));\n $adapter = new DropboxAdapter($client);\n $db_filesystem = new Filesystem($adapter); \t\n \t$files = $db_filesystem->listContents('/', true);\n \t\n foreach($files AS $key => $row)\n {\n $toast = false;\n \n // Only want files.\n if($row['type'] != 'file')\n {\n continue;\n }\n \n // Only want zipfiles with daily\n if($row['extension'] != 'zip')\n {\n continue;\n }\n \n // Only want a certain type of file.\n if(! strpos($row['path'], 'alloptions/Daily/options_'))\n {\n continue;\n }\n \n // See if we need to download it or not.\n if(is_file('/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path']))\n {\n $file = '/Users/spicer/Dropbox/Apps/Stockpeer/' . $row['path'];\n } else\n {\n $toast = true;\n $file = '/tmp/' . basename($row['path']);\n $this->info('Dropbox: Downloading ' . $row['path']);\n file_put_contents($file, $db_filesystem->read($row['path']));\n }\n \t\n // Unzip the file.\n $filesystem = new Filesystem(new ZipArchiveAdapter($file));\n $list = $filesystem->listContents('/'); \n \n // File the file we want to import.\n foreach($list AS $key => $row)\n {\n // Just want the file with the options data.\n if(strpos($row['path'], 'ptions_'))\n {\n // Write the CSV file to the tmp dir.\n $this->info('Importing: ' . $row['path']);\n file_put_contents('/tmp/' . $row['path'], $filesystem->read($row['path']));\n \n // Now that we have the CSV lets start the import.\n $this->_import_from_daily_csv_file('/tmp/' . $row['path'], $symbol_index);\n }\n }\n \n // Toast temp file\n if($toast)\n {\n unlink($file);\n }\n }\n\t}", "private function importDateContents($contents) : void\n {\n //==============================================================================\n // Import Date\n if (!empty($contents[\"date\"])) {\n if ($contents[\"date\"] instanceof DateTime) {\n $this->setRefreshAt($contents[\"date\"]);\n } elseif (is_scalar($contents[\"date\"])) {\n $this->setRefreshAt(new DateTime((string) $contents[\"date\"]));\n }\n }\n }", "public function importDataFile($file, FromDataFile $model)\n {\n $csv = new \\SplFileObject($file);\n $csv->setFlags(SplFileObject::READ_CSV);\n\n $this->info(' Warming up progress bar.', 1);\n $bar = new ProgressBar($this->getOutput(), $this->getTotalLines($csv));\n\n $batched = collect();\n\n $csv->seek(1);\n while (!$csv->eof()) {\n if (count($csv->current()) <= 1) {\n $bar->advance();\n\n continue;\n }\n\n $batched->push($model::fromDataFile($csv->current()));\n\n if ($batched->count() % 1000 === 0) {\n $model::insert($batched->toArray());\n\n $bar->advance(1000);\n\n $batched = collect();\n }\n\n $csv->next();\n }\n\n if ($batched->count() > 0) {\n $model::insert($batched->toArray());\n\n $bar->advance($batched->count());\n }\n }", "public function readCsv()\n {\n ini_set(\"auto_detect_line_endings\", true);\n $fp = fopen($this->inputFile , 'r');\n while($row = fgetcsv($fp)){\n $this->data[] = $row;\n }\n }", "public function parse()\n {\n if ($handle = fopen($this->csv, 'r'))\n {\n while ($data = fgetcsv($handle, \",\"))\n {\n $this->dataArray[] = $data;\n }\n }\n fclose($handle);\n }", "public function import(){\r\n $logs = array();\r\n $data = $this->data;\r\n if($this->__isCsvFileUploaded()){\r\n $logs[] = 'Loading model.User and model.Group ...';\r\n $this->loadModel('User');\r\n $this->loadModel('Group');\r\n extract($this->Student->import(array(\r\n 'data' => $this->data,\r\n 'log' => 'database',\r\n 'logs' => &$logs,\r\n 'user' => &$this->User,\r\n 'group' => &$this->Group,\r\n 'password' => $this->Auth->password('000000'),\r\n 'merge' => $this->data['User']['merge']\r\n )));\r\n }elseif($this->data){\r\n $logs[] = 'Error: No valid file provided';\r\n $logs[] = 'Expecting valid CSV File encoded with UTF-8';\r\n }\r\n $this->set(compact('logs', 'data'));\r\n }", "private function importCsv($params) {\n\n $conn = $this->container->get('doctrine.dbal.default_connection');\n\n // set content in file handler\n $fiveMBs = 5 * 1024 * 1024;\n $fp = fopen(\"php://temp/maxmemory:$fiveMBs\", 'r+');\n fputs($fp, $params['data']);\n rewind($fp);\n\n // get array from CSV\n $data = array();\n while (($row = fgetcsv($fp, 1000, \",\")) !== FALSE) {\n $data[] = $row;\n }\n fclose($fp);\n\n // let's check how the CSV is structured. There can be 3 options\n\n // Option 1.\n // date, value\n // date2, value2\n\n // Option 2.\n // x, date1, date2\n // source_title, value11, value12\n // source_title2, value21, value22\n\n // so let's check the first field to see if it's a date\n $firstField = $data[0][0];\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($firstField);\n\n $dataToInsert = array();\n $sourcesToInsert = array();\n\n // it's a date, so Option 1\n if ( $dateAr ) {\n\n $sourceHash = md5($params['title']);\n\n $sourcesToInsert[] = '('\n . $conn->quote(trim($params['title']), 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // the data is already on the desired format\n $dataToInsert[ $sourceHash ] = $data;\n }\n // Option 2.\n else {\n\n // get dates which are on the first line\n $dates = array_slice($data[0], 1);\n $avoidFirst = true;\n foreach ($data as $lineData) {\n\n // do not insert first line\n if ( $avoidFirst ) {\n $avoidFirst = false;\n continue;\n }\n\n // source title\n $titleSuffix = $lineData[0];\n $sourceTitle = trim($params['title']) . ' - ' . trim($titleSuffix);\n $sourceHash = md5($sourceTitle);\n\n $sourcesToInsert[] = '('\n . $conn->quote($sourceTitle, 'string').', '\n . $conn->quote($sourceHash, 'string').', '\n . $conn->quote($params['unit'], 'string').', '\n . $conn->quote($params['link'], 'string').', now(), now())';\n\n // values\n $values = array_slice($lineData, 1);\n\n $dataToInsert[ $sourceHash ] = array_combine($dates, $values);\n }\n }\n\n $now = date('Y-m-d H:m:s');\n\n // insert masivo de sources\n $r = $conn->executeUpdate('INSERT INTO source (title, hash, unit, link, created_at, updated_at)\n VALUES '.join(',', $sourcesToInsert));\n\n // get all sources\n $results = $conn->fetchAll(\"SELECT id, hash FROM source where created_at > ?\", array($now));\n\n // create array that identifies source\n $sources = array();\n foreach ($results as $r) {\n $sources[ $r['hash'] ] = $r['id'];\n }\n unset($results);\n\n $insert = array();\n foreach ($dataToInsert as $sourceCode => $data) {\n\n foreach ($data as $date => $value ) {\n\n $dateAr = \\Dagora\\CoreBundle\\Entity\\Data::convertDate($date);\n\n $date = $dateAr['date'];\n $dateType = $dateAr['dateType'];\n\n $insert[] = '('.$sources[ $sourceCode ].', '\n .$conn->quote($date, 'string').', '\n .$conn->quote($dateType, 'string').', '\n .$conn->quote($value, 'string').', now(), now())';\n }\n }\n\n $offset = 0;\n $MAX = 10000;\n $total = count($insert);\n\n //$this->output->writeln('Hay '.$total.' data points');\n\n while ( $offset < $total ) {\n\n $insertNow = array_slice($insert, $offset, $MAX);\n\n // hacer insert masivo\n $r = $conn->executeUpdate('INSERT INTO data (source_id, date, date_type, value, created_at, updated_at)\n VALUES '.join(',', $insertNow));\n\n $offset += $MAX;\n\n //$this->output->writeln(' ...añadidos '.$offset);\n }\n }", "public function importLiturgies(){\n\n\t\t\t$row = 1;\n\t\t\t$array = array();\n\t\t\t$marray = array();\n\t\t\t$handle = fopen('./tables/liturgies_combined.csv', 'r');\n\t\t\tif ($handle !== FALSE) {\n\t\t\t\twhile (($data = fgetcsv($handle, 0, \"\\t\")) !== FALSE) {\n\t\t\t\t\tif ($row === 1) {\n\t\t\t\t\t\t$num = count($data);\n\t\t\t\t\t\tfor ($i = 0; $i < $num; $i++) {\n\t\t\t\t\t\t\tarray_push($array, $data[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$c = 0;\n\t\t\t\t\t\tforeach ($array as $key) {\n\t\t\t\t\t\t\t$marray[$row - 1][$key] = $data[$c];\n\t\t\t\t\t\t\t$c++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\n\t\t\t\t$liturgiesSorted = array();\n\t\t\t\t\t\n\t\t\t\tfor($i = 1; $i < count($marray); $i++){\n\t\t\t\t\tif(!isset($marray[$i]['Kuerzel'])){\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$liturgiesSorted[$marray[$i]['Kuerzel']] = $marray[$i];\n\t\t\t\t}\n\t\t\t\tunset($marray);\t\t\n\t\t\t\treturn($liturgiesSorted); // returns sorted liturgies\n\t\t\t\n\t\t\t}\n }", "function importFile($filePath,$siteName) {\n\t\tglobal $uniqueId;\n\t\tprint \"Import Data from file: $filePath\\n<br />\";\n\t\t$fp = fopen($filePath,'r') or die(\"can't open file, $filePath\");\n\t\tdefine('NUM_SITE_VIEW_COLS_TO_READ',7);\t\t// number of columns of data to read from csv file to be inserted into siteViews table\n\t\t\n\t\tprint '<table border=\"1\">'.\"\\n\"; \n\t\tprint \"<tr><td>rating</td><td>timestamp</td><td>age</td><td>gender</td><td>city</td><td>state</td><td>country</td><td>tags</td></tr>\\n\";\n\t\t\n\t\t$columnNames = array('id', 'siteName', 'rating', 'timestamp', 'age', 'gender', 'city', 'state', 'country');\n\t\t$sqlStatements = array();\n\t\t$tagsSqlStatements = array();\n\t\twhile ($csv_line = fgetcsv($fp)) {\n\t\t\t$sqlStatement = \"INSERT INTO siteViews SET $columnNames[0]=$uniqueId, $columnNames[1]=\\\"$siteName\\\"\";\n\t\t\t// read up to where the tags start, to create sql insert statements for the siteViews\n\t\t\tfor ($i = 0; $i < NUM_SITE_VIEW_COLS_TO_READ; $i++) {\n\t\t\t\tprint '<td>'.$csv_line[$i].'</td>'.\"\\n\";\n\t\t\t\t$columnIndex = $i + 2;\n\t//\t\t\tprint \", $columnNames[$columnIndex]=$csv_line[$i]\\n\";\n\t\t\t\t$sqlStatement .= \", $columnNames[$columnIndex]=\\\"$csv_line[$i]\\\"\";\n\t\t\n\t\t\t}\n\t\t\t// read the tag information create SQL for the tags table\n\t\t\tfor ($i=NUM_SITE_VIEW_COLS_TO_READ; $i<count($csv_line); $i++) {\n\t\t\t\t$fields = explode(':',$csv_line[$i]);\n\t\t\t\tif (is_array($fields) && count($fields) > 1) {\n\t\t\t\t\t$tagSqlStatement = \"INSERT INTO tags SET viewId=$uniqueId, siteName=\\\"$siteName\\\", rating=\\\"$csv_line[0]\\\"\";\n\t\t\t\t\t$tagSqlStatement .= \", tag=\\\"$fields[0]\\\", count=\\\"$fields[1]\\\"\";\n\t\t\t\t\t$tagSqlStatements[] = $tagSqlStatement;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uniqueId += 1;\n\t\t\tprint \"</tr>\\n\";\n\t\t\t$sqlStatements[] = $sqlStatement;\n\t\t} \n\t\tprint \"</table>\\n\"; \n\t\tprint \"</body>\\n</html>\\n\";\n\t\tfclose($fp) or die(\"can't close file\");\n\t\texecuteSqlStatements($sqlStatements);\n\t\texecuteSqlStatements($tagSqlStatements);\n\t}", "public function importFromCsvFile($file)\n {\n if (!isset($file['tmp_name'])) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('Invalid file upload attempt.'));\n }\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $ratesRawData = $this->csvProcessor->getData($file['tmp_name']);\n // first row of file represents headers\n $fileFields = $ratesRawData[0];\n $validFields = $this->_filterFileFields($fileFields);\n $invalidFields = array_diff_key($fileFields, $validFields);\n $ratesData = $this->_filterReviewData($ratesRawData, $invalidFields, $validFields);\n // store cache array is used to quickly retrieve store ID when handling locale-specific tax rate titles\n $storesCache = $this->_composeStoreCache($validFields);\n $regionsCache = [];\n \n $db_in = \\Magento\\Framework\\App\\ObjectManager::getInstance()\n ->get('Magento\\Framework\\App\\ResourceConnection');\n $db_connection= $db_in->getConnection();\n \n foreach ($ratesData as $rowIndex => $dataRow) {\n // skip headers\n if ($rowIndex == 0) {\n continue;\n }\n \n $regionsCache = $this->_importRate($dataRow, $regionsCache, $storesCache, $db_connection);\n }\n }", "public function processImport(Request $request)\n\t{\n\n\t\t$importCsv = new ImportCsv;\n\t\t$csvData = $importCsv->getTmpCsv($request);\n\n\t\tif ($csvData === null || route('import_parse') !== \\URL::previous() ) {\n\t\t\treturn back();\n\t\t}\n\n\t\tif (!in_array('0', $_POST['fields']) || !in_array('1', $_POST['fields']) || !in_array('2', $_POST['fields']) || !in_array('3', $_POST['fields']) || count($_POST['fields']) != 4) {\n\t\t\treturn redirect('/errorparseimport')->with('status', 'Error! Make sure there is one of each fields set. No more or less.');\n\t\t}\n\n\t\t$csvData = array_slice($csvData, 1);\n\n\t\t$newArray = array();\n\t\tfor ($i = 0; $i < 4; $i++) {\n\t\t\t$newArray[$i] = array_search($i, $_POST['fields']);\n\t\t}\n\n\t\tforeach ($csvData as $data) {\n\t\t\t$dbData = array();\n\n\t\t\tfor ($i = 0; $i < count($newArray); $i++) {\n\t\t\t\t$db_field = $newArray[$i];\n\t\t\t\t$dbData[] = $data[$db_field];\n\t\t\t}\n\n\t\t\tif ($dbData[2] != null) {\n\t\t\t\t$dbData[2] = $dbData[2] . ' ' . $dbData[3];\n\t\t\t} else {\n\t\t\t\t$dbData[2] = $dbData[3];\n\t\t\t}\n\n\t\t\t$dbData[3] = $dbData[0] . '@mydavinci.nl';\n\n\t\t\t$errors = $this->validateRowData($dbData);\n\t\t\tif (empty($errors)) {\n\t\t\t\t$importCsv->saveCsv($dbData);\n\t\t\t}\n\t\t}\n\n\t\treturn redirect('importcsv')->with('status', 'success');\n\t}", "protected function parseCsv() {\r\n\t\t\r\n\t\t$csv_data = array();\r\n\t\twhile ($this->_currentRow = fgetcsv($this->_fileHandler, null, $this->_delimiter, $this->_enclosure)) {\r\n\t\t\t$csv_data[] = $this->_currentRow;\r\n\t\t}\r\n\t\t\r\n\t\t$this->_data = $csv_data;\r\n\t}", "function _load_source_data($sourceFile) {\n /*\n * empty receiving files in advance just in case\n */\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_import');\n CRM_Core_DAO::executeQuery('TRUNCATE TABLE kov_header');\n $csvSeparator = _check_separator($sourceFile);\n \n $sourceData = fopen($sourceFile, 'r');\n while ($sourceRow = fgetcsv($sourceData, 0, $csvSeparator)) {\n if (!_check_empty_sourcerow($sourceRow)) {\n $insFields = _get_import_record($sourceRow);\n if (!empty($insFields)) {\n $insImport = \"INSERT INTO kov_import SET \".implode(\", \", $insFields);\n CRM_Core_DAO::executeQuery($insImport);\n }\n }\n }\n fclose($sourceData);\n \n $kovHdrInsert = \"INSERT INTO kov_header (SELECT DISTINCT(kov_nr), vge_nr, corr_naam, \n ov_datum, vge_adres, type, prijs, notaris, tax_waarde, taxateur, tax_datum, \n bouwkundige, bouw_datum, definitief FROM kov_import)\";\n CRM_Core_DAO::executeQuery($kovHdrInsert);\n return TRUE;\n}", "public function importAction($file) {\n $row = 0;\n $countError = 0;\n $countInsert = 0;\n \n $content = file_get_contents($file);\n \n $rows = str_getcsv($content, \"\\n\");\n \n if (!empty($rows)) {\n $arrayToInsert = array();\n $nbrow = 0;\n\n $mobileTrafficModel = new mobileTrafficModel();\n //clean table before inserting new file\n $mobileTrafficModel->deleteAll();\n\n foreach ($rows as $row) {\n $resValidation = '';\n $columns = str_getcsv($row, ';');\n \n //check data row\n $resValidation = $this->validRow($columns);\n \n if (is_array($resValidation)) {\n $arrayToInsert[] = $resValidation;\n $countInsert++;\n }\n else {\n $countError++;\n }\n \n $nbrow++;\n }\n\n //muliple insert\n $msc=microtime(true);\n $multipleInsert = array_chunk($arrayToInsert, 10000);\n if (is_array($multipleInsert) && !empty($multipleInsert)) {\n foreach($multipleInsert as $dataToInsert) {\n $mobileTrafficModel->insertMobileTraffic($dataToInsert);\n }\n }\n\n $mobileTrafficModel->commit();\n }\n\n echo '<pre>-------------------------- End of import file with ' . $nbrow . ' rows. --------------------------</pre>';\n echo '<pre>-------------------------- Number of rows inserted in database : ' . $countInsert . '. --------------------------</pre>';\n echo '<pre>-------------------------- Number of rows with wrong data : ' . $countError . '. --------------------------</pre>';\n\n return true;\n }", "function readCsv($fileName) {\n\n\t// Lecture du fichier src :\n\t$myfile = fopen($fileName, \"r\") or die(\"Unable to open file!\");\n\t$dataStr = fread($myfile,filesize($fileName));\n\tfclose($myfile);\n\n\t$lines = explode(\"\\n\", $dataStr);\n\t$days = array();\n\n\tforeach ($lines as $line) {\n\t\t$temp = explode(\";\", $line);\n\t\tif (count($temp) == 2) {\n\t\t\tarray_push($days, new Day($temp[0], $temp[1]));\n\t\t}\n\t}\n\treturn $days;\n}", "public function setData()\n {\n if($this->url != null)\n {\n if (($handle = fopen($this->url, \"r\")) !== FALSE) {\n while (($rows = fgetcsv($handle)) !== FALSE) {\n foreach($rows as $row)\n {\n $this->data[$this->rowCount][] = $row;\n }\n $this->rowCount++;\n }\n fclose($handle);\n }\n }\n }", "abstract public function convert_from_csv($source);", "public function readData()\n\t{\n\t\t$filesForImporting = array();\n\t\t\n\t\t$this->_checkPathsExists();\n\t\t\n\t\tBackupImportLogger::setLogInfo('Unzipping '.basename($this->file).' in userfiles...');\n\t\t\n\t\t$backupManager = new BackupManager();\n\t\t$backupLocation = $backupManager->getBackupLocation(). 'temp_backup_zip/';\n\n\t\t// Remove old files\n\t\t$this->_removeFilesFromPath($backupLocation);\n\t\t\n\t\t$unzip = new \\Microweber\\Utils\\Unzip();\n\t\t$unzip->extract($this->file, $backupLocation, true);\n\n\t\t\n\t\tif ($backupLocation != false and is_dir($backupLocation)) {\n\t\t\tBackupImportLogger::setLogInfo('Media restored!');\n\t\t\t$copy = $this->_cloneDirectory($backupLocation, userfiles_path());\n\t\t}\n\t\t\n\t\t$mwContentJsonFile = $backupLocation. 'mw_content.json';\n\t\t\n\t\tif (is_file($mwContentJsonFile)) {\n\t\t\t$filesForImporting[] = array(\"file\"=>$mwContentJsonFile, \"reader\"=>\"json\");\n\t\t}\n\t\t\n\t\t// Find data to import\n\t\t$tables = $this->_getTableList();\n\t\t$supportedReaders = $this->_getSupportedReaders();\n\t\t$backupFiles = scandir($backupLocation);\n\t\tforeach ($backupFiles as $filename) {\n\t\t\t$file = $backupLocation . $filename;\n\t\t\tif (!is_file($file)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fileExtension = get_file_extension($file);\n\t\t\t$importToTable = str_replace('.'.$fileExtension, false, $filename);\n\n\t\t\t$addToImport = false;\n\t\t\t\n\t\t\tif (strpos($importToTable, 'backup_export') !== false) {\n\t\t\t\t$addToImport = true;\n\t\t\t}\n\n if (strpos($importToTable, 'mw_content') !== false && strpos($importToTable, '_lang') !== false) {\n $addToImport = true;\n }\n\t\t\t\n\t\t\tif (in_array($fileExtension, $supportedReaders) && in_array($importToTable, $tables)) {\n\t\t\t\t$addToImport = true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($addToImport) {\n\t\t\t\t$filesForImporting[] = array(\"file\"=>$file, \"importToTable\"=> $importToTable, \"reader\"=>$fileExtension);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif (empty($filesForImporting)) {\n\t\t\tBackupImportLogger::setLogInfo('The zip file has no files to import.');\n\t\t\treturn;\n\t\t}\n\n $detectedLanguages = array();\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], 'bg_lang') !== false) {\n $detectedLanguages[] = 'bg';\n }\n }\n\n if (!$this->language && !empty($detectedLanguages)) {\n BackupImportLogger::setLogInfo('Its detected other languages in this import.');\n return array('must_choice_language' => true, 'detected_languages'=>$detectedLanguages);\n }\n\n if ($this->language) {\n $selectedLanguageFile = false;\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], $this->language . '_lang') !== false) {\n $selectedLanguageFile = $file;\n break;\n }\n }\n // File for this language is found\n if ($selectedLanguageFile) {\n unset($filesForImporting);\n $filesForImporting[] = $selectedLanguageFile;\n } else {\n // Its not found this language\n // Remove all other lang files\n $newFilesForImporting = array();\n foreach ($filesForImporting as $file) {\n if (strpos($file['file'], '_lang') !== false) {\n continue;\n }\n $newFilesForImporting[] = $file;\n }\n $filesForImporting = $newFilesForImporting;\n }\n }\n \n\t\t// Decode files in zip\n\t\t$readedData = array();\n\t\tforeach ($filesForImporting as $file) {\n\t\t\t\n\t\t\t$readerClass = 'Microweber\\\\Utils\\\\Backup\\\\Readers\\\\' . ucfirst($file['reader']) . 'Reader';\n\t\t\t$reader = new $readerClass($file['file']);\n\t\t\t$data = $reader->readData();\n\t\t\t\n\t\t\tif (strpos($importToTable, 'backup_export') !== false) {\n\t\t\t\t$readedData = $data;\n\t\t\t} else if (strpos($importToTable, 'mw_content') !== false) {\n\t\t\t\t$readedData = $data;\n\t\t\t} else {\n\t\t\t\tif (!empty($data)) {\n\t\t\t\t\tif (isset($file['importToTable'])) {\n\t\t\t\t\t\t$readedData[$file['importToTable']] = $data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tif (empty($readedData)) {\n\t\t\tBackupImportLogger::setLogInfo('The files in zip are empty. Nothing to import.');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\treturn $readedData;\n\t}", "public function importFrom(array $data);", "public function importAction()\n\t{\n\t$file = $this->getRequest()->server->get('DOCUMENT_ROOT').'/../data/import/timesheet.csv';\n\t\tif( ($fh = fopen($file,\"r\")) !== FALSE ) {\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\twhile( ($data = fgetcsv($fh)) !== FALSE ) {\n\t\t\t\t$project = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Project')->find($data[1]);\n\t\t\t\tif( $project ) {\n\t\t\t\t\t$issues = $this->getDoctrine()->getRepository('DellaertDCIMBundle:Issue')->findBy(array('title'=>$data[2],'project'=>$data[1]));\n\t\t\t\t\tif( empty($issues) ) {\n\t\t\t\t\t\t$issue = new Issue();\n\t\t\t\t\t\t$issue->setProject($project);\n\t\t\t\t\t\t$issue->setTitle($data[2]);\n\t\t\t\t\t\t$issue->setRate($project->getRate());\n\t\t\t\t\t\t$issue->setEnabled(true);\n\t\t\t\t\t$issue->setStatsShowListOnly(false);\n\t\t\t\t\t\t$issue->preInsert();\n\t\t\t\t\t\t$em->persist($issue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$issue = $issues[0];\n\t\t\t\t\t}\n\t\t\t\t\t$workentry = new WorkEntry();\n\t\t\t\t\t$workentry->setIssue($issue);\n\t\t\t\t\t$workentry->setDate(new \\DateTime($data[0]));\n\t\t\t\t\t$workentry->setAmount($data[4]);\n\t\t\t\t\t$workentry->setDescription($data[3]);\n\t\t\t\t\t$workentry->setEnabled(true);\n\t\t\t\t\t$workentry->preInsert();\n\t\t\t\t\t$em->persist($workentry);\n\t\t\t\t\t$em->flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->render('DellaertDCIMBundle:WorkEntry:import.html.twig');\n\t}", "function import_csv($obj)\n\t{\n\t\t$param_array = func_get_args();\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\t\t$row = 0;\n\t\t\t\n\t\t\t$handle = fopen($obj->csv_file_path, \"r\");\n\t\t\t\n\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) \n\t\t\t{\n\t\t\t\t\n\t\t\t\tif($row > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->primary_fld, $obj->primary_fld . \" = '\" . $data[0] . \"'\");\n\t\t\t\t\t\n\t\t\t\t\tif($res[1] > 0)\n\t\t\t\t\t{//update the record\n\t\t\t\t\t\t$cond = $obj->primary_fld . \" = '\" . $data[0] . \"'\";\n\t\t\t\t\t\tdatabase_manipulation::update_record($obj, $cond, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{//insert the record\n\t\t\t\t\t\tdatabase_manipulation::insert_record($obj, \"csv\", $data);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\t\n\t\t\tfclose($handle);\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::import_csv() - Return Value : ', 'Importing Csv Data Into the Database.', true);\n\n\t}", "function readdata($filename) {\n global $CFG;\n \n $unique_code = time();\n $temp_dir = $CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code;\n $this->temp_dir = $temp_dir;\n //failures we cannot handle\n if (!$this->check_and_create_import_dir($unique_code)) {\n error(\"Could not create temporary directory\");\n return;\n }\n if(!is_readable($filename)) {\n error (\"Could not read uploaded file\");\n return;\n }\n if (!copy($filename, \"$temp_dir/webwork.zip\")) {\n error(\"Could not copy backup file\");\n return;\n }\n if(!unzip_file(\"$temp_dir/webwork.zip\", '', false)) {\n print \"filename: $filename<br />tempdir: $temp_dir <br />\";\n error(\"Could not unzip file.\");\n return; \n }\n $data = array();\n //open the directory\n $this->process_directory($data,$temp_dir);\n return $data;\n }", "public static function parseImportFile($path)\n {\n $data = null;\n $columns = null;\n $output = array();\n\n // Work out some basic config settings\n \\Config::load('format', true);\n\n // Work out the format from the extension\n $pathinfo = pathinfo($path);\n $format = strtolower($pathinfo['extension']);\n\n // Stop if we don't support the format\n if (!static::supportsFormat($format)) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_format_unknown'));\n }\n\n // Work out how to parse the data\n switch ($format) {\n case 'xls':\n case 'xlsx':\n\n $data = \\Format::forge($path, 'xls')->to_array();\n $first = array_shift($data);\n $columns = is_array($first) ? array_filter(array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_values($first))) : array();\n \n break;\n default:\n\n $data = @file_get_contents($path);\n if (strpos($data, \"\\n\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\n\");\n } else if (strpos($data, \"\\r\") !== false) {\n \\Config::set('format.csv.regex_newline', \"\\r\");\n }\n $data = \\Format::forge($data, $format)->to_array();\n\n // Find out some stuff...\n $first = \\Arr::get($data, '0');\n $columns = is_array($first) ? array_map(function($key) {\n return \\Inflector::friendly_title($key, '_', true);\n }, array_keys($first)) : array();\n\n break;\n }\n\n if (count($columns) > 0) {\n foreach ($data as $num => $row) {\n $values = array_values($row);\n $filtered = array_filter($values);\n if (count($values) > count($columns)) {\n $values = array_slice($values, 0, count($columns));\n } else if (count($values) < count($columns)) {\n while (count($values) < count($columns)) {\n $values[] = null;\n }\n }\n if (!empty($filtered)) $output[] = array_combine($columns, $values);\n }\n } else {\n $columns = $data = $output = null;\n }\n\n // Stop if there's no data by this point\n if (!$data) {\n throw new \\Exception(\\Lang::get('admin.errors.import.file_parse_error'));\n }\n\n return array(\n 'columns' => $columns,\n 'data' => $output\n );\n }", "public function prepareImport();", "function importCSV($cols = array())\n {\n $cols = array_change_key_case(array_keys($this->options));\n \n $inputValues[] = array(); // source for db insert values\n $row = 0;\n $num = 0;\n $status = FALSE;\n $csv_url = $this->csv_url . '&f='. implode('', $this->options) .'&s='. implode(',', $this->current_symbols);\n\n if (($handle = fopen($csv_url, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, count($this->options), \",\")) !== FALSE) {\n $num = count($data);\n for ($c = 0; $c < count($cols); $c++) {\n $inputValues[$row][$cols[$c]] = $data[$c];\n }\n $row++;\n }\n fclose($handle);\n \n if(count($inputValues) > 0)\n {\n $this->db->empty_table($this->csv_import_table);\n $this->db->insert_batch($this->csv_import_table, $inputValues); \n if($this->db->affected_rows() > 0)\n $status = TRUE;\n\t\t\t\telse {\n\t\t \t\t$status = 'Inserts failed';\n\t\t \t\tlog_message('error', $status . ': Yahoo finance csv data insert failed.');\n\t\t\t\t}\n }\n\t \telse {\n\t\t\t\t$status = 'Nothing to import';\n\t\t\t\tlog_message('error', $status . ': Yahoo finance csv data insert array was empty.');\n\t \t}\n\n }\n else {\n $status = 'Network error';\n log_message('error', $status .': Yahoo finance csv download url could not be read.');\n }\n return $status;\n }", "public function extractHistorical($document, $stockID) {\n\t\t\t\n\t\t\t//used to ignore first line of CSV file\n\t\t\t$isFirst = true;\n\t\t\t//parse CSV file into lines\n\t\t\t$sourceLines = str_getcsv($document, \"\\n\");\n\t\t\t//connect to database\n\t\t\t$this->dbConnection->connect();\n\t\t\t//prepare insertion statement\n\t\t\t$this->dbConnection->prepare($this->query->insert_historical());\n\t\t\t//for each line\n\t\t\tforeach($sourceLines as $line) {\n\t\t\t\t//parse contents of each line into an array\n\t\t\t\t$contents = str_getcsv( $line );\n\t\t\t\t\n\t\t\t\t//skip first line\n\t\t\t\tif ($isFirst) {\n\t\t\t\t\t$isFirst = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//bind necessary values to SQL statement\n\t\t\t\t$this->dbConnection->bind(1, $stockID);\n\t\t\t\t$this->dbConnection->bind(2, $contents[0]);\n\t\t\t\t$this->dbConnection->bind(3, $contents[1]);\n\t\t\t\t$this->dbConnection->bind(4, $contents[2]);\n\t\t\t\t$this->dbConnection->bind(5, $contents[3]);\n\t\t\t\t$this->dbConnection->bind(6, $contents[4]);\n\t\t\t\t$this->dbConnection->bind(7, $contents[5]);\n\t\t\t\t$this->dbConnection->bind(8, $contents[6]);\n\t\t\t\t\n\t\t\t\t//execute query\n\t\t\t\t$this->dbConnection->execute();\n\t\t\t}\n\t\t\t//disconnect from databases\n\t\t\t$this->dbConnection->disconnect();\n\t\t}", "public function import(String $file)\n {\n $reader = new readCsv;\n $spreadsheet = $reader->load($file);\n $cells = $spreadsheet->getActiveSheet()->getCellCollection();\n\n for($i = 1; $i < 27; $i++) {\n if (!empty($spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue())) {\n $dataColName[$spreadsheet->getActiveSheet()->getCellByColumnAndRow($i, 1)->getValue()] = $i;\n }\n }\n\n DB::transaction(function () use($cells, $spreadsheet, $dataColName){\n for ($row = 2; $row <= $cells->getHighestRow(); $row++) {\n if (isset($dataColName['title'])) {\n $title = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['title'], $row)->getValue();\n $data['title'] = $title;\n }\n\n if (isset($dataColName['description'])) {\n $descrription = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['description'], $row)->getValue();\n $data['descrription'] = $descrription;\n }\n\n if (isset($dataColName['organization'])) {\n $organization = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['organization'], $row)->getValue();\n $data['organization'] = $organization;\n }\n\n if (isset($dataColName['start'])) {\n $start = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['start'], $row)->getValue();\n $data['start'] = $start;\n }\n\n if (isset($dataColName['end'])) {\n $end = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['end'], $row)->getValue();\n $data['end'] = $end;\n }\n\n if (isset($dataColName['role'])) {\n $role = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['role'], $row)->getValue();\n $data['role'] = $role;\n }\n\n if (isset($dataColName['link'])) {\n $link = $spreadsheet->getActiveSheet()->getCellByColumnAndRow($dataColName['link'], $row)->getValue();\n $data['link'] = $link;\n }\n\n if (isset($dataColName['type'])) {\n $type = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['type'], $row)->getValue();\n $data['type'] = $type;\n }\n\n if (isset($dataColName['skills'])) {\n $skills = $spreadsheet->getActiveSheet()\n ->getCellByColumnAndRow($dataColName['skills'], $row)->getValue();\n }\n\n $validator = Validator::make($data, $this->rules());\n\n if ($validator->fails()) {\n DB::rollback();\n\n return redirect()->route('admin.project.import')->withErrors($validator->errors());\n }\n\n $project = Project::create($data);\n\n if (isset($skills)) {\n $skills = explode(',', $skills);\n\n foreach ($skills as $skill) {\n ProjectSkill::create(['project_id' => $project->id, 'value' => $skill]);\n }\n }\n }\n });\n }", "public function undoImport() \n\t{\n $this->status = self::STATUS_IN_PROGRESS_UNDO_IMPORT;\n\t $this->save();\n\t \n\t // delete imported items\n $itemLimitPerQuery = self::UNDO_IMPORT_LIMIT_PER_QUERY; \n\t $db = get_db();\n $iit = $db->getTable('CsvImport_ImportedItem');\n $it = $db->getTable('Item');\n \n $sql = $iit->getSelect()->where('`import_id` = ?')->limit($itemLimitPerQuery);\n $importedItems = $iit->fetchObjects($sql, array($this->id));\n \n while(count($importedItems) > 0) {\n foreach($importedItems as $importedItem) {\n $itemId = $importedItem->getItemId();\n $item = $it->find($itemId);\n if ($item) {\n $item->delete();\n }\n $importedItem->delete();\n }\n $sql = $iit->getSelect()->where('`import_id` = ?')->limit($itemLimitPerQuery);\n $importedItems = $iit->fetchObjects($sql, array($this->id)); \n } \n \n $this->status = self::STATUS_COMPLETED_UNDO_IMPORT;\n $this->save();\n\t}", "public function testFileToArrayAssertsCorrect()\n {\n $this->createImportFile();\n $response = $this->importer->import('test.csv');\n\n $this->assertSame([\n \"user_id\" => \"3121\",\n \"created_at\" => \"2016-07-19\",\n \"onboarding_perentage\" => \"40\",\n \"count_applications\" => \"0\",\n \"count_accepted_applications\" => \"0\"\n ], $response[0]);\n\n $this->destroyFile();\n }", "public function testWithEmptyFile()\n {\n $config = array(\n 'file' => realpath(dirname(__FILE__)).'/../csv/empty.csv',\n 'skip_lines' => 1,\n 'header_line' => -1\n );\n\n $node_csv = new \\Giift\\Etl\\Extractor\\Csv($config);\n $node_csv->addOutput($this->node_loader);\n\n $node_csv->extract();\n\n $rs = $this->node_loader->getResult();\n\n $this->assertNotNull($rs);\n $this->assertEmpty($rs);\n }", "public function importer_cron()\n\t{\n\t\tDBTP_Utils::log('Importer started');\n\n\t\t$importManager = new DBTP_Import_Manager();\n\t\t$schedule = $importManager->schedule_imports();\n\n\t\tif (is_wp_error($schedule)) {\n\t\t\tDBTP_Utils::log('Importer error: '. $schedule->get_error_message());\n\t\t} else {\n\t\t\tDBTP_Utils::log('Imported has been scheduled');\n\t\t}\n\t}", "private function readHeaderRow() {\n\n // Grab the line as items\n $csvLine = $this->stream->readCSVLine($this->separator, $this->enclosure);\n\n // Create fields from these\n $columns = [];\n foreach ($csvLine as $column) {\n // Expand out the title and the name\n $name = StringUtils::convertToCamelCase(trim($column));\n $columns[] = new Field($name);\n }\n\n $this->csvColumns = $columns;\n }", "public function importFromCSV() {\n $usernames = array();\n if (($handle = fopen ( public_path () . '/top.csv', 'r' )) !== FALSE) {\n while ( ($data = fgetcsv ( $handle, 1000, ',' )) !== FALSE ) {\n\n array_push($usernames, $data );\n\n }\n fclose ( $handle );\n }\n\n $new_users = array();\n $existing_users = array();\n //loop through users to chec against database\n foreach ($usernames as $key => $user) {\n $name = $user[0];\n $user = DB::table('end_users')->where('nick', $name)->first();\n\n if(!$user) {\n $user = new EndUser;\n $user->nick = $name;\n $user->twitch_id = 0;\n $user->foreign_user_id = 0;\n $user->email = $name.'@asd.hu';\n $user->avatar_url = '';\n $user->api_token = bin2hex(openssl_random_pseudo_bytes(30));\n if($user->save()) {\n array_push($new_users, $name);\n }\n } else {\n array_push($existing_users, $name);\n }\n\n //return $user[0];\n }\n\n return [\n 'existing_users' => $existing_users,\n 'new_users'=> $new_users\n ];\n\n }", "public function csvImport(Request $request)\n {\n Excel::import(new CustomersImport, $request->file('csv')->store('temp'));\n return back();\n }", "public function uploadCommissionReport($commission_report){\n $file = $commission_report['tmp_name']; \n $handle = fopen($file,\"r\"); \n \n // unset the first line like this \n fgets($handle);\n\n // created loop here\n while (($data = fgetcsv($handle, 1000, ',')) !== FALSE) {\n \n date_default_timezone_set('America/New_York');\n $purchase_date = date('Y-m-d', strtotime($data[4])); \n $date_activated = date('Y-m-d', strtotime($data[7])); \n \n if($data[0]!=\"\"){ \n $query = \"INSERT INTO \".RDAMS_COMMISIONS.\" (dealer_id,\n dealer_name,\n sim_no,\n market,\n purchase_date,\n sold_price,\n plan,\n date_activated,\n pin_no,\n item_description,\n item_name,\n category_name,\n commision,\n commision_type) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t\t\t\n $stmt = $this->db->prepare($query);\n\n $stmt->bindParam(1, $data[0]); \n $stmt->bindParam(2, $data[1]);\n $stmt->bindParam(3, $data[2]);\n $stmt->bindParam(4, $data[3]);\n $stmt->bindParam(5, $purchase_date); \n $stmt->bindParam(6, $data[5]);\n $stmt->bindParam(7, $data[6]);\n $stmt->bindParam(8, $date_activated);\n $stmt->bindParam(9, $data[8]);\n $stmt->bindParam(10, $data[9]);\n $stmt->bindParam(11, $data[10]);\n $stmt->bindParam(12, $data[11]);\n $stmt->bindParam(13, $data[12]);\n $stmt->bindParam(14, $data[13]);\n\n $stmt->execute();\n } \n }\n fclose($handle);\n return $success=1;\n }", "public function importExternalData($source){\n //importing data into db\n $this->log(\"importing external: $source...\");\n $res = $this->importer->importCsv($source);\n $this->log(\"import finished : \\n\".print_r($res, true));\n\n }", "public function import_csv_products($upload_path)\n\t{\n\t\t$this->load->model('admin/file_model');\n\t\t/*\n\t\t\t-----------------------------------------------------------------------------------------\n\t\t\tUpload csv\n\t\t\t-----------------------------------------------------------------------------------------\n\t\t*/\n\t\t$response = $this->file_model->upload_csv($upload_path, 'import_csv');\n\t\t\n\t\tif($response['check'])\n\t\t{\n\t\t\t$file_name = $response['file_name'];\n\t\t\t\n\t\t\t$array = $this->file_model->get_array_from_csv($upload_path.'/'.$file_name);\n\t\t\t//var_dump($array); die();\n\t\t\t$response2 = $this->sort_csv_data($array);\n\t\t\n\t\t\tif($this->file_model->delete_file($upload_path.\"\\\\\".$file_name, $upload_path))\n\t\t\t{\n\t\t\t}\n\t\t\t\n\t\t\treturn $response2;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', $response['error']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function uploadData()\n {\n\n $count=0;\n $fp = fopen($_FILES['file']['name'],\n \t\t\t$_FILES['file']['tmp_name'],'r') or die(\"can't open file\");\n while($csv_line = fgetcsv($fp,1024))\n {\n $count++;\n if($count == 1)\n {\n continue;\n }//keep this if condition if you want to remove the first row\n for($i = 0, $j = count($csv_line); $i < $j; $i++)\n {\n $insert_csv = array();\n //$insert_csv['id'] = $csv_line[0];//remove if you want to have primary key,\n $insert_csv['category_name'] = $csv_line[0];\n $insert_csv['unit_name'] = $csv_line[1];\n $insert_csv['tax_name'] = $csv_line[2];\n $insert_csv['item_name'] = $csv_line[3];\n $insert_csv['item_description'] = $csv_line[4];\n $insert_csv['purchase_price'] = $csv_line[5];\n $insert_csv['sales_price'] = $csv_line[6];\n\n }\n $i++;\n $data = array(\n 'category_name' => $insert_csv['category_name'],\n 'unit_name' => $insert_csv['unit_name'],\n 'tax_name' => $insert_csv['tax_name'],\n 'item_name' =>$insert_csv['item_name'],\n 'item_description' =>$insert_csv['item_description'],\n 'purchase_price' =>$insert_csv['purchase_price'],\n 'sales_price' =>$insert_csv['sales_price']);\n\n $data['crane_features']=$this->db->insert('import',$data);\n }\n fclose($fp) or die(\"can't close file\");\n $data['success']=\"success\";\n return $data;\n }", "function getDailyCsvFile(){\n\t\t$dailyCsv = \"Registrazione_\" . date(\"Y\"). \"-\" .date(\"m\"). \"-\" .date(\"d\") . \".csv\";\n \t\treturn $dailyCsv;\n\t}", "public function process(): void\n {\n foreach ($this->connection->list() as $filename) {\n $localFile = 'import_' .\n uniqid((string)\\Magento\\Framework\\Math\\Random::getRandomNumber(), true) .\n time() . '.' .\n pathinfo($filename, PATHINFO_EXTENSION);\n\n if ($this->connection->read($filename, $this->tmpDirectory->getAbsolutePath($localFile))) {\n if (!$this->tmpDirectory->isWritable($localFile)) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('Cannot create a target file for reading.')\n );\n }\n }\n\n $source = $this->getSourceAdapter($this->tmpDirectory->getAbsolutePath($localFile));\n\n foreach ($source as $line) {\n $data = array_values($line);\n $this->stockImport->import($data);\n }\n }\n }", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function importCSV($filePath, $bibstart) {\n\t\t$keyMap = array('activeid' => 0, 'lastname' => 1, 'firstname' => 2, 'address1' => 3, 'city' => 4, 'state' => 5, 'zipcode' => 6, 'email' => 7, 'age' => 8, 'sex' => 9, 'size' => 10, 'event' => 11, 'division' => 12, 'team' => 13, 'registration' => 14);\n\t\t$db = Zend_Db_Table_Abstract::getDefaultAdapter();\n\t\t$lineCount = 0;\n\t\t$recordsInserted = 0;\n\t\t$recordsRead = 0;\n\t\t$bibNumber = $bibstart;\n\n\t\tif (($handle = fopen($filePath, \"r\")) !== FALSE) {\n\n\t\t\twhile (($data = fgetcsv($handle, 100000, \",\")) !== FALSE) {\n\t\t\t\t$lineCount++;\n\t\t\t\t$insertData = array();\n\n\t\t\t\tif ($lineCount >= 2) {//SKIP THE HEADER\n\t\t\t\t\tforeach ($keyMap as $key => $column) {\n\t\t\t\t\t\t//teamname special rules\n\t\t\t\t\t\tif ($key == 'team') {\n\t\t\t\t\t\t\t//get both teamname fields and insert them in the proper place\n\t\t\t\t\t\t\t$insertData[$key] = $data[$column] . $data[15];\n\n\t\t\t\t\t\t} elseif ($key == 'size') {\n\t\t\t\t\t\t\t$result = $this -> findLike('sid', $key, $data[$column]);\n\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$insertData[$key] = 8;\n\t\t\t\t\t\t\t\t//unknown size\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//division special rules, dont set if already set by event\n\t\t\t\t\t\t} elseif ($key == 'division') {\n\t\t\t\t\t\t\tif (!isset($insertData['division'])) {\n\t\t\t\t\t\t\t\t$result = $this -> findLike('did', $key, $data[$column]);\n\t\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$insertData[$key] = 1;\n\t\t\t\t\t\t\t\t\t//default to NONE\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//event special rules HALFC causes overwrite of division and event to HALF\n\t\t\t\t\t\t} elseif ($key == 'event') {\n\t\t\t\t\t\t\tif ($data[$column] == \"HALFC\") {\n\t\t\t\t\t\t\t\t$insertData[$key] = 6;\n\t\t\t\t\t\t\t\t//event value\n\t\t\t\t\t\t\t\t$insertData['division'] = 5;\n\t\t\t\t\t\t\t\t//division value\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$result = $this -> findLike('eid', $key, $data[$column]);\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//registration special rules\n\t\t\t\t\t\t} elseif ($key == 'registration') {\n\t\t\t\t\t\t\t$result = $this -> findLike('rid', $key, $data[$column]);\n\t\t\t\t\t\t\tif (sizeof($result)) {\n\t\t\t\t\t\t\t\t$insertData[$key] = $result;\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$insertData[$key] = 3;\n\t\t\t\t\t\t\t\t// Default To Packet Pickup\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$insertData[$key] = $data[$column];\n\t\t\t\t\t\t}\n\t\t\t\t\t}// do insert with verified free bib number and only if activeid is unique\n\t\t\t\t\t$recordsRead++;\n\t\t\t\t\tif ($this -> checkConflicts($bibNumber, $insertData['activeid'])) {\n\t\t\t\t\t\t$insertData['bibnumber'] = $bibNumber;\n\t\t\t\t\t\t$db -> insert('participant', $insertData);\n\t\t\t\t\t\t$recordsInserted++;\n\t\t\t\t\t\t$bibNumber++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'success', 'text' => 'CSV Import Complete, Last Bib: ' . $bibNumber . \" Read: \" . $recordsRead . \" Inserted: \" . $recordsInserted);\n\t\t\t$this -> _redirect('/csvinterface');\n\n\t\t}\n\n\t}", "public function import($type) {\n $this -> clear();\n if ($this -> lines == \"\") {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n } else {\n // Pairs of values <Csv column header> => <eFront DB field>\n $this -> types = EfrontImport::getTypes($type);\n // Pairs of values <eFront DB field> => <import file column>\n $this -> mappings = $this -> parseHeaderLine(&$headerLine);\n if ($this -> mappings) {\n if ($this -> checkImportEssentialField($type)) {\n if ($type == 'users_to_groups' || $type == 'users') {\n $data = array();\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data[] = $this -> parseDataLine($line);\n }\n $this -> importDataMultiple($type, $data);\n } else {\n for ($line = $headerLine+1; $line < $this -> lines; ++$line) {\n $data = $this -> parseDataLine($line);\n $this -> importData($line+1, $type, $data);\n }\n }\n }\n } else {\n $this -> log[\"failure\"][\"missingheader\"] = _NOHEADERROWISDEFINEDORHEADERROWNOTCOMPATIBLEWITHIMPORTTYPE;\n }\n }\n return $this -> log;\n }", "function convertCSVToArray($fileName){\n\n $csv = file_get_contents($fileName);\n $array = array_map(\"str_getcsv\", explode(\"\\n\", $csv));\n $returnArray = array();\n // removes header\n array_splice($array, 0, 1);\n\n foreach($array as $key => $item){\n //checks to make sure the offset is set\n if(isset($item[0])){\n $tempArry['latitude'] = $item[0];\n $tempArry['longitude'] = $item[1];\n $tempArry['bright_ti4'] = $item[2];\n $tempArry['scan'] = $item[3];\n $tempArry['track'] = $item[4];\n $tempArry['acq_date'] = $item[5];\n $tempArry['acq_time'] = $item[6];\n $tempArry['satellite'] = $item[7];\n $tempArry['confidence'] = $item[8];\n $tempArry['version'] = $item[9];\n $tempArry['bright_ti5'] = $item[10];\n $tempArry['frp'] = $item[11];\n $tempArry['daynight'] = $item[12];\n array_push($returnArray, $tempArry);\n }\n }\n return $returnArray; // contains nice new data\n}", "public function importFile( $file )\n {\n $isHeader = true;\n\n $rowCount = - 1;\n while ( ! $file->eof() ) {\n $row = $file->fgetcsv();\n\n if ( $this->isRowEmpty( $row ) ) {\n continue;\n }\n\n $rowCount ++;\n\n if ( $isHeader ) {\n $isHeader = false;\n // remove leading BOM if exists\n $row[0] = str_replace( \"\\xEF\\xBB\\xBF\", '', $row[0] );\n\n\n if ( ! $this->areAllExpectedFieldsPresentInRow( $row ) ) {\n throw new ImportException( \"Les champs du fichier doivent inclure:\" . $this->getDisplayImportFields() );\n }\n\n foreach ( $row as $index => $headerValue ) {\n $this->importFieldsToColNumber[$headerValue] = $index;\n }\n\n continue;\n }\n\n \\DB::beginTransaction();\n $this->extractRow( $row, $rowCount + 1 );\n \\DB::commit();\n }\n\n return $rowCount;\n }", "function importStreets($cityCode) {\n $data = array();\n if ($GLOBALS[\"handle\"]) {\n while (($line = fgetcsv($GLOBALS[\"handle\"])) !== false) { \n if (sprintf(\"%04d\\n\", $line[1]) == $cityCode) {\n $identify = rtrim(sprintf(\"%04d\\n\", $line[1])).ltrim(sprintf(\"%04d\\n\", $line[3]));\n $data[$identify] = array(\"cityCode\"=>$line[1], \"cityName\"=>$line[2], \"streetCode\"=>$line[3], \"streetName\"=>$line[4]);\n } \n }\n fclose($GLOBALS[\"handle\"]);\n ksort($data); //sort the array by identify key\n } else { \n return 0; //error read file \n }\n return $data;\n}", "private function parseCsvLine($line)\n\t{\n\n\t\t$data = str_getcsv($line);\n\t\t// different count of data cols than header cols, bad CSV\n\t\tif (count($data) != $this->colsNum && count($data) != 1)\n\t\t{ // == 1 probably last empty line\n\t\t\t// different number of cols than in header, file is not in correct format\n\t\t\treturn false;\n\t\t}\n\t\t$dataLine = new CsvLine($data[$this->colsOrder[\"CATEGORIES\"]],\n\t\t\t$data[$this->colsOrder[\"SUMMARY\"]],\n\t\t\t$data[$this->colsOrder[\"DTSTART\"]],\n\t\t\t$data[$this->colsOrder[\"DTEND\"]]);\n\t\tforeach ($this->colsOrder as $col => $order)\n\t\t{\n\t\t\tswitch ($col)\n\t\t\t{\n\t\t\t\tcase \"TIMEZONE\":\n\t\t\t\t\t$dataLine->setTimezone($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"LOCATION\":\n\t\t\t\t\t$dataLine->setLocation($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DTSTAMP\":\n\t\t\t\t\t$dataLine->setDtstamp($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-EXTRAINFO\":\n\t\t\t\t\t$dataLine->setExtraInfo($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"X-COLOR\":\n\t\t\t\t\t$dataLine->setColor($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CONTACT\":\n\t\t\t\t\t$dataLine->setContact($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DESCRIPTION\":\n\t\t\t\t\t$dataLine->setDescription($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"RRULE\":\n\t\t\t\t\t$dataLine->setRrule($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"UID\":\n\t\t\t\t\t$dataLine->setUid($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CATEGORIES\":\n\t\t\t\tcase \"SUMMARY\":\n\t\t\t\tcase \"DTSTART\":\n\t\t\t\tcase \"DTEND\":\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"NOENDTIME\":\n\t\t\t\t\t$dataLine->setNoendtime($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"PUBLISHED\":\n\t\t\t\t\t$dataLine->setPublished($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MULTIDAY\":\n\t\t\t\t\t$dataLine->setMultiday($data[$order]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"lockevent\":\n\t\t\t\t\t$dataLine->lockevent = $data[$order];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$dataLine->customField($data[$order], $col);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $dataLine;\n\n\t}", "protected function load_csv_data() {\n $dataset = $this->createCsvDataSet(array(\n 'user' => elis::component_file('program', 'tests/fixtures/mdluser.csv'),\n 'user_info_field' => elis::component_file('program', 'tests/fixtures/user_info_field.csv'),\n 'user_info_data' => elis::component_file('program', 'tests/fixtures/user_info_data.csv'),\n user::TABLE => elis::component_file('program', 'tests/fixtures/pmuser.csv'),\n usermoodle::TABLE => elis::component_file('program', 'tests/fixtures/usermoodle.csv'),\n field::TABLE => elis::component_file('program', 'tests/fixtures/user_field.csv'),\n field_owner::TABLE => elis::component_file('program', 'tests/fixtures/user_field_owner.csv'),\n userset::TABLE => elis::component_file('program', 'tests/fixtures/userset.csv')\n ));\n $dataset = new PHPUnit_Extensions_Database_DataSet_ReplacementDataSet($dataset);\n $dataset->addSubStrReplacement('\\n', \"\\n\");\n $this->loadDataSet($dataset);\n }", "public function setUp() {\n $this->csv = new Csv();\n $this->csv->auto(__DIR__ . '/../example_files/single_column.csv');\n\n // Remove last 2 lines to simplify comparison\n unset($this->csv->data[2], $this->csv->data[3]);\n\n $temp_dir = str_replace(\"\\\\\", '/', sys_get_temp_dir());\n if (substr($temp_dir, -1) != '/') {\n // From the PHP.net documentation:\n // This function does not always add trailing slash. This behaviour\n // is inconsistent across systems.\n $temp_dir .= '/';\n }\n $this->temp_filename = $temp_dir . 'parsecsv_test_file.csv';\n }", "public function importDataOLT()\n {\n $data = $this->varBatchImportOLT;\n $this->db->insert_batch('rekap_data_olt', $data);\n }", "public function next(): void\n {\n $this->values = [];\n $row = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n\n if ($row) { // Is het einde (eof) nog niet bereikt?\n if ($row === array(null)) { // Empty row?\n $this->next(); // Skip row\n return;\n }\n ++$this->index;\n foreach ($this->keys as $index => $key) {\n if (isset($row[$index])) { // Is er voor deze kolom een waarde?\n $this->values[$key] = $row[$index];\n } else {\n $filename = (strpos($this->filename, \\Sledgehammer\\PATH) === 0) ? substr($this->filename, strlen(\\Sledgehammer\\PATH)) : $this->filename; // Waar mogelijk het PATH er van af halen\n \\Sledgehammer\\notice('Row too short, missing column #' . ($index + 1) . ': \"' . $this->keys[$index] . '\" in ' . $filename . ' on line ' . ($this->index + 2), $row); // @todo Calculate line offset compared to the index ()\n }\n }\n } else {\n $this->index = null;\n }\n }", "public function importData()\n {\n # Form submit\n if (Request::isMethod('post'))\n {\n $datafile = Input::file('datafile');\n\n if (!is_null($datafile) && $datafile->getClientOriginalExtension() == 'csv') {\n if (($handle = fopen($datafile->getRealPath(), 'r')) !== FALSE) {\n $locales = Lang::allLocales();\n $columns = fgetcsv($handle, 1000, \",\");\n\n if (count($columns) == ((count($locales) * 3) + 1)) {\n $newFiles = [];\n $oldFiles = [];\n\n // Prepare column names\n foreach ($columns as &$column) $column = str_replace(' ', '_', strtolower($column));\n\n // Import data\n while (($row = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n $file = FileLibrary::find(intval($row[0]));\n\n if (!is_null($file)) {\n $data = array_combine($columns, $row);\n\n foreach ($locales as $lang => $langName) {\n if (empty(trim($data[$lang . '_name']))) $data[$lang . '_name'] = $file->languages[$lang]->file_path;\n\n if ($data[$lang . '_name'] != $file->languages[$lang]->file_path) {\n File::copy($file->languages[$lang]->file_path, $data[$lang . '_name']);\n $newFiles[] = $data[$lang . '_name'];\n $oldFiles[] = $file->languages[$lang]->file_path;\n } else {\n $newFiles[] = $file->languages[$lang]->file_path;\n }\n\n FileLibraryLanguage::where(['file_id' => $data['id'], 'lang' => $lang])->update(['file_path' => $data[$lang . '_name'], 'title' => $data[$lang . '_title'], 'alt' => $data[$lang . '_alt']]);\n }\n }\n }\n\n // Delete old files\n $oldFiles = array_diff($oldFiles, $newFiles);\n\n if (!empty($oldFiles)) {\n foreach ($oldFiles as $path) {\n $thumbs = File::glob('thumbs/' . substr($path, 0, strrpos($path, '.')) . '-*');\n File::delete($thumbs);\n File::delete($path);\n }\n }\n\n Alert::success('Files updated successfully.');\n\n fclose($handle);\n } else {\n Alert::error('File format is wrong. Please export the latest format first then upload.');\n }\n }\n } else {\n Alert::error('Uploaded file is invalid.');\n }\n }\n\n # Breadcrumbs\n Breadcrumbs::add('Files Library', URL::admin('files-library'));\n Breadcrumbs::add('Import Files Data', URL::admin('files-library/import'));\n\n # Load view\n return View::make('admin.files_library.import');\n }", "function import_subscriptions($delim=',', $encl=false, $sample='', $def_format='TEXT', $header_row=true) {\n\tglobal $db;\n\t$email_elem=false; $format_elem=false;\t$error = '';\n\n\t$sample_arr = explode(' ',trim($sample)); $elems = count($sample_arr);\n $email_elem = array_search('email',$sample_arr);\n $format_elem = array_search('format',$sample_arr);\n\n\tif($email_elem===false) { $error = 'Upload failed: No email element specified.'; }\n $import_file = $_FILES['subscriber_import_file']['tmp_name'];\n $import_error = $_FILES['subscriber_import_file']['error'];\n\t\n\t\n\tif(!empty($import_error)) {\n\t switch($import_error) {\n\t\t\tcase 1:\n\t\t\tcase 2: $error = 'Upload failed: The uploaded file exceeds the upload_max_filesize<br/>'; break;\n\t\t\tcase 3: $error = 'Upload failed: The uploaded file was only partially uploaded.<br/>'; break;\n\t\t\tcase 4: $error = 'Upload failed: No file was uploaded.<br/>'; break;\n\t\t\tcase 6: $error = 'Upload failed: Missing a temporary folder.<br/>'; break;\n\t\t\tdefault: $error = 'Upload failed: Unknown error uploading file.<br />'; break;\n\t\t}\n\t} elseif(empty($import_file)) { $error = 'Upload failed: File not found/uploaded.<br />'; return false;}\n\n if(empty($error)) {\n\t\tswitch($delim) {\n\t\t\tcase '\\n' : $delim=\"\\n\"; break;\n\t\t\tcase '\\t' : $delim=\"\\t\"; break;\n\t\t\tcase '\\a' : $delim=\"\\a\"; break;\n\t\t\tcase ' ' : case '' : $delim=\"\\t\"; break;\n\t\t}\n\t\t\n\t\t$row = 1; $imported=0;\n\t\t$handle = fopen($import_file, \"r\");\n\t\tzen_set_time_limit(600);\n\t\tfor($row=1;(($data = fgetcsv($handle, 10000, $delim)) !== FALSE);$row++) {\n\t\t\tif((count($data)==1) && (strlen($data[0])<3)) { /* empty row */ }\n\t\t\telseif($header_row && $row==1) { }\n\t\t\telse {\n\t\t\t\t$ea = (empty($data[$email_elem]) ? '' : $data[$email_elem]);\n\t\t\t\t$ef = (!empty($data[$format_elem]) && in_array(strtoupper($data[$format_elem]),array('HTML','TEXT'))) ? strtoupper($data[$format_elem]) : $def_format;\n\t\t\t\tif(!empty($ea)) {\n\t\t\t\t\t$db->Execute(\"REPLACE INTO \" . TABLE_SUBSCRIBERS . \n\t\t\t\t\t\t\t\t\t\t\t \" ( email_address, email_format, confirmed, subscribed_date ) VALUES ( '{$ea}', '{$ef}', '1', NOW() )\");\n\t\t\t\t\t$imported++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($handle);\n\t}\n\treturn array($imported, $error);\n}", "public static function importCsv($filePath, $noRows)\n {\n\n $tempArr = ImportCsvIO::csvToArray($filePath);\n if ($noRows > count($tempArr)) {\n $message = [\"status\" => \"301\", \"message\" => 'The no of rows('.$noRows.') requested exceeds the records to be imported. Try a smaller figure!'];\n } else {\n for ($i = 0; $i < $noRows; $i++) {\n Temperature::create($tempArr[$i]);\n }\n $message = [\"status\" => \"200\", \"message\" => 'Ok'];\n }\n\n return $message;\n }", "public function import(Request $request)\n {\n // --\n // Check role/permission\n if (!AdminHelper::can_action(6, 'created')) {\n return response()->json(\"Access denied\", 403);\n }\n\n $request->validate(['csv_file' => 'required']);\n $error_file = [];\n $input = $request->all();\n $csvData = explode(\"\\n\", $input['csv_file']);\n foreach ($csvData as $key => $value) {\n $csvData[$key] = explode(',', $value);\n }\n\n if(count($csvData) >= 2){\n $header = array(\n 0 => 'username',\n 1 => 'firstname',\n 2 => 'lastname',\n 3 => 'email',\n 4 => 'department name',\n 5 => 'role name',\n 6 => 'employment id'\n );\n $data = $csvData[0];\n foreach ($header as $key => $value) {\n if(isset($data[$key])){\n if (strtolower(trim($data[$key])) !== $value) {\n $error_file[] = $value.' field is required';\n }\n }else{\n $error_file[] = $value.' field is required';\n }\n }\n if (is_array($error_file) && count($error_file) > 0) {\n return response()->json(['error' => $error_file ], 422);\n }\n\n $res = $this->userRepo->import($request, $csvData);\n return response()->json(['success' => $res]);\n\n }else{\n return response()->json(['error' => 'There are no any record in CSV.'],422);\n }\n }", "public function upload($csv){\n \n // Transformation des fins de ligne au format LF\n $csv = str_replace(\"\\r\\n\", PHP_EOL, $csv);\n $csv = explode(PHP_EOL, $csv);\n $i = 0;\n \n foreach($csv as $line) {\n \n $entry = str_getcsv($line, \";\");\n if(count($entry) != 4) {\n continue;\n }\n \n $address = new Address();\n $address->setNom($entry[0])\n ->setDescription($entry[1])\n ->setAdresse($entry[2])\n ->setUrl($entry[3]);\n \n $this->addressMapper->save($address);\n $i++;\n }\n return $i; \n }", "function load_product_csv_db($csv_db_file){\n if (($fh = fopen($csv_db_file, \"r\")) !== FALSE){\n $temp_arr = array();\n while (($data = fgetcsv($fh, 1000, \",\")) !== FALSE){\n $tmp_product = new Product($data[0], $data[1]);\n if($data[2] !== ''){\n $tmp_product->picture = $data[2];\n }\n array_push($temp_arr, $tmp_product);\n }\n $this->db = $temp_arr;\n fclose($fh); // Close the file\n }else{\n // echo 'file not found!';\n } //end open file\n return $this->db;\n }" ]
[ "0.6739292", "0.6437693", "0.6195104", "0.6019271", "0.59645367", "0.5868316", "0.5804911", "0.5783331", "0.5777469", "0.5732038", "0.5666319", "0.56439173", "0.5631292", "0.56304616", "0.5612842", "0.5602491", "0.560102", "0.5580468", "0.5575635", "0.5558984", "0.55314547", "0.55072963", "0.55068684", "0.5505662", "0.5485058", "0.54766196", "0.54635215", "0.5460829", "0.5460776", "0.5456056", "0.5453976", "0.544616", "0.5430876", "0.5422536", "0.5422058", "0.5419114", "0.54140747", "0.5413795", "0.5391523", "0.53570724", "0.53499216", "0.53487486", "0.5345658", "0.53284544", "0.53138125", "0.5311708", "0.5294876", "0.5289573", "0.5266999", "0.5261081", "0.5251971", "0.52482593", "0.5234129", "0.52163225", "0.52099174", "0.5209766", "0.51782596", "0.51779795", "0.51761216", "0.5173492", "0.5166707", "0.5147438", "0.51416844", "0.5137955", "0.5137673", "0.5110908", "0.510086", "0.5096715", "0.50874186", "0.5087249", "0.5078234", "0.5070079", "0.50697887", "0.50682515", "0.5066533", "0.5055903", "0.5055056", "0.5054258", "0.504633", "0.5038949", "0.503382", "0.5031199", "0.5026211", "0.5022145", "0.5019441", "0.500832", "0.4999324", "0.49961013", "0.49750203", "0.4966033", "0.4964503", "0.49643043", "0.49633572", "0.4963347", "0.49617594", "0.4960656", "0.4956665", "0.4955685", "0.49530333", "0.49526554" ]
0.58105624
6
Return a list of files with eod data.
private function _get_option_eod_summary_files() { $files = []; if(is_dir('/Users/spicer/Dropbox/Apps/Stockpeer')) { $base = '/Users/spicer/Dropbox/Apps/Stockpeer/'; } else { $base = '/tmp/market_data/'; $this->_get_data_from_dropbox(); } foreach($this->eod_option_summary_files AS $key => $row) { $files[] = $base . $row; } return $files; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDatafiles()\n {\n return $this->game->getDatafiles();\n }", "public function getFiles();", "public function getFiles();", "public function getFiles();", "public function getFiles ();", "public static function getFiles()\n\t{\n\t\t$result = Array();\n\t\t$files = sfCore::$db->query(\"SELECT * FROM `swoosh_file_storage`\")->asObjects();\n\t\tforeach($files as $file){\n\t\t\t$sfFileStorageItem = sfCore::make('sfFileStorageItem');\n\t\t\t$sfFileStorageItem->loadFromObject($file);\n\t\t\t$result[] = $sfFileStorageItem;\n\t\t}\n\t\treturn $result;\n\t}", "function get_file_objs() {\n return $this->file_objs;\n }", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public function getFiles()\n {\n return FileInfo::findBy( Condition::EQ(FileInfo::TABLE, 'module_id', $this->getId()),\n new ArrayObject(array('sort'=>$this->getSortBy(), 'ord'=>'asc')) );\n }", "public function getFiles() {}", "private function getFileList()\n {\n\n $count = $this->getFileCount();\n $size = $this->getSize() + 4;\n\n $this->seek(\n $this->offset\n + 18\n + $this->getAliasSize()\n + 4\n + $this->getMetadataSize()\n );\n\n return $this->readFileList($count, $size);\n }", "public function getFiles() {\n return $this->getPartFiles(0);\n }", "public function getFilesList() : array {\n $sqlQuery = 'SELECT * FROM files';\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute();\n\n $dataSet = [];\n while ($row = $statement->fetch()) {\n $dataSet[] = new File($row);\n }\n return $dataSet;\n }", "public function getAllFilesRobot() {\n $sql = \"SELECT * FROM archivo_organizado\";\n $result = $this->_db->prepare($sql);\n $result->execute();\n\n if(!is_null($result->errorInfo()[2]))\n return array('error' => $result->errorInfo()[2]);\n else\n return $result->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getDataFilesList(){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n $files = scandir($data_dir);\r\n\r\n $files_list = array();\r\n $index = 0;\r\n foreach ($files as $file) {\r\n if($file != '.' && $file != '..'){\r\n $files_list[$index]['name'] = $file;\r\n $files_list[$index]['update_time'] = filemtime($data_dir . DIRECTORY_SEPARATOR . $file);\r\n $files_list[$index]['type'] = $this->getFileType($file);\r\n $index++;\r\n }\r\n }\r\n\r\n $update_times = array();\r\n foreach($files_list as $data){\r\n $update_times[] = $data['update_time'];\r\n }\r\n array_multisort($update_times, SORT_DESC, $files_list);\r\n return $files_list;\r\n }", "function get_list_of_files() {\n $result = $this->pdo->query('SELECT * FROM files ORDER BY filename ASC');\n return $result;\n }", "function _generateFilesList() {\n return array();\n }", "public function readFilesInFileadmin() {\n $fileArr = $newArr = array();\n\n // direktes auslesen des Ordners, da evtl. nicht alle Dateien in Tabellen indexiert sind\n $path = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT') . GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . 'fileadmin/';\n $fileList = GeneralUtility::getAllFilesAndFoldersInPath($fileArr, $path);\n\n $pathCount = strlen($path);\n // deployment-Ordner exkludieren\n foreach ($fileList as $filekey => $filevalue) {\n if (strstr($filevalue, '/fileadmin/deployment') == FALSE) {\n $newArr[$filekey] = substr($filevalue, $pathCount);\n }\n }\n\n return $newArr;\n }", "public function all()\n {\n $dir = public_path() . '/uploads/temp/' . Session::getId() . '/';\n $data = [];\n $mimetypes = new Mimetype;\n if(file_exists($dir)) {\n foreach(scandir($dir) as $file) {\n if(in_array($file, ['.', '..'])) continue;\n $filedata = [];\n $filedata['name'] = $file;\n $filedata['url'] = url('/uploads/temp/' .Session::getId() . '/' .$file);\n $filedata['size'] = File::size($dir . $file);\n $filedata['type'] = $mimetypes->detectByFileExtension(File::extension($file));\n $data[] = $filedata;\n }\n return $data;\n }\n }", "private function searchFiles()\n {\n $query = File::whereNull('deleted_at');\n $data = $query->get();\n\n return $data;\n }", "public function getFiles(): array;", "protected function getAllFiles() {\n $sql = \"SELECT * FROM satdatameta\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $results = $stmt->fetchAll();\n return $results;\n }", "private function get_files(): array {\n\t\t$files = [];\n\n\t\tif ( $this->directory->is_readable() ) {\n\t\t\tforeach ( $this->directory->get_files() as $file ) {\n\t\t\t\tif ( ! $file->isFile() || ! $file->isReadable() || $file->getSize() === 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->extension !== null && $this->extension !== $file->getExtension() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$files[] = $file->getFileInfo();\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "public function getEmbeddedFiles() {}", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }", "private function item_files()\r\n\t{\r\n\t\t$items = array();\r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n\t\tsort($items);\r\n\t\treturn array_reverse($items);\r\n\t}", "public function getOtherFiles(): array;", "public function getFiles() : Array\n\t{\n\t\t$files = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\n\t\t\t$directory = opendir($this->directory);\n\t\t\twhile($opened = readdir($directory)) {\n\t\t\t\n\t\t\t\tif (is_file($this->directory . DIRECTORY_SEPARATOR . $opened) && !Directory::isBlockListed($opened)) {\n\t\t\t\t\t$files[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($directory);\n\t\t}\n\n\t\treturn $files;\n\t}", "public function get_files()\n {\n }", "public function loadFiles(){\n\n $files = array();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n\n $sqlQuery = 'SELECT D.* FROM data D , books B WHERE B.id = D.book AND B.id='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $files[] = BookFile::_createFromRow($this->databasePath, $row); \n \n return $files;\n }", "function getAllFiles() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` FROM `file`');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function getAll()\n {\n return $files;\n }", "public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}", "public function getFiles(): array\n {\n return [$this->file];\n }", "public function getFiles(): array\n {\n return $this->files;\n }", "public function readAll()\r\n {\r\n $plugins_dir = $this->basePath.\"/extern/openInviter/plugins\";\r\n $array_file=array();\r\n \r\n $temp=glob(\"{$plugins_dir}/*.php\");\r\n foreach ($temp as $file) {\r\n// echo 'File: '.$file.' - Check: '.str_replace(\"{$plugins_dir}/\",'',$file).\"\\n\";\r\n\r\n if (($file!=\".\") AND ($file!=\"..\") AND (!isset($this->ignoredFiles[str_replace(\"{$plugins_dir}/\",'',$file)]))) {\r\n $array_file[$file]=$file;\r\n }\r\n }\r\n\r\n return $array_file;\r\n }", "public function provideFileInfos()\n {\n return array(\n array('someName', 'someContent')\n );\n }", "public function files();", "public function files();", "public function files();", "public function getFiles() : array\n {\n return $this->files;\n }", "public function getFileList()\n {\n return array_map(\n function (FileEntry $file) {\n return $file->getFilename();\n },\n $this->pharchive->getFiles()\n );\n }", "public function getAllFiles()\n {\n }", "function &getFiles() {\n\t\tif (!isset($this->files)) {\n\t\t\t$res = db_query_params ('SELECT id,artifact_id,description,filename,filesize,' .\n\t\t\t\t\t'filetype,adddate,submitted_by,user_name,realname\n\t\t\t\t\t FROM artifact_file_user_vw WHERE artifact_id=$1',\n\t\t\t\t\t\tarray ($this->getID())) ;\n\t\t\t$rows=db_numrows($res);\n\t\t\tif ($rows > 0) {\n\t\t\t\tfor ($i=0; $i < $rows; $i++) {\n\t\t\t\t\t$this->files[$i]=new ArtifactFile($this,db_fetch_array($res));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->files=array();\n\t\t\t}\n\t\t}\n\t\treturn $this->files;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }", "public function ShowFiles() {\n $i = 0;\n if ($handle = opendir($this->filePath)) {\n while (false !== ($file = readdir($handle))) {\n if (($file != '..') && ($file != '.') && ($file != 'Thumbs.db')) {\n $files[$i] = $file;\n $i++;\n }\n }\n closedir($handle);\n }\n return($files);\n }", "public function files() :array\n {\n $files = DB::query(\"SELECT `ft_filename` AS 'filename', `ft_size` AS 'size' FROM `file_table` WHERE `ft_ut_id` = :u_id ORDER BY `ft_filename` ASC\", array(':u_id'=>$_SESSION['user_id']));\n\n $list = [];\n $i = 0;\n\n foreach($files as $file){\n $list[$i] = array($file['filename'], round($file['size']/1024, 2));\n $i++;\n }\n return $list;\n }", "public static function getAll_files() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, file_name, uploaded, user FROM files\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function getFiles()\n {\n $files = [];\n if($attachmentData = $this->setAttachmentData()){\n $files['attachment'] = $this->setAttachmentData();\n }\n return $files;\n }", "protected function getFiles(): array\n {\n return [];\n }", "public function getFiles()\n {\n return $this->_files;\n }", "protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}", "public function getFiles() {\n\t\treturn $this->files;\n\t}", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "private function getFileList(){\n // Using the high-level iterators returns ALL the objects in your bucket, low level returns truncated result of about 1000 files\n $objects = $this->AmazonClient->getIterator('ListObjects', array('Bucket' => $this->getDataFromBucket));\n return $objects;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/purrrr.php',\n 'data_custom/images/lolcats/index.html',\n 'data_custom/images/lolcats/thumbs/index.html',\n 'data_custom/images/lolcats/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/ridiculous_poses_moddles.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/thumbs/ridiculous_poses_moddles.jpg',\n );\n }", "function getExportFiles()\n\t{\n\t\t$dir = $this->getExportDirectory();\n\n\t\t// quit if export dir not available\n\t\tif (!@is_dir($dir) or\n\t\t\t!is_writeable($dir))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t// open directory\n\t\t$dir = dir($dir);\n\n\t\t// initialize array\n\t\t$file = array();\n\n\t\t// get files and save the in the array\n\t\twhile ($entry = $dir->read())\n\t\t{\n\t\t\tif ($entry != \".\" and\n\t\t\t\t$entry != \"..\" and\n\t\t\t\tpreg_match(\"/^[0-9]{10}_{2}[0-9]+_{2}([a-z0-9]{3})_usrf\\.[a-z]{1,3}\\$/\", $entry, $matches))\n\t\t\t{\n\t\t\t\t$filearray[\"filename\"] = $entry;\n\t\t\t\t$filearray[\"filesize\"] = filesize($this->getExportDirectory().\"/\".$entry);\n\t\t\t\tarray_push($file, $filearray);\n\t\t\t}\n\t\t}\n\n\t\t// close import directory\n\t\t$dir->close();\n\n\t\t// sort files\n\t\tsort ($file);\n\t\treset ($file);\n\n\t\treturn $file;\n\t}", "public function getRemoteExtListFile() {}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "public function getFiles()\n {\n return R::findAll('upload');\n }", "function getFiles()\r\n\t{\r\n\t\treturn $this->files;\r\n\t}", "protected function obtenerListadoDeArchivos(){\n $directorio = storage_path() . '/app/backup';\n // Array en el que obtendremos los resultados\n $res = array();\n\n // Agregamos la barra invertida al final en caso de que no exista\n if(substr($directorio, -1) != \"/\") $directorio .= \"/\";\n\n // Creamos un puntero al directorio y obtenemos el listado de archivos\n $dir = @dir($directorio) or die(\"getFileList: Error abriendo el directorio $directorio para leerlo\");\n while (($archivo = $dir->read()) !== false) {\n // Obviamos los archivos ocultos\n if($archivo[0] == \".\") continue;\n if(is_dir($directorio . $archivo)) {\n $res[] = array(\n \"nombre\" => $archivo,\n \"tamaño\" => 0,\n \"modificado\" => filemtime($directorio . $archivo)\n );\n } else if (is_readable($directorio . $archivo)) {\n $fileTime = Carbon::now()->timestamp(filemtime($directorio . $archivo));\n $res[] = array(\n \"nombre\" => $archivo,\n \"tamaño\" => $this->formatBytes(filesize($directorio . $archivo)),\n //\"modificado\" => date(\"F d Y H:i:s.\",filemtime($directorio . $archivo))\n //\"modificado\" => filemtime($directorio . $archivo)->diffForHuman()\n \"modificado\" => $fileTime->diffForHumans(),\n );\n }\n }\n $dir->close();\n return $res;\n }", "public function listFiles() {\n \n $list = [];\n \n for ($i = 0; $i < $this->zip_archive->numFiles; $i++) {\n $name = $this->zip_archive->getNameIndex($i);\n if ($name === false) {\n throw new Exception(self::getStatus($this->zip_archive->status));\n }\n $list[] = $name;\n }\n\n return $list;\n }", "public function getFiles() {\r\n\r\n $files = array();\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n $dir = FILEPATH . $userId. '/' . $trackingId;\r\n\r\n if (is_dir($dir)) {\r\n if ($dh = opendir($dir)) {\r\n while (($file = readdir($dh)) !== false) {\r\n if($file != '.' && $file != '..') {\r\n $size = $this->Size($dir . '/' . $file);\r\n array_push($files, array('name'=>$file,\r\n 'urlfilename'=>urlencode($file),\r\n 'size'=>$size));\r\n }\r\n }\r\n closedir($dh);\r\n }\r\n }\r\n\r\n return $files;\r\n }", "public function getContents()\n {\n $list = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($this->_root)\n );\n $elements = array();\n foreach ($list as $element) {\n if ($this->_include->isIncluded($element)\n && !$this->_ignore->isIgnored($element)) {\n $file = substr($element->getPathname(), strlen($this->_root));\n $elements[$file] = array(\n 'role' => $this->_role->getRole($file),\n 'as' => $this->_install_as->getInstallAs($file, 'Horde_' . basename($this->_root))\n );\n }\n }\n return $elements;\n }", "private function getTestFileList() {\n\t\treturn [\n\t\t\tself::makeFileInfo('a.txt', 4, 2.3 * \\pow(10, 9)),\n\t\t\tself::makeFileInfo('q.txt', 5, 150),\n\t\t\tself::makeFileInfo('subdir2', 87, 128, true),\n\t\t\tself::makeFileInfo('b.txt', 2.2 * \\pow(10, 9), 800),\n\t\t\tself::makeFileInfo('o.txt', 12, 100),\n\t\t\tself::makeFileInfo('subdir', 88, 125, true),\n\t\t];\n\t}", "protected function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$files = array(\n\t\t\t\t\"test.txt\" => uniqid(),\n\t\t\t\t\"test2.txt\" => uniqid(),\n\t\t\t\t\"test3.txt\" => uniqid(),\n\t\t\t);\n\t\t\tforeach($files as $file => $content) {\n\t\t\t\tfile_put_contents($this->path.\"/\".$file,$content);\n\t\t\t\t$this->assertTrue(file_exists($this->path.\"/\".$file));\n\t\t\t}\n\t\t\t$this->_files = array_keys($files);\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function getFiles() {\n return $this->files;\n }", "public function getFiles() {\n return $this->files;\n }", "public function getFiles(NodeInterface $node) {\n $fids = $this->connection->query(\"SELECT fid FROM {file_usage} WHERE type = 'node' AND id = :nid\", array(':nid' => $node->id()))->fetchCol();\n return File::loadMultiple($fids);\n }", "public function findFiles();", "public function getFiles(): array\n {\n try {\n if (count($this->_filesCollection) === 0) {\n $path = $this->_flysystemHelper->getCurrentPath();\n\n $contents = $this->_flysystemManager->getAdapter()->listContents($path);\n foreach ($contents as $file) {\n if ($this->validateFile($file)) {\n $this->_filesCollection[] = $file;\n }\n }\n }\n } catch (\\Exception $e) {\n $this->_messageManager->addErrorMessage($e->getMessage());\n return [];\n }\n\n return $this->_filesCollection;\n }", "public function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->branch->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function listApplicationFiles() {\r\n\t\t$preload = array(\r\n\t\t\t\"config/main.js\"\r\n\t\t);\r\n\t\t\r\n\t\t$return = array();\r\n\t\t$fullPath = $this->applicationPath;\r\n\t\r\n\t\tforeach($preload as $file) {\r\n\t\t\t$return[] = $fullPath.\"/\".$file;\r\n\t\t}\r\n\t\t\r\n\t\t$options = array(\r\n\t\t\t\"fileTypes\" => array(\"js\"),\r\n\t\t\t\"exclude\" => array_merge($preload, array(\r\n\t\t\t\t\"data\", \"messages\", \"compiled.js\"\r\n\t\t\t))\r\n\t\t);\r\n\t\t\r\n\t\t$return = array_merge($return, CFileHelper::findFiles($fullPath,$options));\r\n\t\t\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "protected function _getFiles() {\n\t\t$Directory = new RecursiveDirectoryIterator(BACKUPS);\n\t\t$It = new RecursiveIteratorIterator($Directory);\n\t\t$Regex = new RegexIterator($It, '/dbdump_.*?[\\.sql|\\.gz]$/', RecursiveRegexIterator::GET_MATCH);\n\t\t$files = array();\n\t\tforeach ($Regex as $v) {\n\t\t\t$files[] = $v[0];\n\t\t}\n\t\t$files = array_reverse($files);\n\t\treturn $files;\n\t}", "public function getDates() {\n // get the files\n $files = $this->readFiles();\n\n // build data using only the names\n $data = [];\n foreach ($files as $file) {\n $data[$file->getName()] = $file->getName();\n }\n\n return $data;\n }", "public function files()\n {\n return $this->_array[\"files\"];\n }", "public function getFiles()\n {\n return isset($this->source['files']) && is_array($this->source['files']) ? $this->source['files'] : [];\n }", "public function files()\r\n {\r\n return $this->files;\r\n }", "public function getFiles()\n {\n if (isset($this->raw->files)) {\n $base = $this->getBasePath();\n $files = array();\n\n foreach ((array) $this->raw->files as $file) {\n $file = new SplFileInfo(\n $path = $base . DIRECTORY_SEPARATOR . Path::canonical($file)\n );\n\n if (false === $file->isFile()) {\n throw new RuntimeException(\n sprintf(\n 'The file \"%s\" does not exist or is not a file.',\n $path\n )\n );\n }\n\n $files[] = $file;\n }\n\n return $files;\n }\n\n return array();\n }", "private function _get_files($ext=false)\n\t{\n\t\t\n\t\t$files = PerchUtil::get_dir_contents(PERCH_RESFILEPATH);\n\n\t\t$returnfiles = array();\n\t\tif(PerchUtil::count($files) > 0) {\n\t\t\tforeach($files as $file) {\n\t\t\t\t// if a file extension has been provided only add files with that extension\n\t\t\t\tif($ext) {\n\t\t\t\t\tif(strtolower(trim($ext)) == strtolower(PerchUtil::file_extension($file))) {\n\t\t\t\t\t\t$returnfiles[] = array('label'=>$file, 'value'=>$file);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// prepare all files for display\n\t\t\t\t\t$returnfiles[] = array('label'=>$file, 'value'=>$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(PerchUtil::count($returnfiles) > 0) {\n\t\t\treturn $returnfiles;\n\t\t} else {\t\n\t\t\treturn false;\n\t\t}\n\t}", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public function getDirContent(){\n $files = [\n 'errors' => '',\n 'path' => $this->path,\n 'value' => []\n ];\n\n //if it's not a dir then return error\n if(!$this->isDir) {\n $files['errors'] = 'Only dir may include files';\n return $files;\n }\n\n $dir = opendir($this->path);\n\n //read content of dir\n while($file = readdir($dir)){\n if(in_array($file, $this->exclude))\n continue;\n\n $files['value'][] = $this->getFileInfo($file, ($this->path).$file);\n }\n\n return $files;\n }", "public function list_owned_files() {\n $stmt = $this->pdo->prepare('select filename from file where user_id = :id');\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n $result = array();\n foreach ($res as $f) {\n array_push($result, $f['filename']);\n }\n return $result;\n }", "function getFilesByObject() {\n if($this->object_id == '') return ;\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE object_id = $this->object_id \";\n return $this->db->query($sql)->result('array');\n\t}", "public function getFiles($where = null){\n $result = null;\n $temp = parent::getObjects(null, $where);\n if(count($temp) > 0){\n $result = array();\n foreach($temp as $item){\n $f = new File();\n $f->setID($item->ID);\n $f->setIdUtente($item->id_utente);\n $f->setUrlFile($item->url_file);\n $f->setDescrizione($item->descrizione);\n array_push($result, $f);\n }\n }\n return $result;\n }", "public function listInscriptionFiles(){\n $req = $this->db->query('SELECT file_url, title_file FROM admin_files');\n $req->setFetchMode(\\PDO::FETCH_CLASS | \\PDO::FETCH_PROPS_LATE, \n 'taekwondo\\model\\FileAdmin');\n return $req;\n }", "public function getFiles()\n {\n echo json_encode($this->galery->getFiles());\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "public function getUserFiles()\n {\n $user_files = Helper::getUserFiles();\n return $user_files;\n }" ]
[ "0.6756202", "0.6754651", "0.6754651", "0.6754651", "0.6681217", "0.6674859", "0.665485", "0.6650601", "0.66485107", "0.6637627", "0.6613034", "0.65925366", "0.65880877", "0.65870667", "0.6546304", "0.65412086", "0.6536871", "0.6536775", "0.6522086", "0.6520818", "0.6515558", "0.6504113", "0.6501648", "0.6493762", "0.64851004", "0.64478105", "0.64312387", "0.6426829", "0.63426095", "0.632056", "0.6316152", "0.6307504", "0.6299157", "0.6295011", "0.6289518", "0.6277387", "0.62271017", "0.62228453", "0.62135667", "0.62135667", "0.62135667", "0.6207719", "0.6207294", "0.61970073", "0.6188355", "0.6179182", "0.6178587", "0.61763954", "0.6173548", "0.61602527", "0.6138659", "0.6125108", "0.61215794", "0.61115617", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.6099159", "0.60835207", "0.60822886", "0.6080021", "0.60726035", "0.60617375", "0.60590255", "0.60586566", "0.6051394", "0.60466266", "0.6045774", "0.6039536", "0.60325855", "0.6031245", "0.60272515", "0.60272515", "0.60157955", "0.6015779", "0.60109293", "0.6010209", "0.6004949", "0.6004717", "0.6000233", "0.5999953", "0.59960306", "0.5991248", "0.5981379", "0.59779054", "0.59772325", "0.5975615", "0.5970401", "0.59634376", "0.59570265", "0.59534305", "0.59381336", "0.5929624", "0.5928531" ]
0.73023045
0
Download files from Dropbox.
private function _get_data_from_dropbox() { $tmp = '/tmp/market_data/'; // tmp/market_data/ if(! is_dir($tmp)) { mkdir($tmp); } // data/optionsendofday/IWM if(! is_dir($tmp . '/data/OptionsEndOfDay/IWM')) { mkdir($tmp . '/data/OptionsEndOfDay/IWM', 0777, true); } // data/optionsendofday/SPY if(! is_dir($tmp . '/data/OptionsEndOfDay/SPY')) { mkdir($tmp . '/data/OptionsEndOfDay/SPY', 0777, true); } // Query dropbox and list files. $client = new Client(env('DROPBOX_ACCESS_TOKEN'), env('DROPBOX_APP_KEY')); $adapter = new DropboxAdapter($client); $filesystem = new Filesystem($adapter); // Loop through and download the data foreach($this->eod_option_summary_files AS $key => $row) { if(is_file($tmp . $row)) { $this->info('Dropbox Already Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files)); continue; } // Download and store. file_put_contents($tmp . $row, $filesystem->read($row)); $this->info('Dropbox Stored: ' . $row . ' ' . ($key+1) . ' of ' . count($this->eod_option_summary_files)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function downloadFile();", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "public function downloadAction()\n {\n $user = $this->getConnectedUser();\n\n $em = $this->getDoctrine()->getManager();\n\n $request = $this->get('request');\n\n if ($request->getMethod() == 'POST') {\n $foldersId = $request->request->get('foldersId');\n $foldersId = json_decode($foldersId);\n $filesId = $request->request->get('filesId');\n $filesId = json_decode($filesId);\n\n if ((!is_null($filesId) && sizeof($filesId) > 0) ||\n (!is_null($foldersId) && sizeof($foldersId) > 0)) {\n $filesToDownload = $em->getRepository('TimeBoxMainBundle:Version')->getLastestFileVersion($user, $filesId);\n $foldersToDownload = $em->getRepository('TimeBoxMainBundle:Folder')->findBy(array(\n 'id' => $foldersId,\n 'user' => $user\n ));\n\n if (!is_null($filesToDownload)) {\n // One file and no folder is requested\n if (sizeof($filesToDownload) == 1 && sizeof($foldersToDownload) == 0) {\n $version = $filesToDownload[0];\n $file = $version->getFile();\n\n $filePath = $version->getAbsolutePath();\n $filename = $file->getName();\n $type = $file->getType();\n if (!is_null($type)) {\n $filename .= '.'.$type;\n }\n\n if (!file_exists($filePath)) {\n throw $this->createNotFoundException();\n }\n\n // Trigger file download\n $response = new Response();\n $response->headers->set('Content-type', 'application/octet-stream');\n $response->headers->set('Content-Disposition', sprintf('attachment; filename=\"%s\"', $filename));\n $response->setContent(file_get_contents($filePath));\n return $response;\n }\n\n // Create zip folder on server if not exist\n $zipFolder = $this->get('kernel')->getRootDir() . '/../web/uploads/zip/';\n if (!file_exists($zipFolder)) {\n mkdir($zipFolder, 0755, true);\n }\n\n // Create zip archive\n $zip = new ZipArchive();\n $zipName = 'TimeBoxDownloads-'.time().'.zip';\n $zipPath = $zipFolder . $zipName;\n $zip->open($zipPath, ZipArchive::CREATE);\n\n // Fill zip with folders\n foreach($foldersToDownload as $folder){\n $this->addFolderToZip($folder, $zip);\n }\n\n // Fill zip with files\n foreach ($filesToDownload as $f) {\n $version = $f;\n $file = $version->getFile();\n\n $filePath = $version->getAbsolutePath();\n $filename = $file->getName();\n $type = $file->getType();\n if (!is_null($type)) {\n $filename .= '.'.$type;\n }\n\n $zip->addFile($filePath, $filename);\n }\n\n $zip->close();\n\n // Trigger file download\n $response = new Response();\n $response->headers->set('Content-type', 'application/octet-stream');\n $response->headers->set('Content-Disposition', sprintf('attachment; filename=\"%s\"', $zipName));\n $response->setContent(file_get_contents($zipPath));\n return $response;\n }\n }\n }\n return new Response('An error has occured.');\n }", "function download() {\r\n $this->zip->read_dir('./uploads/',FALSE);\r\n // create zip file on server\r\n $this->zip->archive('./downloads/'.'images.zip');\r\n // prompt user to download the zip file\r\n $this->zip->download('images.zip');\r\n }", "function zip_download_alternative($files)\r\n{\r\n\tglobal $_course;\r\n\tglobal $_user;\r\n\r\n\t$temp_zip_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\";\r\n\r\n\t// Step 1: create the overview file and add it to the zip\r\n\t$overview_file_content=generate_html_overview($files, array('filename'), array('title'));\r\n\t$overview_file=$temp_zip_dir.'overview'.$_user['firstname'].$_user['lastname'].'.html';\r\n\t$handle=fopen($overview_file,'w');\r\n\tfwrite($handle,$overview_file_content);\r\n\t// todo: find a different solution for this because even 2 seconds is no guarantee.\r\n\tsleep(2);\r\n\r\n\t// Step 2: we copy all the original dropbox files to the temp folder and change their name into the original name\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t$value['title']=check_file_name($value['title']);\r\n\t\t$files[$value['filename']]['title']=$value['title'];\r\n\t\tcopy(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'], api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title']);\r\n\t}\r\n\r\n\t// Step 3: create the zip file and add all the files to it\r\n\t$temp_zip_file=$temp_zip_dir.'/dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip';\r\n\t$zip_folder=new PclZip($temp_zip_file);\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp\");\r\n\t}\r\n\r\n\t// Step 4: we add the overview file\r\n\t$zip_folder->add($overview_file,PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp\");\r\n\r\n\t// Step 5: send the file for download;\r\n\tDocumentManager::file_send_for_download($temp_zip_file,true,$name);\r\n\r\n\t// Step 6: remove the files in the temp dir\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\tunlink(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\".$value['title']);\r\n\t}\r\n\t//unlink($overview_file);\r\n\r\n\texit;\r\n}", "protected function downloadFiles() {\n\t\t// Metadata.\n\t\t$metadataFile = $this->jobDir() . '/metadata.json';\n\t\tif ( !file_exists( $metadataFile ) ) {\n\t\t\t$this->log->info( \"Saving IA metadata to $metadataFile\" );\n\t\t\t$metadata = $this->iaClient->fileDetails( $this->itemId );\n\t\t\tfile_put_contents( $metadataFile, \\GuzzleHttp\\json_encode( $metadata ) );\n\t\t}\n\t\tif ( !isset( $metadata ) ) {\n\t\t\t$metadata = \\GuzzleHttp\\json_decode( file_get_contents( $metadataFile ), true );\n\t\t}\n\n\t\t// Other files (JP2 and DjVu XML).\n\t\t$filesToDownload = preg_grep( '/.*(_djvu.xml|_jp2.zip)/', array_keys( $metadata['files'] ) );\n\t\tforeach ( $filesToDownload as $file ) {\n\t\t\tif ( !file_exists( $this->jobDir() . $file ) ) {\n\t\t\t\t$this->log->info( \"Downloading $this->itemId$file\" );\n\t\t\t\t$this->iaClient->downloadFile( $this->itemId . $file, $this->jobDir() . $file );\n\t\t\t}\n\t\t}\n\t}", "protected function downloadFiles() {\n $aFiles = $this->aFiles;\n\n foreach($aFiles as $aFile) {\n\n $sFile = $this->sDirectory . $aFile;\n if (!Storage::disk('local')->exists($sFile)) {\n\n // Option to switch s3 to local\n $sStorageType = \"local\"; // \"s3\", \"local\"\n\n switch ($sStorageType) {\n case \"s3\":\n // Retrieving Files from AWS S3 bucket\n $file = base64_decode($aFile);\n $name = basename($aFile);\n $oRaw = Storage::disk('s3')->download($file, $name);\n // Writing S3 files to local storage\n Storage::disk('local')->put($sFile, $oRaw);\n break;\n case \"local\":\n // Writing dummy files to local storage\n Storage::disk('local')->put($sFile, 'Contents');\n break;\n default:\n break;\n }\n // sleep(10);\n }\n }\n }", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "public function download() {\t\t}", "public function downloadFiles()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $targetname = $this->input->get_post('targetname');\r\n\r\n // insert userlog\r\n $gid = $this->input->get_post('gid');\r\n if (substr($gid, 0, 1) === 's')\r\n {\r\n $b36_sid = substr($gid, 1);\r\n $share = $this->login->get_share_access($b36_sid);\r\n $gid = $share['gid'];\r\n $folder_name = $share['name'];\r\n }\r\n else\r\n {\r\n $folder_name = $this->login->get_group_name($gid);\r\n }\r\n if (count($filenames_arr) == 1)\r\n {\r\n $fileinode = $this->files_model->fileinode($access_full_path .'/'. $filenames_arr[0]);\r\n $target = str_replace('/'. $folder_name, '', $access_full_path, $cnt = 1) .'/'. $filenames_arr[0];\r\n $details = '';\r\n }\r\n else\r\n {\r\n $fileinode = 0;\r\n $target = $this->files_model->get_utf8_basename($access_full_path) . '.zip';\r\n $details = $filenames;\r\n }\r\n $user = $this->login->get_user();\r\n $this->userlog_model->insert(\r\n $user['id'],\r\n $user['name'],\r\n Userlog_model::FILE_DOWNLOAD,\r\n $gid,\r\n $folder_name,\r\n $fileinode,\r\n $target,\r\n $details\r\n );\r\n\r\n $this->files_model->download_files($access_full_path, $filenames_arr, $targetname);\r\n }", "public function testComAdobeCqSocialFilelibraryClientEndpointsFilelibraryDownloadGe()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.filelibrary.client.endpoints.FilelibraryDownloadGetServlet';\n\n $crawler = $client->request('POST', $path);\n }", "public function downloadFile()\n { \n $urls = [];\n $file = a2_path('workflows/downloadable-urls.yaml');\n $response = json_decode(file_get_contents('php://input'), true);\n \n if(!file_exists($file)){\n file_put_contents($file, '');\n }\n\n if(isset($response['urls'])){\n $urls = $response['urls'];\n file_put_contents($file, Yaml::dump($urls));\n }\n\n if(isset($response['sync'])){\n $urls = Yaml::parseFile($file );\n\n }\n\n $client = new Client();\n foreach ($urls as $key => $url) {\n $res = $client->request('GET', $urls[$key], ['headers' => array(\n 'A2-TECHNOLOGY' => getenv('A2_TECHNOLOGY'),\n 'A2-TOKEN' => getenv('A2_TOKEN'),\n 'Content-Type: text/plain'\n )]);\n if ($res->getStatusCode() == 200) {\n\n $path = \\explode('?path=', $urls[$key])[1];\n if(!file_exists($path=base_path($path))){\n \\file_put_contents($path, $res->getBody());\n }\n unset($urls[$key]);\n }\n }\n // save data\n if(count($urls)){\n file_put_contents($file, Yaml::dump($urls));\n }else {\n file_put_contents($file, '');\n }\n }", "public function test_it_downloads_files()\n {\n // using a real url I suppose, so I'm just going to\n // make sure it constructs for now\n // @todo see if there is a better test for this\n $FileDownloader = new FileDownloader;\n }", "function downloadFiles()\n\t{\n\t\t$appointment = $this->appointment;\n\n\t\t//calendar in the sidebar (marginal calendar)\n\t\tif(empty($appointment))\n\t\t{\n\t\t\t$entry_id = (int)$_GET['app_id'];\n\t\t\t$entry = new ilCalendarEntry($entry_id);\n\t\t\t//if the entry exists\n\t\t\tif($entry->getStart())\n\t\t\t{\n\t\t\t\t$appointment = array(\n\t\t\t\t\t\"event\" => $entry,\n\t\t\t\t\t\"dstart\" => $entry->getStart(),\n\t\t\t\t\t\"dend\"\t=> $entry->getEnd(),\n\t\t\t\t\t\"fullday\" => $entry->isFullday()\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendFailure($this->lng->txt(\"obj_not_found\"), true);\n\t\t\t\t$this->ctrl->returnToParent($this);\n\t\t\t}\n\t\t}\n\n\t\tinclude_once './Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';\n\t\t$download_job = new ilDownloadFilesBackgroundTask($this->user->getId());\n\n\t\t$download_job->setBucketTitle($this->lng->txt(\"cal_calendar_download\").\" \".$appointment['event']->getTitle());\n\t\t$download_job->setEvents(array($appointment));\n\t\t$download_job->run();\n\n\t\t$this->ctrl->returnToParent($this);\n\t}", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "public function downloadBackup() {\n $nonce = $this->getNonce();\n\n if ($nonce && isset($_GET['download'])) {\n $zipfile = $this->tempPath() . self::ZIPCOMP_STUB;\n if (file_exists($zipfile)) {\n $this->loadManifest();\n\n $filename = array(\n __CLASS__,\n $nonce,\n preg_replace('/(?:https?)?[^a-z0-9]+/i', '-', $this->manifest['home_url']),\n );\n\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . implode('-', $filename) . '.zip');\n header('Expires: 0');\n header('Cache-Control: no-cache');\n header('Content-Length: ' . filesize($zipfile));\n readfile($zipfile);\n $this->doCleanup();\n exit();\n } else {\n wp_die('No matching cambrian archive found');\n }\n }\n }", "public function download(string $url);", "function zip_download ($array)\r\n{\r\n\tglobal $_course;\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user;\r\n\tglobal $files;\r\n\t\r\n\t$sys_course_path = api_get_path(SYS_COURSE_PATH);\r\n\t\r\n\t// zip library for creation of the zipfile\r\n\tinclude(api_get_path(LIBRARY_PATH).\"/pclzip/pclzip.lib.php\");\r\n\r\n\t// place to temporarily stash the zipfiles\r\n\t$temp_zip_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].\"/temp/\";\r\n\r\n\t// create the directory if it does not exist yet.\r\n\tif(!is_dir($temp_zip_dir))\r\n\t{\r\n\t\tmkdir($temp_zip_dir);\r\n\t}\r\n\r\n\tcleanup_temp_dropbox();\r\n\r\n\t$files='';\r\n\r\n\t// note: we also have to add the check if the user has received or sent this file. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\t$sql=\"SELECT distinct file.filename, file.title, file.author, file.description\r\n\t\t\tFROM \".$dropbox_cnf[\"tbl_file\"].\" file, \".$dropbox_cnf[\"tbl_person\"].\" person\r\n\t\t\tWHERE file.id IN (\".implode(', ',$array).\")\r\n\t\t\tAND file.id=person.file_id\r\n\t\t\tAND person.user_id='\".$_user['user_id'].\"'\";\r\n\t$result=api_sql_query($sql,__FILE__,__LINE__);\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$files[$row['filename']]=array('filename'=>$row['filename'],'title'=>$row['title'], 'author'=>$row['author'], 'description'=>$row['description']);\r\n\t}\r\n\r\n\t//$alternative is a variable that uses an alternative method to create the zip\r\n\t// because the renaming of the files inside the zip causes error on php5 (unexpected end of archive)\r\n\t$alternative=true;\r\n\tif ($alternative)\r\n\t{\r\n\t\tzip_download_alternative($files);\r\n\t\texit;\r\n\t}\r\n\r\n\t// create the zip file\r\n\t$temp_zip_file=$temp_zip_dir.'/dropboxdownload-'.$_user['user_id'].'-'.mktime().'.zip';\r\n\t$zip_folder=new PclZip($temp_zip_file);\r\n\r\n\tforeach ($files as $key=>$value)\r\n\t{\r\n\t\t// met hernoemen van de files in de zip\r\n\t\t$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox\", PCLZIP_CB_PRE_ADD, 'my_pre_add_callback');\r\n\t\t// zonder hernoemen van de files in de zip\r\n\t\t//$zip_folder->add(api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox/\".$value['filename'],PCLZIP_OPT_REMOVE_PATH, api_get_path(SYS_COURSE_PATH).$_course['path'].\"/dropbox\");\r\n\t}\r\n\r\n\t// create the overview file\r\n\t$overview_file_content=generate_html_overview($files, array('filename'), array('title'));\r\n\t$overview_file=$temp_zip_dir.'/overview.html';\r\n\t$handle=fopen($overview_file,'w');\r\n\tfwrite($handle,$overview_file_content);\r\n\r\n\r\n\t// send the zip file\r\n\tDocumentManager::file_send_for_download($temp_zip_file,true,$name);\r\n\texit;\r\n}", "public function download(){\n\t\t$lang = \"En\";\n\t\tif (isset ( $_SESSION [\"user_settings\"] [\"language\"] )) {\n\t\t\t$lang = $_SESSION [\"user_settings\"] [\"language\"];\n\t\t}\n\t\t\n\t\t// get form posts\n\t\t$localurl = $this->request->getParameter(\"localurl\");\n\t\t$filename = $this->request->getParameter(\"filename\");\n\t\t\n\t\t// get the user login\n\t\t$idUser = $_SESSION[\"id_user\"];\n\t\t$modelUser = new User();\n\t\t$userlogin = $modelUser->userLogin($idUser);\n\t\t\n\t\t// parse the files names\n\t\t$filename = str_replace(\"__--__\", \".\", $filename);\n\t\t$filename = str_replace(\"__---__\", \" \", $filename);\n\t\t$filename = str_replace(\"__----__\", \"/\", $filename);\n\t\t$localurl = str_replace(\"\\\\\", \"/\" , $localurl) . \"/\" . basename($filename);\n\t\t$fileName = \"./\" . $userlogin .\"/\".basename($filename);\n\t\t\n\t\t// refuse to download if the quotas is over\n\t\t$modelQuotas = new StUserQuota();\n\t\t$userQuotas = $modelQuotas->getQuota($idUser); // in GB\n\t\t$modelUploader = new StUploader();\n\t\t$usage = $modelUploader->getUsage($userlogin);\n\t\t$usage = $usage/1000000000; \n\t\t\n\t\tif ($usage >= $userQuotas){\n\t\t\t$this->index( StTranslator::QuotasHoverMessage($lang) . $localurl);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// download\n\t\t$modelFiles = new StUploader();\n\t\t$modelFiles->downloadFile($localurl, $fileName);\n\t\t\n\t\t\n\t\t// view\n\t\t$this->index( StTranslator::DownloadMessage($lang) . $localurl);\n\t\treturn;\n\t}", "public function download_backup(){\n\t\tif ($this->in->get('backups') != \"\"){\n\n\t\t\t$file_name = $this->pfh->FolderPath('backup', 'eqdkp').$this->in->get('backups');\n\n\t\t\tif (preg_match('#^eqdkp-backup_([0-9]{10})_([0-9]{1,10})\\.(sql|zip?)$#', $this->in->get('backups'), $matches) || preg_match('#^eqdkp-fbackup_([0-9]{10})_([0-9]{1,10})\\.(sql|zip?)$#', $this->in->get('backups'), $matches) ){\n\n\t\t\t\t$name = 'eqdkp-backup_' . $this->time->date('Y-m-d_Hi', $matches[1]).\".\".$matches[3];\n\n\t\t\t\tswitch ($matches[3]){\n\t\t\t\t\tcase 'sql':\n\t\t\t\t\t\t$mimetype = 'text/x-sql';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'zip':\n\t\t\t\t\t\t$mimetype = 'application/zip';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\theader('Pragma: no-cache');\n\t\t\t\theader(\"Content-Type: $mimetype; name=\\\"$name\\\"\");\n\t\t\t\theader(\"Content-disposition: attachment; filename=$name\");\n\n\t\t\t\t@set_time_limit(0);\n\n\t\t\t\t$fp = @fopen($file_name, 'rb');\n\n\t\t\t\tif ($fp !== false){\n\t\t\t\t\twhile (!feof($fp)){\n\t\t\t\t\t\techo fread($fp, 8192);\n\t\t\t\t\t}\n\t\t\t\t\tfclose($fp);\n\t\t\t\t}\n\t\t\t\tflush();\n\t\t\t}\n\t\t\texit();\n\t\t\t//$this->display('1');\n\t\t} else {\n\t\t}\n\t}", "public function downloader()\n {\n if ( CKFinderDownloadCommand::ckfinderExists() === true ) {\n return;\n }\n\n Artisan::call('ckfinder:download');\n }", "public static function downloadFromStorage(): void\n {\n $files = Storage::disk(config('translation-manager.storage.disk'))\n ->allFiles(config('translation-manager.storage.path'));\n\n collect($files)\n ->each(static function ($file): void {\n Storage::disk('local')->put(\n self::STORAGE_PREFIX . $file,\n Storage::disk(config('translation-manager.storage.disk'))->get($file),\n );\n });\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "function download($file = \"\") {\n\t\t// Set maximum execution time in seconds (0 means no limit).\n\n\t\tset_time_limit(0);\n\t\t\n\t\t// Check downloader is admin or manager\n\t\tif(!empty($file)) {\n\t\t\t$file = SITE_DIR.\"public\".base64_decode($file);\n\n\t\t\t$this->output_file($file);\n\t\t} else\n\t\t\t$this->download_forbidden();\n\t\texit;\n\t}", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function download() {\n $file_name = get('name');\n// return \\Response::download(temp_path($file_name));\n return \\Response::download(storage_path('app') . '/' . $file_name);\n }", "public function downloadImages(){\n if(Auth::user()->statut_id != 3) return back();\n $this->createZip();\n return response()->download(public_path('allImages.zip'));\n }", "public function download()\n {\n\n $hashes = explode(',', $this->request->get('hashes'));\n $ids = array_map(function($hash) {\n return $this->fileEntry->decodeHash($hash);\n }, $hashes);\n\n $entries = $this->fileEntry->whereIn('id', $ids)->get();\n\n // TODO: refactor file entry policy to accent multiple IDs\n $entries->each(function($entry) {\n $this->authorize('show', [FileEntry::class, $entry]);\n });\n\n if ($entries->count() === 1 && $entries->first()->type !== 'folder') {\n $entry = $entries->first();\n\n $disk = $entry->getDisk();\n $stream = $disk->readStream($entry->getStoragePath());\n\n return response()->stream(function() use($stream) {\n fpassthru($stream);\n }, 200, [\n \"Content-Type\" => $entry->mime,\n \"Content-Length\" => $disk->size($entry->getStoragePath()),\n \"Content-disposition\" => \"attachment; filename=\\\"\" . $entry->name . \"\\\"\",\n ]);\n } else {\n $path = $this->createZip($entries);\n $timestamp = Carbon::now()->getTimestamp();\n return response()->download($path, \"download-$timestamp.zip\");\n }\n }", "public function getDownload($fileimgname)\n {\n \n // $dl= Jobfiles::find($fileimgname);\n \n \n\n // return Storage::download($dl->path,$dl->title);\n return response()->download(public_path('/uploads/Files/'.$fileimgname));\n // return response()->download(public_path('/uploads/Files/', $fileimgname, $headers));\n \n }", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "public function actionDownloadBackupFile()\n\t{\n\t\t$fileName = craft()->request->getRequiredQuery('fileName');\n\n\t\tif (($filePath = IOHelper::fileExists(craft()->path->getTempPath().$fileName.'.zip')) == true)\n\t\t{\n\t\t\tcraft()->request->sendFile(IOHelper::getFileName($filePath), IOHelper::getFileContents($filePath), array('forceDownload' => true));\n\t\t}\n\t}", "function download($filename){\n\t\t$this->downloadFile('files/pdf/',$filename);\n\t}", "public function download()\n {\n return Storage::download(request('path'));\n }", "function tdc_do_download($file_name){\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n\n if($filenode != null){\n $file_path = TDC_DOC_ROOT . tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n if(tdc_send_file($file_path, $file_name)){\n tdc_update_count($database, $filenode, TDC_DATABASE_FILE);\n }\n }\n}", "public function Download(){\n\t\t\n\t\t\n\t}", "public function downloadAction() {}", "function download(){\n $file = $this->input->get('backup');\n $sql = file_get_contents('backups/'.$file);\n $this->load->helper('download');\n force_download($file, $sql);\n }", "public function downloadArchive() {\n\t\t$parsedUrl = parse_url($this->archive);\n\t\t$prefix = 'package';\n\t\t\n\t\t// file transfer via hypertext transfer protocol.\n\t\tif ($parsedUrl['scheme'] == 'http') {\n\t\t\t$this->archive = FileUtil::downloadFileFromHttp($this->archive, $prefix);\n\t\t}\n\t\t// file transfer via file transfer protocol.\n\t\telseif ($parsedUrl['scheme'] == 'ftp') {\n\t\t\t$this->archive = FTPUtil::downloadFileFromFtp($this->archive, $prefix);\n\t\t}\n\t\t\n\t\t// unzip tar\n\t\t$this->archive = self::unzipPackageArchive($this->archive);\n\t\t\n\t\treturn $this->archive;\n\t}", "function ft_hook_download($dir, $file) {}", "public function download_file($file_name){\n $files = Storage::disk('invoice_uploads')->getDriver()->getAdapter()->applyPathPrefix($file_name);\n return response()->download($files);\n }", "function download_attachment($key, $filename)\n {\n global $standard_headers;\n global $cookie;\n\n $fp = fopen($filename, 'w');\n\n $ch = curl_init('https://www.tadpoles.com/remote/v1/attachment?key=' . $key);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $standard_headers);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n curl_setopt($ch, CURLOPT_FILE, $fp);\n\n $response = curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n }", "public function download_files($files, $zip_name='downloaded_files.zip')\n\t{\n\t\tee()->load->model('file_upload_preferences_model');\n\n\t\t$upload_prefs = ee()->file_upload_preferences_model->get_file_upload_preferences(1);\n\n\t\tif (count($files) === 1)\n\t\t{\n\t\t\t// Get the file Location:\n\t\t\t$file_data = ee()->db->select('upload_location_id, file_name')\n\t\t\t\t->from('files')\n\t\t\t\t->where('file_id', $files[0])\n\t\t\t\t->get()\n\t\t\t\t->row();\n\n\t\t\t$file_path = reduce_double_slashes(\n\t\t\t\t$upload_prefs[$file_data->upload_location_id]['server_path'].'/'.$file_data->file_name\n\t\t\t);\n\n\t\t\tif ( ! file_exists($file_path))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$file = file_get_contents($file_path);\n\t\t\t$file_name = $file_data->file_name;\n\n\t\t\tee()->load->helper('download');\n\t\t\tforce_download($file_name, $file);\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Zip up a bunch of files for download\n\t\tee()->load->library('zip');\n\n\t\t$files_data = ee()->db->select('upload_location_id, file_name')\n\t\t\t->from('files')\n\t\t\t->where_in('file_id', $files)\n\t\t\t->get();\n\n\t\tif ($files_data->num_rows() === 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tforeach ($files_data->result() as $row)\n\t\t{\n\t\t\t$file_path = reduce_double_slashes(\n\t\t\t\t$upload_prefs[$row->upload_location_id]['server_path'].'/'.$row->file_name\n\t\t\t);\n\t\t\tee()->zip->read_file($file_path);\n\t\t}\n\n\t\tee()->zip->download($zip_name);\n\n\t\treturn TRUE;\n\t}", "public function handleDownload() {\n $tables = DB::select('SHOW TABLES');\n foreach ($tables as $table) {\n $this->storeDatabaseTable($table->Tables_in_spoferan_blog);\n }\n\n $this->storeUploads();\n $date = date('Y-m-d');\n $path = storage_path($date . $this->archive_download_name);\n $filename = sprintf('%s.zip', $path);\n $zip = new \\ZipArchive();\n $zip->open($filename, \\ZipArchive::CREATE);\n $files = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($path),\n \\RecursiveIteratorIterator::LEAVES_ONLY\n );\n foreach ($files as $name => $file) {\n if (!$file->isDir()) {\n $filePath = $file->getRealPath();\n $relativePath = substr($filePath, strlen($path) + 1);\n $zip->addFile($filePath, $relativePath);\n }\n }\n $zip->close();\n \\File::deleteDirectory(storage_path($date . $this->archive_download_name));\n\n return response()->download(storage_path($date . '_' . $this->archive_download_name . '.zip'))->deleteFileAfterSend(true);\n }", "function urldl(){\n\n // folder to save downloaded files to. must end with slash\n $destination_folder = 'downloads/';\n\n $url = $_POST['url'];\n $newfname = $destination_folder . basename($url);\n\n $file = fopen ($url, \"rb\");\n if ($file) {\n $newf = fopen ($newfname, \"wb\");\n\n if ($newf)\n while(!feof($file)) {\n fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );\n }\n }\n\n if ($file) {\n fclose($file);\n }\n\n if ($newf) {\n fclose($newf);\n }\n\n}", "public static function downloadFile($path)\n {\n return BaseUrl::to([self::$fileflyApiUrl, 'action' => 'download', 'path' => $path]);\n }", "function download_file(string $filename, string $root_path = '/cloud'): void {\n\tif (!file_exists($filename))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" does not exist.');\n\tif (!Common::isAuthorizedPath($filename, $root_path))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" is invalid.');\n\n\t// get file info\n\t$content_type = mime_content_type($filename);\n\t$basename = basename($filename);\n\t$content_length = filesize($filename);\n\n\t// set headers\n\theader(\"Content-Type: $content_type\");\n\theader(\"Content-Disposition: attachment; filename=\\\"$basename\\\"\");\n\theader(\"Content-Length: $content_length\");\n\n\t// clear buffer and flush headers\n\tob_clean();\n\tflush();\n\n\t// output file contents\n\treadfile($filename);\n}", "public function downloadAction() {\r\n $file_id = $this->getRequest()->getParam('file_id');\r\n $chanelphoto = Engine_Api::_()->getItem('sesvideo_chanelphoto', $this->getRequest()->getParam('photo_id'));\r\n if (!$chanelphoto)\r\n return;\r\n $chanelphoto->download_count = $chanelphoto->download_count + 1;\r\n $chanelphoto->save();\r\n $file_id = $chanelphoto->file_id;\r\n if ($file_id == '' || intval($file_id) == 0)\r\n return;\r\n $storageTable = Engine_Api::_()->getDbTable('files', 'storage');\r\n $select = $storageTable->select()->from($storageTable->info('name'), array('storage_path', 'name'))->where('file_id = ?', $file_id);\r\n $storageData = $storageTable->fetchRow($select);\r\n $storageData = (object) $storageData->toArray();\r\n if (empty($storageData->name) || $storageData->name == '' || empty($storageData->storage_path) || $storageData->storage_path == '')\r\n return;\r\n //Get base path\r\n $basePath = APPLICATION_PATH . '/' . $storageData->storage_path;\r\n @chmod($basePath, 0777);\r\n header(\"Content-Disposition: attachment; filename=\" . urlencode(basename($storageData->name)), true);\r\n header(\"Content-Transfer-Encoding: Binary\", true);\r\n header(\"Content-Type: application/force-download\", true);\r\n header(\"Content-Type: application/octet-stream\", true);\r\n header(\"Content-Type: application/download\", true);\r\n header(\"Content-Description: File Transfer\", true);\r\n header(\"Content-Length: \" . filesize($basePath), true);\r\n readfile(\"$basePath\");\r\n exit();\r\n // for safety resason double check\r\n return;\r\n }", "public function download($fileid) {\n\n\t\t$props = $this->get_file_properties($fileid);\n\n\t\t$response = $this->curl_get(skydrive_base_url.$fileid.\"/content?access_token=\".$this->access_token, \"false\", \"HTTP/1.1 302 Found\");\n\n\t\t$arraytoreturn = Array();\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tarray_push($arraytoreturn, Array('properties' => $props, 'data' => $response));\n\n\t\t\treturn $arraytoreturn;\n\n\t\t}\t\t\n\n\t}", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "public function DownoadFile()\r\n\t{\r\n\t\theader(\"download.php?key=\".$this->secretKey);\r\n\t}", "public function download($file_name)\n {\n $backupFolder=env('BACKUP_FOLDER');\n $file = $backupFolder.'/' . $file_name;\n $disk = Storage::disk('local');\n if ($disk->exists($file)) {\n return response()->download(storage_path(\"app/{$file}\"));\n } else {\n abort(404, \"The backup file doesn't exist.\");\n }\n }", "protected function downloadFile($filePath)\n {\n $url = 'https://content.dropboxapi.com/2/files/download';\n\n $resource = curl_init($url);\n\n curl_setopt($resource, CURLOPT_HTTPHEADER, [\n 'Authorization: Bearer ' . $this->getData('access_token'),\n 'Content-Type: application/octet-stream',\n 'Dropbox-API-Arg: {\"path\": \"' . $filePath . '\"}'\n ]);\n curl_setopt($resource, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($resource, CURLOPT_FOLLOWLOCATION, 1);\n $result = curl_exec($resource);\n curl_close($resource);\n\n if ($json = json_decode($result, true)) {\n if (!empty($json['error']['.tag'])) {\n $tag = $json['error']['.tag'];\n if ($tag == 'invalid_access_token') {\n $error = \"Invalid Dropbox access token\";\n } elseif ($tag == 'path') {\n $error = \"File not found on Dropbox: \" . $filePath;\n } else {\n $error = \"Dropbox api error: \" . $result;\n }\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__($error));\n }\n }\n\n if ($result) {\n return $result;\n }\n\n return false;\n }", "public function downloadFile($filename)\n {\n if (!Storage::has('files/' . auth()->user()->id . '/' . $filename)) {\n abort(404);\n }\n\n return response()->streamDownload(function () use ($filename) {\n FileVault::streamDecrypt('cabinet_management/nexasoftware/BDA/' . $filename);\n }, Str::replaceLast('.enc', '', $filename));\n }", "function ciniki_events_web_fileDownload($ciniki, $tnid, $event_permalink, $file_permalink) {\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n\n //\n // Get the file details\n //\n $strsql = \"SELECT ciniki_event_files.id, \"\n . \"ciniki_event_files.uuid, \"\n . \"ciniki_event_files.name, \"\n . \"ciniki_event_files.permalink, \"\n . \"ciniki_event_files.extension, \"\n . \"ciniki_event_files.binary_content \"\n . \"FROM ciniki_events, ciniki_event_files \"\n . \"WHERE ciniki_events.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_events.permalink = '\" . ciniki_core_dbQuote($ciniki, $event_permalink) . \"' \"\n . \"AND ciniki_events.id = ciniki_event_files.event_id \"\n . \"AND (ciniki_events.flags&0x01) = 0x01 \"\n . \"AND ciniki_event_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND CONCAT_WS('.', ciniki_event_files.permalink, ciniki_event_files.extension) = '\" . ciniki_core_dbQuote($ciniki, $file_permalink) . \"' \"\n . \"AND (ciniki_event_files.webflags&0x01) = 0 \" // Make sure file is to be visible\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.events', 'file');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['file']) ) {\n return array('stat'=>'noexist', 'err'=>array('code'=>'ciniki.events.62', 'msg'=>'Unable to find requested file'));\n }\n $rc['file']['filename'] = $rc['file']['name'] . '.' . $rc['file']['extension'];\n\n //\n // Get the storage filename\n //\n $storage_filename = $tenant_storage_dir . '/ciniki.events/files/' . $rc['file']['uuid'][0] . '/' . $rc['file']['uuid'];\n if( file_exists($storage_filename) ) {\n $rc['file']['binary_content'] = file_get_contents($storage_filename); \n }\n\n return array('stat'=>'ok', 'file'=>$rc['file']);\n}", "public function downloadAction()\n {\n $url = $this->getRequest()->REQUEST_URI;\n $url = str_replace('/stream/download/', '/', '../data/uploads/images' . $url);\n $this->download($url, null, 'application/jpg');\n $this->view->message = \"Download erfolgreich.\";\n }", "public function downloadAction(){\n //These are the files that are downloadable.\n $pathToDocs = RAIZ. \"/docs\";\n $param_to_file = array( \"milestone1\" => $pathToDocs . \"/milestone 1/group13-milestone1.pdf\",\n \"milestone2\" => $pathToDocs . \"/milestone 2/group13-milestone2.pdf\",\n \"milestone2-revision1\" => $pathToDocs . \"/milestone 2/group13-milestone2-comments.pdf\",\n \"milestone2-presentation\" => $pathToDocs . \"/milestone 2/group13-milestone2-presentation.pptx\");\n $file = $param_to_file[$this->_getParam('file')];\n //If we are being ask for a file that is not in the previous array, throw an Exception.\n if(is_null($file)){\n throw new Exception(\"Unknown file\");\n }\n //Disable view and layout\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n //The file is in the previous array. So, fetch it and force the download.\n if (file_exists($file) && is_file($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }else{\n echo \"<pre style='color:red'>The file does not exists</pre>\";\n } \n }", "public function testDownloadDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $this->assertEquals($this->doc1, $obj->downloadDocument($this->doc1));\n\n $res = $obj->downloadDocument($this->dir1);\n $this->assertNotNull($res->getId());\n $this->assertEquals(\"zip\", $res->getExtension());\n $this->assertEquals(\"application/zip\", $res->getMimeType());\n $this->assertContains(\"phpunit-\", $res->getName());\n $this->assertEquals(Document::TYPE_DOCUMENT, $res->getType());\n }", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "public function download()\n {\n // -- use env file for DB related values\n $username = env('DB_USERNAME', 'forge');\n $password = env('DB_PASSWORD', '');\n\n // -- back will bo stored in file named\n $backFileName = 'all_db_backup.sql';\n\n // -- command that generates the back up file\n $command = 'mysqldump -u '.$username.' -p'.$password.' --all-databases > '.$backFileName;\n\n // -- command execution\n exec ($command, $output, $return);\n\n // -- check result to display appropriate result\n $resultStr = '';\n if (!$return) {\n $resultStr = \"Backup file generated successfully. Please check public directory for file \".$backFileName;\n }\n return View::make(\"welcome\")->with('resultStr', $resultStr);\n }", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "function download_file($url, $upload_path){\n\t$results = \"\";\n\t$fileArray = explode(\"/\", $url);\n\t$filename = end($fileArray);\n\t\n\n\t$code = get_http_response_code($url);\n\tif($code == 200){\n\t\texec('curl -o ' . $upload_path . $filename .' ' . $url);\n\t\tif (filesize($upload_path . $filename )>0) $results =\"$filename has been uploaded.\";\n\t\telse return $results = \"Error download file\";\n\t}\n\telse {\n\t\t$results = \"File does not exist\";\n\t}\n\n\treturn $results; \n\n}", "public function test_download_files()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->press('Export Data to CSV with Author and Title')\n ->press('Export Data to XML with Author and Title')\n ->assertPathIs('/');\n });\n }", "function download_zone_files($urls, $working_directory){\n\n # The zone files will be saved in a sub-directory\n $output_directory = $working_directory . \"/zonefiles\";\n\n if(!is_dir($output_directory)){\n mkdir($output_directory, 0777, true);\n }\n\n # Download the zone files one by one\n foreach($urls as $link){\n download_one_zone($link, $output_directory);\n }\n}", "private function download()\n {\n $response = $this->httpClient->request('GET', env('PHOTO_ENDPOINT'));\n $content = json_decode($response->getBody()->getContents());\n\n if (! json_last_error() and property_exists($content, 'images')) {\n\n $requests = function ($images) {\n foreach ($images as $image) {\n yield new \\GuzzleHttp\\Psr7\\Request('GET', $image->url);\n }\n };\n\n $pool = new Pool($this->httpClient, $requests($content->images), [\n 'concurrency' => count($content->images),\n 'fulfilled' => function ($response, $index) use ($content) {\n $exp = explode('/', $content->images[$index]->url);\n\n $imageId = end($exp);\n\n $fileName = env('PHOTO_PATH') . $imageId;\n\n if (! Storage::exists($fileName)) {\n Storage::put($fileName, $response->getBody()->getContents(), 'public');\n }\n },\n 'rejected' => function ($reason, $index) {\n die('fail');\n },\n ]);\n\n $promise = $pool->promise();\n $promise->wait();\n }\n }", "function VM_downloadVBOXaddons($checkedVersions)\n{\n\t$cmds=\"\";\n\tforeach($checkedVersions as $version)\n\t\t$cmds.=VM_generateVBOXaddonDownloadCMD($version);\n\n\tif (!SERVER_runningInBackground(\"VBoxAddonDownloader\"))\n\t{\n\t\tSERVER_runInBackground(\"VBoxAddonDownloader\",\"\nrm \".VBOX_addonDownloaderLog.\"\ntouch \".VBOX_addonDownloaderLog.\"\nchmod 555 \".VBOX_addonDownloaderLog.\"\nchmod 555 /m23/log\",root,false);\n\t\tSERVER_runInBackground(\"VBoxAddonDownloader\",$cmds);\n\t}\n}", "public function download(): void\n\t{\n\t\t/** @var ExtensionModel $model */\n\t\t$model = $this->getModel();\n\t\t$id = $this->input->getInt('id');\n\t\t$fileDetails = $model->getFilename($id);\n\n\t\tif (!file_exists($fileDetails->file))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(Text::sprintf('COM_JED_EXTENSIONS_DOWNLOAD_NOT_FOUND',\n\t\t\t\t$fileDetails->file));\n\t\t}\n\n\t\theader('Content-type: application/zip');\n\t\theader('Content-Disposition: attachment; filename=' . $fileDetails->originalFile);\n\t\theader('Content-length: ' . filesize($fileDetails->file));\n\t\theader('Pragma: no-cache');\n\t\theader('Expires: 0');\n\t\treadfile($fileDetails->file);\n\n\t\tFactory::getApplication()->close();\n\t}", "private function downloadZipFile()\n {\n if (! is_writable('/tmp/')) {\n throw new \\Exception(\"Unable to download release: /tmp/ dir is not writable\");\n }\n \n $ch = curl_init(self::RELEASE_URL . 'v' . self::VERSION . '.zip');\n curl_setopt($ch, \\CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, \\CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, \\CURLOPT_RETURNTRANSFER, true);\n $zipData = curl_exec($ch);\n $curlInfo = curl_getinfo($ch);\n if ($curlInfo['http_code'] != 200) {\n throw new \\Exception(\"Unable to download release: server returned code \" . $curlInfo['http_code']);\n }\n \n $zipFile = fopen('/tmp/' . self::VERSION, 'w+');\n fwrite($zipFile, $zipData);\n fclose($zipFile);\n }", "public function downloadftvAction()\n {\n $user_params=$this->_request->getParams();\n $request_id = $user_params['request_id'];\n $zipname = explode(\"/\",$user_params['filename']);\n // set example variables\n $filename = $zipname[1];\n $filepath = $request_id.\"-\".$filename;\n\n $this->_redirect(\"/BO/download_ftv.php?ftvfile=\".$filepath.\"\");\n /** Author: Thilagam **/\n /** Date:05/05/2016 **/\n /** Reason: Code optimization **/\n //$this->_redirect(\"/BO/download-files.php?function=downloadFtv&ftvfile=\".$filepath.\"\");\n\n }", "public function downloadFile($id) {\n $lmsFile = LMSFile::find($id);\n //$file = Storage::disk('local')->get('lms/'.$lmsFile->hash);\n //Alternaive method\n $url = public_path().'/../storage/lms/'.$lmsFile->hash;\n return response()->download($url);\n //return (new Response($file, 200));\n }", "public function downloadFileList(DownloadFileListRequest $request): DownloadFileListResponse\n {\n }", "public function downloadAllEventPictures(){\n\t\treturn response()->download(public_path('pictures/events'));\n\t}", "public function downloadBorme(Request $request)\n {\n //Obtenemos el valor _POST del campo pdf de nuestro formulario\n \t$url_archivo = $request->input(\"pdf\");\n \t//Comprobamos que tenga https, y sino se la añadimos\n \tif(strpos($url_archivo, ':')===false){\n \t\t$url_archivo = \"https://\".$url_archivo;\n \t}\n\n \t//Comprobamos que el dominio es exclusivamente el que queremos usar para descargar\n \tif(strstr(parse_url($url_archivo, PHP_URL_HOST), 'www.boe.es')){\n \t\t//Comprobamos que es un PDF \n \t\t$archivo = parse_url($url_archivo, PHP_URL_PATH);\n \t\tif(strstr(substr($archivo, -4),'.pdf')){\n \t\t\t$this->store($archivo, $url_archivo);\n \t\t\t//Redirigimos a la lista de archivos guardados\n\t\t\t\treturn redirect()->route('listar_txt', [], 301);\n\t\t }else{\n\t\t \t//Si no es un PDF, mensaje de error\n \t\tdie(\"<h1>¡Error!</h1><br>Revisa la url, tienes que introducir la url del PDF del BORME.\");\n\t\t }\n \t}else{\n \t\t//En caso de intentar usar otro dominio para la descarga, mensaje de error\n \t\tdie(\"<h1>¡Error!</h1><br>Ojo, el dominio del que intentas descargar el BORME no es www.boe.es\");\n \t}\t\n\n }", "public function downloads(){\r\n $this->load->helper('download');\r\n //Get the file from whatever the user uploaded (NOTE: Users needs to upload first), @See http://localhost/CI/index.php/upload\r\n $data = file_get_contents(\"./uploads/Past and on-going SC projects.xlsx\");\r\n //Read the file's contents\r\n $name = 'Past and on-going SC projects.xlsx';\r\n\r\n //use this function to force the session/browser to download the file uploaded by the user \r\n force_download($name, $data);\r\n }", "public function download($id)\n\t{\n\t\t$fileInfo = $this->m_admin->getRows(array('name' => $id));\n\t\t//file path\n\t\t$filename = $fileInfo['name'] ?? 'default value';\n\t\t$filepath = 'C:\\xampp\\htdocs\\repositori\\uploads\\file_aplikasi/' . $fileInfo['name'];\n\t\t$data = file_get_contents($filepath);\n\t\t//download file from directory\n\t\t$mime = get_mime_by_extension($filepath);\n\t\theader('Content-Type: ' . $mime); // Add the mime type from Code igniter.\n\n\t\treturn force_download($filename, $data);\n\t}", "function download()\n {\n $field = $this->GET('field');\n $id = $this->GET('id');\n $file = $this->table->data[$id][$field];\n header('Content-Type: ' . $this->_mime_content_type($file));\n header('Content-Length: ' . strlen($file));\n header('Content-Disposition: attachment; filename=\"' . $field . '_' . $id . '\";');\n echo $file;\n }", "public function action_download($file = NULL) {\n $path_file = DOCROOT.\"sites\" . DIRECTORY_SEPARATOR . \"$file.zip\";\n \n //Verifica se o arquivo existe\n if (\\File::exists($path_file)) {\n //Download do arquivo \n \\Sucker::Download($path_file, \"$file\");\n }else{\n //Redireciona caso o arquivo não exista\n \\Response::redirect('home');\n }\n \n }", "public function downloadpresskitveue($file_name)\n {\n // echo $file_name;die;\n $filennmdownload = base64_decode($file_name);\n // echo $filennm;die;\n //********its working for single file\n $download_path = ( public_path() . '/upload/venue-press-kit/source-file/' . $filennmdownload );\n return( Response::download( $download_path ) );\n \n }", "public function downloadFile()\n {\n // Check for request forgeries.\n Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN'));\n\n $model = $this->getModel();\n $model->downloadFile();\n }", "function top_downloads()\r\n\t{\r\n\t\t\r\n\t\tdefine( 'IDM_PATH', ROOT_PATH.'modules/downloads/' );\r\n\t\t\r\n\t\t$this->ipsclass->load_language( 'lang_downloads' );\r\n\t\t$this->ipsclass->load_template( 'skin_downloads_external' );\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get gallery library and API\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\tif( !class_exists( 'api_idm' ) )\r\n\t\t{\r\n\t\t\trequire_once( ROOT_PATH.'sources/api/api_core.php' );\r\n\t\t\trequire_once( ROOT_PATH . 'sources/api/idm/api_idm.php' );\r\n\t\t}\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Create API Object\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$idm_api = new api_idm;\r\n\t\t$idm_api->ipsclass = $this->ipsclass;\r\n\r\n\t\t//-----------------------------------------\r\n\t\t// Get images\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$files = array();\r\n\t\t$files = $idm_api->return_idm_data( $member['id'], 10, 1, 'f.file_downloads DESC' );\r\n\t\t\r\n\t\t//-----------------------------------------\r\n\t\t// Ready to pull formatted stuff?\r\n\t\t//-----------------------------------------\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\tif( count($files) )\r\n\t\t{\r\n\t\t\tforeach( $files as $row )\r\n\t\t\t{\r\n\t\t\t\t$row['css'] = $row['file_open'] == 1 ? 'row2' : 'row2shaded';\r\n\t\t\t\t\r\n\t\t\t\t$row['file_submitteddis'] = $this->ipsclass->get_date( $row['file_submitted'], 'LONG' );\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_updated'] > $row['file_submitted'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['file_updateddis'] = \"<strong>\".$this->ipsclass->lang['catdis_updated'].\"</strong>\".$this->ipsclass->get_date( $row['file_updated'], 'LONG' );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['file_updateddis'] = \"&nbsp;\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $row['file_submitter'] == 0 OR !$row['members_display_name'] )\r\n\t\t\t\t{\r\n\t\t\t\t\t$row['members_display_name'] = $this->ipsclass->lang['idm_guestlang'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$row['submitter'] = $this->ipsclass->make_profile_link( $row['members_display_name'], $row['file_submitter'] );\r\n\t\t\t\t$row['filename'] = $this->ipsclass->compiled_templates['skin_downloads_external']->file_link( $row['file_name'], $row['file_id'] );\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$data[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t$output = $this->ipsclass->compiled_templates['skin_downloads_external']->portal_block( $this->ipsclass->lang['top_downloads'], $data, 1 );\r\n\r\n\t\treturn $output;\r\n\t}", "function download($id){\r\n\t\t\r\n\t\t$id = Sanitize::escape($id);\r\n\t\t//$this->Version->unbind();\r\n\t\t$archivo = $this->Version->findById($id);\r\n\t\t$archivo_id = $archivo['Archivo']['id'];\r\n\t\t\r\n\t\t#Permitir la descarga del archivo si tiene los permisos\r\n\t\tif(!$this->Archivo->verificarPermiso($archivo_id, $this->Session->read('usuario_id'), 'read', $this->Session->read('alias')) ){\r\n\t\t\t$this->flash(\"Existio un error no es posible descargar el Archivo\", \"/categorias/index\");\r\n\t\t}else{\r\n\t\t\t$f = new File($archivo['Version']['nombre']);\r\n\t\t\theader('Content-type: ' . $archivo['Archivo']['type']);\r\n\t\t\theader('Content-length: ' . $archivo['Version']['size']);\r\n\t\t\theader('Content-Disposition: attachment; filename=\"'.$archivo['Archivo']['nombre'].'\"');\r\n\t\t\techo $f->read();\r\n\t\t\tConfigure::write('debug',0);\r\n\t\t\texit(0);\r\n\t\t}\r\n\t}", "public function downloadVideo(Request $request)\n {\n set_time_limit(300);\n ini_set('memory_limit', '-1');\n\n\n $url = $request->input('urlFiles');\n\n list($urlfile, $exten) = explode(\".\", $url);\n\n $fileName = $urlfile;\n\n //dd($fileName);\n\n $semana = $request->input('semanaFile');\n $sem = Semana::find($semana);\n $curso = Curso::find($sem->curso);\n $cursoid= $curso->id_curso;\n\n \n $this->soapWrapper->add('VideoWS', function ($service) {\n $service->wsdl(\"http://localhost:8080/VideoWS/VideoWS?wsdl\");\n $service->trace(true); // Optional: (parameter: true/false)\n $service->cache(WSDL_CACHE_NONE); // Optional: Set the WSDL cache\n });\n\n $data = [\n 'fileName' => $fileName\n ];\n\n $resultado = $this->soapWrapper->call('VideoWS.download', $data);\n \n $destinationPath= 'public/'.'videos/'.$cursoid.'/'.$semana.'/'.$fileName . \".\" . $exten;\n\n Storage::put($destinationPath, $resultado->return);\n\n return redirect()->back();\n }", "public function download(Request $request)\n {\n //Nombre archivo\n \t$nombre_archivo = $request->input(\"file\");\n \t$existencia = Storage::disk('local')->exists($nombre_archivo.'.txt');\n \tif($existencia){\n\t\t\t//Abrimos el txt guardado anteriormente\n\t\t\t$texto = Storage::disk('local')->get($nombre_archivo.'.txt');\n\t\t\t//Nombre del archivo a descargar\n \t\t$nombre_descarga = $nombre_archivo.'.txt';\n\n\t\t // Creamos los headers para generar la descarga\n\t\t $headers = [\n\t\t 'Content-type' => 'text/plain', \n\t\t 'Content-Disposition' => sprintf('attachment; filename=\"%s\"', $nombre_descarga),\n\t\t 'Content-Length' => strlen($texto)\n\t\t ];\n\n\t\t // Enviamos la respuesta al navegador con el contenido y los headers\n\t\t return Response::make($texto, 200, $headers);\n\t\t} else {\n\t\t\tdie(\"El archivo no existe en nuestros sistemas. Prueba a descargarlo antes\");\n\t\t}\n }", "function _download_items($dir, $items)\n{\n _debug(\"count items: '$items[0]'\");\n if (count($items) == 0)\n show_error($GLOBALS[\"error_msg\"][\"miscselitems\"]);\n\n // check if user has permissions to download\n // this file\n if ( ! _is_download_allowed($dir, $items) )\n\t\tshow_error( $GLOBALS[\"error_msg\"][\"accessitem\"] );\n\n // if we have exactly one file and this is a real\n // file we directly download it\n if ( count($items) == 1 && get_is_file( $dir, $items[0] ) )\n {\n $abs_item = get_abs_item($dir, $items[0]);\n _download($abs_item, $items[0]);\n }\n\n // otherwise we do the zip download\n zip_download( get_abs_dir($dir), $items );\n}", "public static function _download_file($file_url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_POST, 0); \n\tcurl_setopt($ch,CURLOPT_URL,$file_url); \n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$file_content = curl_exec($ch);\n\tcurl_close($ch);\n //return file content \n return $file_content;\n }", "function save_items_as_downloads_ajax() {\n\t\t$path = str_replace( '\\\\\\\\', '\\\\', $_POST['path'] );\n\t\t$date = $_POST['selection_date'];\n\t\tif ( isset( $_POST['selected_files'] ) ) {\n\t\t\t$files = $this->edde_selected_files_to_array( $_POST['selected_files'] );\n\t\t} else {\n\t\t\t$files = false;\n\t\t}\n\n\t\t$result = new Import_From_Uploads( $path, $files, $date);\n\t\tif ( $result ) {\n\t\t\techo 'Success!';\n\t\t} else {\n\t\t\techo 'Something went wrong =(';\n\t\t}\n\t\twp_die();\n\t}", "public function get_file_detail(){\n\t\t$api_url \t= \"https://api002.backblazeb2.com\";\n\t\t$auth_token = \"4_002147cd01b5a680000000000_018d4c36_d47af5_acct_8SQ4r2LRCypwp1wl0rPo1ySwDm4=\"; \n\t\t$bucket_id = \"d184771c8d50b17b65ba0618\"; // The ID of the bucket\n\n\t\t$session = curl_init($api_url . \"/b2api/v2/b2_list_file_names\");\n\n\t\t// Add post fields\n\t\t$data = array(\"bucketId\" => $bucket_id);\n\t\t$post_fields = json_encode($data);\n\t\tcurl_setopt($session, CURLOPT_POSTFIELDS, $post_fields); \n\n\t\t// Add headers\n\t\t$headers = array();\n\t\t$headers[] = \"Authorization: \" . $auth_token;\n\t\tcurl_setopt($session, CURLOPT_HTTPHEADER, $headers); \n\n\t\tcurl_setopt($session, CURLOPT_POST, true); // HTTP POST\n\t\tcurl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response\n\t\t$server_output = curl_exec($session); // Let's do this!\n\t\tcurl_close ($session); // Clean up\n\t\techo ($server_output); // Tell me about the rabbits, George!\n\t}", "public function downloadDomainAssociationFile(): void\n {\n $response = $this->httpClient->sendRequest('GET', self::URL_FILE);\n\n if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {\n return;\n }\n\n if ($this->filesystem->has(self::LOCAL_FILE)) {\n $this->filesystem->delete(self::LOCAL_FILE);\n }\n\n $this->filesystem->write(self::LOCAL_FILE, $response->getBody());\n }", "public function updraft_download_backup() {\n\t\ttry {\n\t\t\tif (empty($_REQUEST['_wpnonce']) || !wp_verify_nonce($_REQUEST['_wpnonce'], 'updraftplus_download')) die;\n\t\n\t\t\tif (empty($_REQUEST['timestamp']) || !is_numeric($_REQUEST['timestamp']) || empty($_REQUEST['type'])) exit;\n\t\n\t\t\t$findexes = empty($_REQUEST['findex']) ? array(0) : $_REQUEST['findex'];\n\t\t\t$stage = empty($_REQUEST['stage']) ? '' : $_REQUEST['stage'];\n\t\t\t$file_path = empty($_REQUEST['filepath']) ? '' : $_REQUEST['filepath'];\n\t\n\t\t\t// This call may not actually return, depending upon what mode it is called in\n\t\t\t$result = $this->do_updraft_download_backup($findexes, $_REQUEST['type'], $_REQUEST['timestamp'], $stage, false, $file_path);\n\t\t\t\n\t\t\t// In theory, if a response was already sent, then Connection: close has been issued, and a Content-Length. However, in https://updraftplus.com/forums/topic/pclzip_err_bad_format-10-invalid-archive-structure/ a browser ignores both of these, and then picks up the second output and complains.\n\t\t\tif (empty($result['already_closed'])) echo json_encode($result);\n\t\t} catch (Exception $e) {\n\t\t\t$log_message = 'PHP Fatal Exception error ('.get_class($e).') has occurred during download backup. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t// @codingStandardsIgnoreLine\n\t\t} catch (Error $e) {\n\t\t\t$log_message = 'PHP Fatal error ('.get_class($e).') has occurred during download backup. Error Message: '.$e->getMessage().' (Code: '.$e->getCode().', line '.$e->getLine().' in '.$e->getFile().')';\n\t\t\terror_log($log_message);\n\t\t\techo json_encode(array(\n\t\t\t\t'fatal_error' => true,\n\t\t\t\t'fatal_error_message' => $log_message\n\t\t\t));\n\t\t}\n\t\tdie();\n\t}", "function download_site_file($file_id) {\n$this->session->keep_flashdata($this->back_url_key);\nif (strlen(trim($this->back_url)) <= 0 || $this->back_url == NULL) {\n$this->back_url = $this->home_url;\n}\n$file_data = $this->backup->check_site_file($file_id);\nif ($file_data !== NULL) {\n$this->load->helper('download');\n$file_path = $file_data->backup_location . $file_data->backup_name;\n$data = file_get_contents($file_path); // Read the file's contents\n$filename = basename($file_path);\n$ext = pathinfo($filename, PATHINFO_EXTENSION);\n$name = md5(date('d-m-Y H:i:s')) . date('_d-m-Y_H:i:s') . '.' . $ext;\nforce_download($name, $data);\n}\nredirect($this->back_url);\n}", "public function download($url){\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($ch, CURLOPT_HEADER, 0);\r\n $res = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n $file_name = 'ipx_'.date('Ymd', time()).'.datx';\r\n file_put_contents(__DIR__ . \"/Data/\" . $file_name, $res);\r\n IpxCache::put(self::$latest_file_tag, $file_name, 1440);\r\n $data_files_list = $this->getDataFilesList();\r\n $this->deleteExpire($data_files_list);\r\n }", "function download_db_file($file_id) {\n$this->session->keep_flashdata($this->back_url_key);\nif (strlen(trim($this->back_url)) <= 0 || $this->back_url == NULL) {\n$this->back_url = $this->home_url;\n}\n$file_data = $this->backup->check_db_file($file_id);\nif ($file_data !== NULL) {\n$this->load->helper('download');\n$file_path = $this->db_backup_path . $file_data->backup_name;\n$data = file_get_contents($file_path); // Read the file's contents\n$filename = basename($file_path);\n$ext = pathinfo($filename, PATHINFO_EXTENSION);\n$name = md5(date('d-m-Y H:i:s')) . date('_d-m-Y_H:i:s') . '.' . $ext;\nforce_download($name, $data);\n}\nredirect($this->back_url);\n}", "function downloadFile($folder,$fielname) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $fielname;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$fielname;\n\t\tif(file_exists($path) && is_file($path)) {\t\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path); \n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{ \n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\n \t}", "function drush_gallery_link_fancybox_download() {\n if (!drush_shell_exec('type unzip')) {\n return drush_set_error(dt('Missing dependency: unzip. Install it before using this command.'));\n }\n\n $args = func_get_args();\n if (isset($args[0])) {\n $path = $args[0];\n }\n else {\n $path = 'sites/all/libraries';\n }\n\n $filename = basename(FANCYBOX_DOWNLOAD_URL);\n $dirname = 'fancybox';\n $fullpath = $path . '/' . $dirname;\n\n // Create the path if it does not exist.\n if (is_dir($fullpath)) {\n // Override any existing fancyBox plugin directory.\n drush_delete_dir($fullpath);\n drush_log(dt('An existing version of fancyBox was overwritten at @path', array('@path' => $fullpath)), 'warning');\n }\n\n // Remember curent working directory.\n $olddir = getcwd();\n\n // Set the directory to the download location.\n chdir($path);\n\n // Download the Javascript file.\n if (!drush_shell_exec('wget ' . FANCYBOX_DOWNLOAD_URL)) {\n drush_shell_exec('curl -O ' . FANCYBOX_DOWNLOAD_URL);\n }\n\n if (is_file($filename)) {\n // Extract zip archive.\n drush_shell_exec('unzip -qq -o ' . $filename);\n // Rename directory.\n drush_shell_exec('mv fancyBox-* fancybox');\n // Remove zip archive.\n drush_op('unlink', $filename);\n }\n\n // Set working directory back to the previous working directory.\n chdir($olddir);\n\n // We just check for jquery.fancybox.pack.js file.\n if (file_exists($fullpath . '/source/jquery.fancybox.pack.js')) {\n drush_log(dt('The fancyBox plugin has been downloaded to @path', array('@path' => $fullpath)), 'success');\n }\n else {\n drush_log(dt('Drush was unable to download the fancyBox plugin to @path', array('@path' => $fullpath)), 'error');\n }\n}", "function downloadfolder($fd)\r\n{\r\n $this->get_files_from_folder($fd,'');\r\n header(\"Content-Disposition: attachment; filename=\" .$this->cs(basename($fd)).\"-\".\".zip\"); \r\n header(\"Content-Type: application/download\");\r\n header(\"Content-Length: \" . strlen($this -> file()));\r\n flush();\r\n echo $this -> file(); \r\n exit();\r\n}", "public function downloadDirectFiles($files = array(), $saveTo = '', $newFileNames = array(), $connectionTimeOut = 300)\n\t{\n\t\t// urls to download\n\t\t$urls = array();\n\t\t// if download muiltiple files at once\n\t\tif (is_array($files))\n\t\t\t$urls = $files;\n\t\t// else if download a single file\n\t\telse if (!empty($files))\n\t\t\t$urls = array($files);\n\t\t\n\t\t// new file names to save\n\t\t$fileNames = array();\n\t\tif (!empty($newFileNames))\n\t\t{\n\t\t\t// if download muiltiple files at once\n\t\t\tif (is_array($newFileNames))\n\t\t\t\t$fileNames = $newFileNames;\n\t\t\t// else if download a single file\n\t\t\telse if (!empty($files))\n\t\t\t\t$fileNames = array($newFileNames);\n\t\t}\n\t\t\n\t\t// if there are any files to download\n\t\tif ($urls)\n\t\t{\n\t\t\t// open this multi channel\n\t\t\t$this->openMultiChannel($this->_multiChannel);\n\t\t\t\n\t\t\t// add each download url to queue\n\t\t\tforeach ($urls as $i => $url)\n\t\t\t{\n\t\t\t\t// file name to save\n\t\t\t\tif ($fileNames && !empty($fileNames[$i]))\n\t\t\t\t\t$saveFile = $saveTo.$fileNames[$i];\n\t\t\t\telse \n\t\t\t \t$saveFile = $saveTo.basename($url);\n\t\t\t // only prepare to download if this file has not existed in local computer yet and the download url is not empty\n\t\t\t if (!is_file($saveFile) && !empty($url))\n\t\t\t {\n\t\t\t \t// open download channel\n\t\t\t \t$this->openChannel($this->_arrayChannel[$i], $url, $connectionTimeOut);\n\t\t\t \t// don't include the header in the return result\n\t\t\t \tcurl_setopt($this->_arrayChannel[$i], CURLOPT_HEADER, false);\n\t\t\t \t// open file to write\n\t\t\t $fp[$i] = fopen($saveFile, \"w\");\n\t\t\t // this command indicates that the return result of the url $this->_arrayChannel[$i] when executed will be written to the resource file $fp[$i]\n\t\t\t curl_setopt($this->_arrayChannel[$i], CURLOPT_FILE, $fp[$i]);\n\t\t\t // proceed to add this channel to queue\n\t\t\t curl_multi_add_handle($this->_multiChannel, $this->_arrayChannel[$i]);\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t// proceed to download all files at once\n\t\t\tdo\n\t\t\t{\n\t\t\t $n = curl_multi_exec($this->_multiChannel, $active);\n\t\t\t}\n\t\t\twhile ($active);\n\t\t\t\n\t\t\t// remove all channels from queue\n\t\t\tforeach ($urls as $i => $url)\n\t\t\t{\n\t\t\t\t// file name was saved\n\t\t\t\tif ($fileNames && !empty($fileNames[$i]))\n\t\t\t\t\t$saveFile = $saveTo.$fileNames[$i];\n\t\t\t\telse \n\t\t\t \t$saveFile = $saveTo.basename($url);\n\t\t\t // only remove this channel if this file has not existed in local computer and the download url is not empty\n\t\t\t\tif (!is_file($saveFile) && !empty($url))\n\t\t\t\t{\n\t\t\t\t curl_multi_remove_handle($this->_multiChannel, $this->_arrayChannel[$i]);\n\t\t\t\t $this->closeChannel($this->_arrayChannel[$i]);\n\t\t\t\t fclose($fp[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// close this multi channel\n\t\t\t$this->closeMultiChannel($this->_multiChannel);\n\t\t}\n\t}", "public function action_doc_quick_download()\n\t{\n\t\t$document_id = $this->request->param('id');\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t$kt_connection->downloadDocument($document_id);\n\t}", "public static function check_download() {\n\n\t\t// Check the user's capabilities before proceeding\n\t\t$this->check_capabilities();\n\n\t\t$api_params = array(\n\t\t\t'edd_action' => 'check_download',\n\t\t\t'item_name' => urlencode( $_POST['download'] ),\n\t\t);\n\n\t\t// Send our details to the remote server\n\t\t$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t\t// There was no error, we can proceed\n\t\tif ( ! is_wp_error( $request ) ) {\n\n\t\t\t$request = maybe_unserialize( json_decode( wp_remote_retrieve_body( $request ) ) );\n\n\t\t\tif ( 'free' == $request->download ) {\n\t\t\t\t// This is a free download.\n\t\t\t\t$response = 0;\n\t\t\t} else if ( 'chargeable' == $request->download ) {\n\t\t\t\t// This is a chargeable download.\n\t\t\t\t// We'll probably need to ask for a license.\n\t\t\t\t$response = 1;\n\t\t\t} else {\n\t\t\t\t// File does not exist\n\t\t\t\t$response = 'invalid';\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Server was unreacheable\n\t\t\t$response = 'Server error';\n\n\t\t}\n\n\t\tdie( json_encode( $response ) );\n\n\t}", "public function download_docx(){\r\n\t\tforeach ($this->urls as $key => $parse) {\r\n\t\t\t$html_content = $this->get_html_from_url($parse['url']);\r\n\r\n\t\t\t// print_r($parse);\r\n\t\t\t// print_r($html_content);\r\n\t\t\t$converter = new Html2docx\\Html2docx();\r\n\t\t\t$converter->assign_pandoc($this->pandoc_path);\r\n\t\t\t$converter->input_html_content($html_content);\r\n\t\t\t$converter->output_file($parse['output_file']);\r\n\t\t\t$docx_file = $converter->convert_from_html();\r\n\r\n\t\t\t$this->download_docx_init($docx_file);\r\n\t\t\t$this->download_file($docx_file);\r\n\t\t}\r\n\t\tunset($this->urls);\r\n\t}", "function cemhub_download_flat_file($file_name) {\n $file_details = cemhub_retrieve_file_details($file_name);\n\n if ($file_details) {\n drupal_add_http_header('Content-type', 'octet/stream');\n drupal_add_http_header('Content-disposition', \"attachment; filename=\" . $file_details->filename . \";\");\n drupal_add_http_header('Cache-Control', 'private');\n drupal_add_http_header('Content-Length', filesize($file_details->uri));\n readfile($file_details->uri);\n drupal_exit();\n }\n}", "function downloadFile($folder,$filename) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $filename;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$filename;\n\t\tif(file_exists($path) && is_file($path)) {\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path);\n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{\n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\t //echo 'sssssssssss--->' . $mimeContentType;\t\t exit;\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers \n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\t \n \t}" ]
[ "0.6879092", "0.67751414", "0.66468436", "0.65955806", "0.6519499", "0.6474283", "0.6408808", "0.6392682", "0.6390261", "0.6371924", "0.6341764", "0.6335101", "0.6328385", "0.621745", "0.6149", "0.6113433", "0.60727966", "0.6063108", "0.59824413", "0.5976453", "0.59526485", "0.59475356", "0.5940885", "0.5886273", "0.5881657", "0.5873378", "0.5813469", "0.58037895", "0.58033144", "0.5795732", "0.57874477", "0.57817954", "0.57743996", "0.57730097", "0.57701653", "0.57689905", "0.57682043", "0.57610327", "0.57525015", "0.5749426", "0.5741376", "0.5735275", "0.57293653", "0.57202244", "0.56947607", "0.56850356", "0.56693065", "0.5661271", "0.56436276", "0.56433755", "0.5621128", "0.5619038", "0.561368", "0.5607709", "0.5594512", "0.55866694", "0.55802345", "0.5574116", "0.55596113", "0.5552292", "0.55479676", "0.55468315", "0.55454725", "0.5540768", "0.552317", "0.55125177", "0.55017686", "0.54907376", "0.548666", "0.54860085", "0.54852057", "0.5481328", "0.54783577", "0.5475252", "0.54738206", "0.5472145", "0.54532486", "0.544864", "0.5448226", "0.5446232", "0.54426324", "0.5440533", "0.54386306", "0.5409967", "0.5404055", "0.5395984", "0.5394552", "0.53875464", "0.5385197", "0.53668267", "0.5363392", "0.5339557", "0.533859", "0.5337693", "0.5335365", "0.53188896", "0.53119576", "0.5310702", "0.53105754", "0.53053784" ]
0.5793646
30
Get the console command arguments.
protected function getArguments() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArgs()\n {\n return $this->meta[Cli::ARGS] ?? [];\n }", "private function getArguments() {\n return array_slice($argv, 1);\n }", "public function getArgs() {\n return $this->commandArgs;\n }", "public function getCommandLineArguments()\n {\n return $this->commandLineArguments;\n }", "public function args()\n {\n return $this->arguments->get();\n }", "public function getArgs()\n {\n if ($this['args']) {\n return $this['args'];\n }\n\n return [];\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArgs();", "public function getArgs();", "public function getArgs() {\n return $this->args;\n }", "public function getArgs()\n {\n return $this->args;\n }", "public function getArguments()\n {\n return sprintf(\n \"--%s %s \\\"%s\\\" %s %s %s\",\n $this->name,\n $this->getBoxOptionToString(),\n $this->message,\n $this->height,\n $this->width,\n $this->default\n );\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn isset($this->arguments) ? $this->arguments : array();\r\n\t}", "public function args()\n {\n return [];\n }", "public function getArgs(): array\n {\n return $this->args;\n }", "public function getArguments()\n {\n return sprintf(\n \"--%s %s \\\"%s\\\" %s %s %s %s\",\n $this->name,\n $this->getBoxOptionToString(),\n $this->message,\n $this->height,\n $this->width,\n $this->height - 8,\n $this->getListString()\n );\n }", "public function getArgs() {\n\t\treturn $this->args;\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\n\t\treturn array(\n\t\t\tarray('run', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ];\n }", "public function getArguments() {\n return $this->args;\n }", "public function getArgs() : array\n {\n return $this->args;\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ['alias', InputArgument::OPTIONAL, 'The alias of module will be used.'],\n ];\n }", "public function getArgs()\n {\n return $this->noramlizeArgs($this->_args);\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['connection', InputArgument::OPTIONAL, 'Database connection name', Config::get('database.default')],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t//\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "public function getArgs()\n {\n return $this->parsedArgs;\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t// array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return array(\n //array('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "public function getArguments() : array\n {\n return $this->args;\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t/*['example', InputArgument::REQUIRED, 'An example argument.'],*/\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t];\n\t}", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n {\n return array( //\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['example', InputArgument::OPTIONAL, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t['example', InputArgument::OPTIONAL, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n {\n return array(//\t\t\tarray('example', InputArgument::REQUIRED, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t#array('example', InputArgument::REQUIRED, 'An example argument.'),\n\t\t];\n\t}", "protected function getArguments()\n {\n return array(\n array('example', InputArgument::OPTIONAL, 'An example argument.'),\n );\n }", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t\t//['example', InputArgument::REQUIRED, 'An example argument.'],\n\t\t];\n\t}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n // ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n {\n return [\n//\t\t\t['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "public static function getArguments()\n {\n return func_get_args();\n }", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t//TODO argument to do a single facade. Must be a valid facade\n\t\t\tarray('example', InputArgument::OPTIONAL, 'An example argument.'),\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n {\n return [];\n /*\t\treturn [\n ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n */\n }", "protected function getArguments()\n {\n return [\n ['commit', InputArgument::OPTIONAL, 'A descricão do commit.'],\n // ['commit', InputArgument::REQUIRED, 'A descricão do commit.'],\n ];\n }", "protected function getArguments()\n {\n return [\n ['module', InputArgument::OPTIONAL, 'The module for the language file'],\n ['langFile', InputArgument::OPTIONAL, 'The language file to work on'],\n ['targetLocale', InputArgument::OPTIONAL, 'The target locale for which to add missing keys'],\n ];\n }", "protected function getArguments() {\n\t\treturn array();\n\t}", "protected function getArguments()\n {\n return [\n ['db_name', InputArgument::REQUIRED, 'Database name'],\n ];\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "public function getArguments()\n {\n return $this->arguments;\n }", "protected function getArguments()\n {\n return [\n ['name', InputArgument::REQUIRED, 'The name of the command.'],\n ['component', InputArgument::OPTIONAL, 'The name of component will be used.'],\n ];\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\n {\n return [\n ['example', InputArgument::REQUIRED, 'An example argument.'],\n ];\n }", "protected function getArguments() {\n\t\treturn array(\n\t\t);\n\t}" ]
[ "0.7929734", "0.79042095", "0.7831461", "0.7587314", "0.75166816", "0.70980483", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7011597", "0.7011597", "0.6969377", "0.6941954", "0.6919662", "0.69183534", "0.6889421", "0.6861143", "0.68576336", "0.6853908", "0.68240553", "0.68163955", "0.6801406", "0.6779744", "0.6773187", "0.6766259", "0.6718356", "0.66868067", "0.6682031", "0.6665992", "0.6665992", "0.6662437", "0.6646087", "0.6639124", "0.66325283", "0.6631554", "0.6631554", "0.663134", "0.663134", "0.6630261", "0.6630261", "0.6630261", "0.6629428", "0.66274405", "0.66246825", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6616279", "0.6593955", "0.6593955", "0.6593955", "0.6593955", "0.6580068", "0.6580068", "0.6580068", "0.65620434", "0.6558061", "0.6558061", "0.6558061", "0.6558061", "0.6557318", "0.65526676", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.6550134", "0.65436697", "0.6535705", "0.65260065", "0.6516756", "0.65142566", "0.6511927", "0.6511927", "0.6511927", "0.6510059", "0.65032375", "0.65032375", "0.6496519", "0.6488758" ]
0.65485007
85
Get the console command options.
protected function getOptions() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }", "protected function getOptions()\n {\n return [\n ['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned', 'command:name'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['testMode', null, InputOption::VALUE_OPTIONAL, 'Runs the command in Test Mode.', false],\n\t\t];\n\t}", "protected function getOptions()\n {\n $options = [];\n\n // Here we will gather all of the command line options that have been specified with\n // the double hyphens in front of their name. We will make these available to the\n // Blade task file so they can be used in echo statements and other structures.\n foreach ($_SERVER['argv'] as $argument) {\n if (! Str::startsWith($argument, '--') || in_array($argument, $this->ignoreOptions)) {\n continue;\n }\n\n $option = explode('=', substr($argument, 2), 2);\n\n if (count($option) == 1) {\n $option[1] = true;\n }\n\n $optionKey = $option[0];\n\n $options[Str::camel($optionKey)] = $option[1];\n $options[Str::snake($optionKey)] = $option[1];\n }\n\n return $options;\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],\n ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'],\n ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'],\n\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['native-import', null, InputOption::VALUE_NONE, 'Use the native importer'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'),\n array('pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'),\n array('seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'),\n array('force', null, InputOption::VALUE_NONE, 'Force the operation to run while in production.'),\n );\n }", "protected function getOptions()\n {\n return [\n ['port', null, InputOption::VALUE_OPTIONAL, 'The server port to use.', \\config('minions-server.port', 8085)],\n ];\n }", "protected function getOptions()\n {\n return [\n ['facade', '', InputOption::VALUE_NONE, 'Generate facade for current repository'],\n\n ['model', 'm', InputOption::VALUE_REQUIRED, 'Generate a resource repository for the given model'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['attach', '-a', InputOption::VALUE_OPTIONAL, 'The pipes to attach to the workflow.', null],\n\t\t\t['unguard', '-u', InputOption::VALUE_NONE, 'Do not make this workflow validate data.', null],\n\t\t];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t];\n\t}", "public final function getOptions()\n {\n return $this->_getOptions();\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function options()\n\t{\n\t\treturn [];\n\t}", "protected static abstract function getOptions();", "public function options()\n {\n return $this->options ?: [];\n }", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n\n return [\n ['dry-run' , 'd', InputOption::VALUE_NONE, 'Dry Run'],\n ['payment' , 'p', InputOption::VALUE_NONE, 'Payment Address Only'],\n ['public' , 'u', InputOption::VALUE_NONE, 'Public Address Only'],\n ];\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn isset($this->options) ? $this->options : array();\r\n\t}", "function get_options()\n{\n return php_sapi_name() == 'cli' ? get_options_cli() : get_options_url();\n}", "protected function getOptions()\n {\n return [\n ['format', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The names of formats you would like to generate.', null],\n ['regenerate', 'r', InputOption::VALUE_NONE, 'Whether all files must be regenerated even if exist.', null],\n ['temp', 't', InputOption::VALUE_NONE, 'Whether the temporary storage must be processed.', null],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\tarray('dry-run', null, InputOption::VALUE_NONE, 'Displays the new cron without making any changes.', null),\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function _getCliOptions()\n {\n $cliOptions = array();\n\n foreach ($_SERVER['argv'] as $arg) {\n if (substr($arg, 0, 2) == '--' && strpos($arg, '=') !== false) {\n $option = substr($arg, 2);\n $option = explode('=', $option);\n\n $cliOptions[$option[0]] = $option[1];\n }\n }\n\n return $cliOptions;\n }", "protected function getOptions() {\n\t\treturn array();\n\t}", "public function getOpts(): array\n {\n return $this->opts;\n }", "public function getOpts(): array\n {\n return $this->opts;\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a repository for the given model.'],\n ];\n }", "public function getOptions()\n {\n return $this->options->getOptions();\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Inject a model to the controller.'],\n ['repository', 'r', InputOption::VALUE_OPTIONAL, 'Inject a repository to the controller.'],\n ['view', '', InputOption::VALUE_OPTIONAL, 'Generate a view controller class.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('dry-run', null, InputOption::VALUE_NONE, 'Only shows which files would have been modified.'),\n array('force', 'f', InputOption::VALUE_NONE, 'Do not confirm before editing files.'),\n array('path', null, InputOption::VALUE_OPTIONAL, 'Path containing the files to be fixed.', 'app')\n );\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }" ]
[ "0.780034", "0.77587676", "0.7517654", "0.734501", "0.7340313", "0.7306486", "0.7279262", "0.726863", "0.72377974", "0.7191515", "0.7157065", "0.7155818", "0.713727", "0.7112813", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7110364", "0.7100512", "0.7100512", "0.7099856", "0.7092682", "0.7085081", "0.7081978", "0.7063373", "0.70559907", "0.70406723", "0.70406723", "0.70406723", "0.7036738", "0.7034972", "0.7028708", "0.7024392", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7023164", "0.7021886", "0.7016674", "0.7011458", "0.7011458", "0.70086473", "0.70086473", "0.70086473", "0.70086473", "0.70086473", "0.70086473", "0.70086473", "0.69977915", "0.6996886", "0.69942343", "0.69938654", "0.69844824", "0.69844323", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668", "0.6975668" ]
0.703143
51
Retourne le nombre d'historique
public function countAllByMembre(Membre $membre) { return $this->createQueryBuilder('h') ->select('count(h) nbHistorique') ->where('h.membre = :membre')->setParameter('membre', $membre) ->getQuery()->getOneOrNullResult()['nbHistorique']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdHistorique() {\n return $this->idHistorique;\n }", "public function getHistorial()\n {\n $stmt = Conexion::conectar()->prepare('SELECT *from historiales');\n $stmt->execute();\n }", "public function getCdHistorico()\n {\n return $this->cd_historico;\n }", "public function nombreTotalTableau(){\n $req = $this->db->query(\"SELECT COUNT(*) AS nb FROM tableau\");\n $sortie = $req->fetch(PDO::FETCH_OBJ);\n return $sortie->nb;\n }", "protected function getChartNum()\n {\n self::$chartNum++;\n return self::$chartNum;\n }", "function getIdHistorialCambio() {\r\n return $this->idHistorialCambio;\r\n }", "public function getStatusHistories();", "public function getHistoryCategoryAttribute()\n {\n if ($this->histories->count() == 0) {\n return 'rendah';\n }\n\n if ($this->histories->count() == 1) {\n return 'sedang';\n }\n\n if ($this->histories->count() >= 2) {\n return 'tinggi';\n }\n }", "public function getCounter();", "public function getLastCountsList(){\n return $this->_get(8);\n }", "public function getHistoryCount() {\n return count($this->getHistory());\n }", "function getHistory(){\r\n\t\t// pobranie informacji o poprzedniej erze\r\n\t\t$zapytanie=\"select * from historia_koalicje where nr_ery = (select max(nr_ery) from historia_koalicje) and nazwa='\".$this->getName().\"';\";\r\n\t\t$historia=mysql_query($zapytanie)or Die(\"ups :)\");\r\n\t\tif(mysql_num_rows($historia)>0){\r\n\t\t\t$wiersz_h->dane=mysql_fetch_array($historia);\r\n\t\t\t$wiersz_h->czyJest='ok';\r\n\t\t}else{\r\n\t\t\t$wiersz_h->czyJest=false;\r\n\t\t}\r\n\t\treturn $wiersz_h;\r\n\t}", "public function getReleaseHistogram(): string {\n return $this->release_histogram;\n }", "public function counter(){\n if(!isset($this->counter))\n {\n $class_name = $this->getClassName();\n $this->counter = Counter::where('class_name', $class_name)->where('object_id', $this->id)->orderBy('count_date', 'desc')->first();\n if( !$this->counter ){\n $this->counter = Counter::create(array('class_name' => $class_name, 'object_id' => $this->id, 'count_date'=>date('Y-m-d')));\n }\n }\n return $this->counter;\n }", "public function getItemHistorysCount()\n {\n return $this->count(self::_ITEM_HISTORYS);\n }", "function historial(){\n\n\t\t//Instanciamos y nos conectamos a la bd\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"SELECT tipo_denuncia.*,denuncia.* FROM denuncia INNER JOIN tipo_denuncia ON denuncia.td_cod_tipo_denuncia=tipo_denuncia.td_cod_tipo_denuncia WHERE denuncia.de_estado='tomado'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute();\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n\t}", "public function getExcavateHistoryCount()\n {\n return $this->count(self::_EXCAVATE_HISTORY);\n }", "public function getCount(): int;", "public function getCount(): int;", "function tailleTab($valeur){\r\n $taille = 0;\r\n foreach($valeur as $element){\r\n $taille++;\r\n }\r\n return $taille;\r\n }", "public function getCountsList(){\n return $this->_get(6);\n }", "public function getHistogramSerie();", "public function getCount()\n {\n return $this->count++;\n }", "function nbProduit(){\n\t$nombre = 0; \n\t\n\tif(isset($_SESSION['panier']['quantite'])){\n\t\tfor($i=0; $i < count($_SESSION['panier']['quantite']); $i++){\n\t\t// On tourne autant de fois qu'il y a de références dans le panier (nombre de ligne dans le petit tableau des quantités)\n\t\t\t$nombre += $_SESSION['panier']['quantite'][$i];\n\t\t}\n\t}\n\t\n\treturn $nombre;\n}", "public function NumeroCategorias(){\n $numero_categorias = Categorie::count();\n return $numero_categorias;\n }", "public function getHistorialID($id)\n {\n }", "public function count()\n {\n return $this->itemCounter - 1;\n }", "public function getElementCounter() {}", "public function getCountEntitled()\n {\n if (array_key_exists(\"countEntitled\", $this->_propDict)) {\n return $this->_propDict[\"countEntitled\"];\n } else {\n return null;\n }\n }", "function FacturasAbiertas() {\n $sql = \"SELECT COUNT(*) count FROM \".self::$table.\" WHERE estado='Abierta'\";\n return DBManager::count($sql);\n }", "public function getTab()\n {\n return 'Log ('.count($this->_log->getEvents()).')';\n }", "public function getEntriesCount()\n\t{\n\t\treturn $this->lastCount;\n\t}", "public static function getUltimoPeriodoHistorico($tipo){\n $mysqli = Database::getInstance();\n $query=<<<sql\nSELECT * FROM prorrateo_periodo \nWHERE tipo = \"$tipo\" AND status != 0\nORDER BY prorrateo_periodo.prorrateo_periodo_id DESC \nsql;\n return $mysqli->queryOne($query);\n }", "public abstract function get_counts();", "function listar_historial(){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\n\t\t$sql=\"SELECT * FROM historial ORDER BY id_his\";\n\t\t\n\t\t$consulta=mysql_query($sql);\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "function getCounter()\r\n {\r\n // in order to get back the actual value of the counter\r\n return $this->getVariable('counter');\r\n }", "public function getFrequencia() {\n return $this->sFrequencia;\n }", "public function getOccurrence(): int\n {\n return $this->occurrence;\n }", "public function getStatistics()\n\t{\n\t\treturn $this->counter;\n\t}", "public function getHistogramMax();", "public function getEntryCount() {}", "function obtenirNbEtab ($connexion) {\r\n\r\n $req = \"SELECT COUNT(*) FROM Etablissement\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt -> fetchColumn ();\r\n\r\n }", "public function getNumber()\n {\n return $this->model->count();\n }", "function fetchHistorial() {\n\n $historiales = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM historial\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id_diario = $row['id_diario'];\n $id_poi = $row['id_poi'];\n $fechaVisitaPoi = $row['fechaVisitaPoi'];\n $estaEnPoi = $row['estaEnPoi'];\n $texto = $row['texto'];\n $foto = $row['foto'];\n $video = $row['video'];\n $historial = new Historial($id_diario, $id_poi, $fechaVisitaPoi, $estaEnPoi, $texto, $foto, $video);\n array_push($historiales, $historial);\n }\n\n return $historiales;\n }", "static function getCount(){\n if(empty($query[2])){\n self::$contador=\"Home\";\n }else{\n self::$contador=self::$query[2];\n } \n return self::$contador;\n }", "public function getIdHistory()\n {\n return $this->idHistory;\n }", "function get_counter(){\nglobal $indb;\n\tif ( $indb && connected($indb[\"db\"]) ) {\n\t\t// find where is the element\n\t\t$ctr = _FFDBDIR_.$indb[\"db\"].\"/\".$indb[\"db\"].\".ctr\";\n\t\t$octr = fopen($ctr,\"r\");\n\t\t$ctrstr = fread($octr,filesize($ctr));\n\t\t\tif ( is_numeric($ctrstr) && !is_nan($ctrstr) && is_finite($ctrstr) ){\n\t\t\t\t$ctrnum = (int)$ctrstr;\n\t\t\t\treturn $ctrnum;\n\t\t\t}\n\t\t\telse return false;\n\t\t}\n}", "static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}", "public function getCount();", "public function getCount();", "public function getCount();", "public function getNumArticlesToDisplay();", "function countRubrique() \n{\n\t$req = mysql_query('SELECT count(*) FROM RUBRIQUE;');\n\t$count=mysql_fetch_array($req);\n\tmysql_free_result($req);\n\treturn $count[0];\n}", "function obtenirNbEtabOffrantChambres ($connexion) {\r\n\r\n $req = \"SELECT COUNT(DISTINCT idEtab) FROM Offre\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt -> fetchColumn ();\r\n\r\n }", "public function count()\n {\n return 1;\n }", "public function getCount()\n {\n return $this->count;\n }", "public function getCountLactation()\n {\n return $this->count_lactation;\n }", "public function getCounter()\n {\n return $this->counter;\n }", "public function getCounter()\n {\n return $this->counter;\n }", "public function getNombrePages() \r\n\t{\r\n\t\tvar_dump($this->_db);\r\n\t\treturn ceil(count($this->_db)/self::NOMBRE_PAR_PAGE);\r\n\t\t\r\n\t\t//return $aBiere[$nPage-1];\r\n\t}", "function nombre_utilisateurs(){\n\n\t\t$bdd=connexion_BD('projetLion');\n\n\t\t$reponse = $bdd->query(\"SELECT COUNT(*) as nombre FROM login_users\");\n\n\t\t$donnees = $reponse->fetch();\n\t\t$reponse->closeCursor();\n\t\t\n\t\treturn $donnees['nombre'];\n\n\t}", "public function getCount() {}", "public function getCount() {}", "public function getCount() {}", "public function getCount() {\n \treturn $this->count();\n }", "function getNombreArticle() {\n return ($this->nbarticle);\n }", "function HistoSet($histogram) {\n // get histo set id from generic id \n return preg_replace(\"/\\/.*$/\",\"\",$histogram);\n}", "function getfactoryIndex()\n\t{\n\t\t$vendorQry = db(\"select * from factories where name = '$this->factory' limit 1\");\n\t\t$this->factoryIndex = $vendorQry[\"tableIndex\"];\n\t\treturn $vendorQry[\"tableIndex\"];\n\t}", "function getStatistic() {\n\t\t$ret = array();\n\t\tforeach ($this->data as $entry) {\n\t\t\tif (array_key_exists($entry['entryType'], $ret)) {\n\t\t\t\t$ret[$entry['entryType']]++;\n\t\t\t} else {\n\t\t\t\t$ret[$entry['entryType']] = 1;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function getNewUniqueStatHistory()\n\t{\n\t\treturn $this->new_stat_history;\n\t}", "public function nombreproduit(){\r\n\t\treturn array_sum($_SESSION['panier']);\r\n\t}", "function getCount() {\n $this->putCount();\n //opens countlog.data to read the number of hits\n $datei = fopen(dirname(__FILE__) . DIRECTORY_SEPARATOR .\"countlog.data\", \"r\");\n $count = fgets($datei, 1000);\n fclose($datei);\n return $count;\n }", "public function getCounter()\n {\n return $this->_counter;\n }", "public function getCount()\n\t{\n\t\treturn count($this->_d);\n\t}", "function listar_historial_pedido($id){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\n\t\t$sql=\"SELECT * FROM historial WHERE pertenece_his='$id' ORDER BY id_his ASC\";\n\t\t\n\t\t$consulta=mysql_query($sql);\n\t\t$num=1;\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['numero']=$num++;\n\t\t\t$resultado['fecha_his']=$this->convertir_fecha($resultado['fecha_his']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function createTabsHistorique()\n {\n $tab = new Tab();\n $tab->active = 1;\n $names = array(1 => 'Historique CA', 'Historique CA');\n foreach (Language::getLanguages() as $language) {\n $tab->name[$language['id_lang']] = isset($names[$language['id_lang']])\n ? $names[$language['id_lang']] : $names[1];\n }\n $tab->class_name = 'AdminHistorique';\n $tab->module = $this->name;\n $tab->id_parent = Tab::getIdFromClassName('AdminParentStats');\n\n return (bool)$tab->add();\n }", "function site_statistics_vizitki(&$args)\n{\n global $database;\n \n $statistics =& $args['statistics'];\n \n // NOTE: CACHING WILL BE HANDLED BY THE FUNCTION THAT CALLS THIS\n \n $total = $database->database_fetch_assoc($database->database_query(\"SELECT COUNT(vizitkientry_id) AS total FROM se_vizitkientries\"));\n $statistics['vizitki'] = array(\n 'title' => 1500150,\n 'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )\n );\n \n /*\n $total = $database->database_fetch_assoc($database->database_query(\"SELECT COUNT(vizitkisubscription_id) AS total FROM se_vizitkisubscriptions\"));\n $statistics['vizitkisubscriptions'] = array(\n 'title' => 1500151,\n 'stat' => (int) ( isset($total['total']) ? $total['total'] : 0 )\n );\n */\n}", "public function getHistogramMax()\n {\n // return $this->sides;\n return $this->getSides();\n }", "public static function nombreAssociations() {\n $req = 'SELECT COUNT(*)\n FROM association_vehicule_conducteur';\n return Db::dbQuery($req);\n }", "function getIDTabelRiwayatPangkat(){\n\t$query = mysql_query(\"SELECT MAX(id_data) as 'Max' FROM tbl_riwayat_pangkat\") or die(mysql_error());\n\t$row = mysql_fetch_array($query);\n\t$maks = $row['Max'];\n\t$ID = \"\";\n\t\n\tif($maks > 0){\n\t\t$ID = $maks + 1;\n\t}else{\n\t\t$ID = 1;\n\t}\n\t\n\treturn $ID;\n}", "public function countStored(): int;", "public function count(){\n return $this->_count;\n }", "public static function nombreConducteurs() {\n $req = 'SELECT COUNT(*)\n FROM conducteur';\n return Db::dbQuery($req);\n }", "public function getRevisionHistoryName()\n {\n $revisionHistoryRelation = array_get($this->model->getDynamicProperties(), self::REVISION_HISTORY_NAME_PROPERTY)\n ?: self::REVISION_HISTORY_NAME;\n\n if (defined($this->model . '::REVISION_HISTORY')) {\n $revisionHistoryRelation = $this->model::REVISION_HISTORY;\n }\n\n return $revisionHistoryRelation;\n }", "function size()\n\t{\n\t\treturn $this->nb;\n\t}", "public function getHistorico($idCliente){\n // $sql.=$idCliente;\n // $sql.=\" group by idLog\";2\n $sql = \"SELECT * FROM log_cliente LEFT JOIN acciones on acciones.idAccion=log_cliente.idActividad WHERE log_cliente.idCliente = $idCliente group by log_cliente.idLog\";\n $this->db->query($sql);\n\n $resultado = $this->db->registros();\n\n\n return $resultado;\n }", "function mostrar_historial(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM historial WHERE id_his='$id'\";\n\t\t\t$consulta=mysql_query($sql);\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$this->tabla = $resultado['tabla_his'];\n\t\t\t$this->pertenece = $resultado['pertenece_his'];\n\t\t\t$this->asunto = $resultado['asunto_his'];\n\t\t\t$this->descripcion = $resultado['descripcion_his'];\n\t\t\t$this->fecha = $resultado['fecha_his'];\n\t\t\t$this->hora = $resultado['hora_his'];\n\t\t\t$this->fechamod= $resultado['fechamod_his'];\n\t\t\t\n\t\t} \n\t}", "public function countLigne_mouvement(){\n\t\t\t\t\t return count($this->listeLigne_mouvement());\n\t\t\t\t\t }", "function count_series() {\n $result = $this->pdo->query('SELECT COUNT(DISTINCT series) FROM files');\n return $result->fetchColumn();\n }", "function count() ;", "public function getNbrecord(): int\n {\n return 5;\n }", "public function get_title() {\n\t\treturn __( 'portfolio-counter-widget', 'portfolio-elementor' );\n\t}", "function getNumeroDeBeneficiarios(){\n\t\t\t$benefs = 0;\n\t\t\t$sqlcreel = \"SELECT COUNT(idsocios_relaciones) AS 'beneficiarios'\n\t\t\t\t\t\t\tFROM socios_relaciones\n\t\t\t\t\t\t\tWHERE socio_relacionado=\" . $this->mCodigo . \" AND tipo_relacion=11\";\n\t\t\t$benefs = mifila($sqlcreel, \"beneficiarios\");\n\t\t\treturn $benefs;\n\t}", "function getRowCounter()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public static function getCount(){\n \t$sql = \"SELECT COUNT(*) as count FROM yy_hospital\";\n \t$res = self::getDb()->query($sql)->fetchAll();\n \t$count = $res[0]['count'];\n \treturn $count;\n }", "protected function XAxisCount()\n {\n return 1;\n }", "public function calcularId(){\n\n $registros = PorcentajeBecaArancel::All();\n\n $max_valor = count($registros);\n\n\n if($max_valor > 0){\n\n $max_valor++;\n\n } else {\n\n $max_valor = 1;\n }\n\n return $max_valor;\n\n }", "private function getRecordCounter()\n {\n $recordCounter = DentalLog::where('clinicType', '=', 'D')->count();\n $recordCounter++;\n\n return $recordCounter;\n }", "function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }", "public function getCount()\n {\n return $this->get('Count');\n }", "public function get_duplicate_count() {\n return null;\n }" ]
[ "0.708629", "0.6580433", "0.64230114", "0.6275286", "0.62670255", "0.62086946", "0.61149955", "0.6051766", "0.60196704", "0.59994864", "0.5988982", "0.5944709", "0.5892154", "0.58681244", "0.5864745", "0.5856294", "0.5848151", "0.5820812", "0.5820812", "0.57615525", "0.5755049", "0.5749853", "0.5741502", "0.5698258", "0.5670612", "0.56561625", "0.56542295", "0.5648273", "0.5630185", "0.56147236", "0.5614577", "0.561414", "0.561232", "0.5597418", "0.55885327", "0.55853003", "0.5576908", "0.5576734", "0.5570846", "0.5564369", "0.5556769", "0.55448127", "0.5538578", "0.5532621", "0.5523933", "0.5521386", "0.5520539", "0.55184585", "0.55168355", "0.55168355", "0.55168355", "0.55086124", "0.5504628", "0.54948413", "0.54935294", "0.5491351", "0.5491039", "0.5489716", "0.5489716", "0.54705507", "0.54666495", "0.54611987", "0.5461118", "0.5461118", "0.54511946", "0.5449684", "0.5449651", "0.5446072", "0.5444578", "0.54430956", "0.54241234", "0.5421034", "0.5406432", "0.5403359", "0.5390635", "0.5390305", "0.53850186", "0.5384698", "0.53796196", "0.537287", "0.536722", "0.5364168", "0.53633183", "0.5363138", "0.53622574", "0.5360354", "0.53579545", "0.53532827", "0.53524554", "0.53506136", "0.53505653", "0.5346106", "0.5346049", "0.53427964", "0.53390396", "0.5338877", "0.533833", "0.5336188", "0.53353107", "0.53282547", "0.5315213" ]
0.0
-1
Provide either a Zend_Session_Namespace or a string along with a property name under which to store contents.
public function __construct($namespace, $member) { if (null === $member || !is_scalar($member) || (0 === strlen($member))) { throw NamespaceException::invalidPropertyName($member); } if (!$namespace instanceof \Zend_Session_Namespace) { $namespace = new \Zend_Session_Namespace($namespace); } $this->_namespace = $namespace; $this->_member = $member; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function namespaceSet($var, $value) {\r\n\t\t$_SESSION[self::SESSION_NAMESPACE][$var] = $value;\r\n\t}", "static function setProperty($namespace, $prop, $value)\n\t{\n\t\tif ($namespace == '') {\n\t\t\t$namespace = __CLASS__;\n\t\t}\n\t\tif (is_null($prop)) {\n\t\t\tunset(self::$_properties[$namespace]);\n\t\t} elseif (! isset(self::$_properties[$namespace])) {\n\t\t\tself::$_properties[$namespace] = array();\n\t\t}\n\t\tself::$_properties[$namespace][$prop] = $value;\n\t}", "public final function set($property, $value) \n\t{\n\t\t$_SESSION[$property] = $value;\n\t}", "private function syncSessionProperty($name, $value) {\n if (session_id() &&\n in_array($name, $this->syncedProperties) &&\n isset($this->company) &&\n isset($this->email)) {\n\n if (!isset($_SESSION[self::SESSION_KEY]) ||\n !isset($_SESSION[self::SESSION_KEY][$this->company])) {\n $_SESSION[self::SESSION_KEY] = array(\n $this->company => array($this->email => array())\n );\n } elseif (!isset($_SESSION[self::SESSION_KEY][$this->company][$this->email])) {\n $_SESSION[self::SESSION_KEY][$this->company][$this->email] = array();\n }\n\n $_SESSION[self::SESSION_KEY][$this->company][$this->email][$name] = $value;\n }\n }", "public function set($namespace, $key, $value);", "protected function _setVar($name, $value)\n {\n $store = $this->_getVariableStore();\n\n if ($store instanceof \\Zend_Session_Namespace) {\n $store->__set($name, $value);\n } else {\n $store->offsetSet($name, $value);\n }\n }", "public function __set($name, $value) {\n\t\tif (is_string($name))\n\t\t{\n\t\t\t$this->session[$name] = $value;\n\t\t\t$_SESSION[$name] = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception('Expect a string key name');\n\t\t}\n\t}", "public function __set($name, $value)\n {\n $_SESSION[$this->prefix][$name] = $value;\n }", "public function setValue($name, $value) {\n if (strpos($name, '->')) {\n $name = explode('->', $name, 2);\n $_SESSION[$name[0]][$name[1]] = serialize($value);\n } else {\n $_SESSION[$name] = serialize($value);\n }\n return true;\n }", "public function __set($name,$value){\n\t\treturn $_SESSION[$name] = $value;\n\t}", "public function __set($name, $value) {\n $_SESSION[$this->myedb_session_key][$name] = $value;\n }", "function set ($name,$value) {\r\n $_SESSION[$name]=$value;\r\n }", "public function __set( $name , $value ){\n\n \tif ( $this->sessionState == self::SESSION_NOT_STARTED ){\n \t\tself::$instance->startSession();\n \t}\n\n $_SESSION[$name] = $value;\n }", "public function __set($name, $value)\n {\n if (in_array($name, $this->properties)) {\n $this->data[$name] = $value;\n $this->syncSessionProperty($name, $value);\n }\n }", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public static function store($name, $value)\n\t{\n $_SESSION[$name] = $value;\n\t}", "public function set(string $name, $value) {\n //$this->open();\n $_SESSION[$name] = $value;\n }", "public function set($name, $value)\n {\n $_SESSION[$this->_namespace][$name] = $value;\n\n return $this;\n }", "protected static function getSessionNamespace()\n {\n return rex::getProperty('instname') . '_backend';\n }", "public static function write($name, $value = ''){\n\t\t\tif(empty($name)){\n\t\t\t\ttrigger_error('Failed to set a session because no session name was provided.', E_USER_ERROR);\n\t\t\t}\n\t\t\tarray_inject($_SESSION, $name, $value);\n\t\t}", "protected function setPersistentData($key, $value)\n {\n $this->_sessionNamespace->{$key} = $value;\n }", "final public function set($name, $value)\n {\n $key = $this->getSessionKey($name);\n\n $_SESSION[$key] = $value;\n }", "public static function set_name_space($s)\n\t{\n\t\tif (!isset($_SESSION['Session_Master']))\n\t\t{\n\t\t\t$_SESSION['Session_Master'] = array();\n\t\t}\n\t\t\n\t\tif (!isset($_SESSION['Session_Master'][$s])) \n\t\t{\n\t\t\t$_SESSION['Session_Master'][$s] = array();\n\t\t}\n\t\tself::$s_name_space = $s;\n\t}", "public function setSession($sessionID)\r\n {\r\n $this->$sessionID = $sessionID;\r\n }", "function setNamespace($namespace);", "public function __set($key, $value)\n {\n if (is_object($value)) {\n $_SESSION[$key.'__OBJECT'] = true;\n $value = serialize($value);\n }\n $_SESSION[$key] = $value;\n }", "public function __set($key, $value) {\n $_SESSION[$key] = serialize($value);\n }", "public function setSession($sName, $mData) {\n\n // Set the session\n $_SESSION[$this->loadConfigVar('systemSettings', 'nameSpace')][$sName] = $mData;\n\n // Return instance\n return $this;\n }", "private function setName($name)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->name = $name;\n }", "protected function setStorage($data)\n {\n Session::register(__NAMESPACE__, serialize($data));\n }", "private function updateSession()\n {\n $_SESSION[$this->namespace] = $this->session;\n }", "function setObjectCookie($CookieName, $obj) {\n\t$_SESSION[$CookieName] = Encode(serialize($obj));\n}", "public static function setSessionData($name, $value) {\n if (isset(self::$_session)) {\n self::$_session[$name] = $value;\n } else {\n $_SESSION[$name] = $value;\n }\n }", "public function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function phpunit_add_session_store($name) {\n $this->configstores[$name] = array(\n 'name' => $name,\n 'plugin' => 'session',\n 'configuration' => array(),\n 'features' => 14,\n 'modes' => 2,\n 'default' => true,\n 'class' => 'cachestore_session',\n 'lock' => 'cachelock_file_default',\n );\n }", "public static function load($name = null) {\n $class_name = 'Kuuzu\\\\KU\\\\Core\\\\Session\\\\' . KUUZU::getConfig('store_sessions');\n\n if ( !class_exists($class_name) ) {\n trigger_error('Session Handler \\'' . $class_name . '\\' does not exist, using default \\'Kuuzu\\\\KU\\\\Core\\\\Session\\\\File\\'', E_USER_ERROR);\n\n $class_name = 'Kuuzu\\\\KU\\\\Core\\\\Session\\\\File';\n }\n\n $obj = new $class_name();\n\n if ( !isset($name) ) {\n $name = 'sid';\n }\n\n $obj->setName($name);\n $obj->setLifeTime(ini_get('session.gc_maxlifetime'));\n\n return $obj;\n }", "public function setSessionNamespace(Zend_Session_Namespace $session)\n {\n $this->_session = $session;\n\n return $this;\n }", "public function setSession($name, $value=null)\n {\n if (is_array($name)) {\n $this->_session = $name;\n } else {\n $this->_session[$name] = $value;\n }\n }", "public function set_token_properties($session_key, $sid, $tid, $sproperty_name, $sproperty_value)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\t\t \n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\t\t\t\n\t\t\t\n\t\t\tif(!tableExists(\"{{tokens_$sid}}\"))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No token table', 11);\n\t\t\t\n\t\t\t$current_token = Tokens_dynamic::model($sid)->findByPk($tid);\n\t\t\tif (!isset($current_token))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid tokenid', 22);\t\t\t\n\t\t\t\t\t \n\t\t\tif (hasSurveyPermission($sid, 'tokens', 'update'))\n\t\t\t{\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(!in_array($sproperty_name, array('firstname',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'lastname',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'email',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'emailstatus',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'token',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'blacklisted',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'sent',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'remindersent',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'remindercount',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'completed',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'usesleft',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'validfrom',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'validuntil',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'mpid'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)))\t\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No such property', 25);\n\t\t\t\t\n\t\t\t\t$valid_value = $this->_internal_validate($sproperty_name, $sproperty_value);\n\t\t\t\tif ($valid_value === false)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Update values are not valid', 24);\n\t\t\n\t\t\t\t$current_token->setAttribute($sproperty_name,$valid_value);\n\t\t\t\t$result = $current_token->save();\n\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No permission', 2); \t \n }\t\t\t\t\n\t}", "protected function writeMetadata() {\n $_SESSION[self::METADATA_KEY] = $this->metadata;\n }", "function setNamespace ($name);", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "public static function put($name, $value){\n return $_SESSION[$name] = $value;\n }", "public static function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public static function put($name, $value) {\n return $_SESSION[$name] = $value;\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function setSession($name, $value=null)\n {\n // Set by name or all at once\n if (is_string($name)) {\n $this->_session[$name] = $value;\n } elseif (is_array($name)) {\n $this->_session = $name;\n }\n }", "public function setNamespace($namespace)\n {\n if (is_string($namespace)) {\n $this->namespace = $namespace;\n }\n }", "public function set($key, $value, $namespace = '/')\n {\n if ($namespace == '_zikula_messages') {\n throw new InvalidArgumentException('You cannot access _zikula_messages directly');\n }\n $_SESSION[$namespace][$key] = $value;\n }", "public function set($key,$value) {\n\t\t$this->getFrontendUser()->setKey('ses', self::SESSIONNAMESPACE.$key, $value);\n\t\t$this->getFrontendUser()->storeSessionData();\n return true;\n\t}", "public function propertySet($varname, $value)\n {\n $value = base64_encode($value);\n $this->run(\"property_set -i {id} -n \\${$varname} -- {$value}\");\n }", "public function setNamespace($name);", "public function setAll($array) {\n // this is a kind of bad because sesData is just a property with no protected or private config\n\n foreach($array as $k=>$v){\n if( stristr($k,self::SESSIONNAMESPACE)!==false ){\n $k = str_replace(self::SESSIONNAMESPACE, '', $k);\n $this->storeObject($v, $k);\n }\n }\n\n\t}", "function set_data($name,$value) {\n $this->store_in_session('page_data',$name,$value);\n\n }", "public function setNamespaceName($namespace);", "public function setProperty($key, $value);", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function set_session($name,$val)\n { \n $_SESSION[$name] = $val; \n }", "abstract protected function propertySet($name, $value);", "public function setSession($value)\n\t{\n\t\t$_SESSION[$this->getKey()] = serialize($value);\n\t}", "public function getSessionNamespace()\n {\n if (null === $this->_session) {\n $this->_session =\n new Zend_Session_Namespace($this->_namespace);\n }\n \n return $this->_session;\n }", "public function set($identifier, $value) {\n\t\t$this->data[$identifier] = $value;\n\t\t$GLOBALS['TSFE']->fe_user->setKey('ses', $this->namespace, $this->data);\n\t\t$GLOBALS['TSFE']->fe_user->storeSessionData();\n\t}", "protected function setSessionData()\n {\n $responseData = $this->response->getBody();\n if (strlen($responseData) > 0) {\n $contents = str_replace('$SID', $this->session->getName() . '=' . $this->session->getId(), $responseData);\n $contents = str_replace('$SESSION_NAME', $this->session->getName(), $contents);\n $this->response->replaceBody(str_replace('$SESSION_ID', $this->session->getId(), $contents));\n }\n }", "public function storeSessionData() {}", "public function storeSessionData() {}", "public static function write($value) {\n self::_init();\n if (func_num_args() > 1) {\n $keys = array_slice(func_get_args(), 1);\n foreach ($keys as $keysEntry) {\n if (!is_string($keysEntry))\n throw new InvalidArgumentTypeException('Session key must be string value');\n }\n } else {\n throw new InvalidArgumentTypeException(\"To write session variable you must specify it's value and, at least, one key\");\n }\n $target = & $_SESSION;\n for ($keyIndex = 0; $keyIndex < count($keys); $keyIndex++) {\n $keysEntry = $keys[$keyIndex];\n if ($keyIndex < count($keys) - 1) {\n if (!isset($target[$keysEntry]) || !is_array($target[$keysEntry])) {\n $target[$keysEntry] = array(); //to avoid manually creation of subarrays create it at first attempt\n }\n $target = & $target[$keysEntry];\n } else {\n $target[$keysEntry] = $value;\n }\n }\n self::_age();\n }", "public function SetSessionData( $entryName, $data )\n {\n if( $data == null )\n $this->CleanSessionData( $entryName );\n else\n $_SESSION[SESSION_ENTRY][$entryName] = $data;\n }", "protected function set_session($sKey,$sValue){$_SESSION[$sKey]=$sValue;}", "public function set(string $name, $value)\n {\n $_SESSION[$this->prefix]['vars'][$name] = $value;\n }", "public static function setValue($name,$value)\n {\n $_SESSION[$name] = $value;\n }", "public static function setSessionData($systemName, $dataKey, $data);", "public function setNamespace($namespace)\n {\n $this->_namespace = (string) $namespace;\n }", "public function set($name, $value = null)\n\t{\n\t\tif ( $value === null )\n\t\t\tunset($_SESSION[$name]);\n\t\telse\n\t\t\t$_SESSION[$name] = $value;\n\t}", "public function setProperties(array $properties)\n\t{\n\t\t$this->sessions = $properties;\n\t}", "public function setName($name, $value)\t{\n\n\t\t\t$this->{$name} = $value;\n\t\t\t\t\n\t\t\t//if (ctype_alnum($name) == true)\n\t\t\t\n\t\t\t//(die('The name of the store should only contain letters');\n\t\t\t\n\t\t\t//$this->name = $name;\n\t\t}", "public function set ($name, $val)\n\t{\n\t\t$_SESSION[$name]\t= $val;\n\t}", "public function storeValueInSession($name,$value)\n\t{\n\t\t$_SESSION['stored_forms'][$this->name.$this->target_type][$name] = $value;\n\t}", "public static function register($key,$value)\n\t{\n\t\t$_SESSION[$key] = serialize($value);\n\t}", "public function __set($name, $value) {\n if (ctype_alnum($name) && (ctype_digit($name[0]) == FALSE)) {\n $this->$name = $this->db->quote($value);\n $this->properties[$name] = $value;\n }\n }", "public function set_nameSession($_nameSession)\n {\n $this->_nameSession = $_nameSession;\n\n return $this;\n }", "public function set($name, $value) {\n Session::set($name, $value);\n }", "public function setAttribute($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "function set_name ($name)\r\n {\r\n $_SESSION[\"name\"] = $name;\r\n }", "public function set($mName, $sValue = null): void\n {\n if (is_array($mName)) {\n foreach ($mName as $sName => $sVal) {\n $this->set($sName, $sVal);\n }\n } else {\n $_SESSION[Config::getInstance()->values['session']['prefix'] . $mName] = $sValue;\n }\n }", "public function set($varname, $value)\n {\n $value = base64_encode(serialize($value));\n \n // Does the variable exist?\n $sql = 'SELECT COUNT(name) FROM session_vars '.\n 'WHERE container=\"'.$this->container_id.'\" AND name=\"'.$varname.'\"';\n $num_vars = $this->db->querySingle($sql);\n \n if($num_vars > 0) {\n $sql = 'UPDATE session_vars '.\n 'SET value=\"'.$this->db->escapeString($value).'\" '.\n 'WHERE container=\"'.$this->container_id.'\" AND name=\"'.$varname.'\"';\n } else {\n $sql = 'INSERT INTO session_vars(container, name, value) '.\n 'VALUES(\"'.$this->container_id.'\", \"'.$this->db->escapeString($varname).'\", \"'.\n $this->db->escapeString($value).'\")';\n }\n \n $this->db->exec($sql);\n\n return $value;\n }", "public function session($name, $value){\n if( isset($this->openForm) && is_array($this->openForm) )\n $this->openForm['fields'][] = new fe_session(array('name' => $name, 'value' => $value));\n }", "public static function put($name, $value)\n {\n return $_SESSION[$name] = $value;\n }", "protected function getStorage()\n {\n return unserialize(Session::retrieve(__NAMESPACE__));\n }", "public function __get($name)\n\t{\n\t\tswitch ($name) {\n\t\t\tdefault:\n\t\t\t\tif (isset($this->$name))\n\t\t\t\t{\n\t\t\t\t\treturn $this->$name;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(isset($_SESSION[$name])) $this->$name = $_SESSION[$name];\n\t\t\t\t\telse $this->$name = NULL;\n\t\t\t\t\treturn $this->$name;\n\t\t\t\t}\n\t\t};\n\t}", "private function syncFromSession() {\n if (session_id() &&\n isset($this->company) &&\n isset($this->email) &&\n isset($_SESSION[self::SESSION_KEY]) &&\n isset($_SESSION[self::SESSION_KEY][$this->company]) &&\n isset($_SESSION[self::SESSION_KEY][$this->company][$this->email])\n ) {\n\n $data = $_SESSION[self::SESSION_KEY][$this->company][$this->email];\n foreach ($this->syncedProperties as $property) {\n if (isset($data[$property])) {\n $this->$property = $data[$property];\n }\n }\n }\n }", "public function getSessionNamespace() {\n if (null === $this->_session) {\n $this->_session =\n new Zend_Session_Namespace($this->_namespace);\n }\n\n return $this->_session;\n }", "function setSession($name, $data) {\r\n $_SESSION[$name] = $data;\r\n return true;\r\n}", "function token_set($name) {\r\n\t$session=Zend_Auth::getInstance()->getStorage();\r\n\t$token=auth();\r\n\t$session->set($name,$token);\r\n\r\n\treturn $token;\r\n}", "public static\r\n function set($name, $value) {\r\n if(session_status() != PHP_SESSION_ACTIVE) {\r\n session_start();\r\n }\r\n if(!isset($name)) {\r\n session_register($name);\r\n }\r\n $_SESSION[\"\" . $name . \"\"] = $value;\r\n session_write_close();\r\n //define($name, $value);\r\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "public function __get( $name){\n\t\tif ( isset($_SESSION[$name])){\n\t\t\treturn $_SESSION[$name];\n\t\t}\n\t}", "public function __set( $name, $value )\n {\n switch ( $name )\n {\n case 'database':\n if ( !$value instanceof ezcDbHandler )\n {\n throw new ezcBaseValueException( $name, $value, 'ezcDbInstance' );\n }\n $this->properties[$name] = $value;\n break;\n case 'tableName':\n case 'userIdField':\n case 'userNameField':\n case 'passwordField':\n case 'varNameFilter':\n case 'varNameUserName':\n case 'varNameUserId':\n case 'sessionUserIdKey':\n case 'sessionTimestampKey':\n case 'loginRequiredUri':\n case 'logoutUri':\n if ( !is_string( $value ) )\n {\n throw new ezcBaseValueException( $name, $value, 'string' );\n }\n $this->properties[$name] = $value;\n break;\n\n default:\n throw new ezcBasePropertyNotFoundException( $name );\n }\n }", "public function set($name, $value)\n {\n $_SESSION[$this->_index][$name] = $value;\n }", "public function storeSessionTokenInRegistry() {}", "static function setReporticoSessionParam($param, $value, $namespace = false, $array = false)\n {\n if (!$namespace)\n $namespace = ReporticoApp::get(\"session_namespace_key\");\n\n //echo \"Set $namespace:$param<BR>\";\n if (!$array) {\n $_SESSION[$namespace][$param] = $value;\n } else {\n $_SESSION[$namespace][$array][$param] = $value;\n }\n \n }" ]
[ "0.5917515", "0.55511785", "0.5549255", "0.55224943", "0.54544294", "0.54412425", "0.54136115", "0.53416467", "0.5327926", "0.5322238", "0.53110325", "0.5291771", "0.52808213", "0.5277777", "0.5241896", "0.5241896", "0.52209765", "0.51853675", "0.5166372", "0.51629406", "0.51412696", "0.5137574", "0.51012546", "0.5097736", "0.50777996", "0.50650775", "0.50541186", "0.50526303", "0.5033758", "0.50260514", "0.5006093", "0.5004927", "0.4996925", "0.49905318", "0.49858895", "0.49814257", "0.49752885", "0.4956117", "0.4943599", "0.49346572", "0.49263582", "0.49158457", "0.49037117", "0.48997247", "0.48969766", "0.48965693", "0.48955745", "0.489539", "0.48940352", "0.48824456", "0.48766828", "0.4876016", "0.48758012", "0.4874883", "0.4870388", "0.48686302", "0.48662275", "0.48658958", "0.4848963", "0.4846746", "0.4845576", "0.48294836", "0.48284587", "0.48254424", "0.48252198", "0.48246822", "0.48239446", "0.48151773", "0.48140085", "0.48052126", "0.47955617", "0.47948095", "0.47923917", "0.47911662", "0.47893927", "0.47833008", "0.47820863", "0.4779708", "0.47796023", "0.47779697", "0.47697955", "0.47697437", "0.47668886", "0.47654253", "0.4762445", "0.47550365", "0.47467342", "0.47412732", "0.47398236", "0.4728787", "0.47256702", "0.47111192", "0.47079426", "0.4707835", "0.4697506", "0.46919116", "0.469002", "0.46815237", "0.46759", "0.4671382", "0.46670136" ]
0.0
-1
Check whether the storage is empty
public function isEmpty() { return !isset($this->getNamespace()->{$this->getMember()}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_empty(){\r\n\t\treturn $this->size==0;\r\n\t}", "public function is_empty()\n\t\t{\n\t\t\tif ($this->is_cached()) {\n\t\t\t\treturn !is_null($this->content);\n\t\t\t}\n\n\t\t\tif ($this->exists() || $this->saved) {\n\t\t\t\treturn $this->size() <= 0;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public function isFull(): bool\n {\n return $this->maxSize === $this->size;\n }", "public function is_empty() {\n return ($this->count == 0);\n }", "function empty()\n {\n return count($this->items) == 0;\n }", "public function isEmpty(): bool\n {\n return 0 === $this->size;\n }", "public function isEmpty(): bool\n {\n $this->collectLogs();\n\n return empty($this->data);\n }", "function is_empty() {\n\t\treturn !$this->count();\n\t}", "public function empty() : bool\n {\n return empty($this->samples);\n }", "public function empty() : bool\n {\n return empty($this->container());\n }", "public function isFull()\n\t{\n\t\treturn count($this->_data) >= $this->_limit;\n\t}", "public function isFull()\n {\n return $this->getFreeInMb() <= 0.0;\n }", "public function isEmpty()\n {\n return count($this->_metaData) == 0;\n }", "public function isEmpty()\n {\n return ($this->shelfs[0]->count() == 0) ? true : false;\n }", "public function isEmpty()\n {\n return ($this->size == 0);\n }", "public function empty(): bool\n {\n return count($this->queries) === 0;\n }", "public function clearEmptyStoreBa()\n {\n return $this->builder->has('store');\n }", "public function isEmpty()\n {\n \treturn 0 == $this->getItemCount();\n }", "public function isEmpty(): bool {\n return $this->size() === 0;\n }", "public function empty(): bool\n {\n if ([] !== $this->added) {\n return false;\n }\n \n return 0 === $this->count();\n }", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool\n {\n return $this->count() === 0;\n }", "public function isEmpty(): bool\n {\n return 0 === $this->count();\n }", "public function isEmpty(): bool {\n return empty($this->items);\n }", "function is_empty()\n {\n }", "public function is_empty() {\n\t\treturn 0 === count( $this->get_cart() );\n\t}", "public function valid()\n {\n return $this->storage->valid();\n }", "function empty() {\n return !count($this->queue);\n }", "public function isEmpty() {\n return $this->size() == 0;\n }", "public function testPurgeWholeData()\n {\n $store = new Storage(TESTING_STORE);\n\n // do purging data\n $store->purge();\n\n // the results must be === 0\n $this->assertEquals(0, count($store->read()));\n }", "public function isEmpty(): bool\n\t{\n\t\treturn $this->count() === 0;\n\t}", "public function isEmpty(): bool\n {\n return empty($this->items);\n }", "public function isEmpty(): bool\n {\n return empty($this->items);\n }", "public function isEmpty()\n {\n return $this->count() === 0;\n }", "function is_upload_space_available()\n {\n }", "public function isFull(): bool;", "public function isEmpty() : bool\n {\n return empty($this->items);\n }", "public function isEmpty() {\n return (0 == $this->size());\n }", "public function isEmpty()\n {\n if(empty($this->items))\n \t{\n \t\t//empty\n \t\treturn false;\n \t}\n }", "public function isEmpty(): bool\n {\n return ($this->count() === 0);\n }", "function is_empty($path) \n {\n \n $files = $this->files($path,'.',false,array());\n $folders = $this->folders($path);\n \n if ((count($files) + count($folders)) < 1) {\n return true;\n }\n return false;\n }", "public function isEmpty()\n\t{\n\t\treturn $this->count === 0;\n\t}", "public function isEmpty()\n {\n return empty($this->data);\n }", "public function isEmpty() : bool {\n return sizeof($this) == 0;\n }", "function isFull()\r\n\t\t{\r\n\t\t\treturn count($this->elements) >= $this->size;\r\n\t\t}", "final public function empty(): bool\n {\n return count($this->elements) === 0;\n }", "public function isEmpty()\n {\n return $this->length === 0;\n }", "function isEmpty() {\r\n return empty($this->list);\r\n }", "public function isEmpty() {\n\t\treturn ($this->count === 0);\n\t}", "public function isEmpty() {\n return empty($this->_data);\n }", "public function isInstallQueueEmpty() {}", "public function isEmpty()\n {\n return empty($this->items);\n }", "public function isEmpty()\n {\n return empty($this->items);\n }", "public function isEmpty() {\n return empty($this->items);\n }", "public function isEmpty(): bool\n {\n return $this->actions->isEmpty();\n }", "public function empty(): bool\n {\n $this->session->remove('panier');\n return true;\n }", "public function isEmpty()\n {\n return ($this->count() === 0);\n }", "public function testIsEmpty()\r\n\t{\r\n\t\t$this->assertTrue( $this->list->is_empty() );\r\n\r\n\t\t// add data\r\n\t\t$this->list->ut_dummy_data();\r\n\r\n\t\t// test with data\r\n\t\t$this->assertFalse( $this->list->is_empty() );\r\n\t}", "public function isEmpty() {}", "public function isEmpty() {\r\n \t\r\n \treturn false;\r\n /**\r\n * @todo implementation\r\n */\r\n \t//return ! ( isset ( $this->__sesionStorage->role ) );\r\n }", "public function isEmpty()\n {\n return empty($this->record);\n }", "public function isEmpty()\n {\n if ($this->count == intval(0)) {\n return true;\n } else if ($this->count > intval(0)) {\n return false;\n }\n }", "public function isEmpty()\n {\n return $this->getContent()->isEmpty();\n }", "public function isEmpty()\n {\n return $this->getContent()->isEmpty();\n }", "protected function mustUseFullDataSample(): bool\n {\n return $this->getSampleSize() === 0;\n }", "public function isEmpty(): bool\n {\n return count($this->entities) === 0;\n }", "public function isEmpty()\n {\n return empty($this->handlers);\n }", "public function isEmpty()\n {\n return ($this->count() == 0);\n }", "function isEmpty() {\n\t\tif ($this->f) {\n\t\t\treturn filesize($this->path) == 0;\n\t\t}\n\t\treturn true;\n\t}", "public function isEmpty()\r\n\t{\r\n\t\treturn ( 0 === $this->count() );\r\n\t}", "public function testIsStorageChecksStoragesProperly()\n {\n mkdir(self::$temp.DS.'help');\n file_put_contents(self::$temp.DS.'help'.DS.'foo.txt', 'contents');\n\n $this->assertTrue(Storage::isfile(self::$temp.DS.'help'.DS.'foo.txt'));\n $this->assertFalse(Storage::isfile(self::$temp.DS.'.'.DS.'help'));\n }", "public function is_empty(stdClass $submission) { //called on save\r\n return $this->count_codehandin_submission($submission->id, ASSIGNSUBMISSION_CODEHANDIN_FILEAREA) == 0;\r\n }", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty()\n {\n return $this->getTotalQty() == 0;\n }", "public function check()\n\t{\n\t\t$output = false;\n\n\t\tif($this->storage == self::STORAGE_FILE)\n\t\t{\n\n\t\t}\n\t\telseif($this->storage == self::STORAGE_APC)\n\t\t{\n\t\t\t$output = apc_exists($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_REDIS)\n\t\t{\n\t\t\tif(self::$redis != null)\n\t\t\t\t$output = self::$redis->exists($key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_MEMCACHED)\n\t\t{\n\t\t\tif(self::$memcached != null)\n\t\t\t\t$output = self::$memcached->get($key) !== false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\t\treturn $output;\n\t}", "public function isFull()\n {\n return ($this->getNumberOfAvailableForGet() == $this->getFridgeCapacity()) ? true : false;\n }", "public function isEmpty(): bool\n {\n return true;\n }", "public function isEmpty(): bool {\n\t\treturn count($this->array) === 0;\n\t}", "function isEmpty()\n {\n }", "public function isEmpty()\n {\n return $this->collection->isEmpty();\n }", "public function isEmpty()\n {\n return $this->collection->isEmpty();\n }", "public function exists()\n {\n return !empty($this->data);\n }", "public function isFull()\n {\n if($this->rear==(count($this->array))){\n return true;\n }\n else{\n return false;\n }\n }", "public function isEmpty()\n {\n \t$empty = $this->getHousingCount() == 0;\n \t$empty = $empty && is_null($this->getHousingDescription());\n \t$empty = $empty && $this->getOtherCount() == 0;\n \t$empty = $empty && is_null($this->getOtherDescription());\n \t$empty = $empty && $this->getPhotoCount() == 0;\n \t$empty = $empty && is_null($this->getPhotoDescription());\n \t$empty = $empty && $this->getSheetCount() == 0;\n \t$empty = $empty && is_null($this->getSheetDescription());\n \t$empty = $empty && $this->getVolumeCount() == 0;\n \t$empty = $empty && is_null($this->getVolumeDescription());\n \t\t$empty = $empty && $this->getBoxCount() == 0;\n \t$empty = $empty && is_null($this->getBoxDescription());\n \t\treturn $empty;\n }" ]
[ "0.74716973", "0.7285602", "0.6982764", "0.6908048", "0.6900094", "0.6868147", "0.67686206", "0.67543846", "0.67505896", "0.67417234", "0.6714472", "0.67049915", "0.6693385", "0.6673284", "0.667323", "0.6672379", "0.6650948", "0.6648772", "0.664288", "0.6599895", "0.6577888", "0.6577888", "0.6577888", "0.65699744", "0.6568029", "0.655505", "0.6545129", "0.65414953", "0.65383035", "0.65152615", "0.65008235", "0.6481307", "0.6478328", "0.6478328", "0.64730096", "0.646352", "0.6446325", "0.64364153", "0.642366", "0.6411015", "0.6405714", "0.6402515", "0.6399528", "0.6360901", "0.6355689", "0.63258183", "0.6318211", "0.63151777", "0.63140893", "0.63117325", "0.6306512", "0.6302486", "0.6299525", "0.6299525", "0.62780166", "0.62698734", "0.6265458", "0.6264752", "0.625877", "0.62586385", "0.6253659", "0.62525094", "0.62449926", "0.6242186", "0.6242186", "0.62408704", "0.6231966", "0.62288713", "0.62185895", "0.621793", "0.6206591", "0.61901784", "0.61628884", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6159633", "0.6158493", "0.61377805", "0.61302704", "0.6125769", "0.6124092", "0.6120208", "0.610568", "0.610568", "0.61014646", "0.60997725", "0.6085803" ]
0.0
-1
Read contents of storage
public function read() { return $this->getNamespace()->{$this->getMember()}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read()\n\t{\n\t\t$content = $this->storage->read();\n\t\t$data = array();\n\t\tforeach($content['data'] as $key=>$value) {\n\t\t\t$storage = new \\Zentric\\Storage(array(\n\t\t\t\t'key' => $key\n\t\t\t\t, 'folder' => STORAGE\n\t\t\t\t, 'driver' => 'Array'\t\t\t\n\t\t\t));\t\t\t\n\t\t\t$data[] = $storage->read();\t\t\t \n\t\t}\n\t\treturn $data;\n\t}", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read()\n\t{\n\t\treturn file_get_contents($this->getPath());\n\t}", "public function read()\n {\n return $this->_contents;\n }", "public function readAll() {\n //$max_len = \\filesize($this->file->getAbsolutePath());\n //return $this->readString($max_len);\n return \\file_get_contents($this->file->getAbsolutePath());\n }", "public function getContent() {\n\t\treturn $this->storage->file_get_contents($this->path);\n\t}", "abstract public function read();", "public function getStorage();", "public function getStorage();", "public function read() {\n\t\t\n\t}", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "public function readAll();", "function getStorage() ;", "public function read() {\r\n }", "public function getStorage() {}", "public function getStorage() {}", "public function getStorage() {}", "public function readStream();", "public function readerGetContent();", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public function getContents() {}", "public static function getStorage() {}", "public function contents() {\n\t\treturn file_get_contents($this->path);\n\t}", "abstract public function read($path);", "public function read()\n {\n }", "function getContents() ;", "abstract function read();", "function read($name) {\n return @file_get_contents($this->path . \"/$name\");\n }", "public function readCache()\n {\n return $this->readFile()->unpackData();\n }", "public function read()\n {\n }", "public function read($path);", "protected function readContent() {\r\n\t\t$this->contentList = [];\r\n\t\t$this->read = true;\r\n\t\t$i = 0;\r\n\t\t\r\n\t\t// Read the 512 bytes header\r\n\t\t$longFilename = null;\r\n\t\twhile (strlen($binaryData = $this->file->read(512)) != 0) {\r\n\t\t\t// read header\r\n\t\t\t$header = $this->readHeader($binaryData);\r\n\t\t\tif ($header === false) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// fixes a bug that files with long names aren't correctly\r\n\t\t\t// extracted\r\n\t\t\tif ($longFilename !== null) {\r\n\t\t\t\t$header['filename'] = $longFilename;\r\n\t\t\t\t$longFilename = null;\r\n\t\t\t}\r\n\t\t\tif ($header['typeflag'] == 'L') {\r\n\t\t\t\t$format = 'Z'.$header['size'].'filename';\r\n\t\t\t\t\r\n\t\t\t\t$fileData = unpack($format, $this->file->read(512));\r\n\t\t\t\t$longFilename = $fileData['filename'];\r\n\t\t\t\t$header['size'] = 0;\r\n\t\t\t}\r\n\t\t\t// don't include the @LongLink file in the content list\r\n\t\t\telse {\r\n\t\t\t\t$this->contentList[$i] = $header;\r\n\t\t\t\t$this->contentList[$i]['index'] = $i;\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->file->seek($this->file->tell() + (512 * ceil($header['size'] / 512)));\r\n\t\t}\r\n\t}", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "public function getContents();", "private function getContents()\n {\n if ($this->contents) {\n return $this->contents;\n }\n\n return $this->contents = $this->directory->getContents();\n }", "protected function getFromStorage()\n {\n try {\n if ($data = $this->parseJson(file_get_contents($this->getStoragePath()))) {\n return $data;\n }\n } catch (ErrorException $e) {\n // File does not exist or could not be opened.\n }\n\n // Fall back to the list provided by the package.\n return $this->parseJson(file_get_contents(__DIR__.'/../domains.json'));\n }", "public function read($path) {\n return file_get_contents($path);\n }", "function getStorage();", "function readContent(){\n\n if (ftell($this->handle) == 0){\n $this->readLine();\n }\n $this->content = [];\n \n while ( ($read = $this->readLine()) !== FALSE){\n $this->content[] = $read;\n }\n }", "public function get()\n {\n $file_path = $this->path();\n\n if (Storage::exists($file_path)) {\n\n return Storage::get($file_path);\n\n }\n }", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function getContents($path)\n {\n return file_get_contents($path);\n }", "public function testGetRetrievesStorages()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'Hello World');\n $this->assertSame('Hello World', Storage::get(self::$temp.DS.'file.txt'));\n }", "public function read ()\n {\n return $this->read();\n }", "public function getStorage()\n {\n return $this->get(self::_STORAGE);\n }", "public function getContents( $filePath )\n {\n $this->accumulatorStart();\n if(strpos($filePath,'/storage/') !== FALSE )\n {\n $result = $this->s3->getObject(array('Bucket' => $this->bucket,\n 'Key' => $filePath));\n $ret = (string) $result['Body'];\n }\n else\n {\n\n $item = $this->pool->getItem($filePath);\n $contentsinfo=$item->get($filePath);\n \n if($item->isMiss())\n {\n $item->lock();\n $item->set(file_get_contents( $this->makeDFSPath( $filePath ) ));\n $ret = file_get_contents( $this->makeDFSPath( $filePath ) );\n }else\n {\n $ret = $contentsinfo;\n }\n \n \n }\n $this->accumulatorStop();\n return $ret;\n }", "public function read()\n {\n if(!$this->edit && $this->exists())\n readfile($this->getPath());\n else\n echo $this->contents;\n }", "public function getData()\n\t{\n\t\t$data = '';\n\t\tif($this->beforeRead())\n\t\t{\n\t\t\t$filename = $this->getStorageFile();\n\t\t\t\n\t\t\tif($this->enablePersistentData===true and isset(self::$persistentData[$filename]))\n\t\t\t{\n\t\t\t\treturn self::$persistentData[$filename];\n\t\t\t}\t\t\n\t\t\t\n\t\t\tif(!file_exists($filename) or filesize($filename)===0)\n\t\t\t{\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($filename,'rb');\n\t\t\tself::$persistentData[$filename] = $data = fread($fp,filesize($filename));\n\t\t\tfclose($fp);\n\t\t\t$this->afterRead();\n\t\t}\n\t\treturn $data;\n\t}", "public function read($path)\n {\n }", "abstract protected function read ();", "function getContents();", "protected function getFileContents() {\n $path = $this->getFilePath();\n return file_get_contents($path);\n }", "public function readObject();", "public abstract function readObjects();", "public function getContents()\n {\n }", "public function read($path)\n {\n return file_get_contents($path);\n }", "protected function getStorageInfo() {\n\t\t$dirInfo = \\OC\\Files\\Filesystem::getFileInfo('/', false);\n\t\treturn \\OC_Helper::getStorageInfo('/', $dirInfo);\n\t}", "public function readAll(): string;", "public function fetch() {\r\n $h = null;\r\n if (isset($this->handle)) {\r\n $h = $this->handle;\r\n }\r\n else {\r\n $h = $this->_open();\r\n flock($h, LOCK_SH); // shared lock for reading\r\n }\r\n fseek($h,0);\r\n $result = '';\r\n while (!feof($h)) {\r\n $result .= fread($h, 8192);\r\n }\r\n if (is_null($this->handle)) {\r\n flock($h, LOCK_UN);\r\n fclose($h);\r\n }\r\n return $result;\r\n }", "public function getAll()\n {\n return $this->storage;\n }", "public function getContents()\n {\n return stream_get_contents($this->stream);\n }", "public function get()\n {\n if(is_null($this->contents) && $this->exists())\n $this->contents = file_get_contents($this->getPath());\n\n return $this->contents;\n }", "public function getContents()\n {\n $this->load();\n\n return $this->_contents;\n }", "function GetFromCache()\n {\n return File::GetContents($this->file);\n }", "public function getContents()\n {\n return $this->reader\n ->fetchAssoc($this->associativeMap);\n }", "function loadContents() ;", "public function readAll( ) {\n\n\t\treturn $this->_data;\n\t}", "public function Read($size = 1048576);", "public function read()\n {\n if(Cache::exist($this->key))\n {\n return Cache::get($this->key);\n }\n else\n {\n if(File::exist($this->file))\n {\n if(!static::$cache->hasKey($this->key))\n {\n $file = new Reader($this->file);\n \n if($file->is('php'))\n {\n $data = static::send($file->require());\n }\n else\n {\n $data = static::send($file->lines());\n }\n\n static::$cache->set($this->key, $data);\n\n return $data;\n }\n else\n {\n return static::$cache->get($this->key);\n }\n }\n }\n }", "public function getContents(){\n return file_get_contents($this->source);\n }", "public function get()\n\t{\n\t\t$output = null;\n\t\tif($this->storage == self::STORAGE_FILE)\n\t\t{\n\n\t\t}\n\t\telseif($this->storage == self::STORAGE_APC)\n\t\t{\n\t\t\t$output = apc_fetch($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_REDIS)\n\t\t{\n\t\t\tif(self::$redis != null)\n\t\t\t\t$output = self::$redis->get($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_MEMCACHED)\n\t\t{\n\t\t\tif(self::$memcached != null)\n\t\t\t\t$output = self::$memcached->get($this->key);\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\n\n\t\treturn $output;\n\t}", "protected function fetchStorageRecords() {}", "public function getStorageRecord() {}", "public function read($id) {\n\t\treturn file_get_contents( $this->init['path']['data'] . $id . $this->init['data']['ext'] );\n\t}", "public static function read_content($id)\n {\n $meta = self::meta($id);\n self::file_exists($meta, true);\n return file_get_contents($meta['file']);\n }", "public function getContents()\n {\n return $this->getContents();\n }", "public function read(): mixed\n {\n return json_decode(file_get_contents($this->path), true, 512, JSON_THROW_ON_ERROR);\n }", "public function read(): array;", "public function get()\n {\n if (!$this->storage->has(self::STORAGE_KEY)) {\n $this->update();\n }\n return $this->storage->get(self::STORAGE_KEY);\n }", "public function storage($storage)\n\t{\n\t\treturn $this->storage->get($storage);\n\t}", "function read($name);" ]
[ "0.7855143", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.7054087", "0.69644696", "0.6933722", "0.690313", "0.676574", "0.66663975", "0.6664073", "0.6664073", "0.6649905", "0.66476613", "0.66383845", "0.66355115", "0.6576167", "0.65683216", "0.65681726", "0.65680206", "0.6505697", "0.6474099", "0.64703596", "0.6470032", "0.6470032", "0.6470032", "0.6470032", "0.64626706", "0.6453835", "0.6434162", "0.64193463", "0.6416238", "0.6405801", "0.6390312", "0.6367393", "0.63574725", "0.6357185", "0.63338673", "0.6332383", "0.6332383", "0.6332383", "0.6332383", "0.6332383", "0.6329975", "0.63177514", "0.63093334", "0.6305175", "0.6301228", "0.62992346", "0.629905", "0.629905", "0.6298793", "0.6298084", "0.62854385", "0.6277961", "0.62734956", "0.6194586", "0.6189641", "0.61825436", "0.6175325", "0.6169427", "0.6155798", "0.61556566", "0.615038", "0.61287296", "0.6121429", "0.6114482", "0.61094314", "0.6106442", "0.6097501", "0.60896295", "0.60892504", "0.60779107", "0.60643053", "0.60501254", "0.60365677", "0.6015661", "0.6004415", "0.60005003", "0.5991489", "0.5990577", "0.5977426", "0.5976487", "0.59496623", "0.59494793", "0.59408474", "0.5935352", "0.5927222", "0.5912562", "0.58856946", "0.58767575", "0.5840082", "0.58325243" ]
0.0
-1
Write contents to storage
public function write($contents) { $this->getNamespace()->{$this->getMember()} = $contents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function write($contents);", "public function store($contents)\n {\n file_put_contents(self::$dataFolder . '/' . time() . '.data', serialize($contents));\n }", "protected function write()\n {\n $this->writeString($this->database);\n $this->writeString($this->type);\n $this->writeString($this->storage);\n }", "public function write($content);", "public function write();", "public function write();", "public function write ($contents)\n {\n if (is_array($contents) && count($contents) > 0) {\n Zend_Json::$useBuiltinEncoderDecoder = true;\n $data_storage['session_id'] = $this->_session_id;\n $data_storage['user_ip'] = $this->_user_ip;\n $data_storage['time'] = time();\n $data_storage['data'] = Zend_Json::encode($contents);\n if (isset($contents['username'])) {\n $data_storage['username'] = $contents['username'];\n }\n if (isset($contents['id'])) {\n $data_storage['user_id'] = $contents['id'];\n }\n if (isset($contents['is_admin'])) {\n $data_storage['is_admin'] = $contents['is_admin'];\n }\n if (isset($contents['client_id'])) {\n $data_storage['client_id'] = $contents['client_id'];\n }\n if (isset($contents['guest'])) {\n $data_storage['guest'] = $contents['guest'];\n }\n $this->_storage->setOptions($data_storage);\n if (isset($data_storage['user_id']) && isset($data_storage['username']) && $data_storage['user_id'] > 0) {\n $this->_storage->save();\n }\n }\n }", "public function save(): void\n {\n foreach ($this->getChunks() as $chunk) {\n $this->getFile()->seek(0, SeekType::SEEK_END);\n $chunk->setOffset($this->getFile()->tell() / 4096);\n $chunkData = $chunk->getChunkData();\n $this->getFile()->write($chunkData);\n $this->getFile()->seek($this->calcOffset($chunk->getCoordinates()),\n SeekType::SEEK_SET\n );\n $chunkLocation = $chunk->getLocation();\n $this->getFile()->write($chunkLocation);\n }\n }", "function contentPut($students)\n{\n $serializedData = serialize($students);\n file_put_contents(DB_NAME, $serializedData, LOCK_EX);\n}", "public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\n\t}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "public function save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}", "public function write($name, $content);", "public function putContent($data) {\n\t\t$this->storage->file_put_contents($this->path, $data);\n\t}", "public function file_put_contents($file, $content);", "protected function _write() {}", "protected function saveContents($contents)\n {\n $this->contents = $contents;\n\n try {\n $this->files->put($this->getFilepath(), json_encode($contents));\n } catch (Exception $e) {\n // ...\n }\n }", "protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "abstract public function write($data);", "public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\n\t\t//throw new Exception(\"Not yet implemented!\");\n\t\t\t\t//---------------------\n\n $domDoc = new DOMDocument;\n $rootElt = $domDoc->createElement('items');\n $rootNode = $domDoc->appendChild($rootElt);\n\n foreach($this->_data AS $row) {\n $rowElement = $domDoc->createElement('item');\n\n foreach($row AS $key => $value) {\n\n $element = $domDoc->createElement($key);\n $element->appendChild($domDoc->createTextNode($value));\n\n $rowElement->appendChild($element);\n }\n $rootNode->appendChild($rowElement);\n\n }\n\n $data = $domDoc->saveXML();\n\n //var_dump($data);\n\n file_put_contents($this->_origin, $data);\n\n\t\t// --------------------\n\t}", "public function write($data);", "public function write($data);", "public function write($data);", "public function write($data);", "public function saveStorage($file){\n\t\t$ser_storage = serialize($this->user);\n\t\tfile_put_contents($file, $ser_storage) or die(\"save: unable to open File\");\t\t\n\t}", "public function write(string $file, string $content): void;", "public function write($path, $data);", "abstract protected function _write();", "function StoreToCache($content)\n {\n File::CreateWithText($this->file, $content);\n }", "public function write($content)\n\t{\n\t\treturn file_put_contents($this->getPath(), $content);\n\t}", "public function save($path,$content,$lock = false) ;", "public function store($value) {\r\n $h = null;\r\n if (isset($this->handle)) {\r\n $h = $this->handle;\r\n }\r\n else {\r\n $h = $this->_open();\r\n flock($h, LOCK_EX); // exclusive lock for writing\r\n }\r\n if ($this->option_create) { // mode == 'a+'\r\n ftruncate($h,0);\r\n }\r\n $result = fwrite($h, $value);\r\n if (is_null($this->handle)) {\r\n flock($h, LOCK_UN);\r\n fclose($h);\r\n }\r\n }", "public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }", "protected function writeSysFileStorageRecords() {}", "private function persist()\n {\n $content = $this->adapter->read();\n\n $content = $this->builder->apply($content);\n\n return $this->adapter->write($content);\n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "public function write_file ( $content ) {\r\n\r\n\t}", "public static function putContents($path, $data, $mode = 'w+')\n {\n }", "abstract protected function write();", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "public function writeFile($data);", "public function store($name, $content);", "public function save($values)\n {\n $values = json_encode($values);\n Storage::put($this->storename, $values);\n }", "private function write_cache($content)\r\n\t{\r\n\t\tfile_put_contents($this->cache_file, $content);\r\n\t}", "public static function save($content, $file = null)\n {\n if (null === $file) {\n $file = static::$dataFile;\n }\n\n $dir = Fluid::getBranchStorage() . '/' . dirname($file);\n if (!is_dir($dir)) {\n mkdir($dir);\n }\n\n $file = Fluid::getBranchStorage() . '/' . $file;\n\n file_put_contents($file, $content);\n\n //self::storeCache($content);\n }", "function write() {\n\t\t$this->readychk();\n\t\tif (!is_dir($this->dir_path)) { mkdir($this->dir_path); }\n\t\tif (!is_dir($this->asset_path)) { mkdir($this->asset_path); }\n\n\t\t$cstr = json_encode($this->export(TRUE, TRUE));\n\t\tif (\n\t\t\t$cstr === FALSE &&\n\t\t\tjson_last_error() !== JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config encoding failed.\"); }\n\t\tfile_lock_and_put($this->conf_path, $cstr);\n\t}", "public function setContent($content){\n //asign the content\n $this->contentObject = $content;\n\n //save to disk as serialized\n $json = json_encode($this->contentObject);\n if($this->exists()){\n file_put_contents($this->getPath(), $json);\n }\n\t}", "public function save($filename, $content);", "public function write($filename, $content){\n\t\treturn file_put_contents($this->dirname.'/'.$filename, $content);\n\t}", "public function saveContent( string $content );", "private function write($path, $content)\n {\n file_put_contents($path, $content);\n }", "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function _write($data)\n {\n }", "protected function storeFiles()\n {\n $this->log(sprintf('%s', __METHOD__), 'debug');\n\n $this->log(sprintf('Playlist - Writing file list to temporary file. (%s)', basename($this->tempFilesFromFilename)), 'info');\n $stream = new Stream(fopen($this->tempFilesFromFilename, 'w'));\n\n try {\n $stream->write($this->filesToString());\n } catch (\\Exception $e) {\n $this->log(sprintf('Playlist - Error while writing to file %s. (%s)', basename($this->tempFilesFromFilename), $e->getMessage()), 'error');\n }\n\n $stream->close();\n }", "public function write(string $path, $contents, string $visibility = null)\n {\n if ($visibility === null) {\n if (!isset($this->config['visibility'])) {\n throw new StorageConfigException('Missing storage \"visibility\" config.');\n }\n\n $visibility = $this->config['visibility'];\n }\n\n $this->config = ['visibility' => $visibility];\n\n if (gettype($contents) == 'string') {\n $this->adapter->write($path, $contents, $this->config);\n } else if (gettype($contents) == 'resource') {\n $this->adapter->writeStream($path, $contents, $this->config);\n }\n }", "public function writeAndClose();", "public function write(){\n\n\t\t$ACHFile = fopen($this->getFileLocation(), \"w\");\n\t\tfwrite($ACHFile, $this->getData());\n\t\tfclose($ACHFile);\n\n\t\treturn $this->getFileLocation();\t\n\t}", "public function write($key, $value) {\n\t\treturn $this->_storage->set($key, $value, null);\n\t}", "public function write()\n {\n }", "public function testPutStoresStorages()\n {\n Storage::put(self::$temp.DS.'file.txt', 'Hello World');\n $this->assertStringEqualsFile(self::$temp.DS.'file.txt', 'Hello World');\n }", "public function testAppendAddsDataToStorage()\n {\n file_put_contents(self::$temp.DS.'file.txt', 'foo');\n\n $append = Storage::append(self::$temp.DS.'file.txt', 'bar');\n\n $this->assertTrue(mb_strlen('bar', '8bit') === $append);\n $this->assertTrue(is_file(self::$temp.DS.'file.txt'));\n $this->assertSame('foobar', file_get_contents(self::$temp.DS.'file.txt'));\n }", "public function onWrite();", "public function flush()\r\r\n\t{\r\r\n\t\t$this->_storage->flush();\r\r\n\t}", "private function saveItems()\n {\n $this->storage->save($this->items);\n }", "public function write($data) {\n\t}", "public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }", "public function writeable();", "public function write($content, array $metadata = null)\n {\n // No op\n }", "private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }", "public function saveBuffer(): void {\n\t\t// Get content && update page content\n\t\t$this->setPageContent($this->readBuffer());\n\t}", "public function saveDataToFile()\n {\n\n }", "private function performMemoryWrite() {\r\n $index = $this->MAR->asInt();\r\n $data = $this->MDR->getContent();\r\n\r\n //syslog(LOG_ALERT,'memwrite');\r\n $this->mainMemory->performWrite($index, $data);\r\n }", "protected function store()\n\t{\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t\t//---------------------\n\t\tif (($handle = fopen($this->_origin, \"r\")) !== FALSE)\n\t\t{\n $tasksTag = new SimpleXMLElement(\"<tasks></tasks>\");\n foreach($this->_data as $key => $record){\n $taskTag = $tasksTag->addChild(\"task\");\n foreach($this -> _fields as $value){\n $taskTag->addAttribute($value, $record->$value);\n }\n }\n /*\n $newsXML->addAttribute('newsPagePrefix', 'value goes here');\n $newsIntro = $newsXML->addChild('content');\n $newsIntro->addAttribute('type', 'latest');\n Header('Content-type: text/xml');\n echo $newsXML->asXML();*/\n\n $tasksTag -> asXML ($this -> _origin);\n \n\t\t}\n\t\t// --------------------\n\t}", "public function write(): void\n {\n $this->writeAndReturnAffectedNumber();\n }", "function file_put_contents($filename, $data, $flags = 0, $context = null) {\n\t\n}", "public function save($filename) {\r\n file_put_contents($filename, $this->contents);\r\n }", "public function save(string $file, string $content): void\n {\n $this->filesystem->dumpFile($file, $content);\n }", "public function write()\n\t{\n\t\t$source = $this->compile();\n\n\t\t// file location\n\t\t$file = $this->template->getEnvironment()->getCache() . '/';\n\t\t$file .= $this->template->getEnvironment()->getCacheFilename($this->filename);\n\n\t\t// attempt to create the directory if needed\n\t\tif(!is_dir(dirname($file)))\n\t\t{\n\t\t\tmkdir(dirname($file), 0777, true);\n\t\t}\n\n\t\t// write to tempfile and rename\n\t\t$tmpFile = tempnam(dirname($file), basename($file));\n\t\tif(@file_put_contents($tmpFile, $source) !== false)\n\t\t{\n\t\t\tif(@rename($tmpFile, $file))\n\t\t\t{\n\t\t\t\tchmod($file, 0644);\n\t\t\t}\n\t\t}\n\t}", "public function put(string $contents): void\n {\n if ( $this->exists() && ! $this->isWritable() ) {\n throw new FileSystemException(\n 'File is immutable: '.$this->filename\n );\n }\n\n if ( ! $this->exists() && ! $this->directory->isWritable() ) {\n throw new FileSystemException(\n 'Directory is immutable: '.$this->directory->getPath()\n );\n }\n\n file_put_contents($this->directory->getPath().'/'.$this->filename, $contents);\n }", "public function put_contents($file, $contents, $mode = \\false)\n {\n }", "public function put_contents($file, $contents, $mode = \\false)\n {\n }", "public function put_contents($file, $contents, $mode = \\false)\n {\n }", "public function put_contents($file, $contents, $mode = \\false)\n {\n }", "public function put_contents($file, $contents, $mode = \\false)\n {\n }", "public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }", "function jsonSave()\n {\n try {\n file_put_contents($this->fname, json_encode($this->content));\n } catch (Exception $e) {\n echo $e;\n }\n }", "public function write(string $id, string $content) : void\n {\n $_SESSION[$id] =\n [\n 'content' => $content,\n 'stamp' => Chronos::date()->getDateTime(),\n ];\n }", "public function save()\n {\n return $this->write($this->filename, $this->sections);\n }", "public function write($contents)\r\n {\r\n if (is_string($contents)) {\r\n $this->setIdentity($contents);\r\n }\r\n /** @var \\stdClass */\r\n $result = $this->service->getAuthResultRowObject();\r\n if (is_object($result)) {\r\n $resource = $this->getBareBoneClientResource($contents);\r\n $resource->setData($result);\r\n $this->getResourceManager()->saveResource($resource);\r\n }\r\n }", "protected function writeCache(): void\n {\n $chunkSize = 1024 * 8;\n\n // open remote file\n $arrContextOptions = [\n 'ssl' => [\n 'verify_peer' => false,\n 'verify_peer_name' => false,\n ],\n ];\n $remoteFile = fopen(\n $this->pathFile,\n 'rb',\n false,\n stream_context_create($arrContextOptions)\n );\n if (!$remoteFile) {\n throw new \\RuntimeException(\n sprintf(\n \"Couldn't open file at %s\",\n $this->pathFile\n )\n );\n }\n\n // open cache file\n $cacheFile = fopen($this->pathCache, 'wb');\n if (!$cacheFile) {\n fclose($remoteFile);\n\n throw new \\RuntimeException(\n sprintf(\n \"Couldn't open cache file at %s\",\n $this->pathCache\n )\n );\n }\n\n // write file to cache\n while (!feof($remoteFile)) {\n fwrite(\n $cacheFile,\n fread($remoteFile, $chunkSize),\n $chunkSize\n );\n }\n\n // close cache file\n fclose($cacheFile);\n\n // close remote file\n fclose($remoteFile);\n }", "public function write() {\n\n try {\n $this->open();\n $sessionData = session_encode(); // Returns an encoded string containing the session data.\n $fileHandle = fopen(self::FILEPATH, \"w+\"); // Open the file\n fwrite($fileHandle, $sessionData); // Write the session data to file\n fclose($fileHandle);\n }\n catch(SessionException $e) {\n echo \"Error writing session to file: \" . $e->getMessage();\n }\n }", "public function putContents($file, $data, $append = false);" ]
[ "0.71482015", "0.70803714", "0.69821054", "0.6769129", "0.66977686", "0.6666014", "0.6666014", "0.66531235", "0.6623625", "0.65937775", "0.6590111", "0.6475641", "0.6466115", "0.6432422", "0.6431833", "0.64162785", "0.6374766", "0.6324359", "0.6297792", "0.62567157", "0.6252973", "0.62221587", "0.6221116", "0.62147534", "0.62147534", "0.62147534", "0.62147534", "0.61674637", "0.6137124", "0.6132675", "0.6132411", "0.60822445", "0.6078882", "0.6066691", "0.6061975", "0.6049598", "0.6049339", "0.60318416", "0.6017466", "0.6011223", "0.600227", "0.6002088", "0.59778464", "0.59721035", "0.5958576", "0.5951109", "0.59509516", "0.5902244", "0.5899836", "0.58812976", "0.5874674", "0.58725375", "0.587222", "0.5869587", "0.5866584", "0.5844602", "0.5844602", "0.58425784", "0.58425784", "0.58425784", "0.58408177", "0.58361256", "0.58325356", "0.5830429", "0.5808284", "0.5803892", "0.57949686", "0.57940537", "0.5790904", "0.5780453", "0.57775676", "0.5776349", "0.5771128", "0.57689595", "0.5730813", "0.5720847", "0.57183754", "0.57172954", "0.569984", "0.5691057", "0.5677174", "0.56701463", "0.56698483", "0.56693214", "0.56644684", "0.56618464", "0.56584084", "0.56433517", "0.5642009", "0.56406844", "0.56406844", "0.56406844", "0.56400865", "0.56363064", "0.5634537", "0.563048", "0.56299", "0.5628956", "0.56180394", "0.55874413" ]
0.6035874
37
Specify Model class name
public function model() { return Schedule::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getModelName()\n {\n if (isset($this->options[\"type\"])) {\n $type = ucfirst($this->options[\"type\"]);\n $class = \"\\\\app\\\\models\\\\feeds\\\\\" . $type;\n if (class_exists($class)) {\n return $class;\n }\n }\n \n return \"\\\\app\\\\models\\\\\" . $this->objectName;\n }", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "public static function model($className=__CLASS__)\r\n\t{\r\n return parent::className();\r\n\t}", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n \treturn parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model ($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n\treturn parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) \n\t{\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model ($className = __CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public function getModelClass();", "public function getModelClass();", "public function getModelClass();", "public static function model($className = __CLASS__) {\n return parent::model( $className );\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }" ]
[ "0.768929", "0.76618075", "0.7585344", "0.7583571", "0.7583571", "0.7542252", "0.75075734", "0.74778146", "0.74702877", "0.74578375", "0.74578375", "0.7453601", "0.7453601", "0.7447208", "0.7444998", "0.7435527", "0.74304074", "0.7416409", "0.74128395", "0.74125767", "0.74125767", "0.74125767", "0.741222", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.740793", "0.74018055", "0.7400949", "0.739494", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.7390499", "0.7390499", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7383603", "0.7379902", "0.7379902", "0.73766464", "0.73766464", "0.73766464", "0.73750174", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766" ]
0.0
-1
Specify Validator class name
public function validator() { return ScheduleValidator::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validator()\n {\n\n return EmpreValidator::class;\n }", "public function validator()\n {\n return ZhuanTiValidator::class;\n }", "public function validator()\n {\n\n return ConfigValidator::class;\n }", "public function validator()\n {\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return PescariaValidator::class;\n }", "public function validator()\n {\n\n return ProvidersValidator::class;\n }", "public function validator()\n {\n\n return AvaliacoeValidator::class;\n }", "public function validator()\n {\n\n return AnggotaKeluargaValidator::class;\n }", "public function validator()\n {\n\n return BabyInfoValidator::class;\n }", "public function validator()\n {\n return LanguageValidator::class;\n }", "public function createValidator();", "public function validator()\n {\n\n return OccupationValidator::class;\n }", "public function validator()\n {\n return ClientProjectJobcodeValidator::class;\n }", "public function validator()\n {\n\n return FormInfoValidator::class;\n }", "public function validator()\n {\n\n return TipoContratoValidator::class;\n }", "public function getValidator($name = 'default') {\n\t\t\t//\n\t\t\tif ($name == 'default') { return new Validator();}\n\t\t\trequire (VALIDATORS . $name . '_validator.php');\n\t\t\t$name = $name . '_Validator';\n\t\t\treturn new $name();\n\t\t}", "public function validator()\n {\n return NewsValidator::class;\n }", "public function getValidator() {}", "public function getValidator();", "public function getValidator();", "public function validator()\n {\n\n return TaxrateValidator::class;\n }", "public function validator()\n {\n\n return ProjetoValidator::class;\n }", "public function validatedBy() {\n return get_class($this).'Validator';\n// return 'file_extension_validator';\n }", "public function validator()\n {\n\n return GrupoServicosValidator::class;\n }", "public function validator()\n {\n\n return DateValidator::class;\n }", "public function validator()\n {\n\n return MembersValidator::class;\n }", "public function validator()\n {\n\n return DistribuidorValidator::class;\n }", "public function validator()\n {\n\n return ProducerValidator::class;\n }", "public function validator()\n {\n\n return ClientLocationTypeValidator::class;\n }", "public function validator()\n {\n\n return CategoriesValidator::class;\n }", "public function validator()\n {\n\n return OrderItemValidator::class;\n }", "public function validator()\n {\n\n return MaintenanceStatusValidator::class;\n }", "public function getValidatorService();", "public function validator()\n {\n\n return PlaceCalendarSettingsValidator::class;\n }", "public function validator()\n {\n\n return CategoryJobValidator::class;\n }", "public function validator()\n {\n\n return InsuranceTypeValidator::class;\n }", "public function validator()\n {\n\n return MenuValidator::class;\n }", "public function validator()\n {\n\n return WhitelistedNumberValidator::class;\n }", "protected function getClientClassName()\n\t{\n\t\treturn 'Prado.WebUI.TCompareValidator';\n\t}", "public static function getValidator($name, array $options = []);", "private function createValidator($validatorName, $options = array()) { \n $mergedOptions = array_merge($this->defaults, $options); \n $key = strtolower($validatorName);\n if (! array_key_exists($key, $this->validators)) {\n switch ($validatorName) {\n case self::NOT_EMPTY:\n $validator = new Zend_Validate_NotEmpty();\n break;\n case self::STRING_LENGTH:\n $validator = new Zend_Validate_StringLength($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['encoding']); \n break;\n case self::EMAIL_ADDRESS :\n $validator = new Zend_Validate_EmailAddress();\n break; \n case self::EMAIL_ADDRESS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_EmailAddressAllowEmpty();\n break; \n case self::BETWEEN:\n $validator = new Zend_Validate_Between($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['inclusive']);\n break;\n case self::GREATER_THAN:\n $validator = new Zend_Validate_GreaterThan($mergedOptions['min']);\n break;\n case self::LESS_THAN:\n $validator = new Zend_Validate_LessThan($mergedOptions['max']);\n break;\n case self::LESS_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_LessThanOrEqual($mergedOptions['max']);\n break;\n case self::ALNUM: \n $validator = new Zend_Validate_Alnum($mergedOptions['allowWhiteSpace']);\n break;\n case self::ALNUM_ALLOW_EMPTY :\n $validator = new Miqo_Validation_AlnumAllowEmpty();\n break;\n case self::REGEX:\n $validator = new Zend_Validate_Regex($mergedOptions['pattern']);\n break;\n case self::DB_NO_RECORD_EXISTS: \n $validator = new Zend_Validate_Db_NoRecordExists($mergedOptions['table'], $mergedOptions['field']); \n break;\n case self::DIGITS :\n $validator = new Zend_Validate_Digits();\n break; \n case self::DIGITS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_DigitsAllowEmpty();\n break;\n case self::FLOAT :\n \t$validator = new Zend_Validate_Float();\n \tbreak;\n \tcase self::FLOAT_ALLOW_EMPTY :\n \t\t$validator = new Miqo_Validation_FloatAllowEmpty();\n \t\tbreak;\n case self::PASSWORD:\n $validator = new Miqo_Validation_Password();\n break;\n case self::DATE_GREATER_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_Date_GreaterThanOrEqual($mergedOptions['minDate']);\n break;\n case self::UPLOADED:\n $validator = new Miqo_Validation_Uploaded();\n break;\n default: \n $validatorName = 'Zend_Validate_'.$validatorName;\n $validator = new $validatorName($mergedOptions['table']);\n break;\n }\n $this->validators [$key] = $validator;\n }\n $validator = $this->validators [$key];\n\n if ($validatorName != self::DB_NO_RECORD_EXISTS){\n foreach ($options as $key => $value){\n $methodSet = 'set'.ucfirst($key);\n $validator->$methodSet($value);\n }\n } \n return $validator;\n }", "public function validator()\n {\n\n return ProductMetaValidator::class;\n }", "public function validator()\n {\n\n return CompanyPositionValidator::class;\n }", "public function validator()\n {\n\n return NetworkValidator::class;\n }", "public function validator()\n {\n\n return ProfessorResponsavelCursoValidator::class;\n }", "public function validator()\n {\n\n return AudioValidator::class;\n }", "public function validator()\n {\n return NotificationValidator::class;\n }", "public function validator()\n {\n }", "public static function __callStatic(string $ruleName, array $arguments): ValidatorInterface;", "public function validator()\n {\n\n return PermissionValidator::class;\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "public function getValidatorClass(CodeGeneratorColumn $column){\n\t\tswitch ($column->getSmartType()){\n\t\t\tcase CodeGeneratorColumn::TYPE_BOOLEAN:\n\t\t\t\t$class = 'InputValidatorEnum(\\'true\\',\\'false\\')';\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::TYPE_FLOAT:\n\t\t\t\t$class = 'InputValidatorIsFloat()';\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::TYPE_INTEGER:\n\t\t\t\tif($column->isForeignKey()){\n\t\t\t\t\t$class = 'InputValidatorModelExists(\\''.$column->getReferenceClassName().'\\')';\n\t\t\t\t} else {\n\t\t\t\t\t$class = 'InputValidatorInteger()';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CodeGeneratorColumn::SMARTTYPE_TIMESTAMP:\n\t\t\t\t$class = 'InputValidatorRegex(\\'//\\') /* Timestamp validation */';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$class = 'InputValidatorNotEmpty()';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $class;\n\t}", "public function validatedBy()\n {\n return HireValidator::class;\n }", "public function __call(string $ruleName, array $arguments): ValidatorInterface;", "public function validator()\n {\n\n return CollegeHasAttributeValidator::class;\n }", "public function check_validity($_classname);", "public function getLaravelValidationClassName($object): ?string;", "static public function getClass($validationRule)\n\t{\n\t\t$validationRule = strtolower($validationRule);\n\t\tif(!isset(self::$validators[$validationRule]))\n\t\t\treturn false;\n\n\n\t\t$classname = self::$validators[$validationRule];\n\n\n\t\tif(!class_exists($classname, false))\n\t\t{\n\t\t\tif(strpos($classname, 'MortarFormValidation') == 0)\n\t\t\t{\n\t\t\t\t$config = Config::getInstance();\n\n\n\t\t\t\t$filename = substr($classname, strlen('MortarFormValidation')) . '.class.php';\n\t\t\t\t$path = $config['path']['modules'] . 'Mortar/Form/classes/ValidationRules/' . $filename;\n\n\n\t\t\t\tif(file_exists($path))\n\t\t\t\t{\n\t\t\t\t\tinclude($path);\n\t\t\t\t}else{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn $classname;\n\t}", "private function getValidatorClass($command)\n {\n // Replace Directory\n $className = str_replace('Commands', 'Validators', get_class($command));\n // Replace Name\n $className = str_replace('Command', 'Validator', $className);\n\n if (class_exists($className)) {\n return $className;\n }\n\n return false;\n }", "final public static function register()\n {\n $ruleName = self::getRuleName();\n ValidatorValidator::extend($ruleName, static::class . '@performValidation');\n\n if (method_exists(static::class, 'replacer')) {\n ValidatorValidator::replacer($ruleName, static::class . '@replacer');\n }\n }", "public function setCustomRule(string $name, Validatable $rule): ValidatorInterface;", "public function getValidatorClassForColumn($column)\n {\n switch ($column->getDoctrineType())\n {\n case 'boolean':\n $validatorSubclass = 'Boolean';\n break;\n case 'string':\n \t\tif ($column->getDefinitionKey('email'))\n \t\t{\n \t\t $validatorSubclass = 'Email';\n \t\t}\n \t\telse if ($column->getDefinitionKey('regexp'))\n \t\t{\n \t\t $validatorSubclass = 'Regex';\n \t\t}\n \t\telse\n \t\t{\n \t\t return 'freermsValidatorString';\n \t\t}\n break;\n case 'clob':\n case 'blob':\n return 'freermsValidatorString';\n case 'float':\n case 'decimal':\n $validatorSubclass = 'Number';\n break;\n case 'integer':\n $validatorSubclass = 'Integer';\n break;\n case 'date':\n $validatorSubclass = 'Date';\n break;\n case 'time':\n $validatorSubclass = 'Time';\n break;\n case 'timestamp':\n $validatorSubclass = 'DateTime';\n break;\n case 'enum':\n $validatorSubclass = 'Choice';\n break;\n default:\n $validatorSubclass = 'Pass';\n }\n\n if ($column->isForeignKey())\n {\n $validatorSubclass = 'DoctrineChoice';\n }\n else if ($column->isPrimaryKey())\n {\n $validatorSubclass = 'Choice';\n }\n\n return sprintf('sfValidator%s', $validatorSubclass);\n }", "public function testIfClassCanBeCreated()\n {\n $this->assertInstanceOf(Validator::class, $this->_validator);\n }", "public function validator()\n {\n return LeaveRequestValidator::class;\n }", "public function getValidatorClassForColumn($column) {\n switch ($column->getDoctrineType()) {\n case 'boolean':\n $name = 'Choice';\n break;\n case 'float':\n case 'decimal':\n $name = 'Number';\n break;\n case 'integer':\n $name = 'Integer';\n break;\n case 'date':\n case 'datetime':\n case 'timestamp':\n $name = 'DateRange';\n break;\n case 'enum':\n $name = 'Choice';\n break;\n default:\n $name = 'Pass';\n }\n\n if ($column->isPrimarykey() || $column->isForeignKey()) {\n $name = 'DoctrineChoice';\n }\n\n return sprintf('sfValidator%s', $name);\n }", "protected function parseValidatorClass($path)\n {\n $parts = explode('::', $path);\n $entity = ucwords($parts[0]);\n $method = $this->parseRuleMethod($parts[1]);\n\n $class = \"{$this->rootNamespace}$entity\\\\$method\";\n\n if (class_exists($class)) {\n return new $class();\n }\n\n throw new ValidationRulesetException(\n \"The ruleset for {$entity}\\\\{$method} doesn't exist.\"\n );\n }", "public function validator()\n {\n // Return empty is to close the validator about create and update on the repository.\n return OperateValidator::class;\n }", "public function validator()\n {\n\n return BroadcastValidator::class;\n }", "public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }", "public function getCMSValidator()\n {\n return RequiredFields::create([\n 'ClassName'\n ]);\n }", "abstract function validator();", "public function setupValidatorRules()\n { }", "protected function getValidator(): void\n {\n // TODO: Implement getValidator() method.\n }", "public function getName()\n {\n return 'simplethings_formextra_validation';\n }", "public function __construct(Validator $validator)\n {\n $this->validator = $validator;\n }", "public function getValidator()\n {\n if (!isset($this->customValidator)) {\n throw new CertaintyException('Custom class not defined');\n }\n return $this->customValidator;\n }", "protected static function getFacadeAccessor() { return 'input_validator'; }", "function getJsValidatorName($name) \n{\t\n\tswitch ($name) \n\t{\n\t\tcase \"Number\":\n\t\t\treturn \"IsNumeric\";\n\t\t\tbreak;\n\t\tcase \"Password\":\n\t\t\treturn \"IsPassword\";\n\t\t\tbreak;\n\t\tcase \"Email\":\n\t\t\treturn \"IsEmail\";\n\t\t\tbreak;\n\t\tcase \"Currency\":\n\t\t\treturn \"IsMoney\";\n\t\t\tbreak;\n\t\tcase \"US ZIP Code\":\n\t\t\treturn \"IsZipCode\";\n\t\t\tbreak;\n\t\tcase \"US Phone Number\":\n\t\t\treturn \"IsPhoneNumber\";\n\t\t\tbreak;\n\t\tcase \"US State\":\n\t\t\treturn \"IsState\";\n\t\t\tbreak;\n\t\tcase \"US SSN\":\n\t\t\treturn \"IsSSN\";\n\t\t\tbreak;\n\t\tcase \"Credit Card\":\n\t\t\treturn \"IsCC\";\n\t\t\tbreak;\n\t\tcase \"Time\":\n\t\t\treturn \"IsTime\";\n\t\t\tbreak;\n\t\tcase \"Regular expression\":\n\t\t\treturn \"RegExp\";\n\t\t\tbreak;\t\t\t\t\t\t\n\t\tdefault:\n\t\t\treturn $name;\n\t\t\tbreak;\n\t}\n}", "protected function getValidationFactory()\n {\n return app('validator');\n }", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "private function getValidator()\n {\n return Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator();\n }", "public function getValidatorClassForColumn($column)\n {\n $validatorClasses = array_merge($this->tools->getValidatorConfig('classes'), $this->tools->getValidatorConfig('filter_classes'));\n $formColumnType = $this->tools->getFormColumnType($column);\n\n return isset($validatorClasses[$formColumnType]) ? \n $validatorClasses[$formColumnType] :\n $validatorClasses['default'];\n }", "public function getCreateTaskValidator()\n : Validators\\ValidatorInterface\n {\n return $this->app->make(\n Validators\\CreateTaskValidator::class\n );\n }", "protected function getValidator($name, $options, $message)\n {\n $name = strtolower($name);\n $validator = '\\\\Best\\\\Driver\\\\Validator\\\\' . ucfirst($name);\n return new $validator($options, $message);\n }", "public function validator(string $ormClass) : ValidatorContract\n {\n\n $rules = $this->detectRules($ormClass);\n return $this->createObject(Validator::class, [\n 'rules' => $rules,\n 'ormClass' => $ormClass,\n 'baseValidator' => $this->createObject(IlluminateBaseValidator::class)\n ]);\n\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "protected function validator(array $data)\n {\n return self::getValidator($data);\n }", "public function toValidator($command)\n {\n $commandClass = get_class($command);\n\n return str_replace('Command', 'Validator', $commandClass);\n }", "public function registerValidator($fullClassName)\n {\n\n // Bind the validator as a singleton.\n app()->singleton($fullClassName, function () use ($fullClassName) {\n return new $fullClassName(app()[ValidationManager::class]);\n });\n\n // The rule-name is the name-of the validator-class excl. the namespace and excl \"Validator\" and strtolower().\n $ruleName = strtolower(substr($fullClassName, strrpos($fullClassName, '\\\\') + 1, -9));\n\n // Check, if the rule is already in use and throw exception, if it is.\n $registeredRules = $this->getRegisteredRules();\n if (isset($registeredRules[$ruleName])) {\n throw new RuleAlreadyInUseException('Rule \"' . $ruleName . '\" is already in use as: ' . $registeredRules[$ruleName]);\n }\n\n // Register the validation-rule.\n Validator::extend($ruleName, function ($attribute, $value, $parameters, $validator) use ($fullClassName) {\n\n // Set the calling Illuminate\\Validation\\Validator instance, so the validator can manipulate it.\n app($fullClassName)->setIlluminateValidator($validator);\n\n return app($fullClassName)->validate($attribute, $value, $parameters);\n\n });\n\n // Register the replacer.\n Validator::replacer($ruleName, function ($message, $attribute, $rule, $parameters) use ($fullClassName) {\n return app($fullClassName)->replace($message, $attribute, $rule, $parameters);\n });\n\n // Add rule to $this->registeredRules\n $this->registeredRules[$ruleName] = $fullClassName;\n }", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Kanpaina')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Kanpaina);\n }\n }\n\n return $this->_validator;\n }", "public function validator(){\n\t\t$this->runValidation(new ReqValidator($this, ['field'=>'material_name', 'msg' => 'Material name is required.']));\n\t\t$this->runValidation(new MaxValidator($this, ['field'=>'material_name', 'rule'=>60, 'msg' => 'Material name must be less than 60 characters']));\n\t\t$this->runValidation(new AlphaNumValidator($this, ['field'=>'material_name', 'msg' => 'Material name can only contain letters, numbers and spaces']));\n\t}", "protected function registerUserValidator()\n\t{\n\t\t$this->app->bind('confide.user_validator', function ($app) {\n\t\t\treturn new UserValidator();\n\t\t});\n\t}" ]
[ "0.72592807", "0.72251856", "0.7150773", "0.71146023", "0.7076195", "0.7076195", "0.7076195", "0.7076195", "0.7076195", "0.7014993", "0.69791174", "0.68493617", "0.6822873", "0.67854977", "0.6781244", "0.6729631", "0.672608", "0.67218333", "0.66956973", "0.66793686", "0.66786146", "0.6627619", "0.66222686", "0.6622119", "0.6622119", "0.65781474", "0.6572067", "0.6556066", "0.6553423", "0.65433294", "0.6538805", "0.65299803", "0.6505174", "0.6503342", "0.6480678", "0.6479766", "0.6475696", "0.64604497", "0.6451309", "0.64416414", "0.64183193", "0.6418248", "0.63817227", "0.6375701", "0.63004065", "0.6297874", "0.6289055", "0.6281106", "0.62634367", "0.6248285", "0.62030345", "0.61805487", "0.61590517", "0.61549807", "0.61524427", "0.6134679", "0.61346626", "0.6114948", "0.609151", "0.60541713", "0.6038675", "0.60235786", "0.59803367", "0.5975151", "0.594436", "0.59262013", "0.5922589", "0.59137696", "0.5906716", "0.5903173", "0.58972096", "0.58827597", "0.5872381", "0.58276165", "0.578752", "0.578562", "0.57855487", "0.57808334", "0.5780013", "0.5772062", "0.57460105", "0.5681288", "0.5669612", "0.56593806", "0.5631865", "0.5615454", "0.5615454", "0.5615454", "0.5590734", "0.55702513", "0.5569057", "0.5559853", "0.5539483", "0.55341196", "0.5512875", "0.55116117", "0.55094177", "0.55078864", "0.55056566", "0.54969865" ]
0.6538089
31
Boot up the repository, pushing criteria
public function boot() { $this->pushCriteria(app(RequestCriteria::class)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initRepository(): void;", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\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// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "public function prepare(): void\n {\n $this->processRunner->runAndReport(\n sprintf(\n 'git clone %s --depth 1 --single-branch --branch %s project/sylius',\n $this->getGitRepository(),\n $this->getVersion()\n )\n );\n $this->processRunner->runAndReport('composer install --working-dir project/sylius --no-dev --no-interaction');\n }", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function deploy(){\n\t\t\t// load all configuration, payload, etc\n\t\t\t$this->load();\n\n\t\t\t// setup directories\n\t\t\t$this->setup_dirs();\n\n\t\t\t// initialise local git repositories\n\t\t\t$this->init_repo();\n\n\t\t\t// run the deployment\n\t\t\t$this->_deploy();\n\t\t}", "public function run()\n {\n $repo1 = Repo::create([\n 'name' => 'johnbolton/exercitationem',\n 'url' => 'https://github.com/johnbolton/exercitationem',\n 'event_id' => 1,\n ]);\n\n $repo2 = Repo::create([\n 'name' => 'pestrada/voluptatem',\n 'url' => 'https://github.com/pestrada/voluptatem',\n 'event_id' => 2,\n ]);\n }", "protected function prepareDatabase()\n {\n $this->stateSaver->setConnection($this->input->getOption('database'));\n\n if (!$this->stateSaver->repositoryExists()) {\n $options = ['--database' => $this->input->getOption('database')];\n $this->call('migrate:install', $options);\n }\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function setUp() {\n\n $connection = new \\Redis();\n $connection->connect('127.0.0.1', 6379);\n $connection->select(11);\n $adapter = new Rstore\\ConnectionAdapter\\Phpredis($connection);\n\n $this->connection = $connection;\n $this->repo = new Repository(\n $adapter,\n yaml_parse_file(__DIR__.'/../../config/models.yaml')\n );\n }", "public function setUp()\n {\n $this->config = new Repository();\n }", "public function main() {\n $this->retrieveUsers();\n\n // Adds genome configurations to user\n // Adds genome uploads and genome updates to genome configurations\n foreach($this->users as &$user) {\n $this->retrieveUserConfigs($user);\n foreach($user['configs'] as &$config) {\n $this->retrieveConfigUploads($config);\n $this->retrieveConfigUpdates($config);\n }\n }\n\n // Removes not used databases\n $this->dropUnusedDatabases();\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function __construct()\n {\n $testConfig = array(\n 'database' => array(\n 'in_memory' => true,\n 'driver' => 'pdo_sqlite',\n )\n );\n\n $this->application = new BacklogApplication();\n $this->application->registerPlugin($plugin = DoctrinePlugin::bootstrap($testConfig, 'test'));\n $this->application->setAutoExit(false);\n $this->repositoryManager = $plugin->getRepositoryManager();\n $this->persons = $this->repositoryManager->getPersonRepository();\n }", "protected function initial()\n {\n $adapter = new Local('/', LOCK_SH, Local::SKIP_LINKS);\n $local = new Filesystem($adapter);\n foreach ($this->config->returnActions() as $key => $elem) {\n $ctype = (strtolower($elem['typebackup']) !== 'mysql' ? ucfirst(strtolower($elem['type'])) : 'Time').ucfirst(strtolower($elem['typebackup']));\n $dst = $this->distination($this->config->returnConfig($elem['dst']), $key, $elem['dst']);\n $class = '\\backup\\Actions\\\\'.$ctype;\n $this->run[] = new $class($elem, $dst, $local, $this->config->returnMysqlConfig($elem['mysqlconfig']));\n MyLog::info('Initialization backup process - '.$ctype.' with config', $elem, 'main');\n $this->initial = $this->initial === false ? true : true;\n }\n }", "public function run()\n {\n if (!Repository::find(6)) {\n Repository::create([\n 'id' => 6,\n 'type' => 'model',\n 'name' => '2020 A3 Sedan'\n ]);\n }\n\n if (!Repository::find(7)) {\n Repository::create([\n 'id' => 7,\n 'type' => 'model',\n 'name' => 'BMW Wagon'\n ]);\n }\n\n if (!Repository::find(8)) {\n Repository::create([\n 'id' => 8,\n 'type' => 'model',\n 'name' => 'Ford EcoSport'\n ]);\n }\n\n if (!Repository::find(9)) {\n Repository::create([\n 'id' => 9,\n 'type' => 'model',\n 'name' => 'Honda Amaze'\n ]);\n }\n\n if (!Repository::find(10)) {\n Repository::create([\n 'id' => 10,\n 'type' => 'model',\n 'name' => 'NX 300 F SPORT'\n ]);\n }\n }", "protected function prepareDatabase()\n {\n if (!$this->repositoryExists()) {\n $this->components->info('Preparing database.');\n\n $this->components->task('Creating package migration table', function () {\n return $this->callSilent('package:migrate:install', array_filter([\n '--database' => $this->option('database'),\n ])) == 0;\n });\n\n $this->newLine();\n }\n\n }", "public function collect() {\n // register installed projects\n foreach ($this->drush->getExtensions() as $extension) {\n if ($extension->type == 'theme') {\n continue;\n }\n\n $projectName = $this->projectFactory->getProjectName($extension);\n if ($this->projectRegistry->hasProject($projectName)) {\n $project = $this->projectRegistry->getProject($projectName);\n }\n else {\n $project = $this->projectFactory->createProjectFromExtension($extension);\n $this->projectRegistry->addProject($project);\n }\n\n $module = $this->projectFactory->createModuleFromExtension($extension);\n $module->setProject($project);\n $project->addModule($module);\n\n $this->projectRegistry->addModule($module);\n }\n\n // populate module dependencies\n foreach ($this->drush->getExtensions() as $extension) {\n if ($extension->type == 'theme') {\n continue;\n }\n\n $module = $this->projectRegistry->getModule($extension->name);\n foreach (array_keys($extension->requires) as $name) {\n if ($this->projectRegistry->hasModule($name)) {\n $module->addDependency($this->projectRegistry->getModule($name));\n }\n }\n foreach (array_keys($extension->required_by) as $name) {\n if ($this->projectRegistry->hasModule($name)) {\n $module->addRequiredByModule($this->projectRegistry->getModule($name));\n }\n }\n }\n }", "public function __construct()\n {\n $this->kitchenRecipeRepository = app(KitchenRecipeRepository::class);\n $this->kitchenIngredientRepository = app(KitchenIngredientRepository::class);\n $this->kitchenIngredientKitchenRecipeRepository = app(KitchenIngredientKitchenRecipeRepository::class);\n }", "public function init()\n {\n\n // initialize the prepared statements\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERY));\n $this->addFinder($this->finderFactory->createFinder($this, SqlStatementKeys::PRODUCT_MEDIA_GALLERIES_BY_SKU));\n }", "public function __construct(UserRepository $repository)\n {\n parent::__construct();\n $this->repository = $repository;\n\t $this->repository->pushCriteria(new HasReadyStartupsCriteria());\n }", "function boot()\n {\n parent::boot();\n $this->pushCriteria(app(RequestCriteria::class));\n if ($_FILES) {\n config(['repository.cache.enabled' => false]);\n }\n }", "private function registerRepository(){\n $this->dataSources = array(\n 1=>new DataSourceIRC61647(),\n );\n }", "public final function prep(){\n\n //disable apache from append session ids to requests\n ini_set('session.use_trans_sid',0);\n //only allow sessions to be used with cookies\n ini_set('session.use_only_cookies',1);\n\n //base directory of application\n //$this->path = dirname($_SERVER['DOCUMENT_ROOT']);\n $this->path = dirname(dirname(dirname(dirname(dirname(__DIR__)))));\n \n //load the appropriate application production configuration \n //and override with any dev config.\n if(is_file($this->path.'/.config.php')){\n $this->config = require($this->path.'/.config.php');\n if($this->config['APP_MODE']!='PROD' && is_file($this->path.'/.dev.config.php')){\n $this->config = array_merge($this->config,require($this->path.'/.dev.config.php'));\n }//if\n }//if\n \n //if the COMPOSER PATH isn't set then resort to the default installer path \"vendor/\"\n if(!isset($this->config['COMPOSER_PATH'])){\n $this->config['COMPOSER_PATH'] = 'vendor';\n }//if\n\n }", "function repositoryCustom()\n {\n }", "public function run()\n {\n return $this->repoClass->init();\n }", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", "public function __construct()\n {\n $this->bigStatisticsRepo = new BigStatisticsRepository();\n }", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "public function __construct()\n {\n $this->postRepository = new PostRepository();\n $this->userRepository = new UserRepository();\n $this->commentRepository = new CommentRepository();\n $this->replyRepository = new ReplyRepository();\n }", "function install(){}", "protected function init()\n {\n if (in_array('users', Mongez::getStored('modules'))) {\n $this->isUserModuleExits = true;\n }\n\n $this->info('Preparing data...');\n $this->initController();\n $this->initModel();\n $this->initResource();\n $this->initRepository();\n $this->initData();\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function setup (){\n\t\techo \"\\n\";\n\t\techo \"Setting up: `\".$this->installedComponents[0]->name.\"`\\n\";\n\t\techo \"version: `\".$this->installedComponents[0]->version.\"`\\n\";\n\t\t//$installed[0]->version_normalized;\n\t\t\n\t\t\n\t\t#var_dump(\"xyz\");\n\t\techo \"-----------------------------------------\\n\";\n\t\t\n\t\t$searchDir = realpath($this->vendorDir . '/../..');\n\t\tif( file_exists($searchDir.\"/configuration.ini\") ){\n\t\t\techo \"found a previous `configuration.ini` ( \".$searchDir.\"/configuration.ini\".\" ) \\n\";\t\n\t\t\t\n\t\t\t$app = $this->readConfiguration($searchDir.\"/configuration.ini\" );\n\t\t\t$coreComponent = $this->getComponentVersion($this->installedComponents);\n\t\t\t\n\t\t\techo \"\\nsettings\\n\";\n\t\t\t//print_r($app->settings['conn']);\n\t\t\t\n\t\t\t//print_r();\n\t\t\t\n\t\t\t/* create the $this->pdo instance */\n\t\t\t$this->createPDO($app->configuration->role->conn);\n\t\t\t\n\t\t\t\n\t\t\t#echo \"\\npaths\\n\";\n\t\t\t#print_r($app->paths);\n\t\t\t#echo \"\\ncoreComponent\\n\";\n\t\t\t#print_r($coreComponent);\n\t\t\t\n\t\t\t#echo \"need to add config-parse code here..\\n\";\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->createdb($this->pdo);\n\t\t\t\n\t\t\t//echo \"\\n\\nFINISHED!!\\n\\n\";\n\t\t\t\n\t\t}else{\n\t\t\techo \"\\n No configuration found, starting setup.\\n\";\n\t\t\t$public_html = $this->public_html();\n\t\t\t$tempFolder = $this->tempFolder();\n\t\t\t\n\t\t\t/* create the $this->pdo instance from requested credentials */\n\t\t\t$dbCredentials = $this->dbCredentials();\n\t\t\t\n\t\t\t////////////////////////////////////////////////////\n\t\t\t$this->pdo;\n\t\t\techo \"\\n\\nUNFINISHED!!\\n\\n\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo \"\\n\";\n\t}", "abstract protected function bootstrap();", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "private function initProjects()\n\t{\n\t\t$this->priorities = Dao::readAll(Priority::class, [Dao::key('redmine_id')]);\n\t\t$this->projects = Dao::readAll(Project::class, [Dao::key('redmine_id')]);\n\t\t$this->statuses = Dao::readAll(Status::class, [Dao::key('redmine_id')]);\n\t}", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "abstract public function boot();", "public function __construct()\n {\n $this->typeRepo = new TypesRepository();\n }", "public function install(){\r\n\t\t\r\n\t}", "public function sync()\n {\n $sql = null;\n $module = new \\ZPM\\Core\\Setup\\Schema();\n $modData = new \\ZPM\\Core\\Setup\\Info();\n\n $module->install();\n }", "public function run()\n {\n user_type_repository()->create([\n 'code' => 'admin',\n 'caption' => 'Admin',\n 'is_staff' => true,\n 'is_admin' => true,\n 'is_designer' => false,\n 'is_support' => true,\n 'is_director' => true,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'product_manager',\n 'caption' => 'Product Manager',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'product_qa',\n 'caption' => 'Product QA',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'support',\n 'caption' => 'Support',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => true,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => true,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'art_director',\n 'caption' => 'Art Director ',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => true,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => true,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => true,\n ]);\n user_type_repository()->create([\n 'code' => 'designer',\n 'caption' => 'Designer',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => true,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'junior_designer',\n 'caption' => 'Junior Designer',\n 'is_staff' => true,\n 'is_admin' => false,\n 'is_designer' => true,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => true,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => true,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'decorator',\n 'caption' => 'Decorator',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => true,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'sales_rep',\n 'caption' => 'Campus Ambassador',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'account_manager',\n 'caption' => 'Campus Manager',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'customer',\n 'caption' => 'Customer',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n user_type_repository()->create([\n 'code' => 'placeholder',\n 'caption' => 'Placeholder',\n 'is_staff' => false,\n 'is_admin' => false,\n 'is_designer' => false,\n 'is_support' => false,\n 'is_director' => false,\n 'is_decorator' => false,\n 'can_see_full_names' => false,\n 'can_see_all_campaigns' => false,\n 'can_access_admin' => false,\n 'sees_customer_quick_quote' => false,\n 'sees_support_quick_quote' => false,\n ]);\n }", "public function prepare_db_for_extensions()\n\t{\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_start();\n\n\t\t// Resolves core tasks.\n\t\trequire_once path('sys').'cli/dependencies'.EXT;\n\n\t\t// Check for the migrations table\n\t\ttry\n\t\t{\n\t\t\tDB::table('laravel_migrations')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tCommand::run(array('migrate:install'));\n\t\t}\n\n\t\t// Check for the extensions table. The reason\n\t\t// this isn't in a migration is simply\n\t\ttry\n\t\t{\n\t\t\tDB::table('extensions')->count();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tSchema::create('extensions', function($table)\n\t\t\t{\n\t\t\t\t$table->increments('id')->unsigned();\n\t\t\t\t$table->string('slug', 50)->unique();\n\t\t\t\t$table->text('version', 25);\n\t\t\t\t$table->boolean('enabled');\n\t\t\t});\n\t\t}\n\n\t\t// Just incase the install process got interrupted, start\n\t\t// extensions\n\t\t$this->start_extensions();\n\n\t\t/**\n\t\t * @todo remove when my pull request gets accepted\n\t\t */\n\t\tob_end_clean();\n\t}", "public function install(){\n // Create plugin tables\n Project::createTable();\n\n Repo::createTable();\n\n CommitCache::createTable();\n\n MergeRequest::createTable();\n\n MergeRequestComment::createTable();\n\n $htracker = PLugin::get('h-tracker');\n if($htracker && !$htracker->isInstalled()) {\n $htracker->install();\n }\n\n // Create permissions\n Permission::add($this->_plugin . '.access-plugin', 1, 0);\n Permission::add($this->_plugin . '.create-projects', 0, 0);\n }", "public function run() {\n $this->base_data();\n $this->minimal_data();\n $project = Project::first();\n\n // Create a bunch more stuff, just for testin'.\n for ($i = 0; $i < 5; $i++) Factory::project($project->id);\n for ($i = 0; $i < 15; $i++) Factory::bid();\n for ($i = 0; $i < 15; $i++) Factory::question();\n for ($i = 0; $i < 10; $i++) Factory::vendor();\n for ($i = 0; $i < 40; $i++) Factory::section();\n\n for ($i = 0; $i < 20; $i++) Factory::project($project->id);\n for ($i = 0; $i < 40; $i++) Factory::bid(array(), $project->id);\n\n }", "function startup() {\n\t\t$this->_welcome();\n\t\tif (isset($this->params['datasource'])) {\n\t\t\t$this->dataSource = $this->params['datasource'];\n\t\t}\n\n\t\tif ($this->command && !in_array($this->command, array('help'))) {\n\t\t\tif (!config('database')) {\n\t\t\t\t$this->out(__('Your database configuration was not found. Take a moment to create one.', true), true);\n\t\t\t\treturn $this->DbConfig->execute();\n\t\t\t}\n\t\t}\n\t}", "public function setup() {\n // get files content\n $this->getFileContent();\n\n $this->filterMatches();\n \n // insert the document in db\n $this->insert();\n\n // init terms list\n $this->termsList = new TermsList();\n\n // save terms and relations\n $this->manageMatches();\n }", "function run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( is_array( $this->install->saved_data ) and count( $this->install->saved_data ) )\n\t\t{\n\t\t\tforeach( $this->install->saved_data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#^__sql__#\", $k ) )\n\t\t\t\t{\n\t\t\t\t\t$k = str_replace( \"__sql__\", \"\", $k );\n\t\t\t\t\n\t\t\t\t\t$this->install->ipsclass->vars[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Switch */\n\t\tswitch( $this->install->ipsclass->input['sub'] )\n\t\t{\n\t\t\tcase 'sql':\n\t\t\t\t$this->install_sql();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'settings':\n\t\t\t\t$this->install_settings();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'acpperms':\n\t\t\t\t$this->install_acpperms();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'templates':\n\t\t\t\t$this->install_templates();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'other':\n\t\t\t\t$this->install_other();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'caches':\n\t\t\t\t$this->install_caches();\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t/* Output */\n\t\t\t\t$this->install->template->append( $this->install->template->install_page() );\t\t\n\t\t\t\t$this->install->template->next_action = '?p=install&sub=sql';\n\t\t\t\t$this->install->template->hide_next = 1;\n\t\t\tbreak;\t\n\t\t}\n\t}", "public static function install(){\n\t}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "function pf_setup($argv) {\n if (!has_bin('git')) {\n failure(\"You need to install git before continuing!\");\n failure(\"After installing git run this setup in a new terminal window.\");\n\n return true;\n }\n\n # Check if ssh-kegen is installed\n if (!has_bin('ssh-keygen')) {\n failure(\"You need to install ssh before continuing!\");\n\n return true;\n }\n\n # Test Connection to PHPFog API\n $phpfog = new PHPFog();\n try {\n $has_api = $phpfog->login();\n } catch (PestJSON_Unauthorized $e) {\n failure(\"Invalid username or password. Please try again.\");\n exit(1);\n } catch (Exception $e) {\n failure(\"Error: {$e->getMessage()}\");\n exit(1);\n }\n if (!isset($has_api) || !$has_api) {\n die(failure('Failed to log in.'));\n }\n\n $ssh_identifier = preg_replace(\"/[^A-Za-z0-9-]/\", '-', $phpfog->username());\n\n # Create an ssh key\n $ssh_real_path = HOME.\"/.ssh/\".$ssh_identifier;\n if (!file_exists($ssh_real_path)) {\n $exit_code = execute(\"ssh-keygen -q -t rsa -b 2048 -f \".$ssh_real_path);\n if (0 != $exit_code) {\n die(failure('Failed to generate ssh key'));\n }\n }\n\n # Add ssh to config\n $ssh_config_path = HOME.\"/.ssh/config\";\n $config_host_line = \"Host \".$ssh_identifier;\n if (strpos(@file_get_contents($ssh_config_path), $config_host_line) === false) {\n $fh = @fopen($ssh_config_path, 'a') or die(failure(\"Can't open file: \".$ssh_config_path));\n fwrite($fh, PHP_EOL.wrap($config_host_line));\n fwrite($fh, wrap(\" HostName git01.phpfog.com\"));\n fwrite($fh, wrap(\" User git\"));\n fwrite($fh, wrap(\" IdentityFile \".HOME.\"/.ssh/\".$ssh_identifier).PHP_EOL);\n fclose($fh);\n } else {\n info(\"Config is already set up.\");\n }\n\n $pubkey = file_get_contents($ssh_real_path.\".pub\");\n\n try {\n $phpfog->new_sshkey('', $pubkey);\n success(\"Successfully installed ssh key.\");\n } catch (PestJSON_ClientError $e) {\n $resp = $phpfog->last_response();\n $body = json_decode($resp['body']);\n $message = $body->message;\n failure(\"Error: \".$message);\n }\n\n ewrap(bwhite(\"To clone an app use the following steps:\"));\n ewrap(\"1. List your apps: \".bwhite(\"pf list apps\"));\n ewrap(\"2. To fetch your application code: \".bwhite(\"pf clone <app_id>\"));\n ewrap(\"3. Make your changes\");\n ewrap(\"4. Stage changes in your local repo: \".bwhite(\"git add -A\"));\n ewrap(\"5. Commit changes: \".bwhite(\"git commit -m 'My first commit'\"));\n ewrap(\"6. Deploy to PHP Fog: \".bwhite(\"pf push\"));\n ewrap(\"For more information visit: \".bwhite(\"http://dev.appfog.com/features/article/pf_command_line_tool\"));\n\n return true;\n}", "public function setUp() {\n static::$kernel = static::createKernel();\n static::$kernel->boot();\n $this->em = static::$kernel->getContainer()\n ->get('doctrine')\n ->getManager();\n\n /** @var EntityManager $em */\n $em = $this->em;\n\n $this->blogEntryRepository = $em->getRepository('AnticomShowcaseBundle:BlogEntry');\n }", "public function setUp() {\n\t\t$this->setUpDatabase();\n\t\t$this->match = new Match;\n\t}", "function install() {}", "function __construct()\n\t{\n\t\t// Check repo for any new revisions\n\t\t$this->updateApp();\t\t\n\n\t\t// Create a new amazon connection\t\t\n\t\t$this->amazon();\n\t\t\n\t\t// Configure this server\n\t\t$this->bootstrap();\t\t\n\t}", "protected static function boot() {\n parent::boot();\n static::addGlobalScope(new ActiveProjectScope);\n }", "public function initialized(){\n if( $this->get_git() ){\n // Add query vars\n add_filter('query_vars', function($vars){\n $vars[] = 'giploy';\n return $vars;\n });\n // Add rewrite rule\n add_action('generate_rewrite_rules', array($this, 'generate_rewrite_rules'));\n // Flush rules if rewrite does not exits\n add_action('admin_init', array($this, 'flush_rules'));\n // Get hook\n add_action('pre_get_posts', array($this, 'pre_get_posts'));\n }\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function install() {\n\n\n }", "public function __construct()\n {\n $this->metadatas = app(MetadataRepository::class);\n $this->fileRepository = app(FileRepository::class);\n if(method_exists($this, 'init')){\n $this->init();\n }\n }", "protected function setUp() {\n $this->basePath = $basePath = realpath(__DIR__ . '/../../../../../');\n $appPath = $basePath . '/app';\n $this->confPath = $confPath = $appPath . '/boxdata/conf';\n $this->etcPath = $etcPath = $appPath . '/boxdata/etc/local';\n $this->object = new BoxRepository($confPath,null);\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "public function prepareDeployment() {\n\t\t$bean = $this->unbox();\n\t\tif ($bean->id === 0) {\n\t\t\tR::store($this);\n\t\t}\n\t\t$config = Zend_Registry::get('config');\n\t\t$workdir = $config->directories->deployment;\n\t\t$oldumask = umask(0); \n\t\tif (!is_dir($workdir)) {\n\t\t\tmkdir($workdir, 0777, true);\n\t\t}\n\t\t$this->deploymentDir = $workdir . $this->id;\n\t\tif ($bean->type === 'rollback') {\n\t\t\t$this->queueTarget('RollbackPilot');\n\t\t\t$this->queueTarget('Rollback');\n\n\t\t\t$bean->rollback = false;\n\t\t} elseif ($bean->type === 'upgrade') {\n\t\t\t$this->queueTarget('UpgradePilot');\n\t\t\t$this->queueTarget('Upgrade');\n\n\t\t\t$bean->rollback = true;\n\t\t} else {\n\t\t\t$this->queueTarget('Deploy');\n\n\t\t\t$bean->rollback = true;\n\t\t}\n\t\t\n\t\tif (!is_dir($workdir . $bean->id)) {\n\t\t\tmkdir($workdir . $bean->id, 0777, true);\n\t\t}\n\t\tumask($oldumask);\n\t\t$this->writePropertiesFile($workdir . $bean->id . '/build.properties');\n\t\tR::store($this);\n\t}", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "private function initAsyncRepositories(): void {\n $this->messagesRepository = new MessagesRepository();\n }", "protected function setUp() {\n\t\t$this->object = new QueryAggregateCondition();\n\t}", "private function init() {\n\t\t$GLOBALS[\"mlauto_db_version\"] = 1.0;\n\n\t\t//If SQL Table isn't initiated, initiate it\n\t\tClassificationModel::intializeTable();\n\t\tTermModel::intializeTable();\n\n\t\t$this->buildConfig();\n\n\t\tupdate_option(\"MLAuto_version\", $GLOBALS[\"mlauto_db_version\"]);\n\t}", "protected static function booted()\n {\n static::saved(function (RepositoryTag $repositoryTag) {\n Cache::tags(['repositories', 'tags'])->flush();\n });\n }", "public function run()\n {\n $branches = [\n [\n 'name' => 'Mbeya Branch',\n 'email' => '[email protected]',\n 'address' => 'Ikuti, Mbeya (M), Mbeya',\n 'phone' => '+255 755 456 529',\n 'type' => 1,\n ]\n ];\n\n foreach ($branches as $branch) {\n Branch::firstOrCreate([\n 'name' => $branch['name'],\n 'email' => $branch['email'],\n 'address' => $branch['address'],\n 'phone' => $branch['phone'],\n 'type' => $branch['type']\n ]);\n }\n }", "private function setCustomRepositories()\n {\n $em = $this->getDoctrine()->getManager();\n $this->frontRepository = new FrontRepository($em);\n }", "public function install() {\n //Check if the bot is already installed\n if ($this->checkInstalled()) {\n echo 'It seems like the request bot is already installed. If this\n is not the case then you have tables in the database you\n specified that have the same name as the tables that the\n Pull Request Bot is going to use in its installation. Please\n either delete them or choose different table names in the\n config.inc.php file. Thank you.';\n } else {\n $install_queries = $this->installQueries();\n \n //bool variable to check whether or not to commit the transaction.\n $commit = true;\n\n try {\n //start transactional query\n $this->db->beginTransaction();\n\n //execute queries one by one\n foreach ($install_queries as $key=>$install_query) {\n if ($install_query->execute()) {\n echo $key.': executed successfully.<br />';\n } else {\n $commit = false;\n echo $key.': failed.<br />';\n echo '<pre>';\n print_r($install_query->errorInfo());\n echo '</pre>';\n break;\n }\n }\n\n //Check to see that we can connect to external URLs\n if (WebPage::checkWorks()) {\n echo 'Check to connect to external websites passed.<br />';\n } else {\n //Don't commit.\n $commit = false;\n echo 'Check to connect to external websites failed.<br />';\n }\n\n if (function_exists('json_decode')) {\n echo 'JSON support enabled.<br />';\n } else {\n $commit = false;\n echo 'No JSON support.<br />';\n }\n\n //commit the transaction and display success message.\n if($commit == true) {\n $this->db->commit();\n echo 'Pull Request Bot has been successfully installed.\n Please use the run.php on a Cron job to use it.';\n } else {\n $this->db->rollBack();\n echo 'Install failed. Please see above messages for details.';\n }\n }\n catch (PDOException $e) {\n $this->db->rollBack();\n echo $e->getMessage();\n }\n }\n }", "public function setup()\n {\n $this->createCategories();\n $this->createProducts();\n }", "public function setUp() {\n $app = require __DIR__.'/../../bootstrap/app.php';\n $app->make('Illuminate\\Contracts\\Console\\Kernel')->bootstrap();\n\n $this->consumables=new Consumables();\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }", "public function run()\n {\n $provinces = $this->getProvincesFromFile();\n\n foreach ($provinces as $provinceName => $cities) {\n $province = $this->provincesRepository->create([\n 'name' => $provinceName\n ]);\n\n foreach ($cities as $cityName) {\n $this->citiesRepository->create([\n 'name' => $cityName,\n 'province_id' => $province->id\n ]);\n }\n }\n }", "public function writeAndPush()\n {\n $this->gitConfig();\n $this->writeFullConfFile();\n $this->writeUsers();\n if($this->commitConfig()) $this->pushConfig();\n }", "abstract public function repository();", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function createPreCommit() :void\n {\n $this->preCommitConfig();\n $this->preCommitSetup();\n }", "public function install() {\n\t\t\\GO\\Projects2\\Projects2Module::createDefaultIncomeContractNotificationCron();\n\t\t\n//\t\tif(!GO::modules()->isInstalled('projects')){\n\t\tGO::getDbConnection()->query(\"SET sql_mode=''\");\n\t\t\n\t\tif(!Utils::tableExists(\"pm_projects\")){\n\t\t\tparent::install();\n\t\t\t\n\t\t\t$defaultType = new Type();\n\t\t\t$defaultType->name = GO::t(\"Default\");\n\t\t\t$defaultType->save();\n\n\t\t\t$defaultStatus = new Status();\n\t\t\t$defaultStatus->name = GO::t(\"Ongoing\", \"projects2\");\n\t\t\t$defaultStatus->show_in_tree=true;\n\t\t\t$defaultStatus->save();\n\t\t\t\n\t\t\t$noneStatus = new Status();\n\t\t\t$noneStatus->name = GO::t(\"None\", \"projects2\");\n\t\t\t$noneStatus->show_in_tree=true;\n\t\t\t$noneStatus->filterable=true;\n\t\t\t$noneStatus->save();\n\n\t\t\t$status = new Status();\n\t\t\t$status->name = GO::t(\"Complete\", \"projects2\");\n\t\t\t$status->complete=true;\n\t\t\t$status->show_in_tree=false;\n\t\t\t$status->save();\n\t\t\t\n\t\t\t\n\t\t\t$folder = new \\GO\\Base\\Fs\\Folder(GO::config()->file_storage_path.'projects2/template-icons');\n\t\t\t$folder->create();\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('folder.png')){\n\t\t\t\t$file = new \\GO\\Base\\Fs\\File(GO::modules()->projects2->path . 'install/images/folder.png');\n\t\t\t\t$file->copy($folder);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('project.png')){\n\t\t\t\t$file = new \\GO\\Base\\Fs\\File(GO::modules()->projects2->path . 'install/images/project.png');\n\t\t\t\t$file->copy($folder);\t\t\t\n\t\t\t}\n\n\t\t\t$template = new Template();\n\t\t\t$template->name = GO::t(\"Projects folder\", \"projects2\");\n\t\t\t$template->default_status_id = $noneStatus->id;\n\t\t\t$template->default_type_id = $defaultType->id;\n\t\t\t$template->icon=$folder->stripFileStoragePath().'/folder.png';\n\t\t\t$template->project_type=Template::PROJECT_TYPE_CONTAINER;\n\t\t\t$template->save();\n\t\t\t\n\t\t\t$template->acl->addGroup(GO::config()->group_everyone);\n\n\n\t\t\t$template = new Template();\n\t\t\t$template->name = GO::t(\"Standard project\", \"projects2\");\n\t\t\t$template->default_status_id = $defaultStatus->id;\n\t\t\t$template->default_type_id = $defaultType->id;\n\t\t\t$template->project_type=Template::PROJECT_TYPE_PROJECT;\n\t\t\t$template->fields = 'responsible_user_id,status_date,customer,budget_fees,contact,expenses';\n\t\t\t$template->icon=$folder->stripFileStoragePath().'/project.png';\n\t\t\t$template->save();\n\t\t\t\n\t\t\t$template->acl->addGroup(GO::config()->group_everyone);\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\tGO::setMaxExecutionTime(0);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$oldModelTypeId = \\GO\\Base\\Model\\ModelType::model()->findByModelName(\"GO\\Projects\\Model\\Project\");\n\t\t\t$modelTypeId = \\GO\\Base\\Model\\ModelType::model()->findByModelName(\"GO\\Projects2\\Model\\Project\");\n\t\t\t\n\t\t\t//copy old projects module tables\n\t\t\t$stmt = GO::getDbConnection()->query('SHOW TABLES');\n\t\t\twhile ($r = $stmt->fetch()) {\n\t\t\t\t$tableName = $r[0];\n\n\n\t\t\t\tif (substr($tableName, 0, 9) == 'go_links_' && !is_numeric(substr($tableName, 9, 1))) {\t\t\t\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$sql = \"ALTER TABLE `$tableName` ADD `ctime` INT NOT NULL DEFAULT '0';\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e){}\n\t\t\t\t\t\n\t\t\t\t\t$sql = \"DELETE FROM `$tableName` WHERE model_type_id=\".intval($modelTypeId);\n\t\t\t\t\tGO::debug($sql);\n\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t$sql = \"INSERT IGNORE INTO `$tableName` SELECT id,folder_id, model_id,'$modelTypeId', description, ctime FROM `$tableName` WHERE model_type_id=$oldModelTypeId\";\n\t\t\t\t\tGO::debug($sql);\n\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (strpos($tableName, 'pm_') !== false) {\n\t\t\t\t\t\n\t\t\t\t\t//some GLOBAL2000 tables we do not want to copy\n\t\t\t\t\tif(!in_array($tableName,array('pm_employees','pm_resources','pm_employment_agreements'))){\n\t\t\t\t\t\n\t\t\t\t\t\t$newTable = str_replace('pm_', \"pr2_\", $tableName);\n\n\t\t\t\t\t\t$sql = \"DROP TABLE IF EXISTS `$newTable`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t\t$sql = \"CREATE TABLE `$newTable` LIKE `$tableName`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\t\t\t$sql = \"INSERT INTO `$newTable` SELECT * FROM `$tableName`\";\n\t\t\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"update pr2_projects set name = replace(name, '/','-')\";\n\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t\n//\t\t\t$sql = \"update pr2_projects set files_folder_id=0\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$sql = \"select version from go_modules where id='projects'\";\t\t\t\n\t\t\t$stmt = GO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$record = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\tGO::modules()->projects2->version = $record['version'];\n\t\t\tGO::modules()->projects2->save();\t\t\t\n//\t\t\tGO::modules()->projects->acl->copyPermissions(GO::modules()->projects2->acl);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//start files\n//\t\t\t$sql = \"UPDATE pr2_projects SET files_folder_id=(SELECT files_folder_id FROM pm_projects WHERE pm_projects.id=pr2_projects.id);\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t$fsFolder = new GO\\Base\\Fs\\Folder(GO::config()->file_storage_path.'projects2');\n\t\t\tif($fsFolder->exists()){\n\t\t\t\t$fsFolder->rename('projects2-'.date('c'));\n\t\t\t}\n\n\t\t\t$folder = \\GO\\Files\\Model\\Folder::model()->findByPath('projects');\n\t\t\t$folder->name='projects2';\n\t\t\t$folder->acl_id=GO::modules()->projects2->acl_id;\n\t\t\t$folder->save();\n\n\n//\t\t\t$sql = \"UPDATE pm_projects SET files_folder_id=0;\";\n//\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t$sql = \"update `pr2_templates` set icon = replace(icon, 'projects/', 'projects2/');\";\n\t\t\tGO::getDbConnection()->query($sql);\t\t\t\n\t\t\t\n\t\t\t//end files\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t//upgrade database\n\t\t\tob_start();\n\t\t\t$mc = new \\GO\\Core\\Controller\\MaintenanceController();\n\t\t\t$mc->run(\"upgrade\", array(), false);\n\t\t\tob_end_clean();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//create new acl's\n\t\t\t\n//\t\t\t$types = \\GO\\Projects\\Model\\Type::model()->find();\t\t\t\n//\t\t\tforeach($types as $type){\t\t\t\t\n//\t\t\t\t$type2 = Model\\Type::model()->findByPk($type->id);\t\t\t\t\n//\t\t\t\t$type2->setNewAcl($type->user_id);\t\t\t\t\n//\t\t\t\t$type->acl->copyPermissions($type2->acl);\t\t\t\n//\t\t\t\t$type2->save();\n//\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$sql=\"ALTER TABLE `pr2_hours` CHANGE `income_id` `old_income_id` INT( 11 ) NULL DEFAULT NULL ;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t$sql=\"ALTER TABLE `pr2_hours` ADD `income_id` INT( 11 ) NULL AFTER `old_income_id` ;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t$sql=\"UPDATE `pr2_hours` SET old_income_id=-1*old_income_id;\";\n\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\n\t\t\t\n\t\t\tif(\\GO\\Base\\Db\\Utils::tableExists(\"pm_employment_agreements\")){\n\t\t\t\t\n\t\t\t\t//GLOBAL 2000 version\n\t\t\t\t\n\t\t\t\t$sql = \"replace into pr2_employees (user_id, external_fee, internal_fee) select employee_id, max(external_fee),max(internal_fee) from pm_employment_agreements group by employee_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\t\t$sql = \"replace into pr2_resources (user_id,project_id, external_fee, internal_fee) select user_id,project_id, external_fee, internal_fee from pm_resources\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\n//\t\t\tNo longer necessary because of $updates['201310041023'] in updates.inc.php :\t\n//\t\t\t\t//untested\n//\t\t\t\t$sql = \"ALTER TABLE `pr2_hours` CHANGE `external_value` `external_fee` DOUBLE NOT NULL DEFAULT '0'\";\n//\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$sql = \"insert ignore into pr2_employees (user_id, external_fee, internal_fee) select user_id, max(ext_fee_value), max(int_fee_value) from pm_hours group by user_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\t\t$sql = \"insert ignore into pr2_resources (user_id,project_id, external_fee, internal_fee) select user_id,project_id, max(ext_fee_value), max(int_fee_value) from pm_hours group by user_id, project_id\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$sql = \"update pr2_templates set project_type=1\";\n\t\t\tGO::getDbConnection()->query($sql);\n\n\n\t\t\tif (GO::modules()->customfields) {\n\t\t\t\t\n//\t\t\t\trequire(dirname(__FILE__).'/install/migrate/models.php');\n\t\t\t\t\n//\t\t\t\t\\GO\\Customfields\\CustomfieldsModule::replaceRecords(\"GO\\Projects\\Model\\Project\", \"GO\\Projects2\\Model\\Project\");\n\t\t\t\t\n//\t\t\t\t\\GO\\Customfields\\CustomfieldsModule::replaceRecords(\"GO\\Projects\\Model\\Hour\", \"GO\\Projects2\\Model\\TimeEntry\");\n\t\t\t\t\n\t\t\t\t//$sql = \"RENAME TABLE `cf_pm_projects` TO `cf_pr2_projects` \";\n\t\t\t\t//GO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t//$sql = \"RENAME TABLE `cf_pm_hours` TO `cf_pr2_hours` \";\n\t\t\t\t//GO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t$sql = \"update `cf_categories` set extends_model = 'GO\\\\\\\\Projects2\\\\\\\\Model\\\\\\\\Project' where extends_model = 'GO\\\\\\\\Projects\\\\\\\\Model\\\\\\\\Project';\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\t\t\t\t\n\t\t\t\t$sql = \"update `cf_categories` set extends_model = 'GO\\\\\\\\Projects2\\\\\\\\Model\\\\\\\\Hour' where extends_model = 'GO\\\\\\\\Projects\\\\\\\\Model\\\\\\\\Hour';\";\n\t\t\t\tGO::getDbConnection()->query($sql);\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tGO::getDbConnection()->query(\"UPDATE go_search_cache set model_type_id=$modelTypeId where model_type_id=$oldModelTypeId\");\n\t\t\t\n\t\t\n\t\t\t\n\n\t\t\t// Now, let's make sure that all the projects have a template.\n\t\t\t\n\t\t\t$folder = new Folder(GO::config()->file_storage_path.'projects2/template-icons');\n\t\t\t$folder->create();\t\t\t\n\t\t\t\n\t\t\tif(!$folder->child('folder.png')){\n\t\t\t\t$file = new File(GO::modules()->projects2->path . 'install/images/folder.png');\n\t\t\t\t$file->copy($folder);\n\t\t\t}\n\t\t\t\n\t\t\tif(!$folder->child('project.png')){\n\t\t\t\t$file = new File(GO::modules()->projects2->path . 'install/images/project.png');\n\t\t\t\t$file->copy($folder);\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (\\GO::modules()->files) {\n\t\n\t\t\t\t$fileFolder = \\GO\\Files\\Model\\Folder::model()->findByPath('projects2/template-icons',true);\n\t\t\t\tif(!$fileFolder->acl_id!=\\GO::modules()->projects2->acl_id){\n\t\t\t\t\t$oldIgnore = \\GO::$ignoreAclPermissions;\n\t\t\t\t\t\\GO::$ignoreAclPermissions=true;\n\t\t\t\t\t$fileFolder->acl_id=\\GO::modules()->projects2->acl_id;\n\t\t\t\t\t$fileFolder->save();\t\t\n\t\t\t\t\t\\GO::$ignoreAclPermissions=$oldIgnore;\n\t\t\t\t}\n\t\t\t\t//for icons added after install\n\t\t\t\t$fileFolder->syncFilesystem();\n\t\t\t}\n\t\t\t\n\t\t\t$normalTemplate = new Template();\n\t\t\t$normalTemplate->name = GO::t(\"Normal project\", \"projects2\");\n\t\t\t$normalTemplate->project_type=Template::PROJECT_TYPE_PROJECT;\n\t\t\t$normalTemplate->fields = 'responsible_user_id,status_date,customer,budget_fees,contact,expenses';\n\t\t\t$normalTemplate->icon=$folder->stripFileStoragePath().'/project.png';\n\t\t\t$normalTemplate->save();\n\t\t\t\n\t\t\tGO\\Base\\Db\\Columns::$forceLoad = true;\n\t\t\t\n\t\t\t$noTemplateProjectsStmt = Project::model()->find(\n\t\t\t\tFindParams::newInstance()\n\t\t\t\t\t->criteria(\n\t\t\t\t\t\tFindCriteria::newInstance()\n\t\t\t\t\t\t\t->addCondition('template_id',0)\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\tGO\\Base\\Db\\Columns::$forceLoad = false;\n\t\t\t\n\t\t\tforeach ($noTemplateProjectsStmt as $noTemplateProjectModel) {\n\t\t\t\t$noTemplateProjectModel->template_id = $normalTemplate->id;\n\t\t\t\t$noTemplateProjectModel->save();\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t// Upgrade closed weeks\n\t\t\tob_start();\n\t\t\t$pc = new \\GO\\Projects2\\Controller\\ProjectController();\n\t\t\t$pc->run(\"v1toV2Upgrade\", array(), false);\n\t\t\tob_end_clean();\n\t\t\t\n\t\t}\n\n\t\t\n\t}", "protected static function booted()\n {\n static::addGlobalScope(new NotArchivedScope);\n }", "public function install() {\r\n \r\n }", "protected static function boot()\n {\n parent::boot();\n static::addGlobalScope(new ProjectScope);\n }", "public function install()\n {\n }", "public function install()\n {\n }", "private function startup()\n\t{\n\t\t$this->registerSigHandlers();\n\t\t$this->pruneDeadWorkers();\n\t\tEvent::trigger('beforeFirstFork', $this);\n\t\t$this->registerWorker();\n\t}", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "protected function setUp(){\n $this->poneys = new Poneys;\n $this->poneys->setCount(8);\n }", "public function booted()\n {\n Spark::useStripe()->noCardUpFront()->trialDays(10000);\n\n Spark::freePlan()\n ->features([\n 'First', 'Second', 'Third'\n ]);\n\n // Spark::identifyTeamsByPath();\n }", "public function setup() {}", "protected static function boot()\n {\n parent::boot();\n\n //add the scope wen querying db for students\n static::addGlobalScope(new StudentScope);\n }" ]
[ "0.61221844", "0.59051174", "0.5761602", "0.57011706", "0.5698458", "0.56439424", "0.56439424", "0.557433", "0.5560698", "0.54299444", "0.5423752", "0.5405016", "0.5380625", "0.5370148", "0.5349332", "0.5335366", "0.5313453", "0.52780914", "0.5239638", "0.52233356", "0.51848537", "0.5182007", "0.5160657", "0.5150269", "0.5148992", "0.51483494", "0.5132326", "0.5132081", "0.5113667", "0.51058006", "0.5086428", "0.5085076", "0.50823945", "0.5063945", "0.505778", "0.5057763", "0.5057731", "0.505245", "0.5046867", "0.5045633", "0.5018907", "0.5008495", "0.5003036", "0.5003036", "0.5003036", "0.5003036", "0.50007814", "0.49958217", "0.49873728", "0.49799863", "0.496566", "0.49619788", "0.49617442", "0.4960382", "0.49578467", "0.49533138", "0.49523193", "0.494123", "0.4937633", "0.49193546", "0.4915853", "0.49142095", "0.49129844", "0.49100512", "0.49063385", "0.4905011", "0.49044314", "0.48942965", "0.4892541", "0.48867273", "0.4882935", "0.48793146", "0.48789462", "0.4873529", "0.48688003", "0.48680285", "0.48565513", "0.48531643", "0.48504072", "0.48497298", "0.48414996", "0.48406845", "0.4837947", "0.48366335", "0.48326945", "0.4830512", "0.4824484", "0.4823827", "0.4820561", "0.48189834", "0.48180056", "0.4815991", "0.48135287", "0.48112428", "0.48112428", "0.4808773", "0.48059058", "0.48030308", "0.48017523", "0.4799944", "0.47986558" ]
0.0
-1
Get the facade accessor.
protected static function getFacadeAccessor(): string { return 'autopresentermapper'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final static function getFacadeAccessor() {\n\n\t\t/**\n\t\t * Facade is very simple to use but it can provide a real troubles\n\t\t * if we want have a new instance of related object every time instead a singleton.\n\t\t */\n\t\tunset(static::$resolvedInstance['DelegapiClient']);\n\t\treturn 'DelegapiClient';\n\t}", "protected static function getFacadeAccessor()\n {\n if (static::isProxied()) {\n return new Builder(static::$app['db']->connection());\n } else {\n return parent::getFacadeAccessor();\n }\n }", "protected static function getFacadeAccessor(): string\n {\n return 'basset';\n }", "protected static function getFacadeAccessor()\n {\n return Decorator::class; // the IoC binding.\n }", "protected static function getFacadeAccessor()\n {\n throw new Exception('Facade does not implement getFacadeAccessor method.');\n }", "protected static function getFacadeAccessor(): string\n {\n return 'fitbit';\n }", "public function getAccessor()\n {\n return $this->accessor;\n }", "protected static function getFacadeAccessor()\n {\n throw new \\Exception('Facade does not implement getAliasAccessor method.');\n }", "protected static function getFacadeAccessor ( )\n {\n throw new RuntimeException ( 'Facade does not implement getFacadeAccessor method.' );\n }", "protected static function getFacadeAccessor() : string {\n return 'log-reader';\n }", "protected static function getFacadeAccessor()\n {\n throw new RuntimeException('Facade does not implement getFacadeAccessor method.');\n }", "protected static function getFacadeAccessor()\n {\n return 'mutator';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'eve-esi';\n }", "protected static function getFacadeAccessor()\n {\n return static::$app['mysticquent'];\n }", "protected static function getFacadeAccessor(): string\n {\n return 'Shakurov\\Coinbase\\Coinbase';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'swapi';\n }", "protected static function getFacadeAccessor() : string\n {\n return 'da_data_phone';\n }", "protected static function getFacadeAccessor() : string\n {\n return 'da_data_phone';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'cartavel';\n }", "protected static function getFacadeAccessor() {\n\n\t\treturn 'updown';\n\t}", "protected static function getFacadeAccessor(){\n\t\treturn 'auth';\n\t}", "protected static function getFacadeAccessor()\n {\n return 'Fastly';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'web3.multicall';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'opx_users';\n }", "protected static function getFacadeAccessor(): string\n {\n return Factory::class;\n }", "protected static function getFacadeAccessor(): string\n {\n return 'smsgateway';\n }", "protected static function getFacadeAccessor()\n\t{\n\t\tif (!static::$app) {\n\t\t\tstatic::$app = FlattenServiceProvider::make();\n\t\t}\n\n\t\treturn 'flatten';\n\t}", "protected static function getFacadeAccessor(): string\n {\n return 'ozonupdatestock';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'Collinped\\Twilio\\TwilioAccessToken';\n }", "protected static function getFacadeAccessor()\n {\n return GateContract::class;\n }", "protected static function getFacadeAccessor(): string\n {\n return 'request';\n }", "protected static function getFacadeAccessor() {\n\t\t\treturn CronManager::class;\n\t\t}", "protected static function getFacadeAccessor()\n\t{\n\t\treturn static::$container->get('facade-router');\n\t}", "protected static function getFacadeAccessor()\n {\n return 'Identity'; // the IoC binding.\n }", "public function getAccessor(): String;", "public function getAccessor(): String;", "protected static function getFacadeAccessor(): string\n {\n return NotifyFactory::class;\n }", "protected function getFacadeAccessor()\n {\n return 'travelperk';\n }", "protected static function getFacadeAccessor(): string\n {\n return 'admin_admins';\n }", "protected static function getFacadeAccessor() {\n return 'auth';\n }", "protected static function getFacadeAccessor() {\n\t\treturn 'proxify';\n\t}", "protected static function getFacadeAccessor()\n {\n return 'Antecedentes';\n }", "protected static function getFacadeAccessor()\n {\n return \\MonthlyCloud\\Sdk\\Builder::class;\n }", "protected static function getInstance()\n {\n\t\treturn static::getFacadeAccessor();\n }", "protected static function getFacadeAccessor()\n {\n return Client::class;\n }", "protected static function getFacadeAccessor()\n {\n return Client::class;\n }", "protected static function getFacadeAccessor()\n\t{\n\t\tif (!static::$app) {\n\t\t\tstatic::$app = AcetoneServiceProvider::make();\n\t\t}\n\n\t\treturn 'acetone.acetone';\n\t}", "protected static function getFacadeAccessor()\n {\n return 'twikey';\n }", "protected static function getFacadeAccessor()\n {\n return Lock::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'thaibaht';\n }", "protected static function getFacadeAccessor()\n {\n return Envcrypt::class;\n }", "protected static function getFacadeAccessor()\n {\n return Concret::class;\n }", "protected static function getFacadeAccessor()\n {\n return Factory::class;\n }", "protected static function getFacadeAccessor()\n {\n return Factory::class;\n }", "protected static function getFacadeAccessor()\r\n\t{\r\n\t\treturn 'MmicLdap';\r\n\t}", "protected static function getFacadeAccessor()\n {\n return LiqPayClientInterface::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'sekolah';\n }", "protected static function getFacadeAccessor()\n {\n return \\Irfa\\AppLicenseClient\\Func\\License::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'encrypter';\n }", "protected static function getFacadeAccessor()\n {\n return 'padez';\n }", "protected static function getFacadeAccessor()\n {\n return \"Liger\\Fetcher\";\n }", "protected static function getFacadeAccessor()\n {\n return PermissionsHelper::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'rekening';\n }", "protected static function getFacadeAccessor()\n {\n return 'leopardscod';\n }", "protected static function getFacadeAccessor()\n {\n return 'bex';\n }", "protected static function getFacadeAccessor() { return 'chikka'; }", "protected static function getFacadeAccessor()\n {\n return \\Maksa988\\LaravelAdmin\\LaravelAdmin::class;\n }", "protected static function getFacadeAccessor()\n {\n return CandyClient::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'proxy';\n }", "protected static function getFacadeAccessor()\n {\n return 'arxmin';\n }", "protected static function getFacadeAccessor()\n {\n return 'ml_client';\n }", "protected static function getFacadeAccessor() \n {\n return 'jarboe'; \n }", "protected static function getFacadeAccessor()\n {\n return \\Pnuggz\\LaravelRestrictedUrl\\ServiceRepository\\Services\\RestrictedUrlService::class;\n }", "protected static function getFacadeAccessor()\n {\n return IFXDatabase::class;\n }", "protected static function getFacadeAccessor(): string\n {\n return 'pdp.tld';\n }", "protected static function getFacadeAccessor()\n {\n return 'docit';\n }", "protected static function getFacadeAccessor()\n {\n return 'OADtmClient';\n }", "protected static function getFacadeAccessor()\n {\n return 'linkr';\n }", "protected static function getFacadeAccessor(): string {\n return JsonMarshallerObject::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'Swiss';\n }", "protected static function getFacadeAccessor()\n {\n return Base::class;\n }", "protected static function getFacadeAccessor()\n {\n return CircuitBreaker::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'bugherd';\n }", "protected static function getFacadeAccessor()\n {\n return 'crudwire';\n }", "protected static function getFacadeAccessor()\n {\n return 'grafite-auth';\n }", "protected static function getFacadeAccessor()\n\t{\n\t\treturn 'business';\n\t}", "public function retornaFacade ()\n {\n try {\n // Retorna o nome da classe facade\n return $this->_classeFacade;\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "protected static function getFacadeAccessor() {\n return 'cookie';\n }", "protected static function getFacadeAccessor() { return 'cache'; }", "protected static function getFacadeAccessor()\n\t{\n\t\treturn 'pragmarx.form';\n\t}", "protected static function getFacadeAccessor()\n {\n return 'TAuth'; // the IoC binding.\n }", "protected static function getFacadeAccessor()\n {\n return ':package_name';\n }", "protected static function getFacadeAccessor()\n\t{\n\t\treturn 'AuraIsHere\\LaravelMultiTenant\\TenantScope';\n\t}", "protected static function getFacadeAccessor(): string\n {\n return 'laravel-exception';\n }", "protected static function getFacadeAccessor()\n {\n return 'trigger-builder';\n }", "protected static function getFacadeAccessor()\n {\n return ResponseFactoryContract::class;\n }", "protected static function getFacadeAccessor()\n {\n return 'str';\n }", "protected static function getFacadeAccessor()\n {\n return AnnotationsReader::class;\n }", "protected static function getFacadeAccessor()\n {\n return DefaultAcsClient::class;\n }", "protected static function getFacadeAccessor()\n {\n return Alarm::class;\n }" ]
[ "0.81263566", "0.76811993", "0.7440739", "0.7411451", "0.7386718", "0.7384132", "0.7362343", "0.7343413", "0.7250475", "0.72091854", "0.71902984", "0.7158807", "0.7137446", "0.71369475", "0.7127083", "0.7039666", "0.70367116", "0.70367116", "0.7026316", "0.7004698", "0.69835985", "0.6983541", "0.6976935", "0.6955481", "0.69528824", "0.69188654", "0.68852955", "0.6867627", "0.6864177", "0.6857317", "0.6853106", "0.6851055", "0.68467045", "0.6797312", "0.67849106", "0.67849106", "0.67807573", "0.6764387", "0.6750759", "0.6713953", "0.6708631", "0.66936415", "0.6688553", "0.668137", "0.66538197", "0.66538197", "0.66294616", "0.66084415", "0.6551", "0.65408987", "0.65376824", "0.6531467", "0.6524886", "0.6524886", "0.651591", "0.6500054", "0.64933676", "0.64840764", "0.6482449", "0.6480034", "0.6469148", "0.6462252", "0.64569443", "0.645514", "0.64481014", "0.6440473", "0.6438163", "0.6431116", "0.64179826", "0.6404108", "0.6402071", "0.6401071", "0.6398117", "0.63924885", "0.6374481", "0.6364863", "0.6364263", "0.63469005", "0.6325658", "0.6325507", "0.6316299", "0.63143605", "0.631292", "0.63095844", "0.62956166", "0.6289994", "0.6282971", "0.62824833", "0.62764126", "0.6274914", "0.62721586", "0.62612736", "0.6246097", "0.62363714", "0.6230767", "0.6228857", "0.6223937", "0.6222341", "0.62138355", "0.6212515" ]
0.72246885
9
Get the facade class.
protected static function getFacadeClass(): string { return Facade::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFacadeClass()\n {\n return TravelPerk::class;\n }", "protected function getFacadeClass()\n {\n return PusherBeams::class;\n }", "public function retornaFacade ()\n {\n try {\n // Retorna o nome da classe facade\n return $this->_classeFacade;\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "protected static function getFacadeAccessor(): string\n {\n return Factory::class;\n }", "protected function getFacadeClass()\n {\n return Git::class;\n }", "protected function getFacadeClass()\n {\n return Httplug::class;\n }", "protected static function getFacadeAccessor(): string\n {\n return NotifyFactory::class;\n }", "public final static function getFacadeAccessor() {\n\n\t\t/**\n\t\t * Facade is very simple to use but it can provide a real troubles\n\t\t * if we want have a new instance of related object every time instead a singleton.\n\t\t */\n\t\tunset(static::$resolvedInstance['DelegapiClient']);\n\t\treturn 'DelegapiClient';\n\t}", "public static function get_class(){\n return self::class;}", "protected static function getFacadeAccessor(): string {\n return JsonMarshallerObject::class;\n }", "protected static function getFacadeAccessor()\n {\n return Base::class;\n }", "public function get_class()\n {\n return $this->class;\n }", "protected static function getFacadeAccessor()\n {\n return Concret::class;\n }", "protected static function getFacadeAccessor()\n {\n return Factory::class;\n }", "protected static function getFacadeAccessor()\n {\n return Factory::class;\n }", "public static function getFacadeClass()\n {\n return 'PHPMailChimp\\Core\\Modules\\Lists\\Lists';\n }", "public static function getClass()\n {\n $type = explode('\\\\', get_called_class());\n\n return $type[count($type) - 1];\n }", "protected static function getFacadeAccessor()\n {\n return ResponseFactoryContract::class;\n }", "protected static function getFacadeAccessor()\n {\n return GateContract::class;\n }", "public static function getClass()\n {\n return get_class(new static);\n }", "protected function derive_class() {\n\t\t$class = null;\n\t\t$callable_reference = $this->get_callable_reference();\n\n\t\t// Validate the potential class name.\n\t\tif ( is_string( $callable_reference ) && class_exists( $callable_reference ) ) { // Just the class name.\n\t\t\t$class = $callable_reference;\n\t\t} elseif ( is_array( $callable_reference ) && isset( $callable_reference[0] ) && class_exists( $callable_reference[0] ) ) { // A class and method.\n\t\t\t$class = $callable_reference[0];\n\t\t}\n\t\treturn $class;\n\t}", "public static function getClass() {\n return Singleton::$_class;\n }", "protected function getFacadeRoot()\n {\n return GitWrapperManager::class;\n }", "protected function getFacadeRoot()\n {\n return PusherBeamsManager::class;\n }", "protected static function getFacadeAccessor()\n {\n return \\MonthlyCloud\\Sdk\\Builder::class;\n }", "public function getReflectionClass()\n {\n if (!$this->reflClass) {\n $this->reflClass = new \\ReflectionClass($this->getClassName());\n }\n\n return $this->reflClass;\n }", "protected static function getFacadeAccessor()\n {\n return Decorator::class; // the IoC binding.\n }", "protected static function getFacadeAccessor()\n {\n return Client::class;\n }", "protected static function getFacadeAccessor()\n {\n return Client::class;\n }", "public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }", "final public static function getClass(){\n return get_called_class();\n }", "protected function getFacadeRoot()\n {\n return TravelPerkManager::class;\n }", "public static function getFacadeRoot()\n {\n return static::resolveFacadeInstance(static::getFacadeAccessor());\n }", "public static function getFacadeRoot()\n {\n return static::resolveFacadeInstance(static::getFacadeAccessor());\n }", "protected static function getFacadeAccessor()\n {\n return CircuitBreaker::class;\n }", "protected function getClass()\n {\n return __CLASS__;\n }", "public function get_class() {\n\t\tif ( ! $this->is_class_set ) {\n\t\t\t$this->set_class( $this->derive_class() );\n\t\t}\n\t\treturn $this->class;\n\t}", "public function getClass() {\n return $this->class;\n }", "protected static function getFacadeAccessor()\n {\n return \"Liger\\Fetcher\";\n }", "protected static function getFacadeAccessor()\n {\n return LiqPayClientInterface::class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n return $this->class;\n }", "protected static function getFacadeAccessor() {\n\t\t\treturn CronManager::class;\n\t\t}", "protected static function getFacadeAccessor()\n {\n return CandyClient::class;\n }", "public function getFacade() {\r\n if (self::$_facade === null) {\r\n $repository = $this->_repositoryFactory->getRepository();\r\n $call = new Monitor\\Call();\r\n $storage = new Monitor\\Storage($repository, $call, new Monitor\\Storage\\State());\r\n $storage->attach($repository);\r\n\r\n $ticker = $this->_getTicker($storage, $repository);\r\n $analyzator = new Monitor\\Analyzator($storage, $call);\r\n $statistic = new Monitor\\Statistic($storage, $call);\r\n $display = $this->_displayFactory->getDisplay();\r\n\r\n self::$_facade = new Monitor\\Facade($storage, $ticker, $analyzator, $statistic, $display);\r\n }\r\n\r\n return self::$_facade;\r\n }", "protected static function getFacadeAccessor()\n {\n return IFXDatabase::class;\n }", "public function getClass()\n {\n return $this->class;\n }", "public function getClass()\n {\n $cls_name = $this->getClassName();\n if (empty($this->class_reflection) && !empty($cls_name)) {\n $this->class_reflection = new \\ReflectionClass($cls_name);\n }\n return $this->class_reflection;\n }", "protected static function getSingletonClass()\n {\n return get_called_class();\n }", "protected static function getFacadeAccessor()\n {\n return 'Fastly';\n }", "public static function getFacadeRoot ( )\n {\n return static::resolveFacadeInstance ( static::getFacadeAccessor ( ) );\n }", "protected static function getFacadeAccessor(): string\n {\n return 'Shakurov\\Coinbase\\Coinbase';\n }", "protected static function getFacadeAccessor()\n {\n return Envcrypt::class;\n }", "protected static function getFacadeAccessor()\n {\n return \\AlexGeno\\PhoneVerificationLaravel\\PhoneVerification::class;\n }", "public function getReflectionClass()\n {\n return ReflectionPool::getInstance($this->className);\n }", "public function fetchClass()\n {\n return $this->class;\n }", "protected function derive_class_reflector() {\n\t\ttry {\n\t\t\t$class_reflector = $this->is_class_reference() ? new ReflectionClass( $this->get_class() ) : null;\n\t\t} catch ( ReflectionException $exception ) {\n\t\t\t$class_reflector = null;\n\t\t}\n\t\treturn $class_reflector;\n\t}", "public function getCls() {}", "public function getClass() {\r\n\t\treturn $this->class;\r\n\t}", "public function getClass()\n {\n return get_class($this);\n }", "protected static function getFacadeAccessor()\n {\n return Toast::class;\n }", "protected static function getFacadeAccessor()\n {\n return \\Pnuggz\\LaravelRestrictedUrl\\ServiceRepository\\Services\\RestrictedUrlService::class;\n }", "public function get_called_class() {\n\n\t\tif ( false !== static::$class_path ) {\n\t\t\treturn static::$class_path;\n\t\t}\n\n\t\t$class_path = get_called_class();\n\t\tstatic::$class_path = $class_path;\n\t\treturn $class_path;\n\n\t}", "public function getClass(): ReflectionClass;", "public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}", "public function getClass()\n\t{\n\t\treturn $this->_class;\n\t}", "public function getClass() {\n \treturn $this->_class;\n }", "protected static function getFacadeAccessor(): string\n {\n return 'fitbit';\n }", "protected function getFacadeRoot()\n {\n return HttplugManager::class;\n }", "public function get_class_reflector() {\n\t\tif ( ! $this->is_class_reflector_set ) {\n\t\t\t$this->set_class_reflector( $this->derive_class_reflector() );\n\t\t}\n\t\treturn $this->class_reflector;\n\t}", "protected static function getFacadeRoot(): string\n {\n return AutoPresenterMapper::class;\n }", "protected static function getFacadeAccessor()\n {\n return SmsClient::class;\n }", "public function getClass(): string\n {\n return $this->class;\n }", "protected static function getFacadeAccessor()\n {\n return PsrContainerInterface::class;\n }", "public function getClass(): ?string\r\n {\r\n return $this->class;\r\n }", "public function getReflectionClass()\n {\n return new \\ReflectionClass($this->getName());\n }", "public static function __getClass()\n {\n return __CLASS__;\n }", "protected static function getFacadeAccessor()\n {\n return Transform::class;\n }", "public function getReflectionClass();", "protected static function getInstance()\n {\n\t\treturn static::getFacadeAccessor();\n }", "protected static function getFacadeAccessor()\n {\n return ChannelManager::class;\n }", "protected static function getFacadeAccessor()\n\t{\n\t\tif (!static::$app) {\n\t\t\tstatic::$app = FlattenServiceProvider::make();\n\t\t}\n\n\t\treturn 'flatten';\n\t}", "protected static function getFacadeAccessor()\n {\n return \\Maksa988\\LaravelAdmin\\LaravelAdmin::class;\n }", "public static function getFacadeAccessor()\n {\n return \\App\\Helpers\\General\\EmailHelper::class;\n }", "public function getClass()\n {\n \treturn $this->class;\n }", "public function getClass()\n\t{\n\t\treturn $this->class;\n\t}", "public function getClass()\n\t{\n\t\treturn $this->class;\n\t}", "protected static function getFacadeAccessor(): string\n {\n return 'web3.multicall';\n }", "protected static function getFacadeAccessor()\n {\n return DefaultAcsClient::class;\n }" ]
[ "0.76561874", "0.76208615", "0.7610145", "0.74600923", "0.72164166", "0.7214597", "0.71838", "0.70774853", "0.7060769", "0.7029519", "0.7000669", "0.6887118", "0.68383116", "0.6817372", "0.6817372", "0.67685515", "0.6760814", "0.6748346", "0.6720909", "0.66768444", "0.66576254", "0.6652125", "0.66443473", "0.663175", "0.6612343", "0.6595773", "0.6594913", "0.65792096", "0.65792096", "0.6575993", "0.65706706", "0.65704054", "0.65337986", "0.65337986", "0.652848", "0.6520442", "0.65110505", "0.6501693", "0.6500944", "0.64995754", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.64995015", "0.6493819", "0.64840734", "0.64813465", "0.64760864", "0.64618", "0.64603925", "0.6452982", "0.64509845", "0.6436809", "0.64253885", "0.64099926", "0.63997144", "0.63813585", "0.6375904", "0.63715214", "0.6370223", "0.63654125", "0.636269", "0.6362063", "0.6357912", "0.63574046", "0.6351307", "0.6349263", "0.6349263", "0.6348606", "0.6344229", "0.6333768", "0.6329565", "0.63205874", "0.63084126", "0.63079876", "0.6296967", "0.62934834", "0.62877834", "0.627754", "0.6269339", "0.6267088", "0.6261512", "0.62610847", "0.62597245", "0.62526876", "0.62486607", "0.624531", "0.6223665", "0.6223665", "0.6216861", "0.621273" ]
0.8359229
0
Get the facade root.
protected static function getFacadeRoot(): string { return AutoPresenterMapper::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getFacadeRoot()\n {\n }", "public static function getFacadeRoot()\n {\n }", "public static function getFacadeRoot()\n {\n }", "public static function getFacadeRoot()\n {\n }", "public static function getFacadeRoot ( )\n {\n return static::resolveFacadeInstance ( static::getFacadeAccessor ( ) );\n }", "public static function getFacadeRoot()\n {\n return static::resolveFacadeInstance(static::getFacadeAccessor());\n }", "public static function getFacadeRoot()\n {\n return static::resolveFacadeInstance(static::getFacadeAccessor());\n }", "public function getRoot()\n {\n return $this->root;\n }", "public function getRoot()\n {\n return $this->root;\n }", "public function getRoot() {\n return $this->root;\n }", "public function getRoot()\n {\n return $this->_root;\n }", "public function getManialiveRoot()\n {\n return $this->path->getRoot();\n }", "public function getRoot()\n {\n return $this->drupalFinder()->getDrupalRoot();\n }", "function getRoot() {\n return $this->root;\n }", "public function root() {\n return $this->root;\n }", "public function getRoot() {}", "public function getRoot() {}", "public function getRoot() {}", "public static function getRoot(): string {\n if (! self::$_root) {\n self::$_root = dirname(dirname(dirname(__FILE__)));\n }\n \n return self::$_root;\n }", "public function getRoot() {\n return $this->__root;\n }", "public function getRoot()\n\t{\n\t\treturn $this->Root;\n\t}", "public function root()\r\n\t{\r\n\t\treturn $this->root;\r\n\t}", "protected function getFacadeRoot()\n {\n return PusherBeamsManager::class;\n }", "function getRoot() { return($this->_root); }", "protected function getFacadeRoot()\n {\n return TravelPerkManager::class;\n }", "public function getRoot(): string;", "public function getRoot(): string\n {\n return (string)$this->env['SCRIPT_NAME'];\n }", "private function root() { return $this->toplevel(\"root\"); }", "public function getRootPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_ROOT);\r\n\t}", "public function getRoot()\n {\n return SITE_ROOT;\n }", "public function requestRoot()\n {\n $url = $this->request->root();\n\n return $this->make($url);\n }", "public function root(): string\n {\n return $this->instances->demo()->config()->root() . '/public/' . $this->name;\n }", "function get_root() {\n\t\treturn $this->stack[0];\n\t}", "public function getRootPath()\n {\n return $this->root_path;\n }", "public function getRootDir()\n {\n return $this->rootDir;\n }", "public function getRoot(): self;", "public function rootDirectory() {\r\n return $this->directoryRoot;\r\n }", "public function root(): string\n {\n return rtrim($this->getSchemeAndHttpHost() . $this->getBaseUrl(), '/');\n }", "public function getRootPath()\r\n\t{\r\n\t\treturn $this->rootPath;\r\n\t}", "public function getRootPath()\n {\n return $this->rootPath;\n }", "public function rootDir(): string\n {\n return $this->root;\n }", "protected function getFacadeRoot()\n {\n return GitWrapperManager::class;\n }", "public function getRoot();", "private function _getRoot()\n {\n if ($this->_parent instanceOf Horde_Pear_Package_Xml_Directory) {\n return $this->_parent->_getRoot();\n } else {\n return $this->_parent;\n }\n }", "public function root() {}", "protected function getFacadeRoot()\n {\n return HttplugManager::class;\n }", "private function getRoot(): string\n {\n $bootstrapManager = Drush::bootstrapManager();\n $root = $bootstrapManager->getRoot();\n if (!$root) {\n throw new Exception(dt('Path to Drupal docroot is empty.'));\n }\n\n return $root;\n }", "public function getRoot()\n {\n return $this->active->geContext()->getCurrentSiteNode();\n }", "public function getRootPath();", "public function getRootPath();", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "public function getRootPath(): string\n {\n return $this->rootPath;\n }", "public function get_base_root()\r\n {\r\n return realpath(ROOT_DIR_NAME);\r\n }", "public static function refresh()\n {\n static::clearResolvedInstance(static::getFacadeAccessor());\n\n return static::getFacadeRoot();\n }", "public function getRootDir();", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "public function getRootDir()\n\t{\n\t\treturn $this->_rootDir;\n\t}", "protected function getRootDir()\n {\n return $this->appConfig->getRootDir();\n }", "public function getRootDir()\n {\n return __DIR__;\n }", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "public function getRoot()\n {\n return $this->parent ? $this->parent->getRoot() : $this;\n }", "public function getBaseRootUri()\n {\n return $this->paths->getBaseRootUri();\n }", "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server != null)\r\n\t\t\t\treturn $documentRoot = $server->getDocumentRoot();\r\n\t\t}\r\n\r\n\t\treturn rtrim($_SERVER[\"DOCUMENT_ROOT\"], \"\\\\/\");\r\n\t}", "public function getApiRoot()\n {\n return $this->apiRoot;\n }", "public function getRootFolder() : string;", "public function getRootDirectory();", "public function get_root_path()\n\t{\n\t\treturn $this->ext_root_path;\n\t}", "public function getRoot()\n {\n $this->iterator->rewind();\n return $this->iterator->current();\n }", "public static function getApplicationRoot(){\r\n $path = __DIR__;\r\n return $path;\r\n }", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "protected function getViewRoot() {\r\n\t\treturn $this->getParent()->getViewRoot();\r\n\t}", "public function getRoot()\n {\n return ($this->parent !== null) ? $this->parent->getRoot() : $this;\n }", "public function getFolderAppRoot() : string\n {\n return $this->folderAppRoot;\n }", "public function getConfiguredServerRoot()\n {\n return $this->server_root;\n }", "protected function getRootUrl()\n {\n return $this->appConfig->getRootUrl();\n }", "public function getRootModule();", "public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}", "abstract public function getRoot() ;", "abstract public function getRoot() ;", "public function rootNamespace()\n {\n return $this->laravel->getNamespace();\n }", "public function getRootDirectory()\n {\n return __DIR__.'/../..';\n }", "public static function getFacadeApplication()\n {\n return static::$app;\n }", "public static function getFacadeApplication ( )\n {\n return static::$application;\n }", "public function getServiceRootUri()\n {\n return $this->serviceRootUri;\n }", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "protected static function getDocumentRoot() {\n\t\treturn BootstrapConfig::getParam(\"document_root\", $_SERVER['DOCUMENT_ROOT']);\n\t}", "public function getCurrentRoot()\n {\n if (null !== $this->getCurrentPage()) {\n return $this->getCurrentPage()->getRoot();\n } elseif (null === $this->getCurrentSite()) {\n return;\n } else {\n return $this->application->getEntityManager()\n ->getRepository('BackBee\\CoreDomain\\NestedNode\\Page')\n ->getRoot($this->getCurrentSite());\n }\n }", "public static function root()\n\t{\n\t\t$route = new \\CCRoute;\n\t\t$route->uri = '#root';\n\t\treturn \\CCRequest::create( reset( \\Earth\\Pages\\Router::resolve( array( $route ) ) ) )\n\t\t\t->perform()\n\t\t\t->response();\n\t}", "public function getRootPath()\n {\n if(null === $this->_rootPath) {\n $url = parse_url(str_replace('/index.php/', '/', $this->storeManager->getStore()->getUrl($this->getRouteName(), ['_type' => \\Magento\\Framework\\UrlInterface::URL_TYPE_LINK])));\n $this->_rootPath = isset($url['path']) ? $url['path'] : '';\n }\n\n return $this->_rootPath;\n }", "public function getBaseRootDir()\n {\n return $this->paths->getBaseRootDir();\n }", "public function get_root_location()\n {\n return $this->m_mptt->get_by_node_id(C__OBJ__ROOT_LOCATION);\n }", "public static function rootDir(): string\n {\n if (self::$appRootDir === null) {\n throw new GacelaNotBootstrappedException();\n }\n return self::$appRootDir;\n }", "public function getRootAndPath()\n {\n return $this->getArchive()->getOrDefault('root_and_path', null);\n }", "protected function getRootConstant()\n {\n return defined('JHFRAME_ROOTDIR') ? JHFRAME_ROOTDIR : null;\n }", "function getRoot ()\n\t{\n\t\treturn $this->doc->document_element();\n\t}", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public function getRootPath()\n {\n return $this->getRepositoryRoot();\n }", "static function base()\n {\n return trim(App::router()->getBase(), '/');\n }", "public static function getRootNamespace()\n {\n $config = Config::getInstance();\n\n if ($config->has(['namespaces', 'root'])) {\n return $config->namespaces->root;\n }\n\n return 'App';\n }", "public function getViewRootDir()\n {\n $module = $this->BModuleRegistry->currentModule();\n\n return $module ? $module->view_root_dir : $this->_viewRootDir;\n }" ]
[ "0.87597144", "0.87597144", "0.87597144", "0.87597144", "0.87142324", "0.86972713", "0.86972713", "0.75246793", "0.75246793", "0.7509527", "0.7416818", "0.7403025", "0.7348721", "0.7324908", "0.7321274", "0.7310487", "0.7310487", "0.7310487", "0.7305973", "0.72783136", "0.7273796", "0.72653764", "0.7156685", "0.71119744", "0.7106", "0.7087021", "0.70219254", "0.70183325", "0.70141256", "0.69712466", "0.6970752", "0.6962207", "0.6910349", "0.6888333", "0.6864831", "0.6858909", "0.68558115", "0.6849252", "0.6848004", "0.6844298", "0.6841384", "0.6834975", "0.68277967", "0.6817568", "0.67589504", "0.6754592", "0.67491657", "0.67470497", "0.67360944", "0.67360944", "0.6721593", "0.6719299", "0.6697369", "0.66972613", "0.66800976", "0.6660702", "0.6651032", "0.6635372", "0.66334707", "0.66300404", "0.66225785", "0.6600625", "0.65969706", "0.6574577", "0.65461665", "0.65332055", "0.651625", "0.65130824", "0.64835066", "0.64629894", "0.64596003", "0.64562136", "0.6431024", "0.6421893", "0.64025027", "0.6393466", "0.6379563", "0.6365796", "0.6365796", "0.6363359", "0.63628453", "0.63558084", "0.63498205", "0.6346081", "0.63444346", "0.63283116", "0.6326381", "0.6322201", "0.6306514", "0.6302723", "0.6295903", "0.6284714", "0.6284673", "0.6275499", "0.627234", "0.6247121", "0.6246902", "0.6208295", "0.6174238", "0.6173696" ]
0.7014507
28
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected function setUp() { $this->object = new Pane; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "protected function setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }", "protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "public function setUp(): void\n {\n $this->fixture = new Finder();\n }", "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() {}" ]
[ "0.7593096", "0.71712965", "0.6927249", "0.6909755", "0.689123", "0.688266", "0.68152905", "0.6802125", "0.6752058", "0.6751711", "0.67455655", "0.6732383", "0.67130816", "0.67064613", "0.670096", "0.66827595", "0.66827595", "0.66827595", "0.66827595", "0.66827595", "0.6678057", "0.66770685", "0.6671415", "0.6669632", "0.6646192", "0.66450256", "0.6644453", "0.66359377", "0.66174775", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.6617025", "0.66166914", "0.66166914", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467", "0.6616467" ]
0.0
-1
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "public function teardown()\n {\n }", "public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n self::$driver->close();\n }", "public function tearDown()\n\t{\n\t\tm::close();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown(): void\n {\n $this->closeDatabase();\n }", "protected function tearDown() {\n\t\tm::close();\n\t}", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function doTearDown(): void\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "public function teardown()\n {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}", "protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "public function tearDown()\n {\n $this->stop();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }", "public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }", "protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }", "protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "public function tearDown()\n {\n Resistance::reset();\n }", "public function tearDown()\n\t{\n\t\tMockery::close();\n\t}", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}" ]
[ "0.73065555", "0.72364944", "0.7221215", "0.71869916", "0.71860623", "0.7148144", "0.71395123", "0.7134097", "0.7119696", "0.71024513", "0.70808", "0.707869", "0.7076699", "0.7052117", "0.7048074", "0.7032501", "0.7021807", "0.7014196", "0.70003164", "0.69998145", "0.69991523", "0.6991463", "0.69900304", "0.69796723", "0.6957956", "0.6956488", "0.69546384", "0.69459355", "0.693833", "0.6933643", "0.69274575", "0.6925806", "0.6921821", "0.6917867", "0.6909697", "0.6909479", "0.69057393", "0.68997", "0.6891313", "0.68892854", "0.68892854", "0.68892854", "0.6888574", "0.68883413", "0.6882208", "0.6862082", "0.68607086", "0.6857888", "0.6857888", "0.6857888", "0.6857888", "0.6857888", "0.6853662", "0.6851754", "0.6851754", "0.6851754", "0.68515146", "0.6850463", "0.68438303", "0.68392867", "0.68373144", "0.68329114", "0.6829255", "0.6828825", "0.681066", "0.6810343", "0.68071187", "0.68064725", "0.6806295", "0.680204", "0.6799901", "0.6792165", "0.6790997", "0.6787925", "0.67790335", "0.6773763", "0.6769069", "0.6768043", "0.6766885", "0.67668056", "0.6760156", "0.6760156", "0.6760156", "0.6760156", "0.6760156", "0.6760156", "0.6759574", "0.6758435", "0.67573637", "0.67546093", "0.67534655", "0.6752816", "0.6752816", "0.6752816", "0.6752816", "0.6752816", "0.6752816", "0.6750446", "0.674878", "0.67480356", "0.6747535" ]
0.0
-1
Declares the validation rules. The rules state that username and password are required, and password needs to be authenticated.
public function rules() { //echo $this->scenario; $rules[] = array('last_name,first_name,company_id,email,companyrole_id', 'required', 'on'=>'create'); $rules[] = array('id,companyrole_id', 'required', 'on'=>'update'); $rules[] = array('personalphones', 'checkpersonalPhones', 'on'=>'crate'); $rules[] = array('email', 'uniqueemail','on'=>'create'); $rules[] = array('companyuser_id,company_id,position,tagstitles,tagsids,personalphones', 'safe'); return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray('rememberMe', 'boolean'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray('rememberMe', 'boolean'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'username' => 'required',\n 'password' => 'required',\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, email', 'required'),\n array('username, email', 'length', 'max'=>32),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\t//array('username, password', 'required'),\n\t\t\t// password needs to be authenticated\n\t\t\tarray('textEn', 'validateText'),\n\t\t\tarray('verifyCode', 'captcha', 'allowEmpty' => false),\n\t\t);\n\t}", "public function rules() {\n return array(\n // email and password are required\n array('email', 'required'),\n array('email', 'email'),\n array('email', 'authenticate'),\n );\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "public function rules()\r\n {\r\n return [\r\n //\r\n 'username'=>'required',\r\n 'password'=>'required'\r\n ];\r\n \r\n }", "public function rules() {\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray(\n\t\t\t\t'username, password',\n\t\t\t\t'required'\n\t\t\t),\n\t\t\t//array('username, password, loginType', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\tarray(\n\t\t\t\t'rememberMe',\n\t\t\t\t'boolean'\n\t\t\t),\n\t\t\t// password needs to be authenticated\n\t\t\tarray(\n\t\t\t\t'password',\n\t\t\t\t'authenticate'\n\t\t\t),\n\n\t\t\tarray('loginType', 'safe')\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('firstname, lastname, nick, email, password, password2, lang', 'required'),\n\t\t\t// rememberMe needs to be a boolean\n\t\t\t//array('rememberMe', 'boolean'),\n\t\t\t//array('email', 'email'),\n\t\t\t// password needs to be authenticated\n\t\t\t//array('password2', 'compare'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// email and password are required\n\t\t\t['email, password', 'required'],\n\t\t\t// rememberMe needs to be a boolean\n\t\t\t['rememberMe', 'boolean'],\n\t\t\t// password needs to be authenticated\n\t\t\t['password', 'authenticate'],\n\t\t\t['email', 'checkRole'],\n\t\t);\n\t}", "public function rules()\n {\n $rules['txt_username'] = 'required';\n $rules['txt_password'] = 'required|min:6|max:15';\n\n return $rules;\n }", "public function rules()\n\t{\n\t\treturn [\n 'first_name' => 'required',\n 'username' => 'required|unique:users,username|max:100',\n 'email' => 'required|unique:users,email|email|max:100',\n 'password' => 'required|min:8|same:verifiedpassword',\n 'verifiedpassword'=> 'required'\n\t\t];\n\t}", "public function rules()\n {\n $validations = [\n 'username' => 'required|string',\n 'password' => 'required|string',\n ];\n\n return $validations;\n }", "public function rules()\n {\n $this->setModel(User::class);\n $rules = parent::rules();\n $is_two_factor_auth_enabled = \\TwoFactorAuth::isActive();\n\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191',\n 'last_name' => 'required|max:191',\n 'roles' => 'required',\n 'picture' => 'mimes:jpg,jpeg,png|max:' . maxUploadFileSize(),\n ]\n );\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email',\n 'password' => 'required|confirmed|max:191|min:6'\n ]\n );\n }\n\n if ($this->isUpdate()) {\n $user = $this->route('user');\n\n $rules = array_merge($rules, [\n 'email' => 'required|email|max:191|unique:users,email,' . $user->id,\n 'password' => 'nullable|confirmed|max:191|min:6'\n ]\n );\n if ($is_two_factor_auth_enabled) {\n $rules = array_merge($rules, TwoFactorAuth::registrationValidation($this->all()));\n }\n }\n return $rules;\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('email', 'required'),\n array('email', 'email')\n );\n }", "public function rules() {\n return [\n 'email' => 'required|email',\n 'password' => 'required'\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password, passwordConfirm, email, acceptRules', 'required'),\n\t\t\tarray('password, passwordConfirm', 'length', 'min' => self::PASSWORD_MIN_LENGTH),\n\t\t\tarray('password, passwordConfirm', 'match', 'pattern' => '/[а-яё]/ui', 'not' => true),\n\t\t\tarray('passwordConfirm', 'compare', 'compareAttribute' => 'password'),\n\t\t\tarray('email', 'email'),\n\t\t\tarray('username', 'unique', 'className' => 'User'),\n\t\t\tarray('email', 'unique', 'className' => 'User'),\n\t\t\tarray('acceptRules', 'boolean')\n\t\t);\n\t}", "public function rules() {\n\t\treturn [\n\t\t\t'username' => 'required|between:6,32',\n\t\t\t'email' => 'email|required|between:6,32',\n\t\t\t'password' => 'required|between:6,32',\n\t\t\t'confirm_pass' => 'required|same:password'\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n\n 'email' => 'required|email',\n 'password' => 'required'\n\n ];\n }", "public function rules()\n {\n return [\n 'id' => 'required',\n 'password' => 'required',\n\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('username, password, password2, name, email', 'required',\n\t\t\t\t'message'=>'Поле \"{attribute}\" должно быть заполнено.'),\n\t\t\tarray('username', 'checkUser'),\n\t\t\tarray('password', 'checkPassword'),\n\t\t\tarray('email', 'email'),\n\t\t\tarray('email', 'checkEmail'),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'username' => ['required', 'alpha_num', 'min:3', 'max:30', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'email' => ['required', 'email', Rule::unique('users')->ignore(optional($this->user)->id)],\n 'password' => ['required', 'min:5', 'max:20', 'confirmed'],\n ];\n\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $rules['password'] = ['sometimes', 'min:5', 'max:20', 'confirmed'];\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'password' => 'required', //requerimos el password\n 'email' => 'required|email', //requerimos el email y que sea correcto\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n array('cargo_elaborado_por, aprobado_por, cargo_aprobado_por, rector', 'required'),\n \n\t\t\t// username and password are required\n\t\t\t//array('password, password_new, password_new_repeat', 'required'),\n\n //array('password_new', 'compare'),\n\t\t\t// password needs to be authenticated\n\t\t\t//array('password', 'authenticate'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('email, login, password, confirm_password, phone_number', 'required'),\n\n\t\t\tarray('email', 'email'),\n\n\t\t\t// password needs to be authenticated\n\t\t\tarray('password', 'authenticate'),\n\n\t\t\tarray('email, login', 'unique', 'className' => 'UsuarioIps'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n\t 'username' => 'required|max:16|min:6',\n\t 'password' => 'required|min:6'\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required',\n 'min:3',\n 'max:255',\n 'regex:/^(\\w)+$/i',\n ],\n 'password' => ['required',\n 'min:3',\n 'max:35',\n ],\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('oldpass, newpass, newpass2', 'required'),\n\t\t\tarray('oldpass','sameoldpass'),\n\t\t\tarray('newpass2','samenewpass'),\n\t\t);\n\t}", "public function rules() {\n return array(\n array('username', 'required', 'message' => 'Вы не ввели эл. почту'),\n array('username', 'emailValidate'),\n array('username', 'email'),\n array('password', 'required', 'message' => 'Вы не ввели пароль'),\n array('password', 'authenticate'),\n );\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('type, fromDate, thruDate', 'required'),\n\t\t);\n\t}", "public function rules()\n\t{\n\t\treturn [\n 'email' => 'required|email|max:255|exists:users,email',\n 'password' => 'required|min:6|max:45',\n\t\t];\n\t}", "public function rules()\n {\n return [\n 'username' => 'required|string|between:6,20',\n 'password' => 'required|between:6,16',\n ];\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t//array('email,username', 'required'),\n\t\t\tarray('email', 'checkEmail'),\n array('username', 'check_username'),\n\t\t\tarray('username', 'checkEmptyValue'),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function validation()\n {\n $data = [\n 'username' => null,\n 'password' => 'password',\n ];\n $rules = new Rules( $data );\n\n /* Add source */\n $rules->addSource( 'phone', '081234' );\n $rules->addSource( 'address', 'Lorem ipsum dolor sit.' );\n\n /* Add validation rule */\n $rules->addRule(\n 'username',\n 'Username',\n 'minLength[2]',\n [ 'minLength' => ':attribute Should Be More Than :params', 'required' => ':attribute Required' ]\n );\n $rules->addRule( 'password', 'Password', 'maxLength[2]', ':attribute should be less than :params' );\n\n /* Add multiple rules */\n $rules->addRules(\n [\n [\n 'field' => 'phone',\n 'label' => 'Phone',\n 'rules' => 'required',\n 'messages' => 'Phone Required',\n ],\n [\n 'field' => 'address',\n 'label' => 'Address',\n 'rules' => 'required',\n 'messages' => 'Address Required',\n ],\n ]\n );\n\n /* Validate rules */\n $validate = $rules->validate();\n\n print_out(\n [\n 'validate' => ( $validate == true ? 1 : 0 ),\n 'errors' => $rules->getErrors(),\n ]\n );\n }", "public function rules()\n {\n return [\n 'username' => ['required', 'string', 'min:6', 'max:255', 'unique:users'],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n 'roles' => ['required'],\n 'first_name' => ['required', 'string', 'max:255'],\n 'last_name' => ['required', 'string', 'max:255'],\n 'address' => ['required', 'string', 'max:255'],\n 'contact_number' => ['required', 'regex:/^(01)[0-46-9]*[0-9]{7,8}$/'],\n 'password' => $this->passwordRules()\n ];\n }", "public function rules()\n {\n return array(\n // username and password are required\n array('email', 'required'),\n // rememberMe needs to be a boolean\n array('email','email'),\n );\n }", "public function rules()\n {\n $id = Auth::user()->id;\n\n $rules = [\n 'username' => 'required|string',\n 'phone' => 'required|digits:9|starts_with:5|unique:users,phone,'.$id,\n 'email' => 'required|email|unique:users,email,'.$id,\n ];\n\n if($this->password){\n $rules['password'] = 'required|string|min:8';\n }\n\n return $rules;\n\n }", "public function rules()\n\t{\n\t\tif(!isset($this->scenario))\n\t\t\t$this->scenario = 'login';\n\n\t\t$rules = array(\n\t\t\tarray('username', 'required', 'on' => 'login', 'message' => Yii::t('site', 'Login (email) is required')),\n array('username', 'CEmailValidator', 'message' => Yii::t('site', 'Wrong email')),\n\t\t\tarray('password', 'required', 'on' => 'login', 'message' => Yii::t('site', 'Password is required')),\n array('username' , 'loginByUsername', 'on' => 'login', 'message' => Yii::t('site', 'Имя пользователя или неверный пароль')),\n\t\t\tarray('username', 'required', 'on' => 'openid'),\n\t\t\tarray('rememberMe', 'boolean'),\n array('username', 'required', 'on' => 'login_admin', 'message' => Yii::t('site', 'Login (email) is required')),\n array('username', 'CEmailValidator', 'message' => Yii::t('site', 'Wrong email')),\n array('password', 'required', 'on' => 'login_admin', 'message' => Yii::t('site', 'Password is required')),\n array('username' , 'loginByUsernameAdmin', 'on' => 'login_admin', 'message' => Yii::t('site', 'Имя пользователя или неверный пароль')),\n\t\t);\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n return [\n 'username' => 'required',\n 'email' => 'required|email',\n 'type' => 'required',\n 'cpassword' => 'required',\n 'npassword' => 'required',\n 'confirm_password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'username' => 'unique:users',\n 'company' => 'required',\n 'email' => 'required|email|unique:users',\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|min:8|same:password'\n ];\n }", "public function rules()\r\n {\r\n return [\r\n 'email' => 'required|email',\r\n 'password' => 'required|min:6'\r\n ];\r\n }", "public function rules()\n {\n $routeName = $this->route()->getName();\n switch ($routeName) {\n case \"api.user.store\":\n $rule = [\n 'username' => 'required|between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|unique:users,name',\n 'password' => 'required|string|min:5'\n ];\n break;\n case \"api.user.update\":\n $userId = \\Auth::guard('api')->id();\n $rule = [\n 'username' => 'between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|unique:users,name,' .$userId,\n 'avatar_image_id' => 'exists:images,id,type,avatar,user_id,'.$userId,\n ];\n break;\n case \"api.user.delete\":\n $rule = [\n 'username' => 'required'\n ];\n break;\n case \"api.user.password\":\n $rule = [\n 'username' => 'required|between:3,25|regex:/^[A-Za-z0-9\\-\\_\\x7f-\\xff]+$/|exists:users,name',\n// 'old_password' => 'required|string|min:5',\n 'password' => 'required|string|min:5',\n ];\n break;\n default:\n $rule = [];\n };\n\n return $rule;\n }", "protected function rules()\n\t{\n\t\treturn [\n\t\t\t'resetToken' => 'required',\n\t\t\t'email' => 'required|email',\n\t\t\t'password' => 'required|min:10',\n\t\t];\n\t}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\t// username and password are required\n\t\t\tarray('email, password, knight_name', 'required'),\n\t\t\t// check email format\n\t\t\tarray('email', 'email'),\n\t\t\t// check max length\n\t\t\tarray('email', 'length', 'max'=>255),\n\t\t\tarray('password', 'length', 'max'=>60),\n\t\t\t//Check min length knight name\n\t\t\tarray( 'knight_name', 'length', 'min'=>4)\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required|max:50',\n 'email' => 'required|string|email|max:255|unique:users',\n 'username' => 'required|unique:users,username|max:50|alpha',\n 'password' => 'required|min:3|max:50',\n 'cpassword' => 'required|same:password',\n ];\n }", "public function rules(): array\n {\n return [\n 'email' => 'email|required',\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n $passwordRules = 'min:8|max:100';\n $rules = [\n 'name' => 'bail|required|max:50|min:2',\n 'email' => '',\n 'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n 'active'=>'integer',\n 'password'=>''\n ];\n\n if ($this->method() == 'POST') {\n $rules['password'] = $passwordRules . \"|required|confirmed\";\n $rules['email'] = \"required|email|min:2|max:100|unique:users\";\n\n }\n\n if ($this->method() == 'PUT') {\n $rules['email'] = Rule::unique('users')->ignore($this->id);\n }\n\n return $rules;\n }", "public static function rules()\n {\n return [\n 'password' => 'required|confirmed|min:6|max:50',\n 'user_name' => 'required|string',\n 'email' => 'required|email',\n ];\n }", "function __construct ($params=array())\n {\n /**\n * Define Rules\n * Key is rule identifier\n * Value is rule parameter\n * false is disabled (default)\n * Type is type of parameter data\n * permitted values are 'integer' or 'boolean'\n * Test is php code condition returning true if rule is passed\n * password string is $p\n * rule value is $v\n * Error is rule string definition\n * use #VALUE# to insert value\n */\n $this->rules['min_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return strlen($p)>=$v;',\n 'error' => 'Password must be more than #VALUE# characters long');\n\n $this->rules['max_length'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return (strlen($p)<=$v);',\n 'error' => 'Password must be less than #VALUE# characters long');\n\n $this->rules['min_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# lowercase characters');\n\n $this->rules['max_lowercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[a-z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# lowercase characters');\n\n $this->rules['min_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# uppercase characters');\n\n $this->rules['max_uppercase_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[A-Z]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# uppercase characters');\n\n $this->rules['disallow_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)==0;',\n 'error' => 'Password may not contain numbers');\n\n $this->rules['disallow_numeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[0-9]/\",$p,$x)==0;',\n 'error' => 'First character cannot be numeric');\n\n $this->rules['disallow_numeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[0-9]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be numeric');\n\n $this->rules['min_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# numbers');\n\n $this->rules['max_numeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[0-9]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# numbers');\n\n $this->rules['disallow_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)==0;',\n 'error' => 'Password may not contain non-alphanumeric characters');\n\n $this->rules['disallow_nonalphanumeric_first'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/^[\\W]/\",$p,$x)==0;',\n 'error' => 'First character cannot be non-alphanumeric');\n\n $this->rules['disallow_nonalphanumeric_last'] = array(\n 'value' => false,\n 'type' => 'boolean',\n 'test' => 'return preg_match_all(\"/[\\W]$/\",$p,$x)==0;',\n 'error' => 'Last character cannot be non-alphanumeric');\n\n $this->rules['min_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)>=$v;',\n 'error' => 'Password must contain at least #VALUE# non-aplhanumeric characters');\n\n $this->rules['max_nonalphanumeric_chars'] = array(\n 'value' => false,\n 'type' => 'integer',\n 'test' => 'return preg_match_all(\"/[\\W]/\",$p,$x)<=$v;',\n 'error' => 'Password must contain no more than #VALUE# non-alphanumeric characters');\n\n // Apply params from constructor array\n foreach( $params as $k=>$v ) { $this->$k = $v; }\n\n // Errors defaults empty\n $this->errors = array();\n\n return 1;\n }", "public function rules(): array\n {\n return [\n 'email' => 'required|email',\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'firstname' => 'required',\n 'lastname' => 'required',\n 'username' => 'required|unique:users|string',\n 'email' => 'required|email|unique:users',\n 'roles' => 'required',\n 'photo_id' => 'required|max:10000',\n 'password' => 'required|min:8',\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|filled|alpha_num|max:30',\n 'password' => 'required|filled|between:6,20|',\n 'telephone' => 'string|max:11',\n 'jobnumber' => 'string|max:6',\n ];\n }", "public function rules()\n {\n return [\n 'fullname' => 'required|between:6,64',\n 'username' => 'required|between:6,64',\n 'email' => 'required|email|between:6,64',\n 'password' => 'required|between:6,32',\n 'repassword' => 'required|same:password|between:6,32',\n ];\n }", "public function rules()\n {\n /** @var \\App\\User */\n $user = $this->route('user');\n\n return [\n 'first_name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'username' => 'required|string|max:255|unique:users,username,' . $user->id,\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n 'password' => 'required|string|min:6|confirmed',\n ];\n }", "function validation_rules()\n\t{\n\t\t// validation rules for create\n\t\t$this->create_validation_rules = array(\n\t\t\tarray(\n\t \t'field' => 'product_id',\n\t \t'rules' => 'required'\n\t ),\n\t array(\n\t \t'field' => 'user_id',\n\t \t'rules' => 'required'\n\t )\n );\n\n\t}", "public function rules()\n {\n return [\n 'username' => 'required|string|max:255',\n 'email' => ['required', 'string', 'email', 'max:255', Rule::unique('users')->ignore($this->segment(3), 'id')],\n 'password' => 'nullable|string|min:6|confirmed',\n 'active' => 'required|boolean',\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'login' => 'required',\n 'email' => 'required',\n 'password1' => 'required|min:6',\n ];\n }", "public function rules() {\n\n $rules = [\n 'username' => 'required',\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'email' => 'required|email',\n\n ];\n\n if (Input::filled('password')) {\n $rules['password'] = 'confirmed|min:6';\n }\n\n return $rules;\n\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|max:20|unique:users',\n 'email' => 'required|email|max:255|unique:users',\n 'mobile' => 'required|numeric|unique:users',\n 'status' => 'required',\n 'password' => 'required|min:8',\n ];\n }", "public function rules()\n {\n return [\n 'name' => ['required', 'string', 'max:255', new UserName],\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users,email'],\n 'password' => ['required', 'string', 'min:8'],\n 'password_confirm' => ['required', 'string', 'same:password'],\n ];\n }", "public function rules()\n {\n $rules = [];\n\n // $rules['first_name'] = [ 'required' ];\n // if(\\Request::get('id') != NULL) {\n // if(\\Request::get('password') != '') {\n // $rules['password'] = [ 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'same:password' ];\n // }\n // } else {\n // $rules['password'] = [ 'required', 'regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,16}$/' ];\n // // $rules['confirm_password'] = [ 'required', 'same:password' ];\n // }\n // $rules['email'] = [ 'required', \n // 'email', \n // Rule::unique('users')->where(function ($query) {\n // $query = $query->where('id', '!=', \\Request::get('id'));\n // return $query;\n // }) \n // ];\n\n return $rules;\n }", "public function rules() {\n\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required|max:255',\n ];\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('username, old_password, password, confirm_password', 'required'),\r\n\t\t\tarray('password','valid'),\r\n\t\t\tarray('confirm_password','compare','compareAttribute'=>'password'),\r\n\t\t);\r\n\t}", "public function rules()\n {\n //自定义验证规则,用来判断原密码是否相等\n $this->checkPassword();\n return [\n 'old_password' => 'required|check_password',\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'name'=> 'required|string',\n 'username' => 'required|string|unique:users',\n 'email' => 'required|string|unique:users',\n 'password' => 'required|string'\n ];\n }", "public function rules() {\n return array(\n // username and password are required\n array('email', 'required'),\n array('email', 'userExists'),\n // rememberMe needs to be a boolean\n array('email', 'email'),\n // password needs to be authenticated\n array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),\n );\n }", "public function rules()\n {\n return [\n 'email' => [\n 'required',\n new UserExistCheck(new User())\n ],\n 'password' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|string|email|max:100',\n 'password' => 'required|string|min:6',\n //\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|min:4|max:25',\n 'email' => 'required|email'\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'last_name' => 'required|string|max:255',\n 'user_type' => 'required|string',\n ];\n if ($this->method() == 'PUT') {\n $rules['email'] = 'required|string|email|max:255|unique:users,email,' . $this->route()->parameter('user');\n $rules['password'] = 'sometimes|string|' .config('rules.password');\n } else {\n $rules['email'] = 'required|string|email|max:255|unique:users';\n $rules['password'] = 'required|string|' .config('rules.password');\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n // username and password are both required\n [['username', 'password',/*'confirmPassword','email', 'verifyCode'*/], 'required'],\n\t\t\t//['username', 'unique'],\n\t\t\t//['confirmPassword', 'compare', 'compareAttribute' => 'password'],\n\t\t\t//[['confirmPassword'], 'safe'],\n\t\t\t//['email', 'email'],\n\t\t\t//['verifyCode', 'captcha'],\n ];\n }", "public function rules(): array\n {\n return [\n 'email' => 'required|email|exists:users',\n 'password' => 'required'\n ];\n }", "public function createRules(){\n return [\n 'email' => 'required|string|max:50',\n 'password' => 'required|string',\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required','min:6','max:12',new IsUsernameExist()],\n 'password'=> 'required|string|min:8|max:20|confirmed|regex:/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/',\n 'password_confirmation' => 'required',\n ];\n }", "public function __construct()\n\t{\n\t\t$this->form_rules = array(\n\t\t\t'email' => 'required|email',\n\t\t\t'password' => 'required',\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'username' => 'required|unique:users,username,' . $this->id,\n 'email' => 'required|email|unique:users,email,'. $this->id,\n 'active' => 'required',\n 'password' => 'sometimes|required',\n 'retype_password' => 'required_with:password|same:password',\n 'role_id' => 'required',\n 'client_id' => 'exists:clients,id',\n ];\n }", "public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }", "public function rules()\n\t{\n\t\treturn [\n 'firstname' \t\t=> 'required|string',\n 'lastname' \t\t\t=> 'required|string',\n 'email' \t\t\t=> 'required|email|unique:users',\n 'password' \t\t\t=> 'required|min:8',\n\t\t];\n\t}", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users',\n 'password' => 'required|string|min:6|confirmed',\n ];\n\n //no need for name in instagram\n if($this->getPathInfo() == '/instagram/connect') {\n $rules['password'] = str_replace('|confirmed', '', $rules['password']);\n $rules['username'] = 'required';\n unset($rules['name']);\n unset($rules['email']);\n }\n\n return $rules;\n }", "public function rules()\n {\n return [\n 'email' => ['required', 'email'],\n 'password' => ['required', Password::min(8)->symbols(true)->mixedCase(true)],\n ];\n }", "public function rules() {\n return array(\n 'Username' => array('string' => array('min' => 4, 'max' => 15), 'required'),\n 'Password' => array('match' => array('ConfirmPassword'), 'string' => array('min' => 8, 'max' => 20), 'required'),\n 'FirstName' => array('string', 'required'),\n 'LastName' => array('string', 'required'),\n 'Email' => array('email'),\n// 'WebUrl' => array('url' => array('required' => 0)),\n// 'Template' => array('required'),\n// 'ProfileImage' => array('file' => array('type' => array('image/jpeg', 'image/pjpeg', 'image/png', 'image/gif'), 'size' => 200000))\n );\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'username' => 'required|unique:users',\n 'password' => 'required|gt:4',\n 'email' => 'unique:users'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required|min:8|max:32'\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required',\n 'email' => 'required|email|unique:users|max:255',\n 'password' => 'required|min:8',\n 'password_confirmation' => 'required|same:password'\n ];\n }", "public function rules()\n {\n return [\n 'email' => 'required|email|exists:users,email',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n return [\n 'username' => ['required', 'min:3', 'unique:users,name', 'alpha_num'],\n 'email' => ['required', 'email', 'unique:users'], // unique:table_name\n 'password' => ['required', 'confirmed', 'min:6'],\n 'role' => ['required', 'integer'],\n ];\n }", "public function rules()\n {\n if($this->method()=='GET') return [];\n return [\n 'username'=>'required|alpha_dash|between:3,64|unique:users,username',\n 'email'=>'required|email|unique:users,email|max:64',\n 'password'=>'required|confirmed|between:6,128',\n 'nickname'=>'max:128',\n ];\n }", "public function rules()\n {\n\t\t$id = $this->route('admin_user');\n\t\t$rules = [\n\t\t\t'password' => 'nullable|between:6,20',\n\t\t\t'name' => 'required|between:2,20|allow_letter|unique:admin_users,name,'.$id\n\t\t];\n\n\t\tif (!$id) {\n\t\t\t$rules['password'] = 'required';\n\t\t}\n\t\treturn $rules;\n }", "public function rules()\n {\n return [\n 'username' => 'required|min:3|unique:users,username',\n 'password' => 'required|min:3',\n 'name' => 'required|min:3',\n ];\n }", "protected function _set_rules($params)\n\t{\n\t\t$password_lenght = model('user')->_password_lenght;\n\t\t$rules = array();\n\t\t$rules['method'] = array('security_method', 'required|trim|callback__check_method');\n\t\t$rules['password_old'] = array('password_old', 'required|trim|callback__check_password_old');\n\t\t$rules['password'] = array('password', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['password_confirm'] = array('password_confirm', 'required|trim|xss_clean|matches[password]');\n\t\t$rules['pin_old'] = array('pin_old', 'required|trim|callback__check_pin_old');\n\t\t$rules['pin'] = array('pin', 'required|trim|xss_clean|min_length[' . $password_lenght . ']');\n\t\t$rules['pin_confirm'] = array('pin_confirm', 'required|trim|xss_clean|matches[pin]');\n\t\t$rules[$this->_mod()->param()] = array('security_value', 'required|callback__check_user_security');\n\t\t$this->form_validation->set_rules_params($params, $rules);\n\t}", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'email' => 'required|unique:users',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n return [\n 'name'=>'required', \n 'email'=>'required|email|unique:users',\n 'rol_id'=>'required|exists:rols,id',\n 'password'=>array('required'),\n ];\n }", "public function rules()\n {\n return [\n 'username' => 'required|regex:/^1[345789][0-9]{9}$/|unique:user,username',\n 'password' => 'required|min:8',\n 'repassword' => 'required|same:password',\n 'head_url' => 'required|url',\n ];\n }", "public function rules()\n {\n $this->sanitize();\n\n return [\n 'name' => 'required|max:255',\n 'address' => 'max:150',\n 'email' => ['required', 'email', 'max:255', Rule::unique('users')],\n 'username' => ['required', 'max:20', Rule::unique('users')],\n 'password' => 'required|min:2|confirmed',\n 'role_id' => 'required'\n ];\n }", "public function rules()\n {\n return [\n 'name' => 'required|between:0,10',\n 'email' => 'required|email|between:0,255|unique:users',\n 'password' => 'required|alpha_num_check|size:8|confirmed'\n ];\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }" ]
[ "0.7669122", "0.7669122", "0.74879825", "0.7358366", "0.7287219", "0.72671556", "0.7252849", "0.7249616", "0.7215109", "0.71844596", "0.71464556", "0.71017116", "0.7061328", "0.7038431", "0.7034937", "0.7001096", "0.6995491", "0.69825536", "0.69133484", "0.69013023", "0.68874276", "0.6867888", "0.68654", "0.68521875", "0.6848112", "0.6845626", "0.68437564", "0.6837568", "0.683275", "0.67849684", "0.6772876", "0.6758847", "0.6749201", "0.67488265", "0.6746171", "0.67353547", "0.6702999", "0.6701483", "0.66989887", "0.66974485", "0.66955215", "0.6693338", "0.66870743", "0.66859686", "0.66827816", "0.66819954", "0.66715956", "0.66667414", "0.66653705", "0.66552436", "0.6653743", "0.6653214", "0.6640244", "0.6635107", "0.66291916", "0.66269094", "0.66230404", "0.66207147", "0.66161823", "0.66161686", "0.6605185", "0.65970856", "0.6593444", "0.658768", "0.6586491", "0.65859187", "0.6583824", "0.65810895", "0.6579194", "0.65749", "0.6573925", "0.65624267", "0.6561763", "0.65536654", "0.65485203", "0.65433604", "0.6540808", "0.6537173", "0.65252006", "0.65224177", "0.6517242", "0.6515097", "0.65142405", "0.6509285", "0.6494148", "0.6493214", "0.6492367", "0.6487227", "0.64807254", "0.6477984", "0.6464963", "0.6458092", "0.64567333", "0.6450674", "0.64474833", "0.643026", "0.6429427", "0.6422056", "0.64218223", "0.64169776", "0.6415794" ]
0.0
-1
register signal & tickts
public function registerTicks() { if (!$this->_isSubProcess) { // register signal,send signal to parent process // 使用ticks需要PHP 4.3.0以上版本 echo "i am registering signal for main process!\n"; // 安装信号处理器 pcntl_signal(SIGINT, array($this, "sigHandler")); pcntl_signal(SIGTERM, array($this, "sigHandler")); pcntl_signal(SIGUSR1, array($this, "sigHandler")); if (version_compare(PHP_VERSION, "5.3.0") >= 0) { pcntl_signal_dispatch(); } } else { echo "i am registering signal for subprecesses!\n"; pcntl_signal(SIGCHLD, array($this, "sigHandler")); if (version_compare(PHP_VERSION, "5.3.0") >= 0) { pcntl_signal_dispatch(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n register_tick_function([&$this, 'tick']);\n }", "public function onTick($currentTick){ \n }", "function tick_handler()\n{\n echo \"called\\n\";\n}", "public function onTick() {\r\n\r\n }", "function tick();", "public function tick();", "private function _registerSigHandlers ()\n {\n if (! function_exists('pcntl_signal')) {\n return;\n }\n \n declare(ticks = 1);\n pcntl_signal(SIGTERM, array(\n $this,\n 'shutdown'\n ));\n pcntl_signal(SIGINT, array(\n $this,\n 'shutdown'\n ));\n pcntl_signal(SIGQUIT, array(\n $this,\n 'shutdown'\n ));\n \n $this->_logger->info('Registered signals');\n }", "public function tick()\n {\n //\n }", "protected function tick() {\n // per second, but possibly more often.\n }", "public function set_signal($signal)\n {\n $this->_signal = $signal;\n }", "private function registerSigHandlers()\n\t{\n\t\tif (!function_exists('pcntl_signal')) {\n\t\t\treturn;\n\t\t}\n\n\t\tpcntl_signal(SIGTERM, array($this, 'shutDownNow'));\n\t\tpcntl_signal(SIGINT, array($this, 'shutDownNow'));\n\t\tpcntl_signal(SIGQUIT, array($this, 'shutdown'));\n\t\tpcntl_signal(SIGUSR1, array($this, 'killChild'));\n\t\tpcntl_signal(SIGUSR2, array($this, 'pauseProcessing'));\n\t\tpcntl_signal(SIGCONT, array($this, 'unPauseProcessing'));\n\t\t$this->logger->log(LogLevel::DEBUG, 'Registered signals');\n\t}", "private function dispatchSig()\n\t{\n\t\tswitch ( $this->signal ) {\n\t\t\t// reload\n\t\t\tcase 'reload':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\t// stop\n\t\t\tcase 'stop':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function tick() \n\t{\n\t\t// Override this for any process that should happen periodically.Will happen at least once\n\t\t// per second, but possibly more often.\n\t}", "public function register()\n {\n // maybe something, one day\n }", "function __construct($tick) {\n global $stperiod;\n global $mtperiod;\n global $ltperiod;\n\n $this->tick = $tick;\n $this->st = new Trend('ST', $stperiod);\n $this->mt = new Trend('MT', $mtperiod);\n $this->lt = new Trend('LT', $ltperiod);\n }", "protected function registerTickHandler(?callable $callback): void\n {\n }", "public function tick()\n {\n $this->poloniexWatcher->updateAssetPrices();\n\n $this->binanceWatcher->updateAssetPrices();\n\n $this->bitfinexWatcher->updateAssetPrices();\n\n $this->bittrexWatcher->updateAssetPrices();\n\n $this->coinMarketWatcher->sync();\n }", "function eis_device_signal($calldata) {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status;\n\t$callparam=$calldata[\"param\"];\n\tswitch ($calldata[\"cmd\"]) {\n\n\t\tdefault:\n\t\t\t// manage unknown command\n\t\t\teis_log(1,\"system:unknownSignal --> \".$calldata[\"cmd\"]);\n\t}\n}", "public function register() {\n\t\treturn array(T_BACKTICK);\n\t}", "function set_signal_history($flag)\n{\n return XPSPL::instance()->set_signal_history($flag);\n}", "public function init()\n\t{ \n\t\t# Return if no countoff is needed\n\t\tif ($this->countoff<1) return;\n\t\t\n\t\t# initialize event array\n\t\t$this->events = array();\n\t\t\n\t\tif ($this->initRestTicks) {\n\t\t\t# Add a brief rest and then all notes off and all sound off to relevant channels here\n\t\t\tfor($ix=0; $ix<$this->track_total; $ix++) {\n\t\t\t\t$this->track_ix = $ix;\n\t\t\t\t\n\t\t\t\t# for all channels in this track\n\t\t\t\tforeach($this->channels[$this->track_ix] as $chan) {\n\t\t\t\t\t$this->addEvent(0,176+$chan,123,0);\n\t\t\t\t\t$this->addEvent(0,176+$chan,7,0);\n\t\t\t\t}\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,0);\n\t\t\t\t$this->addEvent($this->initRestTicks,176+$this->channels[$this->track_ix][0],7,$this->mVol);\n\t\t\t}\n\t\t}\n\t\t\n\t\t# Put in the initial countoff\n\t\tfor($i=0; $i<$this->timeSig; $i++) { \n\t\t\t$vol = ($i==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t\t\n\t\t# record where this track starts for looping purposes\n\t\t$this->loopStart[$this->track_ix] = count($this->events[$this->track_ix]);\n\t}", "public function _register()\n {\n }", "public function addSignal(float $timeout = -1): bool {}", "public static function connectSignal( $signal1, $signal2 )\n\t{\n\t\tif( is_array( $signal ) )\n\t\t{\n\t\t\t$emitent = $signal[0];\n\t\t\t$signal = $signal[1];\n\t\t\t\n\t\t\tif( is_object( $emitent ) )\n\t\t\t{\n\t\t\t\t$emitent = get_class( $emitent );\n\t\t\t}\n\t\t\t\n\t\t\t$signal = $emitent . '_' . $signal;\n\t\t}\n\t\t\n\t\t$GLOBALS['_RPC_']['signals'][$signal][] = array( 'type' => 'signal', 'slot' => $slot );\n\t}", "public function add_signal($signal = null, $vars = null, $event = null) \n {\n $this->_signals = [$signal, $vars, $event];\n }", "public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }", "private function updateDetectRegisters()\n {\n\n //Initialise the banks with nothing set\n //Is this a problem? Could something else be depending on them being set in another process?\n $banks_watching = [0, 0];\n\n foreach ($this->pins as $bank => $bank_pins) {\n foreach ($bank_pins as $bit_position => $pin) {\n $banks_watching[$bank] |= 1 << $bit_position;\n }\n }\n\n ///Set rising and falling - irrelevant events will be ignored.\n foreach ($banks_watching as $index => $bank) {\n $this->gpio_register[Register\\GPIO::$GPREN[$index]] = $bank;\n $this->gpio_register[Register\\GPIO::$GPFEN[$index]] = $bank;\n }\n\n //Stop or start the timer if necessary.\n //array sum checking if any bits in either bank are set\n if (array_sum($banks_watching) === 0) {\n $this->stop();\n } elseif (!$this->isActive()) {\n $this->start();\n }\n\n }", "public function register()\n {\n $this->registerSwither();\n }", "public function register()\n {\n parent::register();\n\n $this->configureQueue();\n\n $this->registerWorkCommand();\n }", "public function register()\n {\n register_shutdown_function([$this, 'onShutdown']);\n }", "abstract public function register ( );", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "function current_signal($offset = 0)\n{\n return XPSPL::instance()->current_signal($offset);\n}", "private function registerSignalHandlers()\n {\n $this->processControl->registerSignalHandler(\n [SIGINT, SIGTERM],\n [$this, 'terminate']\n );\n }", "function on_start($function)\n{\n return signal(new \\XPSPL\\processor\\SIG_Startup(), $function);\n}", "public function timer($names, $value, array $tags = [], $sampleRate = 1.0);", "public static function signal(EventBase $base, int $signum, callable $cb, $arg): Event {}", "public function register()\n {\n $this->registerFinite();\n }", "public function registerEvents() {\n $this->cx->getEvents()->addEvent('model/expired');\n $this->cx->getEvents()->addEvent('model/terminated');\n $this->cx->getEvents()->addEvent('model/payComplete');\n }", "function signal_handler($signal) {\n\tglobal $DBH, $wa, $tracking_numbers;\n switch($signal) {\n case SIGTERM:\n case SIGKILL:\n case SIGINT:\n \t// Kill any event listeners\n\t foreach ($tracking_numbers as $number) {\n\t\t\t\t$wa->sendPresenceUnsubscription($number);\n\t\t\t}\n \t// Update tracker session\n\t\t\t$end_tracker_session = $DBH->prepare('UPDATE tracker_history SET \"end\" = NOW() WHERE \"end\" IS NULL;');\n\t\t\t$end_tracker_session->execute();\n\t\t\t// End any running record where an user is online\n\t\t\t$end_user_session = $DBH->prepare('UPDATE status_history\n\t\t\t\t\t\t\t\t\t\t\t\tSET \"end\" = NOW() WHERE \"end\" IS NULL AND \"status\" = true;');\n\t\t\t$end_user_session->execute();\n\t\t\t$wa -> disconnect();\n echo '[exit] Shutting down tracker'.\"\\n\";\n exit;\n }\n}", "public static function connect( $signal, $slot )\n\t{\n\t\tif( is_array( $signal ) )\n\t\t{\n\t\t\t$emitent = $signal[0];\n\t\t\t$signal = $signal[1];\n\t\t\t\n\t\t\tif( is_object( $emitent ) )\n\t\t\t{\n\t\t\t\t$emitent = get_class( $emitent );\n\t\t\t}\n\t\t\t\n\t\t\t$signal = $emitent . '_' . $signal;\n\t\t}\n\t\t\n\t\t$GLOBALS['_RPC_']['signals'][$signal][] = array( 'type' => 'callback', 'slot' => $slot );\n\t}", "protected function startSignalHandlers(): void\n {\n if (!$this->hasPcntl) {\n return;\n }\n\n foreach ($this->signalMap ?? [] as $number => $set) {\n pcntl_signal($number, function ($number) use ($set) {\n foreach ($set as $binding) {\n /** @var Binding $binding */\n $binding->trigger($number);\n }\n });\n }\n }", "public function timerEvent()\n {\n echo 'timer is triggered',\"\\n\";\n }", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "abstract public function register();", "abstract public function register();", "abstract public function register();", "public function listen($signal,$who)\n {\n if(!isset($this->sigtable[$signal])){\n $this->sigtable[$signal]=$who;\n }\n }", "public function onEnable(){\n\t\t $this->getServer()->getPluginManager()->registerEvents($this, $this);\n $this->getLogger()->info(TextFormat::BLUE . \"TimerAPI has been enabled!\");\n }", "public function get_signal()\n {\n return $this->_signal;\n }", "function on_shutdown($function)\n{\n return signal(new \\XPSPL\\processor\\SIG_Shutdown(), $function);\n}", "static private function setTimer() {\n if(!self::$timer) {\n self::$timer = self::$loop->addPeriodicTimer(0, \\Closure::bind(function () {\n $this->tick();\n \n $queue = \\GuzzleHttp\\Promise\\queue();\n $handles = $this->handles;\n \n if($queue->isEmpty() && \\count($handles) === 0) {\n URLHelpers::stopTimer();\n }\n }, self::$handler, self::$handler));\n }\n }", "public function registerWorker()\r\n {\r\n Resque::redis()->sadd('workers', $this);\r\n setlocale(LC_TIME, \"\");\r\n setlocale(LC_ALL, \"en\");\r\n Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));\r\n }", "static function stackTicket($tick) {\n\t\t$myHandler =& Cgn_ObjectStore::getObject(\"object://defaultSystemHandler\");\n\t\tarray_push($myHandler->ticketList, $tick);\n\t}", "public function register()\n\t{\n\t\t$this->runListeners();\n\t}", "public static function register()\n {\n }", "private function sendSignal()\n {\n $this->view->downSignal = true;\n }", "public function register(){}", "public function register()\n {\n //\n }", "public function register()\n {\n //\n }", "public function register() {\n //\n }", "public function register()\n {\n\t\t\t//\n }", "public static function register()\n {\n Container::extensionMethod('addDate', function (Container $container, $name, $label = NULL) {\n $control = new DateTimeInput($label);\n $control->type = DateTimeInput::TYPE_DATE;\n return $container[$name] = $control;\n });\n /*\n Container::extensionMethod('addTime', function (Container $container, $name, $label = NULL) {\n $control = new DateTimeInput($label);\n $control->type = DateTimeInput::TYPE_TIME;\n return $container[$name] = $control;\n });\n Container::extensionMethod('addDatetime', function (Container $container, $name, $label = NULL) {\n $control = new DateTimeInput($label);\n $control->type = DateTimeInput::TYPE_DATETIME;\n return $container[$name] = $control;\n });\n */\n }", "public function updateTicker()\n {\n \n $val = $this->mtgox->getTicker();\n \n $arr = [\"value\"=>\"\", \"value_int\"=>\"\", \"display\"=>\"\", \"currency\"=>\"\"];\n \n $defs = [\n \"high\" => $arr,\n \"low\" => $arr,\n \"avg\" => $arr,\n \"vwap\" => $arr,\n \"vol\" => $arr,\n \"last_all\" => $arr,\n \"last_local\" => $arr,\n \"last_orig\" => $arr,\n \"last\" => $arr,\n \"buy\" => $arr,\n \"sell\" => $arr,\n ];\n \n $val = array_merge($defs, $val);\n \n $this->insert($val);\n \n $this->setPercentChange();\n \n $this->tickerPear();\n }", "public function register(): void;", "function paintSignal($type, &$payload) {\r\n $this->_scorer->paintSignal($type, $payload);\r\n }", "public function addsignal($IMEI, $Date, $dt, $RFID)\n {\n /* $data_message['imei'] = $IMEI;\n $data_message['date'] = $Date;\n $data_message['time'] = $dt;\n $data_message['card_id'] = $RFID;\n $this->db->insert('device_signal', $data_message);\n echo $this->db->_error_message(); */\n\n $this->db->query(\"Insert into device_signal values ('125','2012-01-01','2012-01-01','1234')\");\n //echo $this->db->_error_message();\n //echo $this->db->affected_rows();\n //echo $this->db->last_query();\n }", "public function register()\n {\n //\n }", "public function onRegister();", "public function clockSeqHi();", "public function register()\n {\n //\n\t\t\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "protected static function register() {}", "public function register() {}", "public function register()\r\n {\r\n //\r\n\t}", "public function register() {\n\t\t//\n\t}", "public function register() {\n\t\t//\n\t}", "public function register() {\n\t\t//\n\t}", "public static function _register()\n {\n self::assignElements([\n 'Type' => ['type' => 'MarkUpMarkDownEventTypeCodeType', 'enum' => true, 'xmlns' => self::XMLNS],\n 'Time' => [],\n 'Reason' => []\n ], parent::NAME);\n\n self::assignAttributes([]);\n }", "abstract public function onRegister(): void;", "public function register()\n {\n \n }", "public function register()\n {\n \n }", "public function register(){\n\t\t$this->registerOptimusAsAlias();\n\t\t$this->registerCommand();\n\t}", "public function register( \\Aimeos\\MW\\Observer\\Publisher\\Iface $p );", "public function getSignal()\n {\n return $this->signal;\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }" ]
[ "0.7177069", "0.62790525", "0.60348064", "0.6032207", "0.5911731", "0.5812185", "0.5709681", "0.5654872", "0.55474186", "0.5463986", "0.54326826", "0.53226155", "0.53038853", "0.52809507", "0.5277291", "0.51221144", "0.50967526", "0.509577", "0.5088748", "0.508826", "0.5019128", "0.5011437", "0.4983165", "0.4955445", "0.4943131", "0.49295527", "0.4901926", "0.48502135", "0.48376876", "0.48098865", "0.48087448", "0.47811544", "0.47810307", "0.4778931", "0.47736317", "0.47665069", "0.47542825", "0.47456983", "0.4738633", "0.47269386", "0.4713226", "0.47051236", "0.4699456", "0.4684655", "0.4684655", "0.4684655", "0.4684655", "0.4684655", "0.4684655", "0.4684655", "0.4684655", "0.46818492", "0.46818492", "0.46818492", "0.4659939", "0.4650452", "0.4626783", "0.46239358", "0.46171477", "0.46074966", "0.4607139", "0.46007407", "0.4598431", "0.45873445", "0.45831993", "0.45769852", "0.45769852", "0.45711154", "0.45625073", "0.4559851", "0.4556178", "0.4552101", "0.45504168", "0.45377806", "0.45331493", "0.4532877", "0.45274442", "0.45242167", "0.45223138", "0.45223138", "0.45223138", "0.45223138", "0.45223138", "0.45220467", "0.45166612", "0.4513132", "0.45092285", "0.45092285", "0.45092285", "0.45076406", "0.4506101", "0.45054156", "0.45054156", "0.4503154", "0.44992456", "0.4493586", "0.44926986", "0.44926986", "0.44926986", "0.44926986" ]
0.6851136
1
this function is used for ensuring running gearman worker not to be interrupted
public function gearmanRunOnceBeforeExit() { echo "i am handling signal!\n"; if (!isset($this->_app)) { $this->_app = CApp::getApp(); } // var_dump($this->sub_process_keys); foreach ($this->sub_process_keys as $_k => $_subProcessKey) { $workeName = $this->_gearmanFuncNamePre."_".$_subProcessKey; $this->_app->logger->log("i am worker {$workeName},i am tring to run last worker before exit", "NOTICE"); $dataDir = $this->_app->systemDataDir; $workingJobsDir = $dataDir.DIRECTORY_SEPARATOR.self::WORKING_JOBS_DIRNANE; if (!file_exists($workingJobsDir)) { mkdir($workingJobsDir); } $registerFuncName = $this->_gearmanFuncNamePre."_".$_subProcessKey; $workingJobFile = $workingJobsDir.DIRECTORY_SEPARATOR.$registerFuncName; var_dump($workingJobFile); if (!file_exists($workingJobFile)) { $this->_app->logger->log("i am worker {$workeName},i am not working when i am nicely killed", "NOTICE"); // when job isn't running kill the working process posix_kill($this->_forkedPids[$_k], SIGKILL); } else { echo "the worker $workeName is running\n"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gracefulStop(){\n $this->handleWorkerOutput('warn', \"Work done, exiting now.\");\n $this->stop();\n }", "public function gearmanWorkerStop()\n {\n for($i = 0; $i < $this->_gearmanForkCount; $i++){\n $this->sub_process_keys[] = $i+1;\n }\n foreach ($this->sub_process_keys as $_sub_key) {\n $shell_cmd = \"ps aux | grep \".$this->_workerFileName. \" |\";\n $shell_cmd .= \"grep -v 'grep' | awk '{print $2}' |\";\n $sub_process_name = $this->_workerFileName.\"_\".$_sub_key;\n $pid_file = $this->_lockDir.$this->_workerFileName.\"_\".$_sub_key.\".pid\";\n $pid_cmd = \"cat $pid_file\";\n $pid = exec($pid_cmd);\n $shell_cmd .= \" grep $pid\";\n echo $shell_cmd.\"\\n\";\n //查看进程是不是存在\n $ps_res = exec($shell_cmd);\n if (empty($ps_res)) {\n echo \"process $sub_process_name is not running!\\n\";\n } else {\n $kill_cmd = \"kill $pid\";\n exec($kill_cmd);\n $this->killed_sub_process_keys[] = $_sub_key;\n echo \"process $sub_process_name is stopped\\n\";\n }\n }\n }", "public function run()\n {\n $this->_fnameFlagStop = dirname(__FILE__) . '/' . $this->getIndividualFilenameAsFlag();\n $this->checkIfShouldStopWork();\n\n $worker = Mage::getModel('myproject_gearman/worker'); // just a wrapper around PHP Gearman class\n\n $worker->addFunction($this->getJobName(), function (GearmanJob $job) {\n $this->_curJobObject = $job;\n $data = unserialize($job->workload());\n $this->processDataWrapper($data, $job);\n });\n\n $worker->addFunction($this->getIndividualFilenameAsFlag(), function (GearmanJob $job) {\n $this->log('Got job to exit. Job name: ' . $this->getIndividualFilenameAsFlag());\n $job->sendComplete('ok'); // without this line queue not cleans and task stay in this queue\n exit;\n });\n\n $worker->work();\n }", "public function haltJobLoop()\n\t{\n\t\t$this->halt_job_loop = true;\n\t}", "public function handle()\n {\n while (1) {\n $this->worker->work();\n if ($this->worker->returnCode() != GEARMAN_SUCCESS) break;\n sleep(2);\n }\n }", "abstract protected function _restart();", "public function trylock() {}", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "private function checkWorkers() {\n global $workers;\n $living = array();\n\n // Find any dead workers\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->debug(\"Checking worker $workerID (pid $pid)\");\n\n // Check if this worker still exists as a process\n if (pcntl_waitpid($pid, $status, WNOHANG|WUNTRACED) === $pid) {\n // If the worker exited normally, stop tracking it\n if (pcntl_wifexited($status) && pcntl_wexitstatus($status) === 0) {\n gosUtility_parallel::$logger->info(\"Worker $workerID (pid $pid) exited normally\");\n unset($workers[$workerID]);\n }\n }\n\n // If it has a session ID, then it's still living\n if (posix_getsid($pid))\n $living[] = $pid;\n }\n\n // Start new workers to replace dead ones\n $dead = array_diff($workers, $living);\n foreach ($dead as $workerID => $deadPID) {\n gosUtility_parallel::$logger->warn(\"Worker $workerID (pid $deadPID) died. Conscripting replacement...\");\n\n unset($workers[$workerID]);\n $this->startWorker($workerID);\n }\n }", "private function main()\n {\n $this->initDataSource();\n while ($this->running) {\n try {\n $this->eventDispatcher->dispatch(new QueueStatus($this));\n } catch (\\Throwable $e) {\n $this->stdOutLogger->error('Watch coroutine exception, msg:' . $e->getMessage());\n $this->fileLogger->alert('Watch coroutine exception', [\n 'file' => $e->getFile(),\n 'line' => $e->getLine(),\n 'msg' => $e->getMessage(),\n 'trace' => $e->getTraceAsString(),\n ]);\n }\n\n Coroutine::sleep(self::WATCH_COMMAND_TIME);\n }\n $this->stdOutLogger->info('消费进程(' . $this->process->pid . ')退出');\n $this->fileLogger->info('消费进程(' . $this->process->pid . ')退出');\n }", "public function wakeUp() {}", "private function hangup()\n\t{\n\t\twhile ( true ) {\n\t\t\t// dispatch signal for the handlers\n\t\t\tpcntl_signal_dispatch();\n\n\t\t\t// daemon process\n\t\t\t$this->daemon->check( $this );\n\n\t\t\t// prevent the child process become a zombie process\n\t\t\t// pcntl_wait($status);\n\t\t\tforeach ( $this->workers as $k => $v ) {\n\t\t\t\t$res = pcntl_waitpid( $v->pid, $status, WNOHANG );\n\t\t\t\t// if ($res == -1 || $res = 0) {\n\t\t\t\t// \t// exception\n\t\t\t\t// \tcontinue;\n\t\t\t\t// }\n\t\t\t\tif ( $res > 0 ) {\n\t\t\t\t\tunset( $this->workers[ $res ] );\n\n\t\t\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'reload' ) {\n\t\t\t\t\t\tif ( array_key_exists( $res, $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t\t\tunset( $this->waitSignalProcessPool[ 'pool' ][ $res ] );\n\t\t\t\t\t\t\t// fork a new worker\n\t\t\t\t\t\t\t$this->fork();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'stop' ) {\n\t\t\t\t\t\tif ( array_key_exists( $res, $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t\t\tunset( $this->waitSignalProcessPool[ 'pool' ][ $res ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $this->waitSignalProcessPool[ 'signal' ] === 'stop' ) {\n\t\t\t\t// all worker stop then stop the master process\n\t\t\t\tif ( empty( $this->waitSignalProcessPool[ 'pool' ] ) ) {\n\t\t\t\t\t$this->master->stop();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// read signal from worker\n\t\t\t// $this->master->pipeRead();\n\n\t\t\t// precent cpu usage rate reach 100%\n\t\t\tusleep( self::$hangupLoopMicrotime );\n\t\t}\n\t}", "private function doWorkParent() {\n Log5PHP_MDC::put('Generation', 'parent');\n\n global $run;\n global $reload;\n global $workers;\n\n $this->parentSetup();\n\n while ($run && count($workers) > 0) {\n if ($reload) {\n gosUtility_parallel::$logger->info(\"Parent saw reload, restarting workers\");\n\n $reload = false;\n $this->killAllWorkers();\n $this->startAllWorkers();\n } else {\n $this->checkWorkers();\n }\n\n // Sleep 4 seconds\n usleep(4000000);\n }\n\n $this->parentCleanup();\n $this->killAllWorkers();\n pcntl_wait($status);\n }", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "public function _wake_up() {\n\t\tdo_action( 'searchwp\\debug\\log', 'Waking up', 'indexer' );\n\t\t$this->_destroy_queue();\n\t\t$this->unlock_process();\n\t\tsleep( 1 );\n\t\t$this->trigger();\n\t}", "public function recoverFromCorruption()\n {\n }", "protected function checkStartConditions(): void\n {\n if (!$this->exists) {\n throw new WorkerException('Worker must be properly created before start.');\n }\n\n if ($this->getAttribute('pid') !== null) {\n throw new WorkerException('Worker is running already.');\n }\n }", "function CIR_waitForNextJob()\n{\n\t$lang = getClientLanguage();\n\n\t$quiet = ($_SESSION['debug'] ? \"\": \"-qq\");\n\n\tinclude(\"/m23/inc/i18n/\".I18N_m23instLanguage($lang).\"/m23inst.php\");\n\n\n\techo(\"\n#mv work.php `date +%s`.old\n\nSEC=0\nTIME=0\nloopRun=`true`\n\nwhile \\$loopRun\n\tdo\n\t\");\n\n\tif (RMV_get(\"debug\")!=1)\n\techo(\"dialog --backtitle \\\"$I18N_client_installation\\\" --title \\\"$I18N_client_status\\\" --infobox \\\"\\n$I18N_waiting_for_jobs\\\" 6 70\");\n\n\techo(\"\n\t\t#Add the client ID if it is available\n\t\tid=`cat /m23clientID 2> /dev/null`\n\t\tif test \\$id\n\t\tthen\n\t\t\tidvar=\\\"?m23clientID=\\$id\\\"\n\t\tfi\n\n\t\twget $quiet -Owork.php \\\"https://\".getServerIP().\"/work.php\\$idvar\\\" --no-check-certificate\n\t\t\n\t\tif test `find work.php -printf \\\"%s\\\"` -gt 0\n\t\tthen\n\t\t\tchmod +x work.php\n\t\t\tloopRun=`false`\n\t\t\tbreak\n\t\tfi\n\t\tsleep 20\n\t\tTIME=`expr \\$SEC / 60`\n\t\tSEC=`expr \\$SEC + 20`\n\tdone\n\t./work.php\n\t\\n\");\n}", "public function run() {\n\t\tif ($this->schedule->isRun()) {\n\t\t\t$this->excuteHandle->excute();\n\t\t}\n\t}", "public function halt();", "public function wasWorked();", "public function __invoke()\n {\n pcntl_signal_dispatch();\n }", "protected function shouldRemoveBackgroundJob(): bool {\n\t\treturn $this->config->getSystemValueBool('has_internet_connection', true) === false ||\n\t\t\t$this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com') === '' ||\n\t\t\t$this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes') !== 'yes' ||\n\t\t\t$this->retries >= 5;\n\t}", "public function prepareForRestart() {\n\t\tparent::prepareForRestart();\n\t}", "public function start($exit_when_running = true, $stuck_threshold = 20)\n\t{\n\t\techo $this->_nl, \"checking lock on $this->_dbtype $this->_object. at \" . date('Y/m/d H:i:s', time()), $this->_nl;\n\n\t\ttry\n\t\t{\n\t\t\t$q = $this->_conn->prepare(\"select in_process, case when start_time > finish_time and datediff(minute, start_time, getdate()) > {$stuck_threshold} then 1 else 0 end as is_stuck from sandbox.dbo.daemon where object = :object and dbtype = :dbtype\");\n\t\t\t$q->bindParam(':object', $this->_object);\n\t\t\t$q->bindParam(':dbtype', $this->_dbtype);\n\n\t\t\t$q->execute();\n\t\t\t$rs = $q->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\techo 'ERROR: ' , $e->getMessage(), $this->_nl;\n\t\t\t\n\t\t\tif ($exit_when_running)\n\t\t\t\tdie();\n\t\t\telse return false;\n\t\t}\n\n\t\t// if no daemon entry for this queue, create one\n\t\t$currently_running = $is_stuck = false;\n\t\tif (empty($rs))\n\t\t\t$this->create();\n\t\telse $currently_running = (bool) $rs[0]['in_process'];\n\t\t\n\t\t$is_stuck = $rs[0]['is_stuck'];\n\t\tif ($is_stuck)\n\t\t{\n\t\t\techo \"$this->_dbtype $this->_object is stuck.\", $this->_nl, $this->_nl;\n\t\t\t@mail('[email protected]', \"$this->_dbtype $this->_object is stuck\", '');\n\t\t}\n\n\t\tif ($currently_running)\n\t\t{\n\t\t\t// do I want to just exit here? or is there something a script would have to do regardless of whether the queue is locked\n\t\t\techo \"$this->_dbtype $this->_object is currently running: locked.\", $this->_nl, $this->_nl;\n\t\t\t\n\t\t\tif ($exit_when_running)\n\t\t\t\tdie();\n\t\t\telse return false;\n\t\t}\n\n\t\t$this->set_process_state(true);\n\t\treturn true;\n\t}", "public function __sleep()\n\t{\n\t\t$this->_redisMaster = $this->_redisSlave = null;\n\t}", "public function manageNotFoundExecutableAction()\n {\n $responses = $this->triggerEvent(__FUNCTION__ . '.normalAction');\n return !$responses->stopped() && $this->flowEvaluator->attemptResume();\n }", "private static function start_gearman_workers($gearman_options) \n\t{\n\t\tforeach($gearman_options AS $gearman_class => $worker_count) {\n\t\t\tfor ($worker_id = 0; $worker_id < $worker_count; $worker_id++) {\n\t\t\t\t$pid_file = self::$pid_dir.$gearman_class.'_'.$worker_id.'.pid';\n\t\t\t\tself::_start_job_process($gearman_class, $pid_file, 'gearman');\n\t\t\t}\n\t\t}\n\t}", "protected function stopTask() {}", "public function handle()\r\n {\r\n try {\r\n $this->call(\"swooliy:stop\");\r\n\r\n sleep(2);\r\n \r\n $this->call(\"swooliy:start\");\r\n } catch (Throwable $e) {\r\n die($e);\r\n }\r\n }", "private function doWakeup()\n {\n $runnerStatus = $this->getRunnerStorage()->getStatus();\n $currentGuid = $runnerStatus->getGuid();\n if (!empty($currentGuid) && !$runnerStatus->isExpired()) {\n return;\n }\n\n if ($runnerStatus->isExpired()) {\n $this->runnerStatusStorage->setStatus(TaskRunnerStatus::createNullStatus());\n Logger::logDebug('Expired task runner detected, wakeup component will start new instance.');\n }\n\n $guid = $this->getGuidProvider()->generateGuid();\n\n $this->runnerStatusStorage->setStatus(\n new TaskRunnerStatus(\n $guid,\n $this->getTimeProvider()->getCurrentLocalTime()->getTimestamp()\n )\n );\n\n $this->getAsyncProcessStarter()->start(new TaskRunnerStarter($guid));\n }", "public function runFailed();", "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 }", "public function stop()\n {\n die;\n }", "protected function checkForCliDispatch() {}", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "public function unregisterSchedulerWorker()\n {\n return $this->redis->del(self::$schedulerWorkerKey) > 0;\n }", "protected function run()\n {\n //to use\n\n //$this->task is available here\n //$this->queue is available here\n\n //set $this->exit_response to any value before returning\n //with a EXIT_STATUS. This will be saved to response column of the $task object.\n\n //if you want to retry\n //return self::EXIT_STATUS_RETRY\n\n //if you do not want to retry\n //return self::EXIT_STATUS_RETRY\n\n //if success\n //return self::EXIT_STATUS_OK\n\n\n }", "private function assert_not_running(): void\n\t{\n\t\tif ($this->status >= self::STATUS_RUNNING)\n\t\t{\n\t\t\tthrow new ApplicationAlreadyRunning;\n\t\t}\n\t}", "protected function _balanceQueues(){\n// $this->RUNNING = false;\n }", "protected function restartAgent($data) {\n \n $command = \"\";\n $bp = new utils\\BackgroundProcess($command);\n }", "public function continue()\n {\n $this->run('run -i {id}');\n }", "function stop ()\n{\n file_put_contents(config::CLIENT_BASE_DIR . '/act', 'idle');\n die();\n}", "protected function restart(): void\n {\n // TODO\n }", "public function unregisterWorker()\n\t{\n\t\tif (is_object($this->currentJob)) {\n\t\t\t$this->currentJob->fail(new DirtyExitException());\n\t\t}\n\n\t\t$id = (string)$this;\n\t\tResque::redis()->srem('workers', $id);\n\t\tResque::redis()->del('worker:' . $id);\n\t\tResque::redis()->del('worker:' . $id . ':started');\n\t\tStat::clear('processed:' . $id);\n\t\tStat::clear('failed:' . $id);\n\t}", "public function keepalive() : bool\n {\n $this->reloadPids();\n\n // if already running don't do anything:\n if ($this->managerIsRunning() === true) {\n return false;\n }\n\n // if there are no workers at all do a fresh start:\n if (empty($this->pids)) {\n $this->start();\n return true;\n }\n\n // startup new workers if necessary:\n $this->adjustRunningWorkers();\n\n // delete old pid files:\n $this->reloadPids();\n\n return true;\n }", "function isStopped();", "public function handle_exit_recovery_mode()\n {\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 }", "function run_leaving_activity_pre()\n\t\t{\n\t\t\t//actually we never send emails when cancelling\n\t\t\treturn true;\n\t\t}", "public function shutdown ()\n {\n $this->_signalAllWorkers(SIGKILL);\n \n $this->_logger->info('Exiting...');\n $this->_shutdown = true;\n \n exit(1);\n }", "public function beforeSyncing() {}", "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 abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function handle()\n {\n Artisan::call('queue:retry');\n }", "public function run()\n {\n try {\n $this->initial();\n $this->startBackup();\n } catch (NoInicializationException $error) {\n die('[NoInicializationException] '.$error->getMessage());\n } catch (NoDistinationException $error) {\n die('[NoDistinationException] '.$error->getMessage());\n }\n }", "public function shutdown()\n {\n // do nothing here\n }", "public function check(): bool\n {\n return pcntl_signal_dispatch();\n }", "public function lock() {}", "public function withoutQueue()\n {\n // Sleep is taking the place of our long task you can imagine this as an image upload\n // or maybe some heavy duty encryption, or a call to an API endpoint, or an email. Anything\n // we don't want the user to have to wait for.\n sleep(5);\n Log::info('Long task run without queue');\n Session::flash('success', 'Successfully completed long running task');\n return redirect()->route('queueExample');\n }", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "function shutdown() ;", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function restart()\n {\n $this->destroy();\n $this->start();\n }", "public function isInterruptable()\n {\n return true;\n }", "public function testJobDisable()\n {\n\n }", "public function handle()\n {\n global $argv;\n $action = $this->argument('action');\n if(!in_array($action, ['start', 'stop'])){\n $this->error('Error Argument');exit;\n }\n $argv[0] = 'workerman:wsserver';\n $argv[1] = $action;\n $argv[2] = $this->option('daemonize') ? '-d' : '';\n\n\n //\n $REAL_MYSQL_ADDRESS = 'tcp://127.0.0.1:3306';\n\n $proxy = new Worker('tcp://0.0.0.0:4406');\n\n $proxy->onConnect = function($connection) use ($REAL_MYSQL_ADDRESS){\n //异步建立一个到Mysql服务器的连接\n $connection_to_mysql = new AsyncTcpConnection($REAL_MYSQL_ADDRESS);\n //msyql连接发来数据时,转发给对应的客户端连接\n $connection_to_mysql->onMessage = function ($connection_to_mysql, $buffer) use ($connection) {\n echo \"connection_to_mysql->onMessage \\n\";\n $connection->send($buffer);\n };\n\n //msyql关闭时,关闭对应的代理到客户端的连接\n $connection_to_mysql->onClose = function ($connection_to_mysql) use ($connection)\n {\n echo \"connection->close(1);\\n\";\n $connection->close();\n };\n //\n $connection_to_mysql->onError = function ($connection_to_mysql) use ($connection)\n {\n echo \"connection->close(2); \\n \";\n $connection->close();\n };\n\n //执行异步连接\n $connection_to_mysql->connect();\n\n //客户端发来数据时,转发给对应的数据库连接\n $connection->onMessage = function($connection, $buffer) use ($connection_to_mysql)\n {\n echo \"connection_to_mysql->send \\n\";\n $connection_to_mysql->send($buffer);\n };\n\n //客户端断开连接时,断开对应的Mysql连接\n $connection->onClose = function($connection) use ($connection_to_mysql)\n {\n echo \"connection_to_mysql->close\\n\";\n $connection_to_mysql->close();\n };\n };\n Worker::runAll();\n }", "function run()\n {\n $this->_loadState();\n $start_time = microtime_float();\n while ((microtime_float() - $start_time) < DC_WORKER_TIME_OUT)\n {\n if($this->_process_info['status']=='INITED' or $this->_process_info['status']=='PROCESSING')\n {\n $this->_doWork();\n };\n\n if($this->_process_info['status']=='PRE_COMPLETED')\n {\n $this->_finishWork();\n break;\n };\n\n if($this->_process_info['status']=='ERRORS_HAPPENED')\n {\n $this->_breakWork();\n break;\n };\n }\n\n $this->_saveState();\n return;\n }", "private function dispatchSig()\n\t{\n\t\tswitch ( $this->signal ) {\n\t\t\t// reload\n\t\t\tcase 'reload':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\t// stop\n\t\t\tcase 'stop':\n\t\t\t\t$this->workerExitFlag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function _environmentCheck()\n {\n if ( php_sapi_name() != \"cli\" )\n {\n die(\"ArrowWorker hint : only run in command line mode\".PHP_EOL);\n }\n\n if ( !function_exists('pcntl_signal_dispatch') )\n {\n declare(ticks = 10);\n }\n\n if ( !function_exists('pcntl_signal') )\n {\n die('ArrowWorker hint : php environment do not support pcntl_signal'.PHP_EOL);\n }\n\n if ( function_exists('gc_enable') )\n {\n gc_enable();\n }\n\n }", "public function __construct(Zend_Application_Bootstrap_BootstrapAbstract $bootstrap)\n {\n if (!extension_loaded('gearman')) {\n throw new RuntimeException('The PECL::gearman extension is required.');\n }\n $this->_bootstrap = $bootstrap;\n $this->_worker = $this->_bootstrap->bootstrap('gearmanworker')\n ->getResource('gearmanworker');\n if (empty($this->_registerFunction)) {\n throw new InvalidArgumentException(get_class($this) . ' must implement a registerFunction');\n }\n // allow for a small memory gap:\n $memoryLimit = ($this->_memory + 128) * 1024 * 1024;\n ini_set('memory_limit', $memoryLimit);\n $this->_worker->addFunction($this->_registerFunction, array(&$this, 'work'));\n $this->_worker->setTimeout($this->_timeout);\n $this->init();\n\n $check = 10;\n $c = 0;\n while (@$this->_worker->work() || $this->_worker->returnCode() == GEARMAN_TIMEOUT) {\n $c++;\n\n if ($this->_worker->returnCode() == GEARMAN_TIMEOUT) {\n $this->timeout();\n continue;\n }\n\n if ($this->_worker->returnCode() != GEARMAN_SUCCESS) {\n $this->setError($this->_worker->returnCode() . ': ' . $this->_worker->getErrno() . ': ' . $this->_worker->error());\n break;\n }\n\n if (($c % $check === 0) && $this->isMemoryOverflow()) {\n break; // we've consumed our memory and the worker needs to be restarted\n }\n\n }\n\n $this->shutdown();\n }", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "public function needsExecution() {}", "public function run()\n {\n /* this particular object won't run */\n }", "public function cancellationRequested() : bool;", "public function isStopped();", "protected function _tick() \n\t{\n\t\t// Core maintenance processes, such as retrying failed messages.\n\t\tforeach ( $this->heldMessages as $key => $hm ) \n\t\t{\n\t\t\t$found = false;\n\n\t\t\tforeach ( $this->users as $currentUser ) \n\t\t\t{\n\t\t\t\tif ( $hm['user']->socket == $currentUser->socket ) \n\t\t\t\t{\n\t\t\t\t\t$found = true;\n\n\t\t\t\t\tif ( $currentUser->handshake ) \n\t\t\t\t\t{\n\t\t\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t\t\t\t$this->send($currentUser, $hm['message']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$found ) \n\t\t\t{\n\t\t\t\t// If they're no longer in the list of connected users, drop the message.\n\t\t\t\tunset($this->heldMessages[$key]);\n\t\t\t}\n\t\t}\n\t}", "public function testJobTerminate()\n {\n\n }", "abstract function shutdown();", "public function startWorking(){\r\n }", "protected function runningFromCliOrWrongConfiguration() {}", "public function __construct()\n {\n parent::__construct();\n $this->worker = new \\GearmanWorker();\n $this->worker->addServer();\n $this->worker->addFunction(env('QUEUE_SEMANTIC'), sprintf('\\\\%s::%s', __CLASS__, 'start'));\n }", "function stopDownloadToPool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\t\t$this->addInfoMessage($I18N_downloadAborted);\n\n\t\tSERVER_deleteFile($this->getPoolDir().'/lock');\n\n\t\tSERVER_killBackgroundJob('downloadPoolPackages');\n\t}", "function edd_pup_is_ajax_restart( $emailid = null ) {\n\n\tif ( empty( $emailid ) ) {\n\t\treturn;\n\t}\n\n\t$queue = edd_pup_check_queue( $emailid );\n\n\tif ( $queue['queue'] > 0 ) {\n\t\treturn $queue;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function handle()\n {\n Artisan::call('queue:retry all');\n Log::info(__('Running failed jobs'));\n }", "protected function shutdown()\n {\n }", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "public function main()\n {\n $workers = $this->getWorkers();\n $deadWorkers = [];\n $aliveWorkers = [];\n\n foreach($workers as $worker) {\n $isAlive = CremillaWorker::isAlive($worker->pid);\n if(!$isAlive) {\n $deadWorkers[] = $worker;\n }else{\n $aliveWorkers[] = $worker->id;\n }\n }\n\n if(!empty($aliveWorkers)) {\n $event = new Event('Cremilla.Worker.alive', $this, [\n 'data' => [\n 'aliveWorkers' => $aliveWorkers\n ]\n ]);\n $this->dispatchEvent($event);\n }\n\n if(!empty($deadWorkers)) {\n if($this->shouldNotifyWorkersDead(count($aliveWorkers))) {\n $event = new Event('Cremilla.Worker.dead', $this, [\n 'data' => [\n 'deadWorkers' => $deadWorkers\n ]\n ]);\n $this->dispatchEvent($event);\n }\n }\n }", "public function executeOnShutdown();", "function abort() \n {\n return $this->instance->abort();\n }" ]
[ "0.63283414", "0.62497145", "0.6187386", "0.58987856", "0.5823127", "0.5809223", "0.5743171", "0.56973636", "0.5689473", "0.56821793", "0.5492178", "0.5454132", "0.54520893", "0.54484385", "0.5381954", "0.53758806", "0.53637993", "0.5336607", "0.5336099", "0.53348863", "0.52863634", "0.5279856", "0.52634925", "0.52568424", "0.525559", "0.525077", "0.5229018", "0.5228736", "0.5225528", "0.52185607", "0.51990026", "0.51977384", "0.5192566", "0.5181445", "0.5177202", "0.51718277", "0.5162724", "0.51524633", "0.51508933", "0.5149528", "0.51374626", "0.5134896", "0.51291865", "0.5128243", "0.5114598", "0.510757", "0.5107372", "0.51017076", "0.51005566", "0.50991243", "0.5094658", "0.5092236", "0.5089364", "0.5084845", "0.5083799", "0.5081701", "0.5074182", "0.50617313", "0.5059649", "0.50551903", "0.504208", "0.5041264", "0.5039181", "0.5039181", "0.5039181", "0.5039181", "0.5039181", "0.5029869", "0.50291", "0.5025108", "0.50201285", "0.50196195", "0.50178766", "0.5015909", "0.49991518", "0.4995088", "0.4995088", "0.49950105", "0.49950105", "0.49950105", "0.49900457", "0.4989959", "0.49854222", "0.49832648", "0.4975864", "0.49718192", "0.49714437", "0.49658415", "0.49638525", "0.49514842", "0.49507353", "0.49417818", "0.49407494", "0.49382952", "0.49382952", "0.49382952", "0.49382952", "0.49357906", "0.49294117", "0.49233618" ]
0.6922119
0
use kill command to stop process it is unsafe and particularly dangerous for running gearman worker
public function gearmanWorkerStop() { for($i = 0; $i < $this->_gearmanForkCount; $i++){ $this->sub_process_keys[] = $i+1; } foreach ($this->sub_process_keys as $_sub_key) { $shell_cmd = "ps aux | grep ".$this->_workerFileName. " |"; $shell_cmd .= "grep -v 'grep' | awk '{print $2}' |"; $sub_process_name = $this->_workerFileName."_".$_sub_key; $pid_file = $this->_lockDir.$this->_workerFileName."_".$_sub_key.".pid"; $pid_cmd = "cat $pid_file"; $pid = exec($pid_cmd); $shell_cmd .= " grep $pid"; echo $shell_cmd."\n"; //查看进程是不是存在 $ps_res = exec($shell_cmd); if (empty($ps_res)) { echo "process $sub_process_name is not running!\n"; } else { $kill_cmd = "kill $pid"; exec($kill_cmd); $this->killed_sub_process_keys[] = $_sub_key; echo "process $sub_process_name is stopped\n"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function kill();", "private function serveStop()\n {\n foreach ($this->pid as $pid) {\n $command = \"kill -9 {$pid} > /dev/null 2> /dev/null &\";\n @exec($command, $output);\n }\n }", "public function kill(): void;", "function kill_Process()\n {\n $this->set_kill_Command();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }", "public function stop()\n {\n if (OS::isWin()) {\n $cmd = \"taskkill /pid {$this->pid} -t -f\";\n } else {\n $cmd = \"kill -9 {$this->pid}\";\n }\n shell_exec($cmd);\n }", "function killProcess(string $id) : void\n {\n shell_exec(\"kill $id\");\n }", "function killProcess($pid)\n{\n $mapper = systemToolkit::getInstance()->getMapper('process', 'process');\n $process = $mapper->searchOneByField('pid', $pid);\n if($process) {\n $mapper->delete($process);\n }\n}", "public function stop() {\n try {\n $pid = $this->getPidFile()->read();\n\n Logger::log(\"Killing THIS PID: \" . $pid, \\Zend_Log::WARN);\n posix_kill($pid, SIGTERM);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n $this->_exit();\n }", "public function killCommand()\n {\n $this->registry->set(Registry::DAEMON_KILL_KEY, time());\n $this->outputLine('Broadcast kill signal');\n }", "private function stop_ATD()\n\t{\n\t\texecuteCommand('killall run-lowmem.sh', '', $result, $return_status);\n\t}", "function stdapi_sys_process_kill($req, &$pkt) {\n # that isn't enabled by default, but better to try it and avoid shelling\n # out when unnecessary.\n my_print(\"doing kill\");\n $pid_tlv = packet_get_tlv($req, TLV_TYPE_PID);\n $pid = $pid_tlv['value'];\n if (is_callable('posix_kill')) {\n $ret = posix_kill($pid, 9);\n $ret = $ret ? ERROR_SUCCESS : posix_get_last_error();\n if ($ret != ERROR_SUCCESS) {\n my_print(posix_strerror($ret));\n }\n } else {\n $ret = ERROR_FAILURE;\n if (is_windows()) {\n my_cmd(\"taskkill /f /pid $pid\");\n # Don't know how to check for success yet, so just assume it worked\n $ret = ERROR_SUCCESS;\n } else {\n if (\"foo\" == my_cmd(\"kill -9 $pid && echo foo\")) {\n $ret = ERROR_SUCCESS;\n }\n }\n }\n return $ret;\n}", "public static function killProcesses() {\n foreach(self::$__pIds as $pid => $active) {\n if(self::$__infoKill) {\n echo sprintf(self::$__infoKill, date('r'), $pid) . PHP_EOL;\n }\n exec('kill ' . $pid);\n unset(self::$__pIds[$pid]);\n };\n }", "public function killChild()\n\t{\n\t\tif (!$this->child) {\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'No child to kill.');\n\t\t\treturn;\n\t\t}\n\n\t\t$context = array('child' => $this->child);\n\t\t$this->logger->log(LogLevel::INFO, 'Killing child at {child}', $context);\n\t\tif (exec('ps -o pid,s -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'Child {child} found, killing.', $context);\n\t\t\tposix_kill($this->child, SIGKILL);\n\t\t\t$this->child = null;\n\t\t} else {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::INFO, 'Child {child} not found, restarting.', $context);\n\t\t\t$this->shutdown();\n\t\t}\n\t}", "public function stop() {\n\t\tLogger::getRootLogger ()->info ( \"Stopping IPsec\" );\n\t\t$pid = file_exists ( self::PID_PATH ) ? Functions::shellCommand ( \"pgrep -F \" . self::PID_PATH ) : 0;\n\t\tif ($pid > 0) {\n\t\t\tFunctions::shellCommand ( \"/bin/kill {$pid}\" );\n\t\t}\n\t}", "protected function killProcess(): void\n {\n if (($pid = $this->getAttribute('pid')) === null) {\n return;\n }\n\n if ($this->systemCommands()->isProcessRunning($pid)) {\n $this->systemCommands()->killProcess($pid);\n }\n }", "public function stop() {\n\t\t$this->invoke(\"stop\");\n\t}", "protected abstract function killFree();", "protected function stop()\n {\n $pidFile = $this->getPidFile();\n\n if(!is_file($pidFile)){\n echo \"PID file not present, so service is not started\\n\";\n exit;\n }\n if(!is_writable($pidFile)){\n echo \"Insufficient permissions. Please execute as service like 'sudo service anyterm start'\";\n exit;\n }\n\n shell_exec('kill `cat /var/run/anyterm.pid`');\n unlink($pidFile);\n }", "public function gracefulStop(){\n $this->handleWorkerOutput('warn', \"Work done, exiting now.\");\n $this->stop();\n }", "public function terminate();", "public function kill()\n {\n $this->log(\"Killing process {$this->pid}\");\n $command = \"kill {$this->pid}\";\n exec($command, $output);\n\n if ($this->processIsRunning()) {\n $this->log(\"Process {$this->pid} cannot die!\");\n return false;\n }\n\n $this->log(\"Process {$this->pid} is dead.\");\n return true;\n }", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop();", "public function stop() {}", "public function stop() {\n $cmd = sprintf(\"./control.sh stop %s -game %s\", $this->sid, $this->gameId);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 0 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }", "public function stop()\n {\n die;\n }", "function killbyname($procname) {\n\treturn mwexec(\"/bin/killall \" . escapeshellarg($procname));\n}", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "public function handle()\r\n {\r\n try {\r\n $this->call(\"swooliy:stop\");\r\n\r\n sleep(2);\r\n \r\n $this->call(\"swooliy:start\");\r\n } catch (Throwable $e) {\r\n die($e);\r\n }\r\n }", "public function killJob($args){\n \\Queue::killJob($args[0]);\n }", "public function kill_process($pid)\n {\n\n if (!is_numeric($pid)) return false;\n $pid = (int)$pid;\n $sql = \"KILL $pid\";\n\n return $this->db->query($sql);\n }", "public function stop() {\n\t\t// Setup\n\t\t$options = array(\n\t\t\t'appName' => 'cakedaemon',\n\t\t\t'logLocation' => TMP . \"logs\" . DS . 'cakedaemon.log'\n\t\t);\n\n\t\tSystem_Daemon::setOptions($options);\n\t\tSystem_Daemon::stopRunning();\n\t}", "public function killWithoutQueue()\n {\n $processList = $this->getProcessList(\"| grep -v 'queue'\");\n $this->killAll($processList);\n }", "public function terminate(Process $process);", "public function kill($force = false){\n\t\tif(!$this->_pid) return (bool) false;\n\n\t\t$command = 'kill ';\n\t\tif($force) $command .= '9 ';\n\t\t$command .= $this->_pid;\n\t\texec($command);\n\n\t\tif(!$this->isAlive()) $this->writeState(self::STATE_CANCELED);\n\n\t\treturn $this->isAlive();\n\t}", "private function stopServer() {\n\t\t$this->socketSend('shutdown');\n\t\tforeach($this->pipes as $pipe) {\n\t\t\tfclose($pipe);\n\t\t}\n\t\tproc_close($this->server);\n\t}", "public function stopProcess() {\n // Do not change the status of an idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_STOPPING))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }", "abstract public function stop();", "public function killProcess($pid)\n {\n return posix_kill($pid, SIGKILL);\n }", "function kill($error) {\n echo $error.\"<br /><br />\";\n die();\n }", "function stop()\n{\n global $ipfsutils, $avahi_type, $avahi_port, $staticFile, $urlpath;\n\n // Stop the daemon\n $cmd = $ipfsutils.\" stop \";\n $cmd_res = execute_program($cmd);\n\n // Un-announce the IPFS instance to the community cloud via any of the\n // available methods -including IPFS itself, if enabled-\n $unpub_res = avahi_unpublish($avahi_type, $avahi_port);\n\n $flash_content = txt(t('ipfs_flash_stopping')) . ptxt($cmd_res['output'][0]);\n $flash_content .= txt(t('ipfs_flash_unpublish')) . ptxt($unpub_res);\n\n setFlash($flash_content);\n return(array('type'=>'redirect','url'=>$staticFile.$urlpath));\n}", "public function terminate()\n {\n $this->logger->debug(MessageFormatter::receivedTerminateSignal('Supervisor'));\n\n foreach ($this->consumerProcesses as $processGroup) {\n $processGroup->sendStopSignal();\n }\n\n foreach ($this->consumerProcesses as $processGroup) {\n $processGroup->stopCompletely();\n }\n\n die();\n }", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function Kill( $message = '' )\r\n\t{\r\n\t\tif( strlen( $message ) > 0 )\r\n\t\t{\r\n\t\t\texit( $message );\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\texit( $this->Error() );\r\n\t\t}\r\n\t}", "protected function stopTask() {}", "public function kill()\n {\n $this->option('-k');\n return $this;\n }", "public function stopProcess($pid, $grace = 5)\n { $log = usingLog()->startAction(\"stop process '{$pid}' on host '{$this->args[0]}'\");\n\n // is the process running at all?\n if (!fromHost($this->args[0])->getPidIsRunning($pid)) {\n $log->endAction(\"process is not running\");\n return;\n }\n\n // yes it is, so stop it\n // send a TERM signal to the screen session\n $log->addStep(\"send SIGTERM to process '{$pid}'\", function() use ($pid) {\n if ($this->getIsLocalhost()) {\n posix_kill($pid, SIGTERM);\n }\n else {\n usingHost($this->args[0])->runCommand(\"kill {$pid}\");\n }\n });\n\n // has this worked?\n $isStopped = $log->addStep(\"wait for process to terminate\", function() use($pid, $grace, $log) {\n for($i = 0; $i < $grace; $i++) {\n if (!fromHost($this->args[0])->getPidIsRunning($pid)) {\n return true;\n }\n\n // process still exists\n sleep(1);\n }\n\n return false;\n });\n\n // did the process stop?\n if ($isStopped) {\n $log->endAction();\n return;\n }\n\n $log->addStep(\"send SIGKILL to process '{$pid}'\", function() use($pid) {\n if ($this->getIsLocalhost()) {\n posix_kill($pid, SIGKILL);\n }\n else {\n usingHost($this->args[0])->runCommand(\"kill -9 {$pid}\");\n }\n sleep(1);\n });\n\n // success?\n if (fromHost($this->args[0])->getProcessIsRunning($pid)) {\n $log->endAction(\"process is still running :(\");\n throw new E5xx_ActionFailed(__METHOD__);\n }\n\n // all done\n $log->endAction(\"process has finished\");\n }", "public function Terminate ();", "public function handle()\n {\n $this->info('socket service is shutting down...');\n echo shell_exec('sudo ps -ef | grep \\'socket start\\' | grep -v grep | awk \\'{ print $2 }\\' | sudo xargs kill -9');\n }", "function sigkillbyname($procname, $sig) {\n\treturn mwexec(\"/bin/killall -{$sig} \" . escapeshellarg($procname));\n}", "public function stop()\n {\n // nop\n }", "function VM_stopVMCommandFile($vmName)\n{\n\t$cmd.=\"; rm \\\"/m23/vms/runningVMs/$vmName.run\\\"\";\n}", "public function shutdown();", "public function shutdown();", "public function stop(): bool\n {\n return $this->processRunner->stop();\n }", "public function kill()\n {\n session_regenerate_id();\n $_SESSION[CCID] = array(); // session_unset();\n session_destroy();\n }", "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 die(\"{$this->config['process_name']} has not process\".PHP_EOL);\n }\n\n exec(\"kill -USR1 \" . implode(' ', $pid), $output, $return);\n\n if ($return === false) {\n die(\"{$this->config['process_name']} reload fail\".PHP_EOL);\n }\n echo \"{$this->config['process_name']} reload success\".PHP_EOL;\n }", "public function testStopProcess()\n {\n $command = new SchedulerCommands('unittest');\n\n $exec = $this->getFunctionMock('Martin1982\\LiveBroadcastBundle\\Broadcaster\\Linux', 'exec');\n $exec->expects($this->once())->willReturnCallback(\n function ($command) {\n self::assertEquals('kill 1337', $command);\n }\n );\n\n $command->stopProcess(1337);\n }", "public function stop()\n {\n }", "public function stop()\n {\n\n }", "public function shutdown ()\n {\n $this->_signalAllWorkers(SIGKILL);\n \n $this->_logger->info('Exiting...');\n $this->_shutdown = true;\n \n exit(1);\n }", "public function stop()\n {\n }", "public function JStop() {}", "function stop();", "protected function killProcessById(Server $server, $pid)\n\t{\n\t\tposix_kill($pid, SIGKILL);\n\t\tif ($server->getVerboseExit())\n\t\t{\n\t\t\techo sprintf(\"Terminating server %d\\n\", $pid);\n\t\t}\n\t}", "public function stop()\r\n {\r\n\r\n }", "public function stop( $args, $assoc_args ) {\n\t\t$this->site_docker_compose_execute( $args[0], 'stop', $args, $assoc_args);\n\t}", "function stopDownloadToPool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\t\t$this->addInfoMessage($I18N_downloadAborted);\n\n\t\tSERVER_deleteFile($this->getPoolDir().'/lock');\n\n\t\tSERVER_killBackgroundJob('downloadPoolPackages');\n\t}", "function cleanup($sig = '?') {\n global $g_pidfile;\n if ($g_pidfile) {\n Filesystem::remove($g_pidfile);\n $g_pidfile = null;\n }\n\n global $g_future;\n if ($g_future) {\n $g_future->resolveKill();\n $g_future = null;\n }\n\n exit(1);\n}", "public function shutdown() {\n\t\t$this->stop();\n\t}", "public function halt();", "function deactivate_ipc(){\n\t\t\n\t\t}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function shutdown() {}", "public function kill( $threadId );", "public function unregisterIPC($id);", "public function stopEngine(int $code = 0, string $reason = \"\");", "function fsl_session_kill($name){\n unset($_SESSION[''.$name.'']);\n unset($_SESSION[''.$name.'_timeout']);\n session_destroy();\n return true;\n}", "public static function stopPhantomDriver()\n {\n if (static::$phantomProcess) {\n static::$phantomProcess->stop();\n }\n }", "function killbypid($pidfile) {\n\tsigkillbypid($pidfile, \"TERM\");\n\tunlink_if_exists($pidfile);\n}", "public function unregisterWorker()\n\t{\n\t\tif (is_object($this->currentJob)) {\n\t\t\t$this->currentJob->fail(new DirtyExitException());\n\t\t}\n\n\t\t$id = (string)$this;\n\t\tResque::redis()->srem('workers', $id);\n\t\tResque::redis()->del('worker:' . $id);\n\t\tResque::redis()->del('worker:' . $id . ':started');\n\t\tStat::clear('processed:' . $id);\n\t\tStat::clear('failed:' . $id);\n\t}", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "public function stop(): bool {}", "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 }", "public function noKill()\n {\n $this->option('--nokill');\n return $this;\n }", "protected function stopped()\n {\n $this->redis->zrem(Queue::redisKey($this->queue, 'running'), $this->payload);\n\n Stats::decr('running', 1);\n Stats::decr('running', 1, Queue::redisKey($this->queue, 'stats'));\n }", "public function handle()\n {\n// echo 'Shutdown...';\n }" ]
[ "0.780975", "0.7335286", "0.72063285", "0.7094114", "0.7086525", "0.70338255", "0.6961979", "0.6866553", "0.6847355", "0.67614466", "0.66687155", "0.6592907", "0.6512263", "0.6483066", "0.6429606", "0.6396682", "0.63490456", "0.6286256", "0.62840074", "0.6283107", "0.6277343", "0.62764525", "0.62764525", "0.62764525", "0.62764525", "0.62764525", "0.62764525", "0.62764525", "0.62764525", "0.62553215", "0.6248004", "0.6229279", "0.6210344", "0.619005", "0.6171383", "0.6168404", "0.6142335", "0.6141891", "0.6134061", "0.60864806", "0.606204", "0.6025498", "0.6018085", "0.5993814", "0.5984131", "0.5951886", "0.5943531", "0.59251577", "0.58856916", "0.58856916", "0.58856916", "0.58856916", "0.58856916", "0.5882288", "0.5881562", "0.58059627", "0.58020645", "0.5786736", "0.57826066", "0.5770095", "0.5764979", "0.5764038", "0.5762554", "0.5762554", "0.5744244", "0.574296", "0.57335997", "0.5728373", "0.57103133", "0.56955296", "0.56811047", "0.5677397", "0.5667465", "0.56660175", "0.5654272", "0.56404984", "0.5631592", "0.5629497", "0.56243813", "0.56095207", "0.5606634", "0.5595783", "0.55789757", "0.55789757", "0.55789757", "0.55789757", "0.55789757", "0.5567449", "0.5552761", "0.5550814", "0.55469733", "0.55434763", "0.55380213", "0.5536373", "0.55302894", "0.55164033", "0.551323", "0.55061865", "0.55007416", "0.548629" ]
0.7410336
1
Set name of the quickie sender
public function setAuthor($author) { $this->author = $author; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setGiftcardSenderName($value);", "function setFromName($to_set=\"noreply\"){\n\t\t\t$this->from_name = $to_set;\n\t\t}", "public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }", "public function setSenderName($value)\n {\n return $this->set(self::_SENDER_NAME, $value);\n }", "public function setSender($sender);", "public function setSender($sender ){\n $this->sender = $sender;\n }", "public function setName($name){\n $this->__set('name',$name);\n }", "public function setName($name){\n $this->_name = $name;\n }", "public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }", "public function setSender($sender) {\n $this->_sender = $sender;\n }", "public function setName($name) {\n\t\t$this->_name = (string)$name;\n\t}", "public function setName()\n {\n }", "public function setName($name) {\n\t\t$this->_name = $name;\n\t}", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n {\n $this->_name = $name;\n }", "function set_name($name) {\n $this->name = $name;\n }", "function change_sender() {\n\t\treturn \"[email protected]\";\n\n\t}", "public function setName($x) { $this->name = $x; }", "public function setName($name){\n \n $this->name = $name;\n \n }", "public function getAttributeName(): string\n {\n return 'Sender';\n }", "function setName($value) {\n $this->name = $value;\n }", "function setName($name) {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->_name = (string)$name;\n }", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name) {\r\n\t\t$this->name = $name;\r\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName()\n {\n $this->_role->name = '伊泽瑞尔';\n }", "function setName($name){\n\t\t$this->name=$name;\n\t}", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function getSenderName()\n {\n return $this->get(self::_SENDER_NAME);\n }", "function setName($value) {\n $this->name = $value;\n }", "public function setAutoResponderFromName($value) { $this->_autoResponderFromName = $value; }", "public function setName($x) {\n $this->name = $x;\n }", "public function setName( string $name ) {\n\t\t$this->name = $name;\n\t}", "function setSender($from){\n $this->From = $from;\n }", "public function setName($name) \n {\n $this->name = $name;\n }", "private function setName($name) {\n if (is_string($name)) {\n $this->name = $name;\n }\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "public function setName( $name ) {\n\t\t$this->mName = $name;\n\t}", "public function setGiftcardRecipientName($value);", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {}", "public function setName($name) {}", "public function setEmailFromName($value) { $this->_emailFromName = $value; }", "public function setName($name)\r\n {\r\n $this->name = $name;\r\n }", "function set_email_name( $name )\n\t{\n\t\tif( $donate_name = DN_Settings::instance()->email->get( 'from_name' ) )\n\t\t{\n\t\t\treturn sanitize_title( $donate_name );\n\t\t}\n\t\treturn $name;\n\t}", "public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}", "function setName();", "public function setName($name) {\n\t}", "public function setName($name)\n {\n $this->name = $name;\n\n \n }", "function setName( $value )\n {\n $this->Name = $value;\n }", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);" ]
[ "0.6843585", "0.6722104", "0.66989005", "0.6677015", "0.6552855", "0.6506503", "0.6403242", "0.63776344", "0.63082284", "0.6297223", "0.62731904", "0.6246282", "0.6241106", "0.6200633", "0.619566", "0.619566", "0.6164848", "0.6159936", "0.6144231", "0.6125021", "0.6122529", "0.6121749", "0.61105025", "0.6099191", "0.60898155", "0.6084289", "0.6084289", "0.60838455", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.6077833", "0.60775363", "0.60761136", "0.60761136", "0.60761136", "0.60761136", "0.60669684", "0.6044182", "0.60399103", "0.6034481", "0.6019875", "0.60007364", "0.5999412", "0.5992217", "0.5991516", "0.59876424", "0.59876424", "0.59876424", "0.59876424", "0.59876424", "0.59840536", "0.5980288", "0.597198", "0.597198", "0.597198", "0.597198", "0.597198", "0.597198", "0.5957809", "0.5957809", "0.59547836", "0.59491247", "0.5935311", "0.59308976", "0.59280396", "0.5927329", "0.59243727", "0.5920254", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315" ]
0.0
-1
Set name of the quickie sender
public function getAuthor() { return $this->author; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setGiftcardSenderName($value);", "function setFromName($to_set=\"noreply\"){\n\t\t\t$this->from_name = $to_set;\n\t\t}", "public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }", "public function setSenderName($value)\n {\n return $this->set(self::_SENDER_NAME, $value);\n }", "public function setSender($sender);", "public function setSender($sender ){\n $this->sender = $sender;\n }", "public function setName($name){\n $this->__set('name',$name);\n }", "public function setName($name){\n $this->_name = $name;\n }", "public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }", "public function setSender($sender) {\n $this->_sender = $sender;\n }", "public function setName($name) {\n\t\t$this->_name = (string)$name;\n\t}", "public function setName()\n {\n }", "public function setName($name) {\n\t\t$this->_name = $name;\n\t}", "public function setName($name) \n {\n $this->_name = $name; \n }", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name){\n\t\t$this->name = $name;\n\t}", "public function setName($name)\n {\n $this->_name = $name;\n }", "function set_name($name) {\n $this->name = $name;\n }", "function change_sender() {\n\t\treturn \"[email protected]\";\n\n\t}", "public function setName($x) { $this->name = $x; }", "public function setName($name){\n \n $this->name = $name;\n \n }", "public function getAttributeName(): string\n {\n return 'Sender';\n }", "function setName($value) {\n $this->name = $value;\n }", "function setName($name) {\n $this->name = $name;\n }", "public function setName($name)\n {\n $this->_name = (string)$name;\n }", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name)\n\t{\n\t\t$this->_name = $name;\n\t}", "public function setName($name) {\r\n\t\t$this->name = $name;\r\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName($name) {\n\t\t$this->name = $name;\n\t}", "public function setName()\n {\n $this->_role->name = '伊泽瑞尔';\n }", "function setName($name){\n\t\t$this->name=$name;\n\t}", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name)\n {\n $this->_name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function getSenderName()\n {\n return $this->get(self::_SENDER_NAME);\n }", "function setName($value) {\n $this->name = $value;\n }", "public function setAutoResponderFromName($value) { $this->_autoResponderFromName = $value; }", "public function setName($x) {\n $this->name = $x;\n }", "public function setName( string $name ) {\n\t\t$this->name = $name;\n\t}", "function setSender($from){\n $this->From = $from;\n }", "public function setName($name) \n {\n $this->name = $name;\n }", "private function setName($name) {\n if (is_string($name)) {\n $this->name = $name;\n }\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "public function setName( $name ) {\n\t\t$this->mName = $name;\n\t}", "public function setGiftcardRecipientName($value);", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {\n $this->name = $name;\n }", "public function setName($name) {}", "public function setName($name) {}", "public function setEmailFromName($value) { $this->_emailFromName = $value; }", "public function setName($name)\r\n {\r\n $this->name = $name;\r\n }", "function set_email_name( $name )\n\t{\n\t\tif( $donate_name = DN_Settings::instance()->email->get( 'from_name' ) )\n\t\t{\n\t\t\treturn sanitize_title( $donate_name );\n\t\t}\n\t\treturn $name;\n\t}", "public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}", "function setName();", "public function setName($name) {\n\t}", "public function setName($name)\n {\n $this->name = $name;\n\n \n }", "function setName( $value )\n {\n $this->Name = $value;\n }", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);" ]
[ "0.6843585", "0.6722104", "0.66989005", "0.6677015", "0.6552855", "0.6506503", "0.6403242", "0.63776344", "0.63082284", "0.6297223", "0.62731904", "0.6246282", "0.6241106", "0.6200633", "0.619566", "0.619566", "0.6164848", "0.6159936", "0.6144231", "0.6125021", "0.6122529", "0.6121749", "0.61105025", "0.6099191", "0.60898155", "0.6084289", "0.6084289", "0.60838455", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.60801655", "0.6077833", "0.60775363", "0.60761136", "0.60761136", "0.60761136", "0.60761136", "0.60669684", "0.6044182", "0.60399103", "0.6034481", "0.6019875", "0.60007364", "0.5999412", "0.5992217", "0.5991516", "0.59876424", "0.59876424", "0.59876424", "0.59876424", "0.59876424", "0.59840536", "0.5980288", "0.597198", "0.597198", "0.597198", "0.597198", "0.597198", "0.597198", "0.5957809", "0.5957809", "0.59547836", "0.59491247", "0.5935311", "0.59308976", "0.59280396", "0.5927329", "0.59243727", "0.5920254", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315", "0.5912315" ]
0.0
-1
Load the needed libraries.
public function __construct() { parent::__construct(); $this->load->model('Players'); $this->load->model('Leagues'); $this->load->helper('form'); //RESTRICTED TO LOGGED IN MEMBERS ONLY //Just in case not logged in we direct to login page if ($this->session->userdata('logged_in')) { $this->team_id = $this->session->team_id; $this->league_id=$this->Teams->get_team_league_id($this->team_id); $this->current_year = $this->Leagues->get_current_season($this->league_id); $this->current_week = $this->Leagues->get_current_week($this->league_id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadLibraries(){\n\t\trequire_once('uf-store.acf.functions.php');\n\t\trequire_once('uf-store.ajax.functions.php');\n\t\trequire_once('uf-store.shortcode.functions.php');\n\n\t\t//UFStore\n\t\trequire_once('uf-store.cart.class.php');\n\t\trequire_once('uf-store.shipping.class.php');\n\t\trequire_once('uf-store.shipping.usps.class.php');\n\t\trequire_once('uf-store.checkout.class.php');\n\n\t\tUFStoreCart::setupCart();\n\t\t// $ufstore = UFStore::instance();\n\t\t// $ufstore->shoppingCart = new UFStoreCart();\n\t}", "private function load_libraries() {\n\n\t\t\t// Load the update checker library.\n\t\t\trequire_once ASCRIPTA_ENGINE_LIBRARIES_PATH . 'class-update-check.php';\n\n\t\t}", "public function loadLibraries(){\n // twig\n require_once LIBRARY_PATH.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Autoloader.php';\n Twig_Autoloader::register();\n \n }", "public function load()\n\t\t{\n\t\t\t$data = array('config', 'form', 'generator', 'db', 'url', 'text', 'frontend', 'crypt', 'security', 'cache', 'img', \n\t\t\t\t'math', 'cookie', 'export');\n\n\t\t\tforeach($data as $library)\n\t\t\t{\n\t\t\t\t$library_path = SYSPATH . 'libraries/' . ucfirst($library) . '.php';\n\t\t\t\tif( file_exists($library_path) )\n\t\t\t\t\tinclude $library_path;\n\t\t\t\telse\n\t\t\t\t\texit('I can not find <b>' . $library . '</b> library at <b>' . $library_path . '</b>');\n\t\t\t}\n\t\t}", "private function loadLib(){\n foreach($this->lib as $key=>$lib){\n $this->$key = RO::lib($lib);\n }\n }", "private function load_dependencies() {\n\n\t\t//For CHAOS lib\n\t\tset_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ .\"/lib/chaos-client/src/\");\n\t\trequire(\"CaseSensitiveAutoload.php\");\n\t\tspl_autoload_extensions(\".php\");\n\t\tspl_autoload_register(\"CaseSensitiveAutoload\");\n\n\t\trequire(\"wpportalclient.php\");\n\t\trequire(\"wpchaosobject.php\");\n\t\trequire(\"widgets/chaoswidget.php\");\n\t\trequire(\"widgets/attribute.php\");\n\t\trequire(\"widgets/multiattribute.php\");\n\t}", "private static function loadLibs(){\n $file = Storange::getBaseWowPath().'wow/lib/readbeans/rb.php';\n if(file_exists($file)){\n include_once $file;\n }\n }", "protected function RequireLibs()\n {\n\n }", "protected function load_libraries_for_additional_tests() {\n global $CFG;\n\n require_once($CFG->dirroot.'/elis/program/lib/setup.php');\n require_once(elispm::lib('data/userset.class.php'));\n require_once(elispm::lib('data/user.class.php'));\n require_once(elispm::lib('data/usermoodle.class.php'));\n require_once(elispm::lib('data/userset.class.php'));\n }", "public function loadLibraries($var = array())\n {\n $this->load->library($var);\n }", "function loadTagLibraries()\r\n\t{\r\n\t\t$this->libraries->processTlds($this->ctxt);\r\n\t}", "private function load_dependencies()\n\t{\n\t\t$dependencies = [\n\t\t\t'Routing',\n\t\t\t'Loader',\n\t\t\t'Base',\n\t\t];\n\n\t\tforeach($dependencies as $file)\n\t\t{\n\t\t\trequire_once plugin_dir_path(__FILE__) . $file . '.php';\n\t\t}\n\t}", "private function load_dependencies() {\n /**\n * \"BEHIND THE SCENCE\" CLASSES\n * Note: usually the admin and public do not directly use them, they are\n * necessary for the plugin (eg. i18n)\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-i18n.php';\n\n /* ADMIN */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-api.php';\n\n /* PUBLIC */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-public.php';\n }", "private function loadLib() {\r\n $this->load->library( 'javascript' );\r\n\r\n $this->load->helper( 'url' );\r\n $this->load->helper( 'html' );\r\n }", "protected function loadDependencies()\n {\n // See: https://github.com/concrete5/concrete5-5.7.0/issues/360\n $filesystem = new Filesystem();\n $filesystem->getRequire(__DIR__ . '/vendor/autoload.php');\n }", "private function load_dependencies() {\n //require_once( $this->inc . 'class-best-faq-admin.php' );\n require_once( $this->inc . 'best-faq-shortcode.php' );\n }", "private function load_dependencies() {\n\t\t/**\n\t\t * Admin related fucntions.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-admin.php';\n\n\t\t/**\n\t\t * Frontend related fucntions.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-uncode-toolkit-privacy-public.php';\n\t}", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n spl_autoload_register(array('AutoLoader', 'autoloadPhpdocx'));\n spl_autoload_register(array('AutoLoader', 'autoloadLog4php'));\n spl_autoload_register(array('AutoLoader', 'autoloadZetaComponents'));\n spl_autoload_register(array('AutoLoader', 'autoloadTcpdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadPdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadDompdf'));\n spl_autoload_register(array('AutoLoader', 'autoloadMht'));\n }", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core theme.\n\t\t */\n\t\trequire_once 'class-custom-theme-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public area.\n\t\t */\n\t\trequire_once 'public/class-theme-public.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once 'admin/class-theme-admin.php';\n\n\n\t\t$this->loader = new Wpt_Custom_Theme_Loader();\n\n\t}", "private function load_dependencies() {\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-ttr66-loader.php';\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-ttr66-admin.php';\n\t\t$this->loader = new TTR66_Loader();\n\t}", "public function setUp() {\n $this->libraryLoader= \\lang\\ClassLoader::registerLoader(new \\lang\\archive\\ArchiveClassLoader(new Archive(\\lang\\XPClass::forName(\\xp::nameOf(__CLASS__))\n ->getPackage()\n ->getPackage('lib')\n ->getResourceAsStream('three-and-four.xar')\n )));\n }", "private function load_dependencies() {\n\n\t\t$this->loader = new Service_Tracker_Loader();\n\n\t}", "private function dc_load_dependencies() {\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'includes/dc_class_loader_dorancafe.php';\n\t\t// admin class and functions\n\t\trequire_once DORANCAFE_PATH . 'admin/dc_class_admin_dorancafe.php';\n\t\t// public class and functions\n\t\trequire_once DORANCAFE_PATH . 'public/dc_class_public_dorancafe.php';\n\n\t\t$this->loader = new Dorancafe_Loader();\n\t}", "private function load_dependencies() {\n\t\t// Load the views file.\n\t\trequire_once( dirname( __FILE__ ) . '/views-user-profile.php' );\n\n\t}", "public static function load() {\n self::initialLoad();\n self::vendor();\n self::loadLibs();\n //registra o SLP AUTO LOAD\n spl_autoload_register(array('\\wow\\Loader','autLoad'));\n }", "private function load_dependencies() {\n\n\t\t$this->loader = new Loader();\n\t\t$TSB_hooks_loader = new Init_Functions();\n\t\t$this->loader->add_action( 'init', $TSB_hooks_loader, 'app_output_buffer' );\n\n//\t\t$this->loader->add_action( 'init', \t$TSB_hooks_loader, 'remove_admin_bar' );\n\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'includes/class-facebook-stats-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'includes/class-facebook-stats-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'admin/class-facebook-stats-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path(dirname(__FILE__)).'public/class-facebook-stats-public.php';\n\n\t\t$this->loader = new Facebook_Stats_Loader();\n\n\t}", "private function load_dependencies()\n {\n /**\n * The class responsible for orchestrating the actions and filters of\n * the core plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) .\n 'includes/class-myfossil-resources-loader.php';\n\n /**\n * The class responsible for defining internationalization\n * functionality of the plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) .\n 'includes/class-myfossil-resources-i18n.php';\n\n /**\n * The class responsible for defining all actions that occur in the\n * Dashboard.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) .\n 'admin/class-myfossil-resources-admin.php';\n\n /**\n * The class responsible for defining all actions that occur in the\n * public-facing side of the site.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) .\n 'public/class-myfossil-resources-public.php';\n\n $this->loader = new myFOSSIL_Resources_Loader();\n\n }", "private function load_dependencies() {\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-online-magazine-manager-admin.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-online-magazine-manager-public.php';\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-online-magazine-theme-functions.php';\n\n require_once plugin_dir_path( __FILE__ ) . 'class-online-magazine-loader.php';\n $this->loader = new Online_Magazine_Loader();\n\n // like wpdb we make an instance of Online_Magazine_Manager_Public to make interface available to the users\n global $ommp;\n $ommp = new Online_Magazine_Manager_Public($this->version);\n\n }", "function import_libraries(){\n\t//require_once('xajax/xajax_core/xajax.inc.php');\n\t//require_once('ajax/ajax_functions.php');\n}", "public static function load()\n\t{\n\t\tforeach ( func_get_args() as $library )\n\t\t{\n\t\t\t$name = self::$path . strtolower($library) . '.php';\n\t\t\tif ( ! file_exists($name) )\n\t\t\t{\n\t\t\t\tthrow new LibraryNotFoundException($library);\n\t\t\t}\n\t\t\t\n\t\t\tif ( class_exists($library) )\n\t\t\t{\n\t\t\t\tthrow new LibraryAlreadyExistsException($library);\n\t\t\t}\n\t\t\t\n\t\t\trequire($name);\n\t\t}\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-soisy-pagamento-rateale-loader.php';\n\n /**\n * The class responsible for defining internationalization functionality\n * of the plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-soisy-pagamento-rateale-i18n.php';\n /**\n * The class responsible for defining settings\n * of the plugin.\n */\n require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-soisy-pagamento-rateale-gateway-settings.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-soisy-pagamento-rateale-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-soisy-pagamento-rateale-public.php';\n\t\t\n\t\t\n\t\t$this->loader = new Soisy_Pagamento_Rateale_Loader();\n\n\t}", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "public function init_component_loaders () {\n\t\t$this->load_active_components( 'bundled' );\n\t\t$this->load_active_components( 'downloadable' );\n\t}", "protected function loadLibraries(){\n \n $javascripts = array();\n \n // jQuery\n $javascripts['jquery'] = '//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'; \n\n // Crockford's JSON library (used by backbone)\n $javascripts['json2'] = '/sfAltumoPlugin/js/altumo/vendor/douglascrockford/json2.js';\n \n foreach( $javascripts as $javascript ){\n \n \\sfContext::getInstance()->getResponse()->addJavaScript( $javascript, 'first' );\n \n }\n\n\n return $this;\n\n }", "private function load_dependencies() {\n\t\t// Public.\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-api.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-assets.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-blocks.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-collection.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-manager.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-post-type.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-settings.php' );\n\t\trequire_once( WPRMPRC_DIR . 'includes/public/class-wprmprc-shortcode.php' );\n\n\t\t// Admin.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( WPRMPRC_DIR . 'includes/admin/class-wprmprc-manage.php' );\n\t\t}\n\t}", "private function load_dependencies() {\n\n\t\t/**\n\t\t * The class responsible for contants\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'lib/class-aps-constants.php';\n\n\t\t/**\n\t\t * The class responsible for orchestrating the actions and filters of the\n\t\t * core plugin.\n\t\t */\n\t\t/* The class responsible to load all libraries */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining internationalization functionality\n\t\t * of the plugin.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-i18n.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the admin area.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-aps-admin.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the public-facing\n\t\t * side of the site.\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-aps-public.php';\n\n\t\t/**\n\t\t * The class responsible for loading config fields\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-fields-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all actions that occur in the aps gateway\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-gateway-loader.php';\n\n\t\t/**\n\t\t * The class responsible for defining all ajax actions that occur in the aps gateway\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-ajax.php';\n\n\t\t/**\n\t\t * This class is responsible to all common woocommerce hooks\n\t\t */\n\t\trequire_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-aps-wc-hooks.php';\n\n\t\t$this->loader = new APS_Loader();\n\n\t}", "function loadDependencies() {\n if (strpos(TERMINUS_ROOT, 'phar:') === 0) {\n require TERMINUS_ROOT . '/vendor/autoload.php';\n return;\n }\n\n $has_autoload = false;\n\n foreach (getVendorPaths() as $vendor_path) {\n if (file_exists($vendor_path . '/autoload.php')) {\n require $vendor_path . '/autoload.php';\n $has_autoload = true;\n break;\n }\n }\n\n if (!$has_autoload) {\n fputs(STDERR, \"Internal error: Can't find Composer autoloader.\\n\");\n exit(3);\n }\n}", "private function load_dependencies()\n {\n global $wp_queue;\n\n if (empty($wp_queue)) {\n $wp_queue = new WP_Queue();\n }\n\n // fire up the loader\n $this->loader = new MailChimp_WooCommerce_Loader();\n\n // change up the queue to use the new rest api version\n $service = new MailChimp_WooCommerce_Rest_Api();\n $this->loader->add_action( 'rest_api_init', $service, 'register_routes');\n }", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "protected function _loader(){\n\t\t/*\n\t\t* \n\t\t* Load all the Model to use database\n\t\t* Load all the library\n\t\t*\n\t\t*/\n\t\t$this->load->model('post');\n\t\t$this->load->model('user');\n\t\t$this->load->library('form_validation');\n\t}", "public function loadDependencies(array $paths);", "public static function chainload() {\n require_once self::BASE_PATH . \"/vendor/autoload.php\";\n foreach (scandir(dirname(__FILE__)) as $filename) {\n $path = dirname(__FILE__) . \"/\" . $filename;\n if (is_file($path) && substr_compare($path, \".php\", strlen($path) - strlen(\".php\"), strlen(\".php\")) === 0) {\n require_once $path;\n }\n }\n }", "private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }", "private function _load_library($library='', $instantiate='')\n\t{\t\n\t\tif ($library == 'channel_data')\n\t\t{\n\t\t\t// load channel data library\n\t\t\t$this->EE->load->library('channel_data_lib');\n\t\t}\n\n\t\telse if ($library == 'api')\n\t\t{\n\t\t\t// load native EE API library\n\t\t\t$this->EE->load->library('api');\n\n\t\t\t// instantiate API\n\t\t\t$this->EE->api->instantiate($instantiate);\n\n\t\t\t// load stats library\n\t\t\t$this->EE->load->library('stats');\n\t\t}\n\t}", "protected function loadCoreClasses() {\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'View.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php';\r\n require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php';\r\n }", "public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}", "protected function loadExternalPackages(): void\n {\n $this->setProviders();\n }", "public function loadModules();", "protected function _loadFramework()\n {\n include 'Exception.php';\n include 'Coverage.php';\n include 'Result.php';\n include 'Result/Error.php';\n include 'Result/Failure.php';\n include 'Result/Success.php';\n include 'TestCase.php';\n include 'Tracker.php';\n }", "private function IncludeLibraries()\n {\n foreach ($this->libraries_files as $library_folder => $library_files) {\n foreach ($library_files as $library_file) {\n $path = \"Lib/\" . $library_folder . \"/\" . $library_file . \".php\";\n if (file_exists($path))\n include $path;\n else\n throw new Exception(\"There is no a file named '{$path}'.\", 404);\n }\n }\n }", "function _assign_libraries()\r\n\t{\r\n\t\tif ($CI =& get_instance())\r\n\t\t{\r\n\t\t\t// Load CodeIgniters form validation if not already loaded\r\n\t\t\tif ( ! isset($CI->form_validation))\r\n\t\t\t{\r\n\t\t\t\t$CI->load->library('form_validation');\r\n\t\t\t}\r\n\r\n\t\t\t$this->form_validation = $CI->form_validation;\r\n\t\t\t$this->lang = $CI->lang;\r\n\t\t\t$this->load = $CI->load;\r\n\t\t\t$this->db = $CI->db;\r\n\t\t\t$this->config = $CI->config;\r\n\t\t}\r\n\t}", "public function load($library, $agrs = array()) {\n if(empty($this->{$library})) {\n $class = ucfirst($library) . '_Library';\n require_once(PATH_SYSTEM . '/library/' . $class . '.php');\n $this->{$library} = new $class($agrs);\n }\n }", "function require_dependencies() {\n global $CFG;\n\n //needed to define CURMAN_DIRLOCATION\n require_once($CFG->dirroot . '/curriculum/config.php');\n\n //needed for constants that define db tables\n require_once($CFG->dirroot.'/curriculum/lib/cmclass.class.php');\n\n //make sure we have access to the context library\n require_once($CFG->dirroot.'/curriculum/lib/contexts.php');\n }", "private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}", "protected function _initDependencies()\n {\n // Loading jsonp library for cross-domain AJAX requests\n $this->view->headScript()->appendFile('/scripts/jquery/plugins/jsonp/jquery.jsonp-2.4.0.min.js?' .\n SCRIPT_VERSION_JS);\n// $this->view->headScript()->appendFile('/scripts/libraries/content/plugins/jqueryForm/jquery.form.js');\n }", "private function load_services() {\n\t\tforeach ( $this->get_services() as $service_classname ) {\n\t\t\t$this->load_service( $service_classname );\n\t\t}\n\t}", "function _initialize()\n {\n\n //initalize Loader\n $auto_load=array(\"io\",\"segment\",\"router\");\n \n foreach($auto_load as $library)\n {\n $this->$library=& load_class($library);\n }\n //load loader class\n $this->load =& load_class('Loader');\n \n //call auto load from config file\n $this->load->_auto_load();\n }", "function loadlibrary() {\n\t\twp_enqueue_style( 'normalize', get_template_directory_uri() . '/css/normalize.css' );\n\t\twp_enqueue_style( 'theme', get_stylesheet_uri() );\n\t\twp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css' );\n\t}", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "function loadLibraryFiles(array $fileNames){\n foreach($fileNames as $fileName){\n $libraryPath = $this->libraryBasePath . $fileName . $this->suffix;\n if(file_exists($libraryPath)){\n require $libraryPath;\n }\n }\n }", "static function _shfw_autoloader()\n {\n\t\tinclude_once(BASEPATH.'config'.DIRECTORY_SEPARATOR.'autoload.php');\n\n\t\tif ( ! isset($autoload))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Autoload helpers.\n\t\tforeach ($autoload['helper'] as $type)\n\t\t{\t\t\t\n\t\t\tself::loadHelper($type);\n\t\t}\n\n\t\t// Autoload core components.\n\t\tforeach ($autoload['core'] as $type)\n\t\t{\t\t\t\n\t\t\tself::initCoreComponent($type);\n\t\t}\n\n\t\t/*\n\t\tif(SHIN_Core::$_benchmark){\n\t\t\tSHIN_Core::$_benchmark->mark('code_start');\n\t\t}\n\t\t*/\n\t\t\n\t\t// Autoload libraries.\n\t\tforeach ($autoload['libraries'] as $type)\n\t\t{\n\t\t\tself::loadLibrary($type, TRUE);\n\t\t}\n\n\t\t// Autoload models.\n\t\tforeach ($autoload['models'] as $type)\n\t\t{\n\t\t\tself::loadModel($type, TRUE);\n\t\t}\n\t}", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "protected function loadBundles()\n {\n /**\n * @var $bundle BundleInterface\n */\n foreach (static::$bundles as $bundle) {\n $bundle->init($this);\n }\n }", "function __load_libraries($className)\n{\n $filename = str_replace('\\\\', '/', $className . '.php');\n require_once $filename;\n}", "protected function getLibs($libs)\n {\n $pathLibs = RAIZ . 'lbs' . DS . 'classes' . DS . $libs . '.php';\n\n if (is_readable($pathLibs)) {\n require_once $pathLibs;\n } else {\n throw new Exception('ERRO ao carregar a livraria, LIBS');\n }\n }", "function rum_class_loader() {\n $loader = new UniversalClassLoader();\n $loader->registerNamespace('Rum', __DIR__ . '/lib');\n $loader->register();\n}", "protected function getLibraries(): array\n {\n return [];\n }", "private function dld_load_dependencies()\n {\n require_once plugin_dir_path(__FILE__) . '../woocommerce-delivery-schedular/admin/settings-data.php';\n require_once plugin_dir_path(__FILE__) . 'class-custom-delivery-date-admin-settings.php';\n }", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "private function libraryLoader( $className ) {\r\n\t\t// $className = trim( str_replace(\"_\", \"/\", $className), \"/\" );\r\n\t\t@include_once CORE_LIBRARY . $className . '.php';\r\n\t\t\r\n }", "function omega_extension_scripts_attach_libraries(&$variables) {\n $registry = theme_get_registry();\n\n // Check if there are any enabled libraries.\n foreach ($registry['html']['libraries'] as $library => $info) {\n drupal_process_attached(array('#attached' => $info['attached']));\n\n if (!empty($info['callbacks'])) {\n foreach ($info['callbacks'] as $callback) {\n $callback($library, $info['settings']);\n }\n }\n }\n}", "function loadPlugins() {\n // @todo make this more efficient\n $plugin_dirs = $this->listDir(MWG_BASE . '/plugins/');\n foreach($plugin_dirs as $ptypes) {\n $this->loadPluginGroup($ptypes);\n } \n }", "public function load_framework() {\n\t\t\t$latest_version = max( array_keys( self::$data ) );\n\t\t\t$info = ( isset( self::$data[ $latest_version ] ) ) ? self::$data[ $latest_version ] : [];\n\n\t\t\tif ( empty( $info ) ) {\n\t\t\t\twp_die( __( 'Unable To Load WPOnion Framework. Please Contact The Author', 'wponion' ) . '<p style=\"word-break: break-all;\"> <strong>' . __( 'ERROR ID : ', 'wponion' ) . '</strong>' . base64_encode( wp_json_encode( self::$data ) ) . '</p>' );\n\t\t\t}\n\n\t\t\tif ( ! version_compare( PHP_VERSION, '5.6', '>=' ) ) {\n\t\t\t\t// translators: 1. Added PHP Version\n\t\t\t\twp_die( sprintf( __( 'WPOnion incompatible with PHP Version %2$s. Please Install/Upgrade PHP To %1$s or Higher ', 'wponion' ), '<strong>5.6</strong>', '<code>' . PHP_VERSION . '</code>' ) );\n\t\t\t}\n\n\t\t\tself::$_loaded = array(\n\t\t\t\t'path' => $info,\n\t\t\t\t'version' => $latest_version,\n\t\t\t);\n\t\t\trequire $info . 'wponion-init.php';\n\t\t}", "protected function _initAutoloader()\n {\n $loader = new StandardAutoloader();\n $loader->registerNamespace('Doctrine', PROJECT_PATH.'/library/Doctrine')\n ->registerNamespace('App', PROJECT_PATH.'/library/App')\n ->registerNamespace('Domain', PROJECT_PATH.'/library/Domain')\n ->registerNamespace('Gedmo', PROJECT_PATH.'/library/Doctrine/Extension/Gedmo');\n $loader->register();\n }", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "static function loadFiles()\r\n\t{\r\n\t\t//required files\r\n\t\t\r\n\t\t//load bibliotek\r\n\t\t$paths = array(rp_self.\"lib/\");\r\n\t\t$to_header = array();\r\n\t\tforeach($paths as $path)\r\n\t\t{\r\n\t\t\t$scan = scandir($path);\r\n\t\t\tforeach($scan as $file)\r\n\t\t\t{\r\n\t\t\t\tif(is_file($path.$file))\r\n\t\t\t\t{\r\n\t\t\t\t\t$ext = explode(\".\", $file);\r\n\t\t\t\t\t$ext = $ext[1];\r\n\t\t\t\t\tif($ext == \"php\")\r\n\t\t\t\t\t\trequire_once($path.$file);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//tilføj script tag til header hvis det er javascript\r\n\t\t\t\t\tif($ext == 'js')\r\n\t\t\t\t\t\t$to_header[] = '<script type=\"text/javascript\" src=\"'.$path.$file.'\"></script>';\r\n\t\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\treturn implode('', $to_header);\r\n\t}", "protected function _initLibrairie(){\n\t\t$autoloader = Zend_Loader_Autoloader::getInstance();\r\n\t\t$autoloader->registerNamespace('Application_');\r\n\t}", "function membership_stripe_load_dependencies() {\r\n\t\tinclude_once 'includes/class-ms-gateway-stripecheckout.php';\r\n\t\tinclude_once 'includes/class-ms-gateway-stripecheckout-api.php';\r\n\t\tinclude_once 'includes/view/class-ms-gateway-stripecheckout-view-button.php';\r\n\t\tinclude_once 'includes/view/class-ms-gateway-stripecheckout-view-settings.php';\r\n\t}", "protected function _initAutoload () {\n\t\t// configure new autoloader\n\t\t$autoloader = new Zend_Application_Module_Autoloader (array ('namespace' => 'Admin', 'basePath' => APPLICATION_PATH.\"/modules/admin\"));\n\n\t\t// autoload validators definition\n\t\t$autoloader->addResourceType ('Validate', 'validators', 'Validate_');\n\t}", "public static function regist() {\n $appLibray = APP_ROOT.\"/library\";\n $paths = explode(PATH_SEPARATOR,get_include_path());\n if(!in_array($appLibray, $paths)) {\n set_include_path(get_include_path().PATH_SEPARATOR.$appLibray);\n }\n\n spl_autoload_register(array(__CLASS__, \"autoload\"));\n\n return true;\n }", "public function getLibraries()\n {\n return $this->libraries;\n }", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "public static function initModuleLoading(){\n\n\t}", "public static function load_extra_classes() {\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-elementor.php';\n\t\tElementor::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-woo.php';\n\t\tWoo::init();\n\n\t\trequire_once TVE_DASH_PATH . '/inc/automator/class-tap-facebook.php';\n\t\tFacebook::init();\n\t}", "public static function getLibrary() {}", "protected function loadHelpers(): void\n {\n $files = glob(__DIR__ . '/../Helpers/*.php');\n foreach ($files as $file) {\n require_once($file);\n }\n }", "public static function autoload()\n {\n if (file_exists(__DIR__ . '/Stringprep/vendor/autoload.php')) {\n require_once __DIR__ . '/Stringprep/vendor/autoload.php';\n } else {\n require_once __DIR__ . '/../../bundle/vendor/autoload.php';\n }\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "public function includeLibs()\n {\n $string = '';\n\n if($this->css_files)\n {\n foreach( $this->css_files as &$css_file )\n {\n $string .= '<link rel=\"stylesheet\" href=\"' . $css_file . '\" type=\"text/css\" />';\n }\n }\n \n if($this->js_files)\n {\n foreach( $this->js_files as &$js_file )\n {\n $string .= PHP_EOL . '<script src=\"' . $js_file . '\" type=\"text/javascript\"></script>';\n }\n }\n $this->tpl->assign(\"libs\", $string . PHP_EOL);\n }", "public function requires() {\n\t\t$this->required_components = apply_filters( 'dln_required_components', array( 'oauth', 'rest', 'phrase' ) );\n\t\t\n\t\t// Loop through required components\n\t\tforeach( $this->required_components as $component ) {\n\t\t\tif ( file_exists( DLN_SKILL_PLUGIN_DIR . '/dln-' . $component . '/dln-' . $component . '-loader.php' ) )\n\t\t\t\tinclude( DLN_SKILL_PLUGIN_DIR . '/dln-' . $component . '/dln-' . $component . '-loader.php' );\n\t\t}\n\t}", "private function autoload_scripts() {\n\t\t\n\t}", "function alternate_tribe_libs_autoloader( $libs_path = '/application/tribe-libs' ) {\n\t$autoload_file = dirname( __DIR__, 2 ) . '/vendor/autoload.php';\n\n\tpreg_match( '#return\\s+(.*?)::getLoader#', file_get_contents( $autoload_file ), $matches );\n\n\tif ( empty( $matches[1] ) ) {\n\t\treturn;\n\t}\n\n\t$loader_class = $matches[1];\n\n\t/** @var ClassLoader $loader */\n\t$loader = $loader_class::getLoader();\n\tforeach ( $loader->getPrefixesPsr4() as $prefix => $paths ) {\n\t\tif ( strpos( $prefix, 'Tribe\\\\Libs' ) === false ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$loader->setPsr4( $prefix, array_map( static function ( $path ) use ( $libs_path ) {\n\t\t\treturn preg_replace( '#^.*tribe-libs/src#', $libs_path . '/src', $path );\n\t\t}, $paths ) );\n\t}\n\t$loader->setPsr4( \"Tribe\\\\Libs\\\\\", $libs_path . '/src' );\n}", "public function buildLibraries($docs = FALSE);", "function gb_load() {\n require_once( 'vendor/autoload.php' );\n \\Carbon_Fields\\Carbon_Fields::boot();\n}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "public static function registerAutoloaders()\n {\n $modules = self::getModsTable();\n unset($modules[0]);\n foreach ($modules as $module) {\n $base = ($module['type'] == self::TYPE_MODULE) ? 'modules' : 'system';\n $path = \"$base/$module[directory]/lib\";\n ZLoader::addAutoloader($module['directory'], $path);\n }\n }", "function lib($Library) {\n\tif (file_exists(PATH.\"htdocs/include/$Library.php\")) {\n\t\trequire_once PATH.\"htdocs/include/$Library.php\";\n\t\treturn;\n\t}\n\tif (file_exists(PATH.\"htdocs/include/functions/$Library.php\")) {\n\t\trequire_once PATH.\"htdocs/include/functions/$Library.php\";\n\t\treturn;\n\t}\n\tthrow new Exception('Could not load library '.$Library);\n}", "function __autoload($class){\nrequire LIBS.$class.\".php\";\n}" ]
[ "0.8041295", "0.7872291", "0.77858925", "0.7691104", "0.76625913", "0.7577121", "0.75461775", "0.7325678", "0.723254", "0.7153171", "0.7029496", "0.7020306", "0.7012841", "0.69977975", "0.6922977", "0.68834114", "0.68030155", "0.667139", "0.66134936", "0.65574205", "0.6551838", "0.6482039", "0.6452004", "0.64420664", "0.64331865", "0.6403733", "0.63968813", "0.63835806", "0.63819766", "0.63776064", "0.63489413", "0.632774", "0.63247305", "0.6305212", "0.63000304", "0.6245584", "0.6169103", "0.6134166", "0.6132592", "0.6129982", "0.61214477", "0.61142415", "0.6099546", "0.60819703", "0.6074863", "0.6060804", "0.60214883", "0.59811974", "0.59783643", "0.59691155", "0.5956844", "0.5946639", "0.594047", "0.5911566", "0.59054416", "0.5900351", "0.5890567", "0.58814496", "0.58720595", "0.58568877", "0.5854625", "0.58495903", "0.5847946", "0.584629", "0.5843792", "0.58376724", "0.5834972", "0.5818038", "0.5806969", "0.5797288", "0.5788948", "0.5786849", "0.5785529", "0.57798636", "0.57405", "0.5725804", "0.57228804", "0.5713272", "0.57125556", "0.5699101", "0.5698044", "0.56746215", "0.5666294", "0.5663845", "0.56628335", "0.56619996", "0.5646789", "0.5643398", "0.56358904", "0.5635005", "0.56326866", "0.56266654", "0.5615376", "0.5608392", "0.5606726", "0.5604734", "0.5603003", "0.55938125", "0.558698", "0.5586314", "0.5583697" ]
0.0
-1
Loads the content for the drafts view:
public function index($year=NULL, $page_content='probowl', $content_data=array()) { //this is loading a view from one of the methods to display on the page //RESTRICTED TO LOGGED IN MEMBERS ONLY //Just in case not logged in we direct to login page if (!$this->session->userdata('logged_in') ) { redirect("/Restricted"); } if(is_NULL($year)) { $year = $this->current_year; } //titles of the pages will be upper cased either Register Login or Update Profile $title = str_replace('_',' ',$page_content); $content_data['title']= ucwords($title); $path = 'team/'.$page_content; $this->load_view($path, $content_data, false, false, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDrafts()\n {\n $mostRecommended = Post::mostRecommended();\n $last = Post::lastPosts()\n ->orderBy('created_at')\n ->where('public', 0)\n ;\n\n $categories = PostCategory::all();\n\n $drafts = Post::where('public', 0)->get();\n\n $last = $last->paginate(4);\n\n return View('blog/index',\n array(\n 'title'=>\"News\",\n 'mostRecommended'=>$mostRecommended,\n 'last'=>$last,\n 'categories' => $categories,\n 'category' => \"Drafts\" , \n 'drafts' => $drafts\n )\n );\n }", "public function drafts()\n {\n $postsQuery = Post::unpublished();\n $posts = $postsQuery->paginate();\n return view('posts.drafts', compact('posts'));\n }", "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "public function createContentAndCopyDraftPage() {}", "public function loadForView();", "public function index()\n {\n //\n $user = auth()->user();\n $drafts = Draft::where(['user_id' => $user->id])->get();\n\n $n = Notification::where([\"user_id\" => auth()->user()->id, \"read\" => \"no\"])->get();\n\n return view(\"drafts.index\", compact(\"drafts\", \"user\", \"n\"));\n }", "private function _getContent() {\r\n $fieldsToLoad = array('id', 'pagetitle', 'longtitle', 'description', 'parent',\r\n 'alias', 'pub_date', 'parent', 'introtext', 'content', 'createdby', 'createdon', 'class_key');\r\n $c = $this->xpdo->newQuery('disBoard');\r\n $c->setClassAlias('Board');\r\n $c->distinct();\r\n $c->select(array(\r\n $this->xpdo->getSelectColumns('disBoard', 'Board', 'Board_', $fieldsToLoad),\r\n $this->xpdo->getSelectColumns('disBoard', 'subBoard', 'subBoard_', $fieldsToLoad),\r\n 'lastpost_pagetitle' => 'Post.pagetitle',\r\n 'lastpost_content' => 'Post.content',\r\n 'lastpost_id' => 'Post.id',\r\n 'lastpost_author' => 'Post.createdby',\r\n 'lastpost_username' => 'User.username',\r\n 'lastpost_display_name' => 'Profile.display_name',\r\n 'lastpost_use_display_name' => 'Profile.use_display_name',\r\n 'lastpost_thread_id' => 'Post.parent',\r\n 'lastpost_parent' => 'c.ancestor', // Setting this to Board to show as last post on it\r\n 'lastpost_class_key' => 'Post.class_key',\r\n 'lastpost_createdon' => 'Post.createdon',\r\n 'subPost_pagetitle' => 'subPost.pagetitle',\r\n 'subPost_content' => 'subPost.content',\r\n 'subPost_id' => 'subPost.id',\r\n 'subPost_author' => 'subPost.createdby',\r\n 'subPost_username' => 'User2.username',\r\n 'subPost_display_name' => 'Profile2.display_name',\r\n 'subPost_use_display_name' => 'Profile2.use_display_name',\r\n 'subPost_thread_id' => 'subPost.parent',\r\n 'subPost_parent' => 'c2.ancestor', // Setting this to Board to show as last subPost on it\r\n 'subPost_class_key' => 'subPost.class_key',\r\n 'subPost_createdon' => 'subPost.createdon'\r\n ));\r\n $c->innerJoin('disClosure', 'c', \"{$this->xpdo->escape('c')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')} \");\r\n $c->leftJoin('disBoard', 'subBoard', \"{$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')}\r\n AND {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('class_key')} = 'disBoard'\");\r\n\r\n $cSub = $this->xpdo->newQuery('disPost');\r\n $cSub->setClassAlias('postPrimary');\r\n $cSub->select(array(\"MAX({$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('id')})\"));\r\n $cSub->leftJoin('disClosure', 'c3', \"{$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('c3')}.{$this->xpdo->escape('descendant')}\");\r\n $cSub->where(array(\r\n \"{$this->xpdo->escape('c3')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('Board')}.{$this->xpdo->escape('id')}\",\r\n \"{$this->xpdo->escape('postPrimary')}.{$this->xpdo->escape('class_key')} = 'disPost'\"));\r\n $cSub->prepare();\r\n\r\n $c->leftJoin('disPost', 'Post', \"{$this->xpdo->escape('Post')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('c')}.{$this->xpdo->escape('descendant')}\r\n AND {$this->xpdo->escape('Post')}.{$this->xpdo->escape('class_key')} = 'disPost'\r\n AND{$this->xpdo->escape('Post')}.{$this->xpdo->escape('id')} = ({$cSub->toSQL()})\");\r\n\r\n $cSub2 = $this->xpdo->newQuery('disPost');\r\n $cSub2->setClassAlias('postSecondary');\r\n $cSub2->select(array(\"MAX({$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('id')})\"));\r\n $cSub2->leftJoin('disClosure', 'c4', \"{$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('c4')}.{$this->xpdo->escape('descendant')}\");\r\n $cSub2->where(array(\r\n \"{$this->xpdo->escape('c4')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('id')}\",\r\n \"{$this->xpdo->escape('postSecondary')}.{$this->xpdo->escape('class_key')} = 'disPost'\"\r\n ));\r\n\r\n $cSub2->prepare();\r\n $c->leftJoin('disClosure', 'c2', \"{$this->xpdo->escape('c2')}.{$this->xpdo->escape('ancestor')} = {$this->xpdo->escape('subBoard')}.{$this->xpdo->escape('id')} \");\r\n $c->leftJoin('disPost', 'subPost', \"{$this->xpdo->escape('subPost')}.{$this->xpdo->escape('parent')} = {$this->xpdo->escape('c2')}.{$this->xpdo->escape('descendant')}\r\n AND {$this->xpdo->escape('subPost')}.{$this->xpdo->escape('class_key')} = 'disPost'\r\n AND subPost.id = ({$cSub2->toSQL()})\");\r\n\r\n $c->leftJoin('disUser', 'User', \"{$this->xpdo->escape('User')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('Post')}.{$this->xpdo->escape('createdby')}\");\r\n $c->leftJoin('disUserProfile', 'Profile', \"{$this->xpdo->escape('Profile')}.{$this->xpdo->escape('internalKey')} = {$this->xpdo->escape('User')}.{$this->xpdo->escape('id')}\");\r\n\r\n $c->leftJoin('disUser', 'User2', \"{$this->xpdo->escape('User2')}.{$this->xpdo->escape('id')} = {$this->xpdo->escape('subPost')}.{$this->xpdo->escape('createdby')}\");\r\n $c->leftJoin('disUserProfile', 'Profile2', \"{$this->xpdo->escape('Profile2')}.{$this->xpdo->escape('internalKey')} = {$this->xpdo->escape('User2')}.{$this->xpdo->escape('id')}\");\r\n\r\n $c->where(array(\r\n 'Board.parent' => $this->id,\r\n 'Board.published' => 1,\r\n 'Board.deleted' => 0,\r\n ));\r\n $c->sortby(\"{$this->xpdo->escape('Board')}.{$this->xpdo->escape('menuindex')}\", 'ASC');\r\n $c->prepare();\r\n $rows = self::_loadRows($this->xpdo, 'disCategory', $c);\r\n $rows = $rows->fetchAll(PDO::FETCH_ASSOC);\r\n if (count($rows) == 0) {\r\n return;\r\n }\r\n $hydrated = array();\r\n\r\n foreach ($rows as $row) {\r\n $hydrated = $this->xpdo->discuss2->hydrateRow($row, $hydrated);\r\n }\r\n $disCategory = $this->xpdo->newObject('disBoard');\r\n foreach ($hydrated as $k => $board) {\r\n if ($board['class_key'] == 'disBoard') {\r\n $disCategory->id = $board['id'];\r\n $disCategory->_policies = array();\r\n if ($disCategory->checkPolicy('load') !== true) {\r\n unset($hydrated[$k]);\r\n }\r\n }\r\n }\r\n reset($hydrated);\r\n\r\n $boards = $this->xpdo->discuss2->createTree($hydrated);\r\n $boards = $this->_treeToView($boards);\r\n $this->xpdo->setPlaceholder('discuss2.content', implode(\"\\n\",$boards));\r\n }", "public function readAll2()\n {\n show_view('views/admin/post/create.php', ['bodyParts' => BodyPart::all()]);\n }", "public function drafts()\n {\n if (is_a($this->drafts, 'Kirby\\Cms\\Pages') === true) {\n return $this->drafts;\n }\n\n $kirby = $this->kirby();\n\n // create the inventory for all drafts\n $inventory = Dir::inventory(\n $this->root() . '/_drafts',\n $kirby->contentExtension(),\n $kirby->contentIgnore(),\n $kirby->multilang()\n );\n\n return $this->drafts = Pages::factory($inventory['children'], $this, true);\n }", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function index()\n {\n $drafts = Draft::latest()->get();\n\n if ($drafts->count() < 1) {\n return response()->json([\n 'data' => [],\n 'status' => 'info',\n 'message' => 'No data found!'\n ], 404);\n }\n\n return response()->json([\n 'data' => $drafts,\n 'status' => 'success',\n 'message' => 'Draft List'\n ], 200);\n }", "public function draftPost()\n {\n \t$posts = Post::where([['status', 0], ['user_id', auth()->id()]])->get();\n \t$countPublicPosts = Post::where([['status', 1], ['user_id', auth()->id()]])->count();\n\n \treturn view('users.posts.draft', compact('posts', 'countPublicPosts'));\n }", "public function drafts()\n {\n $rqsQuery = RequestModel::all();\n\n $rqs = $rqsQuery;\n $id = Auth::user()->id;\n $user = User::where('id', $id)->first();\n if ($user->inRole('admin')) {\n $rqs = $rqsQuery->where('status', '<>', 'Close');\n }\n if ($user->inRole('user')) {\n $rqs = $rqsQuery->where('user_id', Auth::user()->id);\n }\n if ($user->inRole('manager')) {\n $rqs = $rqsQuery->where('manager', $user->name);\n }\n return view('requests.drafts', compact('rqs'));\n }", "public static function drafts()\n {\n return self::where('published', '=', false)->get();\n }", "public function showContent()\r\n {\r\n $this->preparePage();\r\n /**\r\n * @todo do code refactoring\r\n */\r\n if (clsSysCommon::isAjax()) {\r\n $content = $this->getContent();\r\n } else {\r\n $content = $this->getContent();\r\n }\r\n return $content;\r\n }", "public final function get_content()\n {\n }", "public final function get_content()\n {\n }", "public final function get_content()\n {\n }", "public function loadPostAction()\n {\n $id = $this->params()->fromRoute(\"id\");\n $posts = $this->getServiceLocator()->get(\"Application\\Service\\BlogPost\")->fetchAll(null, 'date DESC');\n $model = $posts[$id];\n $view = new \\Zend\\View\\Model\\ViewModel();\n $view->setTerminal(true);\n $view->setVariables(array('body' => $model->getBody(),\n 'nextId' => ($id+1),\n 'id' => $model->getId(),\n 'title' => $model->getTitle()));\n return $view;\n }", "private function getDraftData() {\n return [\n 'title' => $this->title,\n 'content' => $this->content,\n 'author_id' => $this->author_id\n ];\n }", "public static function load()\n {\n P4Cms_PubSub::subscribe('p4cms.content.render.close',\n function($html, $helper)\n {\n $entry = $helper->getEntry();\n\n // if we don't have an entry id or the entry being rendered\n // isn't the default we won't append comments\n if (!$entry->getId()\n || $entry->getId() != $helper->getDefaultEntry()->getId()\n ) {\n return $html;\n }\n\n // let comment view helper take care of the rest.\n $html = $helper->getView()->comments(\n \"content/\" . $entry->getId(),\n (array) $entry->getValue('comments')\n ) . $html;\n\n return $html;\n }\n );\n\n // participate in content editing by providing a subform.\n P4Cms_PubSub::subscribe('p4cms.content.form.subForms',\n function(Content_Form_Content $form)\n {\n return new Comment_Form_Content(\n array(\n 'name' => 'comments',\n 'order' => -10\n )\n );\n }\n );\n\n // provide comment grid (moderate) actions\n P4Cms_PubSub::subscribe('p4cms.comment.grid.actions',\n function($actions)\n {\n $actions->addPages(\n array(\n array(\n 'label' => 'Approve',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickApprove();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowApprove(this);',\n 'order' => '10'\n ),\n array(\n 'label' => 'Reject',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickReject();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowReject(this);',\n 'order' => '20'\n ),\n array(\n 'label' => 'Pend',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickPend();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowPend(this);',\n 'order' => '30'\n ),\n array(\n 'label' => 'Delete',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickDelete();',\n 'order' => '40'\n ),\n array(\n 'label' => '-',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowView(this);',\n 'order' => '50'\n ),\n array(\n 'label' => 'View Content Entry',\n 'onClick' => 'p4cms.comment.grid.Actions.onClickView();',\n 'onShow' => 'p4cms.comment.grid.Actions.onShowView(this);',\n 'order' => '60'\n ),\n )\n );\n }\n );\n\n // provide form to search comments\n P4Cms_PubSub::subscribe('p4cms.comment.grid.form.subForms',\n function(Zend_Form $form)\n {\n return new Ui_Form_GridSearch;\n }\n );\n\n // filter comment list by search term\n P4Cms_PubSub::subscribe('p4cms.comment.grid.populate',\n function(P4Cms_Record_Query $query, Zend_Form $form)\n {\n $values = $form->getValues();\n\n // extract search query.\n $keywords = isset($values['search']['query'])\n ? $values['search']['query']\n : null;\n\n // early exit if no search text.\n if (!$keywords) {\n return;\n }\n\n // add a text search filter to the comment query.\n $filter = new P4Cms_Record_Filter;\n $fields = array('comment', 'user', 'name');\n $filter->addSearch($fields, $keywords);\n $query->addFilter($filter);\n }\n );\n\n // provide form to filter comments by status.\n P4Cms_PubSub::subscribe('p4cms.comment.grid.form.subForms',\n function(Zend_Form $form)\n {\n $form = new P4Cms_Form_SubForm;\n $form->setName('status');\n $form->addElement(\n 'radio',\n 'status',\n array(\n 'label' => 'Status',\n 'multiOptions' => array(\n '' => 'Any State',\n Comment_Model_Comment::STATUS_PENDING => 'Only Pending',\n Comment_Model_Comment::STATUS_APPROVED => 'Only Approved',\n Comment_Model_Comment::STATUS_REJECTED => 'Only Rejected'\n ),\n 'autoApply' => true,\n 'value' => ''\n )\n );\n\n return $form;\n }\n );\n\n // filter comment list by status\n P4Cms_PubSub::subscribe('p4cms.comment.grid.populate',\n function(P4Cms_Record_Query $query, Zend_Form $form)\n {\n $values = $form->getValues();\n\n // extract status filter.\n $status = isset($values['status']['status'])\n ? $values['status']['status']\n : null;\n\n // early exit if no status filter.\n if (!$status) {\n return;\n }\n\n // add a status filter to the comment query.\n $filter = new P4Cms_Record_Filter;\n $filter->add('status', $status);\n $query->addFilter($filter);\n }\n );\n\n // organize comment records when pulling changes.\n P4Cms_PubSub::subscribe(\n 'p4cms.site.branch.pull.groupPaths',\n function($paths, $source, $target, $result)\n {\n $paths->addSubGroup(\n array(\n 'label' => 'Comments',\n 'basePaths' => $target->getId() . '/comments/...',\n 'inheritPaths' => $target->getId() . '/comments/...'\n )\n );\n }\n );\n }", "public static function display( $title = null, $userID = null ) {\n\t\tglobal $wgRequest;\n\n\t\t// Gets draftID\n\t\t$currentDraft = Draft::newFromID( $wgRequest->getIntOrNull( 'draft' ) );\n\t\t// Output HTML for list of drafts\n\t\t$drafts = self::get( $title, $userID );\n\t\tif ( $drafts !== null ) {\n\t\t\t$html = '';\n\t\t\t$context = RequestContext::getMain();\n\t\t\t$user = $context->getUser();\n\t\t\t$lang = $context->getLanguage();\n\t\t\t$editToken = $user->getEditToken();\n\n\t\t\t// Build XML\n\t\t\t$html .= Xml::openElement( 'table',\n\t\t\t\t[\n\t\t\t\t\t'cellpadding' => 5,\n\t\t\t\t\t'cellspacing' => 0,\n\t\t\t\t\t'width' => '100%',\n\t\t\t\t\t'border' => 0,\n\t\t\t\t\t'id' => 'drafts-list-table'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t$html .= Xml::openElement( 'tr' );\n\t\t\t$html .= Xml::element( 'th',\n\t\t\t\t[ 'width' => '75%', 'nowrap' => 'nowrap' ],\n\t\t\t\twfMessage( 'drafts-view-article' )->text()\n\t\t\t);\n\t\t\t$html .= Xml::element( 'th',\n\t\t\t\tnull,\n\t\t\t\twfMessage( 'drafts-view-saved' )->text()\n\t\t\t);\n\t\t\t$html .= Xml::element( 'th' );\n\t\t\t$html .= Xml::closeElement( 'tr' );\n\t\t\t// Add existing drafts for this page and user\n\t\t\t/**\n\t\t\t * @var $draft Draft\n\t\t\t */\n\t\t\tforeach ( $drafts as $draft ) {\n\t\t\t\t// Get article title text\n\t\t\t\t$htmlTitle = htmlspecialchars( $draft->getTitle()->getPrefixedText() );\n\t\t\t\t// Build Article Load link\n\t\t\t\t$urlLoad = $draft->getTitle()->getFullURL(\n\t\t\t\t\t'action=edit&draft=' . urlencode( (string)$draft->getID() )\n\t\t\t\t);\n\t\t\t\t// Build discard link\n\t\t\t\t$urlDiscard = SpecialPage::getTitleFor( 'Drafts' )->getFullURL(\n\t\t\t\t\tsprintf( 'discard=%s&token=%s',\n\t\t\t\t\t\turlencode( (string)$draft->getID() ),\n\t\t\t\t\t\turlencode( $editToken )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t// If in edit mode, return to editor\n\t\t\t\tif (\n\t\t\t\t\t$wgRequest->getRawVal( 'action' ) === 'edit' ||\n\t\t\t\t\t$wgRequest->getRawVal( 'action' ) === 'submit'\n\t\t\t\t) {\n\t\t\t\t\t$urlDiscard .= '&returnto=' . urlencode( 'edit' );\n\t\t\t\t}\n\t\t\t\t// Append section to titles and links\n\t\t\t\tif ( $draft->getSection() !== null ) {\n\t\t\t\t\t// Detect section name\n\t\t\t\t\t$lines = explode( \"\\n\", $draft->getText() );\n\n\t\t\t\t\t// If there is any content in the section\n\t\t\t\t\tif ( count( $lines ) > 0 ) {\n\t\t\t\t\t\t$htmlTitle .= '#' . htmlspecialchars(\n\t\t\t\t\t\t\ttrim( trim( substr( $lines[0], 0, 255 ), '=' ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Modify article link and title\n\t\t\t\t\t$urlLoad .= '&section=' . urlencode( (string)$draft->getSection() );\n\t\t\t\t\t$urlDiscard .= '&section=' .\n\t\t\t\t\t\turlencode( (string)$draft->getSection() );\n\t\t\t\t}\n\t\t\t\t// Build XML\n\t\t\t\t$html .= Xml::openElement( 'tr' );\n\t\t\t\t$html .= Xml::openElement( 'td' );\n\t\t\t\t$html .= Xml::tags( 'a',\n\t\t\t\t\t[\n\t\t\t\t\t\t'href' => $urlLoad,\n\t\t\t\t\t\t'class' => 'mw-draft-load-link',\n\t\t\t\t\t\t'data-draft-id' => $draft->getID(),\n\t\t\t\t\t\t'style' => 'font-weight:' .\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t$currentDraft->getID() == $draft->getID() ?\n\t\t\t\t\t\t\t\t\t'bold' : 'normal'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t],\n\t\t\t\t\t$htmlTitle\n\t\t\t\t);\n\t\t\t\t$html .= Xml::closeElement( 'td' );\n\t\t\t\t$html .= Xml::element( 'td',\n\t\t\t\t\tnull,\n\t\t\t\t\t$lang->getHumanTimestamp( MWTimestamp::getInstance( $draft->getSaveTime() ), null, $user )\n\t\t\t\t);\n\t\t\t\t$html .= Xml::openElement( 'td' );\n\t\t\t\t$html .= Xml::element( 'a',\n\t\t\t\t\t[\n\t\t\t\t\t\t'href' => $urlDiscard,\n\t\t\t\t\t\t'class' => 'mw-discard-draft-link'\n\t\t\t\t\t],\n\t\t\t\t\twfMessage( 'drafts-view-discard' )->text()\n\t\t\t\t);\n\t\t\t\t$html .= Xml::closeElement( 'td' );\n\t\t\t\t$html .= Xml::closeElement( 'tr' );\n\t\t\t}\n\t\t\t$html .= Xml::closeElement( 'table' );\n\t\t\t// Return html\n\t\t\treturn $html;\n\t\t}\n\t\treturn '';\n\t}", "public function actionLoadModalContent(){\r\n\t\t$this->renderPartial(\"_modalContent\");\r\n\t}", "public function readAll()\n {\n show_view('views/admin/bodyparts/readAll.php', ['bodyParts' => BodyPart::all()]);\n }", "function preview($id){\r\n $content = array();\r\n\r\n // get content from database\r\n $result = $this->reg->db->GetRow('SELECT title, content, last_edited, show_title, show_date, advanced, head\r\n FROM system__content\r\n WHERE id = ?', array($id[0], $_SESSION['SYSTEM']['USER_ID']));\r\n // format for screen\r\n if(count($result)){\r\n $content['title'] = $this->reg->validation->escape_rich_text($result['title']);\r\n $content['content'] = $this->reg->validation->escape_rich_text($result['content']);\r\n $content['date'] = date('M j, Y', $this->reg->validation->escape_html(strtotime($result['last_edited'])));\r\n $content['advanced'] = (bool)$result['advanced'];\r\n $content['show_title'] = (bool)$result['show_title'];\r\n $content['show_date'] = (bool)$result['show_date'];\r\n\r\n // include head if post is set as advanced\r\n if($result['advanced']){\r\n $this->reg->config->set('head.', $result['head']);\r\n }\r\n }\r\n\r\n // return final html\r\n return $content;\r\n }", "public function show($id)\n {\n //\n $user = auth()->user();\n $draft = Draft::where([\"id\" => $id])->first();\n $n = Notification::where([\"user_id\" => auth()->user()->id, \"read\" => \"no\"])->get();\n return view(\"drafts.show\", compact(\"draft\", \"user\", \"n\"));\n }", "public function renderContent() {}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function loadContents()\n {\n // 'cover' is a very special content for epub books\n $excludedElements = array('cover', 'toc', 'lot', 'lof');\n\n // strip 'toc' and 'cover' elements before loading book contents\n $contents = array();\n foreach ($this->app->book('contents') as $content) {\n if (!in_array($content['element'], $excludedElements)) {\n $contents[] = $content;\n }\n }\n $this->app->book('contents', $contents);\n\n parent::loadContents();\n }", "public function draftsGet($page_id = '') {\n\t\t$url = $this->draftsUrl($page_id);\n\n\t\t$output = $this->get($url);\n\t\treturn $this->parseOutput($output);\n\t}", "public function getDrafts($value='')\n {\n // get current logged in user\n $uid = \\Auth::user()->id;\n\n // get all the drafts events from this user\n $events = User::find($uid)->events->where('status', '=', 0);\n\n // load the view and pass the events\n return view('admin.events.index')\n ->with('events', $events);\n }", "public function getDrafts()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('drafts');\n }", "public function loadAction()\n {\n $uri = $this->params('uri');\n $review = $this->params('review');\n $caller = $this->params('caller');\n $owner = $this->params('owner');\n $content = Pi::service('comment')->loadContent(array('uri' => $uri, 'review' => $review, 'caller' => $caller, 'owner' => $owner));\n $result = array(\n 'status' => 1,\n 'content' => $content,\n );\n return $result;\n }", "public function viewAction()\n {\n $blogpostId = $this->_registry->args[0];\n $blogpost = new Rwtt_Entity_BlogPost();\n $blogpost->loadById($blogpostId);\n $this->view->title = $blogpost->title;\n $this->view->content = $blogpost->content;\n }", "public function displayContentOverview() {}", "public function show($draft)\n {\n $draft = Draft::find($draft);\n if (! $draft) {\n return response()->json([\n 'data' => null,\n 'status' => 'error',\n 'message' => 'Invalid ID entered'\n ], 422);\n }\n return response()->json([\n 'data' => $draft,\n 'status' => 'success',\n 'message' => 'Document Draft details'\n ], 200);\n }", "public function content($id) {\n return view('webpage.content', [\n \"address\" => Storage::disk('public')->get(\"webpages/{$id}.html\")\n ]);\n }", "public function getImportContent() {\n $this->loadTemplatePart('content-import');\n }", "public function index()\n {\n $articles = Article::latest()->published()->get();\n\n return view('admin.content', compact('articles'));\n }", "private function load()\n\t{\n\t\tglobal $mediaWiki;\n\t\t\n\t\t$title = Title::newFromText( $this->title );\n\t\t \n\t\t// Can't load page if title is invalid.\n\t\tif ($title == null)\n\t\t\treturn;\n\t\t\n\t\t$article = $mediaWiki->articleFromTitle($title);\n\t\t\n\t\t// Also, if article can't be found, bail out.\n\t\tif ($article == null )\n\t\t\treturn;\n\t\t\n\t\t// Let's try fetching the page content.\n\t\t$article->loadContent();\n\t\t\n\t\t// V1.3 security feature.\n\t\t// At this point, the page's restriction\n\t\t// is loaded. Get 'edit' protection state.\n\t\t$state = $title->getRestrictions('edit');\n $this->protectState = false;\n $state = $title->getRestrictions('edit');\n foreach ($state as $index => $group )\n if ( $group == 'sysop' )\n $this->protectState = true;\n\t\t\n\t\tif (! $this->protectState)\n\t\t\treturn; \n\t\t\n\t\t# if no page or an empty one\n\t\tif (!$article->mDataLoaded)\n\t\t\treturn;\n\t\t \n\t\t$this->content = $article->mContent;\n\t\t$this->raw = $article->mContent;\n\t\t\n\t\t// Now, let's analyse the page\n\t\t// to determine things like page type.\n\t\t$this->analyse();\n\t}", "public function all_post() {\n if($this->access_role->is_Admin() == false) show_404();\n \n $this->load->model('All_post_Model');\n $data = $this->All_post_Model->view_post();\n $this->load->view('admin/all_post_content',$data);\n }", "function _setContent()\r\n {\r\n global $_FRONTEND_LANGID;\r\n\r\n $this->_objTpl->addBlockfile('FILEBROWSER_CONTENT', 'fileBrowser_content', 'module_fileBrowser_content.html');\r\n\r\n $ckEditorFuncNum = isset($_GET['CKEditorFuncNum']) ? '&amp;CKEditorFuncNum='.contrexx_raw2xhtml($_GET['CKEditorFuncNum']) : '';\r\n $ckEditor = isset($_GET['CKEditor']) ? '&amp;CKEditor='.contrexx_raw2xhtml($_GET['CKEditor']) : '';\r\n $rowNr = 0;\r\n\r\n switch ($this->_mediaType) {\r\n case 'webpages':\r\n $jd = new \\Cx\\Core\\Json\\JsonData();\r\n $data = $jd->data('node', 'getTree', array('get' => array('recursive' => 'true')));\r\n $pageStack = array();\r\n $ref = 0;\r\n $data['data']['tree'] = array_reverse($data['data']['tree']);\r\n foreach ($data['data']['tree'] as &$entry) {\r\n $entry['attr']['level'] = 0;\r\n array_push($pageStack, $entry);\r\n }\r\n while (count($pageStack)) {\r\n $entry = array_pop($pageStack);\r\n $page = $entry['data'][0];\r\n $arrPage['level'] = $entry['attr']['level'];\r\n $arrPage['node_id'] = $entry['attr']['rel_id'];\r\n $children = $entry['children'];\r\n $children = array_reverse($children);\r\n foreach ($children as &$entry) {\r\n $entry['attr']['level'] = $arrPage['level'] + 1;\r\n array_push($pageStack, $entry);\r\n }\r\n $arrPage['catname'] = $page['title'];\r\n $arrPage['catid'] = $page['attr']['id'];\r\n $arrPage['lang'] = BACKEND_LANG_ID;\r\n $arrPage['protected'] = $page['attr']['protected'];\r\n $arrPage['type'] = \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::TYPE_CONTENT;\r\n $arrPage['alias'] = $page['title'];\r\n $arrPage['frontend_access_id'] = $page['attr']['frontend_access_id'];\r\n $arrPage['backend_access_id'] = $page['attr']['backend_access_id'];\r\n \r\n // JsonNode does not provide those\r\n //$arrPage['level'] = ;\r\n //$arrPage['type'] = ;\r\n //$arrPage['parcat'] = ;\r\n //$arrPage['displaystatus'] = ;\r\n //$arrPage['moduleid'] = ;\r\n //$arrPage['startdate'] = ;\r\n //$arrPage['enddate'] = ;\r\n \r\n // But we can simulate level and type for our purposes: (level above)\r\n $jsondata = json_decode($page['attr']['data-href']);\r\n $path = $jsondata->path;\r\n if (trim($jsondata->module) != '') {\r\n $arrPage['type'] = \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::TYPE_APPLICATION;\r\n $module = explode(' ', $jsondata->module, 2);\r\n $arrPage['modulename'] = $module[0];\r\n if (count($module) > 1) {\r\n $arrPage['cmd'] = $module[1];\r\n }\r\n }\r\n \r\n $url = \"'\" . '[[' . \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::PLACEHOLDER_PREFIX;\r\n \r\n// TODO: This only works for regular application pages. Pages of type fallback that are linked to an application\r\n// will be parsed using their node-id ({NODE_<ID>})\r\n if (($arrPage['type'] == \\Cx\\Core\\ContentManager\\Model\\Entity\\Page::TYPE_APPLICATION) && ($this->_mediaMode !== 'alias')) {\r\n $url .= $arrPage['modulename'];\r\n if (!empty($arrPage['cmd'])) {\r\n $url .= '_' . $arrPage['cmd'];\r\n }\r\n \r\n $url = strtoupper($url);\r\n } else {\r\n $url .= $arrPage['node_id'];\r\n }\r\n \r\n // if language != current language or $alwaysReturnLanguage\r\n if ($this->_frontendLanguageId != $_FRONTEND_LANGID ||\r\n (isset($_GET['alwaysReturnLanguage']) &&\r\n $_GET['alwaysReturnLanguage'] == 'true')) {\r\n $url .= '_' . $this->_frontendLanguageId;\r\n }\r\n $url .= \"]]'\";\r\n \r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_ROW_CLASS' => $rowNr%2 == 0 ? \"row1\" : \"row2\",\r\n 'FILEBROWSER_FILE_PATH_CLICK' => \"javascript:{setUrl($url,null,null,'\".\\FWLanguage::getLanguageCodeById($this->_frontendLanguageId).$path.\"','page')}\",\r\n 'FILEBROWSER_FILE_NAME' => $arrPage['catname'],\r\n 'FILEBROWSER_FILESIZE' => '&nbsp;',\r\n 'FILEBROWSER_FILE_ICON' => $this->_iconPath.'htm.png',\r\n 'FILEBROWSER_FILE_DIMENSION' => '&nbsp;',\r\n 'FILEBROWSER_SPACING_STYLE' => 'style=\"margin-left: '.($arrPage['level'] * 15).'px;\"',\r\n ));\r\n $this->_objTpl->parse('content_files');\r\n \r\n $rowNr++;\r\n }\r\n break;\r\n case 'Media1':\r\n case 'Media2':\r\n case 'Media3':\r\n case 'Media4':\r\n \\Permission::checkAccess(7, 'static'); //Access Media-Archive\r\n \\Permission::checkAccess(38, 'static'); //Edit Media-Files\r\n \\Permission::checkAccess(39, 'static'); //Upload Media-Files\r\n\r\n //Hier soll wirklich kein break stehen! Beabsichtig!\r\n \r\n \r\n default:\r\n if (count($this->_arrDirectories) > 0) {\r\n foreach ($this->_arrDirectories as $arrDirectory) {\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_ROW_CLASS' => $rowNr%2 == 0 ? \"row1\" : \"row2\",\r\n 'FILEBROWSER_FILE_PATH_CLICK' => \"index.php?cmd=FileBrowser&amp;standalone=true&amp;langId={$this->_frontendLanguageId}&amp;type={$this->_mediaType}&amp;path={$arrDirectory['path']}\". $ckEditor . $ckEditorFuncNum,\r\n 'FILEBROWSER_FILE_NAME' => $arrDirectory['name'],\r\n 'FILEBROWSER_FILESIZE' => '&nbsp;',\r\n 'FILEBROWSER_FILE_ICON' => $arrDirectory['icon'],\r\n 'FILEBROWSER_FILE_DIMENSION' => '&nbsp;',\r\n ));\r\n $this->_objTpl->parse('content_files');\r\n $rowNr++;\r\n }\r\n }\r\n \r\n if (count($this->_arrFiles) > 0) {\r\n $arrEscapedPaths = array();\r\n foreach ($this->_arrFiles as $arrFile) {\r\n $arrEscapedPaths[] = contrexx_raw2encodedUrl($arrFile['path']);\r\n $this->_objTpl->setVariable(array(\r\n 'FILEBROWSER_ROW_CLASS' => $rowNr%2 == 0 ? \"row1\" : \"row2\",\r\n 'FILEBROWSER_ROW_STYLE'\t\t\t\t=> in_array($arrFile['name'], $this->highlightedFiles) ? ' style=\"background: '.$this->highlightColor.';\"' : '',\r\n 'FILEBROWSER_FILE_PATH_DBLCLICK' => \"setUrl('\".contrexx_raw2xhtml($arrFile['path']).\"',\".$arrFile['width'].\",\".$arrFile['height'].\",'')\",\r\n 'FILEBROWSER_FILE_PATH_CLICK' => \"javascript:{showPreview(\".(count($arrEscapedPaths)-1).\",\".$arrFile['width'].\",\".$arrFile['height'].\")}\",\r\n 'FILEBROWSER_FILE_NAME' => contrexx_stripslashes($arrFile['name']),\r\n 'FILEBROWSER_FILESIZE' => $arrFile['size'].' KB',\r\n 'FILEBROWSER_FILE_ICON' => $arrFile['icon'],\r\n 'FILEBROWSER_FILE_DIMENSION' => (empty($arrFile['width']) && empty($arrFile['height'])) ? '' : intval($arrFile['width']).'x'.intval($arrFile['height'])\r\n ));\r\n $this->_objTpl->parse('content_files');\r\n $rowNr++;\r\n }\r\n \r\n $this->_objTpl->setVariable('FILEBROWSER_FILES_JS', \"'\".implode(\"','\",$arrEscapedPaths).\"'\");\r\n }\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_IMAGE_PATH', $this->mediaTypePaths[$this->_mediaType][1]);\r\n } else {\r\n $this->_objTpl->setVariable('FILEBROWSER_IMAGE_PATH', ASCMS_CONTENT_IMAGE_WEB_PATH);\r\n }\r\n break;\r\n }\r\n $this->_objTpl->parse('fileBrowser_content');\r\n }", "protected function content() {\r\n\t\t$oClassAtual = get_class($this);\r\n\r\n\t\t$oClassAtual = str_replace('app\\\\controller\\\\', '', $oClassAtual);\r\n\r\n\t\t$oClassAtual = strtolower(str_replace('Controller', '', $oClassAtual));\r\n\r\n\t\trequire_once \"app/view/\".$oClassAtual.\"/\".$this->oView->cPage.\".phtml\";\r\n\t}", "public function deleteContentAndCopyDraftPage() {}", "public function onPagesInitialized()\n {\n // Don't proceed if we are in the admin plugin\n if ($this->isAdmin()) {\n $this->active = false;\n return;\n }\n // Do not act upon empty POST payload or any POST not for this plugin\n $post = $_POST;\n if (!$post || ! isset($post['ce_data_post']) ) {\n return;\n }\n // Preemtively handle review edits ajax call\n if ($post['action'] == 'ceReviewEdits') {\n $output = $this->grav['twig']->processTemplate(\n 'partials/data-manager/content-edit/item.html.twig',\n [ 'itemData' => CompiledYamlFile::instance(DATA_DIR . $this->edits_loc . DS . $post['file'])->content() ]\n );\n } else {\n $pages = $this->grav['pages'];\n $page = $pages->dispatch($post['page'] , true);\n if ($post['language'] && $post['language'] != 'Default' ) {\n $fn = preg_match('/^(.+)\\..+?\\.md$/', $page->name(), $matches);\n if ($fn) {\n $fileP = $page->path() . DS . $matches[1] . '.' . $post['language'] . '.md';\n $route = $page->route();\n $page = new Page();\n $page->init(new \\SplFileInfo($fileP), $post['language'] . '.md');\n }\n }\n switch ($post['action']) {\n case 'ceTransferContent': // Transfer the md for the page\n $hd = $page->header();\n $menuExists = property_exists($hd,'menu') && $hd->menu !== null;\n $output = [ 'data' => $page->rawMarkdown(), 'menu' => $page->menu(), 'menuexists' => $menuExists ];\n break;\n case 'ceSaveContent': // Save markdown content\n $output = $this->saveContent($post, $page);\n break;\n case 'cePreviewContent': // Preview a route\n $r = ( $post['language'] == 'Default' ? '' : $post['language'] ) . $post['page'] ;\n $this->grav->redirect($r);\n break;\n case 'ceFileUpload': // Handle a file (or image) upload\n $output = $this->saveFile($post, $page);\n break;\n case 'ceFileDelete': // Deleting a file or images\n $output = $this->deleteFile($post, $page);\n break;\n default:\n return;\n }\n }\n $this->setHeaders();\n echo json_encode($output);\n exit;\n }", "static function content_listing(){\n\n\t\tif(Indira::get('modules.sections.active') && Indira::get('modules.posts.active') || Indira::get('modules.blog.active')){\n\n\n\t\t\tif(Indira::get('modules.sections.active') && Indira::get('modules.posts.active')){\n\t\t\t\t\n\t\t\t\t$data[\"sections\"] \t= \tSections::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->order_by('order')\n\t\t\t\t\t\t\t\t\t\t->add('id', 'count', 'qty')\n\t\t\t\t\t\t\t\t\t\t->get();\n\n\t\t\t\t$data[\"posts\"] \t\t= \tPosts::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->and_where('published', '=', 'true')\n\t\t\t\t\t\t\t\t\t\t->and_where('access', '<=', Session::get('user.access'))\n\t\t\t\t\t\t\t\t\t\t->group('section', array('order', 'ASC'))\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t\t}\n\n\t\t\tif(Indira::get('modules.blog.active')){\n\n\t\t\t\t$data[\"blogs\"] \t\t= \tBlog::where('lang', '=', Session::get('lang'))\n\t\t\t\t\t\t\t\t\t\t->and_where('published', '=', 'true')\n\t\t\t\t\t\t\t\t\t\t->and_where('access', '<=', Session::get('user.access'))\n\t\t\t\t\t\t\t\t\t\t->order_by('order')\n\t\t\t\t\t\t\t\t\t\t->limit(0, 10)\n\t\t\t\t\t\t\t\t\t\t->get();\n\t\t\t}\n\n\t\t\tif(isset($data[\"sections\"]) && isset($data[\"posts\"]) && $data[\"sections\"] && $data[\"posts\"]){\n\n\t\t\t\t\n\t\t\t\t$data[\"posts_link\"] \t= \tIndira::get('modules.posts.link');\n\t\t\t\t$data[\"sections_link\"] \t= \tIndira::get('modules.sections.link');\n\t\t\t\t$data[\"page\"] \t\t\t= \t'templates::content_listing';\n\n\t\t\t}elseif(isset($data[\"blog\"]) && $data[\"blog\"]){\n\n\t\t\t\t$data[\"blog_link\"] \t\t= \tIndira::get('modules.blog.link');\n\t\t\t\t$data[\"page\"] \t\t\t= \t'templates::content_listing';\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"page\"] = 'templates::assets.no_content';\n\t\t\t}\n\n\t\t\t$data[\"images\"] = Media::get(array('id', 'formats'));\n\n\t\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('templates::main', $data);\n\n\t\t}else{\n\n\t\t\treturn void;\n\t\t}\n\t}", "protected function renderContents()\n {\n // We will keep track of the amount of views being rendered so we can flush\n // the section after the complete rendering operation is done. This will\n // clear out the sections for any separate views that may be rendered.\n $this->factory->incrementRender();\n\n $this->factory->callComposer($this);\n\n $contents = $this->getContents();\n\n // Once we've finished rendering the view, we'll decrement the render count\n // so that each sections get flushed out next time a view is created and\n // no old sections are staying around in the memory of an environment.\n $this->factory->decrementRender();\n\n return $contents;\n }", "public function set_draft_single_action() {\n\t\t\t?>\n\t\t\t<div class=\"wrap\">\n\t\t\t\t<h1>WPGlobus :: <?php esc_html_e( 'Set Draft', 'wpglobus-plus' ); ?></h1>\n\t\t\t\t<hr />\n\t\t\t\t<?php\n\n\t\t\t\t$ok_to_process = true;\n\n\t\t\t\t// Check for required parameters.\n\t\t\t\tif ( empty( $_GET['lang'] ) || empty( $_GET['post_type'] ) ) {\n\t\t\t\t\tesc_html_e( 'URL format', 'wpglobus-plus' );\n\t\t\t\t\techo \": &lang=...&post_type=...\";\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t// Check if language is one of the enabled\n\t\t\t\t$language = $_GET['lang'];\n\t\t\t\tif ( ! WPGlobus_Utils::is_enabled( $language ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Unknown language', 'wpglobus-plus' );\n\t\t\t\t\techo ': ' . esc_html( $language );\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\t$post_type = $_GET['post_type'];\n\n\t\t\t\t/**\n\t\t\t\t * Filter the array of disabled entities on page of module Publish.\n\t\t\t\t *\n\t\t\t\t * @since 1.1.22\n\t\t\t\t * @scope admin\n\t\t\t\t *\n\t\t\t\t * @param array WPGlobus::Config()->disabled_entities Array of disabled entities.\n\t\t\t\t */\n\t\t\t\t$disabled_entities = apply_filters( 'wpglobus_plus_publish_bulk_disabled_entities', WPGlobus::Config()->disabled_entities );\n\n\t\t\t\tif ( in_array( $post_type, $disabled_entities, true ) ) {\n\t\t\t\t\techo '<p>';\n\t\t\t\t\tesc_html_e( 'Disabled post type', 'wpglobus-plus' );\n\t\t\t\t\techo ': <strong>' . esc_html( $post_type ) . '</strong>';\n\t\t\t\t\techo '</p>';\n\n\t\t\t\t\t$ok_to_process = false;\n\t\t\t\t}\n\n\t\t\t\tif ( $ok_to_process ) {\n\n\t\t\t\t\techo '<h2>';\n\t\t\t\t\techo esc_html( sprintf(\n\t\t\t\t\t\t__( 'Setting as \"draft\" all records with post type \"%1$s\" for language \"%2$s\"',\n\t\t\t\t\t\t\t'wpglobus-plus' ),\n\t\t\t\t\t\t$post_type, $language\n\t\t\t\t\t) );\n\t\t\t\t\techo '</h2>';\n\t\t\t\t\techo '<hr/>';\n\n\t\t\t\t\t// Get all posts with the specified type\n\t\t\t\t\t$posts = get_posts( array(\n\t\t\t\t\t\t'numberposts' => - 1,\n\t\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t\t'orderby' => 'ID',\n\t\t\t\t\t\t'order' => 'ASC'\n\t\t\t\t\t) );\n\n\t\t\t\t\t// Loop through the posts\n\t\t\t\t\tforeach ( $posts as $post ) {\n\n\t\t\t\t\t\t$order = array(\n\t\t\t\t\t\t\t'action' \t=> 'set_status',\n\t\t\t\t\t\t\t'post_id' \t=> $post->ID,\n\t\t\t\t\t\t\t'language'\t=> $language,\n\t\t\t\t\t\t\t'status'\t=> 'draft'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$result = $this->set_status( $order );\n\n\t\t\t\t\t\t// Print the post title and link to edit\n\t\t\t\t\t\tprintf(\n\t\t\t\t\t\t\t'<a href=\"%s\">%s</a> : %s : ',\n\t\t\t\t\t\t\tadmin_url( '/post.php?post=' . $post->ID . '&action=edit' ),\n\t\t\t\t\t\t\t$post->ID,\n\t\t\t\t\t\t\tesc_html( apply_filters( 'the_title', $post->post_title ) )\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\techo $result[ 'message' ];\n\n\t\t\t\t\t\techo '<br/>';\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( count( $posts ) === 0 ) {\n\t\t\t\t\t\tesc_html_e( 'No records found.', 'wpglobus-plus' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo '<br/>';\n\t\t\t\t\t\tesc_html_e( 'Done.', 'wpglobus-plus' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->back_button('single-action');\n\t\t\t\t?>\n\t\t\t</div><!-- .wrap -->\t\n\t\t\t<?php\n\t\t}", "public function ajax_get_content() {\n\n\t\t\tif ( ! function_exists( 'jet_engine' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'jet-engine/listing/grid/posts-query-args', array( $this, 'add_query_args' ), 10, 2 );\n\t\t\tadd_filter( 'jet-engine/listing/grid/custom-settings', array( $this, 'add_settings' ), 10, 2 );\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Grid_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/listings/static-widgets/grid.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/components/elementor-views/static-widgets/grid.php' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Calendar_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/calendar.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/widget.php' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tElementor\\Plugin::instance()->frontend->start_excerpt_flag( null );\n\n\t\t\t$widget = new Elementor\\Jet_Listing_Calendar_Widget( array(\n\t\t\t\t'id' => null,\n\t\t\t\t'elType' => 'widget',\n\t\t\t\t'settings' => jet_smart_filters()->query->get_query_settings(),\n\t\t\t\t'elements' => array(),\n\t\t\t\t'widgetType' => 'jet-listing-calendar',\n\t\t\t), array() );\n\n\t\t\t$widget->render_posts();\n\n\t\t}", "public function action_edit()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}", "public function edit($id)\n {\n //\n $user = auth()->user();\n // $draft = Draft::findOrFail($id);\n $draft = Draft::where([\"id\" => $id])->with(\"photo\")->first();\n $post = Post::where([\"id\" => $draft->responding_to])->first();\n $photos = Photo::where([\"user_id\" => $user->id])->get();\n\n return view(\"drafts.edit\", compact(\"draft\", \"post\", \"user\", \"photos\"));\n }", "public function index() {\n\t\t$ids = $this->CmsFrontpage->find('list', array(\n\t\t\t'fields' => array(\n\t\t\t\t$this->modelClass . '.id',\n\t\t\t\t$this->modelClass . '.id'\n\t\t\t)\n\t\t));\n\n\t\t$contents = $this->CmsFrontpage->CmsContent->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'CmsContent.id' => $ids\n\t\t\t),\n\t\t\t'order' => $this->CmsFrontpage->CmsContent->_order\n\t\t));\n\n\t\t$this->set('contents', $contents);\n\t\t$this->render('index', null, App::pluginPath('Cms') . 'views' . DS . 'contents' . DS . 'index.ctp');\n\t}", "public function load() {\n\t\t$this->init();\n\t\t$action = $this->action;\n\t\t$view = $this->$action();\n\n\t\tif ($view instanceof View && !$this->app->isErrorPage()):\n\t\t\t$this->app->view = $view;\n\t\tendif;\n\n\t\t$this->app->view->mergeData($this->data);\n\t\t$this->app->view->validate();\n\t}", "public function index()\n {\n $locales=config('translatable.locales');\n $contents=Content::all();\n // return $contents[0];\n // return $locales;\n return view('admin.content.content',compact('locales','contents'));\n \n }", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function moveContentAndCopyDraftPage() {}", "public function get_content()\n\t\t{\n\t\t\tif (!$this->is_cached()) {\n\t\t\t\t$this->load();\n\t\t\t}\n\n\t\t\treturn $this->content;\n\t\t}", "public function user_posts_draft(Request $request)\n {\n //\n $user = $request->user();\n $posts = Posts::where('author_id',$user->id)->where('active',0)->orderBy('created_at','desc')->paginate(5);\n $title = $user->name;\n return view('home')->withPosts($posts)->withTitle($title);\n }", "public function index()\n {\n return view('admin.page_contents.page_content_list');\n }", "public static function renderContent() {}", "private function renderContent()\n {\n $this->tabs[$this->currentlyActiveTab()]->view()->render();\n }", "static function get_preview( $settings = array() ){\n\t\t\t\t$content = self::get_content($settings);\n\t\t\t\treturn $content;\n\t\t\t}", "function sh_page_content() {\n\tglobal $post, $wp_query;\n\t\n\t// if there's a specific page template, then redirect to this\n\t$action = get_query_var ( 'sh_action' );\n\t$type = get_query_var ( 'sh_post_type' );\n\t\n\tif ($action == 'new') {\n\t\t$template = locate_template (array('edit/'.$type.'.php') );\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t}\n\t\treturn;\n\t} \n\telse if ($action == 'edit') {\n\t\t$template = locate_template ( array (\n\t\t\t\t'edit/' . $post->post_type . '-' . get_query_var ( 'sh_part' ) . '.php',\n\t\t\t\t'edit/' . $post->post_type . '.php' \n\t\t) );\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t}\n\t\treturn;\n\t} \n\telse if ($post) {\n\t\t$template = locate_template ( array (\n\t\t\t\t'content/page-' . $post->post_name . '.php',\n\t\t\t\t'content/' . $post->post_type . '.php' \n\t\t) );\n\t\t\n\t\tif ($template != '') {\n\t\t\tinclude ($template);\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\t// otherwise, show the new post form and feed\n\tsh_post_form ();\n\tsh_topic_loop ();\n}", "public function getPostContent();", "function load_conversation()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_load_conversation_start');\n\n $conversation=$this->get_input_vals();\n\n $data['messages']=$this->message_model->get_conversation_messages($this->user,array('conversation_id'=>$conversation['cid']));\n $data['user']=$this->user;\n\n $message_html=$this->load->view(\"template/node/message_stream\",$data,true);\n\n /* BENCHMARK */ $this->benchmark->mark('func_load_conversation_end');\n\n // success\n exit(json_encode($message_html));\n }", "public function index()\n {\n return view('admin.content.edit', [\n \"socialMedias\" => SocialMedia::all(),\n \"meta\" => Meta::first(),\n \"menus\" => Menu::all(),\n 'categories' => NewsCategory::all(),\n ]);\n }", "public function get_content() {\n global $DB, $OUTPUT, $PAGE;\n if (!is_null($this->content)) {\n return $this->content;\n }\n\n $selected = optional_param('section', null, PARAM_INT);\n $intab = optional_param('dtab', null, PARAM_TEXT);\n\n $this->content = new stdClass();\n $this->content->footer = '';\n $this->content->text = '';\n\n if (empty($this->instance)) {\n return $this->content;\n }\n\n if ($PAGE->pagelayout == 'admin') {\n return $this->content;\n }\n\n $format = course_get_format($this->page->course);\n $course = $format->get_course(); // Needed to have numsections property available.\n\n if (!$format->uses_sections()) {\n if (debugging()) {\n $this->content->text = get_string('notusingsections', 'block_course_modulenavigation');\n }\n return $this->content;\n }\n\n if ($format instanceof format_dynamictabs) {\n // Dont show the menu in a tab.\n if ($intab) {\n return $this->content;\n }\n $sections = $format->tabs_get_sections();\n } else {\n $sections = $format->get_sections();\n }\n\n if (empty($sections)) {\n return $this->content;\n }\n\n $context = context_course::instance($course->id);\n\n $modinfo = get_fast_modinfo($course);\n\n $template = new stdClass();\n\n $completioninfo = new completion_info($course);\n\n if ($completioninfo->is_enabled()) {\n $template->completionon = 'completion';\n }\n\n $completionok = array(COMPLETION_COMPLETE, COMPLETION_COMPLETE_PASS);\n\n $thiscontext = context::instance_by_id($this->page->context->id);\n\n $inactivity = false;\n $myactivityid = 0;\n\n if ($thiscontext->get_level_name() == get_string('activitymodule')) {\n // Uh-oh we are in a activity.\n $inactivity = true;\n if ($cm = $DB->get_record_sql(\"SELECT cm.*, md.name AS modname\n FROM {course_modules} cm\n JOIN {modules} md ON md.id = cm.module\n WHERE cm.id = ?\", array($thiscontext->instanceid))) {\n $myactivityid = $cm->id;\n }\n }\n\n if ($format instanceof format_dynamictabs) {\n $coursesections = $DB->get_records('course_sections', array('course' => $course->id));\n $mysection = 0;\n foreach ($coursesections as $cs) {\n $csmodules = explode(',', $cs->sequence);\n if (in_array($myactivityid, $csmodules)) {\n $mysection = $cs->id;\n }\n }\n if ($mysection) {\n if ($DB->get_records('format_dynamictabs_tabs', array('courseid' => $course->id,\n 'sectionid' => $mysection))) {\n // This is a module inside a tab of the Dynamic tabs course format.\n // Prevent showing of this menu.\n return $this->content;\n }\n }\n }\n\n $template->inactivity = $inactivity;\n\n if (count($sections) > 1) {\n $template->hasprevnext = true;\n $template->hasnext = true;\n $template->hasprev = true;\n }\n\n $courseurl = new moodle_url('/course/view.php', array('id' => $course->id));\n $template->courseurl = $courseurl->out();\n $sectionnums = array();\n foreach ($sections as $section) {\n $sectionnums[] = $section->section;\n }\n $template->arrowpixurl = $OUTPUT->pix_url('arrow-down', 'block_course_modulenavigation');\n foreach ($sections as $section) {\n $i = $section->section;\n if ($i > $course->numsections) {\n break;\n }\n if (!$section->uservisible) {\n continue;\n }\n\n if (!empty($section->name)) {\n $title = format_string($section->name, true, array('context' => $context));\n\n } else {\n $summary = file_rewrite_pluginfile_urls($section->summary, 'pluginfile.php', $context->id, 'course',\n 'section', $section->id);\n $summary = format_text($summary, $section->summaryformat, array('para' => false, 'context' => $context));\n $title = $format->get_section_name($section);\n }\n\n $thissection = new stdClass();\n $thissection->number = $i;\n $thissection->title = $title;\n $thissection->url = $format->get_view_url($section);\n $thissection->selected = false;\n\n if ($i == $selected && !$inactivity) {\n $thissection->selected = true;\n }\n\n $thissection->modules = array();\n if (!empty($modinfo->sections[$i])) {\n foreach ($modinfo->sections[$i] as $modnumber) {\n $module = $modinfo->cms[$modnumber];\n if ($module->modname == 'label' || $module->modname == 'url') {\n continue;\n }\n if (! $module->uservisible) {\n continue;\n }\n $thismod = new stdClass();\n\n if ($inactivity) {\n if ($myactivityid == $module->id) {\n $thissection->selected = true;\n $thismod->active = 'active';\n }\n }\n\n $thismod->name = $module->name;\n $thismod->url = $module->url;\n $hascompletion = $completioninfo->is_enabled($module);\n if ($hascompletion) {\n $thismod->completeclass = 'incomplete';\n }\n\n $completiondata = $completioninfo->get_data($module, true);\n if (in_array($completiondata->completionstate, $completionok)) {\n $thismod->completeclass = 'completed';\n }\n $thissection->modules[] = $thismod;\n }\n $thissection->hasmodules = (count($thissection->modules) > 0);\n $template->sections[] = $thissection;\n }\n\n if ($thissection->selected) {\n\n $pn = $this->get_prev_next($sectionnums, $thissection->number);\n\n $courseurl = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => $i));\n $template->courseurl = $courseurl->out();\n\n if ($pn->next === false) {\n $template->hasnext = false;\n }\n if ($pn->prev === false) {\n $template->hasprev = false;\n }\n\n $prevurl = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => $pn->prev));\n $template->prevurl = $prevurl->out(false);\n\n $currurl = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => $thissection->number));\n $template->currurl = $currurl->out(false);\n\n $nexturl = new moodle_url('/course/view.php', array('id' => $course->id, 'section' => $pn->next));\n $template->nexturl = $nexturl->out(false);\n }\n }\n if ($intab) {\n $template->inactivity = true;\n }\n\n $template->coursename = $course->fullname;\n $template->config = $this->config;\n $renderer = $this->page->get_renderer('block_course_modulenavigation', 'nav');\n $this->content->text = $renderer->render_nav($template);\n return $this->content;\n }", "public function getPageContents()\n {\n $jobs = Job::where('isActive', '=', 1)->where('activeUntil', '>', date('Y-m-d'))->orderBy('postedDate')->get();\n //$blogs = Post::withCount('comments')->orderBy('createdTime')->get();\n $blogs = Post::withCount('comments')->get();\n\n return view('layouts.index')->with('jobs', $jobs)->with('blogs', $blogs);\n }", "public function get_content() {\n echo '<div id=\"main\">';\n\n if(!$_GET['id']) {\n echo 'Не правильные данные для вывода статьи';\n }\n else {\n $id_text = (int) $_GET['id'];\n if(!$id_text) {\n echo 'Не правильные данные для вывода статьи';\n }\n else {\n\n $query = \"SELECT title, text, date, img_src FROM statti WHERE id='$id_text'\";\n $result = $this->db->query($query);\n if(!$result) {\n exit(\"Не удалось обрабботать запрос - \" . $this->db->error);\n }\n else {\n $row = $result->fetch_assoc();\n printf(\"\n <div style='margin: 10px 0 0 10px; border-bottom: 2px; solid-color: #c2c2c2'>\n <p style='font-size: 18px;'>%s</p>\n <p>%s</p>\n <p><img src='%s' width='150px' align='left' style='margin-right: 5px;'>%s</p>\n </div>\", $row['title'], $row['date'], $row['img_src'], $row['text']);\n }\n }\n }\n\n echo '</div>\n </div>';\n\n }", "abstract protected function showContent(): self;", "protected function index() \n {\n //fetch all entries\n $rows = Article::where('group_id', Auth::user()->group_id)->where('status', '>=', 1)->get(); \n foreach ($rows as $row) \n { \n $row['owner_id'] = User::findOrFail($row['owner_id'])->name;\n\n //show 100st caracther of the description\n $content_length = strlen($row['content']);\n $row['content'] = substr(strip_tags($row['content']), 0, min(150, $content_length)) . (($content_length > 100) ? '...' : '');\n }\n return view('dashboard.article.view')->with('data', $rows);\n }", "public function index()\n {\n if (request()->ajax()) {\n return app(ContentDataGrid::class)->toJson();\n }\n\n return view($this->_config['view']);\n }", "public function index() {\n $this->view->title = 'Egyéb tartalom oldal';\n $this->view->description = 'Egyéb tartalom oldal description';\n\n\n $this->view->js_link[] = $this->make_link('js', ADMIN_JS, 'pages/content.js');\n\n $this->view->all_content = $this->content_model->all_content();\n\n $this->view->render('content/tpl_content');\n }", "public function readAll() {\n // we store all the posts in a variable and get the blogid from the url to only display relevant comments\n $viewblogcomments = Comment::allComments($_GET['blogid']);\n //this brings up the html to display the list of comments\n require_once('views/comments/readallcomments.php');\n }", "public function view($id)\n {\n $user = Auth::user();\n $data['content'] = Content::findorfail($id);\n $this->authorize('view', $data['content']);\n $data['page_title'] = 'Content Details';\n $data['countries'] = Settings::COUNTRIES;\n //$data['privacy_settings'] = json_decode($data['content']->privacy_settings);\n return view('client.content.view', $data);\n }", "public function get_archive_content() {\n\t\t$post_type = get_post_type();\n\t\tget_template_part( 'content', $post_type );\n\t}", "public function show(Draft $draft)\n {\n return view('draft.show')\n ->with('draft', $draft);\n }", "function the_content() {\n\tglobal $discussion;\n\treturn Parsedown::instance()->parse($discussion['content']);\n}", "function Content($order,$name)\r\n\t{\r\n\t\tglobal $_REQUEST;\r\n\t\tglobal $_SETTINGS;\r\n\t\t\r\n\t\t$page = $_REQUEST['page'];\r\n\t\t\r\n\t\tif($page == \"\")\r\n\t\t{\r\n\t\t\t$page = $this->activeHomepage();\r\n\t\t}\r\n\t\t\r\n\t\t$select = \"SELECT * FROM pages WHERE clean_url_name='\".$page.\"' \".$_SETTINGS['demosqland'].\" and active='1'\";\r\n\t\t$result = doQuery($select);\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\t$page_id = $row['id'];\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"CONTENT AREA PAGE ID: $page_id<Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif($_REQUEST['PREVIEW']){\r\n\t\t\r\n\t\t\t$select = \t\"SELECT * FROM `content` WHERE \".\r\n\t\t\t\t\t\t\"`page_id`='\".$page_id.\"' AND \".\r\n\t\t\t\t\t\t\"`order`='\".$order.\"' AND \".\r\n\t\t\t\t\t\t\"`preview`='1' \".\r\n\t\t\t\t\t\t\"\".$_SETTINGS['demosqland'].\"\";\r\n\t\t\t\t\t\t\r\n\t\t} else {\r\n\r\n\t\t\t$select = \t\"SELECT * FROM `content` WHERE \".\r\n\t\t\t\t\t\t\"`page_id`='\".$page_id.\"' AND \".\r\n\t\t\t\t\t\t\"`order`='\".$order.\"' AND \".\r\n\t\t\t\t\t\t\"`preview`='0' \".\r\n\t\t\t\t\t\t\"\".$_SETTINGS['demosqland'].\"\";\r\n\r\n\t\t}\r\n\t\t$result = mysql_query($select)or die(\"err\");\r\n\t\t$row = mysql_fetch_array($result);\r\n\t\t$content = $row['content']; \r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"CONTENT AREA ID: \".$row['id'].\"<Br>\";\r\n\t\t}\r\n\t\t\r\n\t\techo $content;\r\n\t}", "public function content(){\n\n\t\t$currentUser = \\Auth::User();\n\t\t\n\t\tif ($currentUser->isInvestor()) {\n\t\t\treturn new RedirectResponse(url('/dashboard'));\n\t\t}\n\t\t\n\t\t$station = $currentUser->station;\n\n\t\t$contentTypeListForConnect = ContentType::$CONTENT_TYPES_FOR_CONNECT;\n\n\t\t// limit access to client info for non-admin users\n\t\t/*if (!$currentUser->isAdminUser()) {\n\t\t\tunset($contentTypeListForConnect[ContentType::GetClientInfoContentTypeID()]);\n\t\t}*/\n\n\t\tif ($currentUser->isClientManager()) {\n\t\t\t$contentTypeListForConnect = array();\n\t\t\t$contentTypeListForConnect[ContentType::GetClientInfoContentTypeID()] = ContentType::$CONTENT_TYPES_FOR_CONNECT[ContentType::GetClientInfoContentTypeID()];\n\t\t}\n\n\t\t$initialFormMode = Request::input('initialFormMode');\n\t\t$initialContentID = Request::input('initialContentID');\n\t\t$initialContentTypeID = Request::input('initialContentTypeID');\n\t\t$prevPage\t\t = Request::input('prevPage');\n\n\t\tif (empty($initialContentTypeID)) $initialContentTypeID = 0;\n\t\tif (empty($initialContentID)) $initialContentID = 0;\n\n\t\treturn view('airshrconnect.content')\n\t\t\t->with('content_type_list', ContentType::$CONTENT_TYPES)\n\t\t\t->with('content_type_list_for_connect', $contentTypeListForConnect)\n\t\t\t->with('ad_duration_list', ConnectContent::$AD_DURATION_LIST)\n\t\t\t->with('ad_percent_list', ConnectContent::$AD_PERCENT_LIST)\n\t\t\t->with('client_list', $station->contentClientsArray())\n\t\t\t->with('product_list', $station->contentProductsArray())\n\t\t\t->with('executive_list', $station->contentExecutives)\n\t\t\t->with('agency_list', $station->contentAgencies)\n\t\t\t->with('action_list', ConnectContentAction::all())\n\t\t\t->with('content_version_list', ConnectContent::$MATERIAL_INSTRUCTION_VERSION_LIST)\n\t\t\t->with('content_sub_type_list', ContentType::$CONTENT_SUB_TYPES)\n\t\t\t->with('WebSocketURL', \\Config::get('app.WebSocketURL'))\n\t\t\t->with('station_info', json_encode($station->getJSONArrayForConnect()))\n\t\t\t->with('initialFormMode', $initialFormMode)\n\t\t\t->with('initialContentID', $initialContentID)\n\t\t\t->with('prevPage', $prevPage)\n\t\t\t->with('client_trading_name_list', \\Auth::User()->station->contentClientTradingNameArray())\n\t\t\t->with('initialContentTypeID', $initialContentTypeID);\n\n\t}", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function index($draft_id)\n {\n //get the draft\n $draft = Draft::findOrFail($draft_id);\n\n //get his notes\n $notes = $draft->notes;\n\n //return NoteResource\n return NoteResource::collection($notes);\n }", "public function index()\n {\n $content = Content::all();\n $defaultLocale = default_locale();\n\n $content = $content->filter(function (DataContent $entry) {\n /**\n * Check if the entry has a route set up\n * Only accept the front page with an empty url.\n */\n $hasRoute = $entry instanceof Page || $entry->url() !== '/';\n\n return $entry->published() && $hasRoute;\n })->map(function (DataContent $entry) use ($defaultLocale) {\n try {\n if (method_exists($entry, 'date')) {\n $date = $entry->date();\n }\n } catch (InvalidEntryTypeException $e) {\n // Don't do anything when there's no date field\n }\n\n // set up alternate locales\n $alternates = [];\n foreach ($entry->locales() as $locale) {\n // skip default locale\n if ($locale === $defaultLocale) {\n continue;\n }\n\n // locale and generate url\n $entry->locale($locale);\n $alternates[$locale] = $entry->absoluteUrl();\n }\n\n // reset locale of the entry to generate correct url\n $entry->locale($defaultLocale);\n\n return [\n 'url' => $entry->absoluteUrl(),\n 'date' => isset($date) ? $date : null,\n 'alternates' => $alternates,\n ];\n })->unique('url');\n\n return response()->make($this->view('index', compact('content')), '200')->header('Content-Type', 'text/xml');\n }" ]
[ "0.65148693", "0.65022784", "0.64151174", "0.6345991", "0.6175783", "0.61727476", "0.61697763", "0.6050392", "0.5955103", "0.5954854", "0.59541744", "0.59541744", "0.5953953", "0.5947845", "0.59446025", "0.59062546", "0.58712345", "0.5864848", "0.57960814", "0.57955074", "0.57955074", "0.5793417", "0.5782626", "0.5768782", "0.5750339", "0.5745484", "0.5738629", "0.5736538", "0.5728901", "0.57053256", "0.5685607", "0.5685607", "0.56609756", "0.56466997", "0.56430554", "0.56337965", "0.56314987", "0.5531854", "0.5530378", "0.55292946", "0.55192405", "0.5515268", "0.55011725", "0.5498381", "0.5473912", "0.5460501", "0.54556924", "0.54542094", "0.5454157", "0.54429364", "0.5430314", "0.5430207", "0.5424803", "0.5420732", "0.5413019", "0.5409359", "0.54084164", "0.5403946", "0.54026085", "0.54026085", "0.53978115", "0.5396276", "0.537582", "0.537077", "0.53631127", "0.53608966", "0.5360467", "0.53582", "0.53566533", "0.5356648", "0.53532225", "0.5347361", "0.53470546", "0.5328831", "0.53209156", "0.53153276", "0.53120553", "0.53097874", "0.5304657", "0.5302785", "0.53025866", "0.53008217", "0.53001404", "0.52981955", "0.52966845", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5294012", "0.5290826", "0.5289975" ]
0.0
-1
receives a post data for a roster puts it in the database
public function submit_probowl($team_id){ $year=$this->current_year; $received_players = rtrim($this->input->post('players'),','); $players = explode(",",$received_players); $incomplete=0; while(count($players)<8){ $incomplete=1; $players[]=0; } $closed=1; if($closed){ echo "Pro Bowl Closed"; } else{ if(!empty($this->Rosters->get_probowl_roster($team_id,$year))){ $success = $this->Rosters->update_probowl_roster($team_id,$year,$players); } else { $success = $this->Rosters->insert_probowl_roster($team_id,$year,$players); } if(!$success){ echo "<div class='col-xs-24 bg-danger'><strong>Error. Please contact the administrator</strong></div>"; } elseif($incomplete){ echo "<div class='col-xs-24 bg-danger'><strong>Incomplete Roster</strong></div>"; } else{ echo "<div class='col-xs-24 bg-info'><strong>Success</strong></div>"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "protected function post() {\n // Get data form request body\n $request_data = $this->get_request_body();\n if ($request_data->room_name == \"\" || $request_data->username == \"\") {\n $this->write_error(\"Request Error!\");\n }\n $this->room_name = addslashes(htmlentities($request_data->room_name));\n $this->username = addslashes(htmlentities($request_data->username));\n $this->options = $request_data->options;\n\n if (!$this->db->check_row(\"rooms\", array(\"room_name\" => $this->room_name))) {\n $access = $this->options->access;\n $tags = $this->options->tags;\n $add_room_qr = \"INSERT INTO rooms (room_ID, session_ID, room_name, access, tags)\n VALUES ('$this->room_ID', '$this->session_ID', '$this->room_name', '$access', '$tags')\";\n $add_room = $this->db->query($add_room_qr);\n if ($add_room) {\n $user = new users(null);\n $result = $user->join_room($this->username, $this->room_ID);\n return $result;\n }else {\n $this->write_error(\"Error creating room!\");\n }\n }else {\n $this->write_error(\"Room already exist!\");\n }\n }", "public function postdata() {\n $name = $this->input->post('name');\n $age = $this->input->post('age');\n $dob = $this->input->post('dob');\n $profession = $this->input->post('profession');\n $locality = $this->input->post('locality');\n $guests = $this->input->post('guests');\n $address = $this->input->post('address');\n $this->participant->setName($name);\n $this->participant->setAge($age);\n $this->participant->setDob($dob);\n $this->participant->setProfession($profession);\n $this->participant->setLocality($locality);\n $this->participant->setGuests($guests);\n $this->participant->setAddress($address);\n }", "function _submit_data()\n {\n\t$data = $this->get_data_from_post();\n\t\n\t//$data['photo'] = Modules::run('upload_manager/upload','image');\n\t$id = $this->uri->segment( 3 );\n\tif ( is_numeric( $id ) ) {\n\t $this->_update( $id, $data );\n\t redirect( 'auth/profile/' . $id );\n\t} else {\n\t $this->_insert( $data );\n\t redirect( 'auth/add_lecturer' );\n\t}\n }", "public function index_post(){\n\n // Comprobar que venga un objeto revista_author en la peticion\n if( !$this->post() ){\n $this->response( null, 400 );\n }\n\n $id = $this->rautor_model->save( $this->post() );\n\n // Comprobar que el id tiene informacion\n if( !is_null( $id ) ){\n $this->response( array( 'response' => \"True\" ), 200 );\n }\n\n else {\n $this->response( array('error' => \"Algo ha falldo en el servidor. No se pudo añadir revista-autor\" ), 400 );\n }\n }", "public function getMyPlayingRooster_post() {\n $this->form_validation->set_rules('ContestGUID', 'ContestGUID', 'trim|required|callback_validateEntityGUID[Contest,ContestID]');\n $this->form_validation->set_rules('WeekID', 'WeekID', 'trim|required');\n $this->form_validation->set_rules('SubGameTypeKey', 'SubGameTypeKey', 'trim|required');\n $this->form_validation->set_rules('UserGUID', 'UserGUID', 'trim|callback_validateEntityGUID[User,UserID]');\n $this->form_validation->set_rules('Status', 'Status', 'trim|callback_validateStatus');\n $this->form_validation->validation($this); /* Run validation */\n /* Get Joined Contest Users Data */\n $AllMatchesList = $this->SnakeDrafts_model->getMyPlayingRooster($this->ContestID, $this->Post['WeekID'], $this->UserID, $this->Post['SubGameTypeKey'], @$this->StatusID);\n if (!empty($AllMatchesList)) {\n $this->Return['Data'] = $AllMatchesList;\n }\n }", "public function p_add() {\n\t\t\t#print_r($_POST);\n\t\t\t\n\t\t\t\n\t\t\t$_POST['created'] = Time::now();\n \t\t\t$_POST['modified'] = Time::now();\n\t\t\t$_POST['poster'] = $this->user->user_id;\n\t\t\t\n\t\t\t#Write Post to the Database\n\t\t $post_id= DB::instance(DB_NAME)->insert('posts', $_POST);\n\t\t\t#Call the parser to look for hashtags: \n\t\t\t$_POST['post'] = $this->parse(\"#\",$_POST['post'],$post_id);\n\t\t\t#Call the parser to look for mentions, and the 'reply_to' for the post\n\t\t\t$_POST['post'] = $this->parse(\"@\",$_POST['post'],$post_id);\n\t\t\t#Update the Post record with new post, updated in the parser:\n\t\t\tDB::instance (DB_NAME)->update('posts',$_POST,\"where post_id = '\".$post_id.\"'\");\t\n\t\t\t\n\t\t Router::redirect('/users/');\n\t\t\t\n\t\t\t\t\t\t\n\t\t}", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function postAction() {\n\t\t$db = Zend_Db_Table_Abstract::getDefaultAdapter();\n\t\t$postData = $this -> _request -> getParams();\n\t\t//Build insert data the easy new way\n\t\t$insertData = array();\n\t\tforeach ($postData as $key => $value) {\n\t\t\tif ($key != 'controller' && $key != 'module' && $key != 'action' && $key != 'submit') {\n\t\t\t\t$insertData[$key] = $value;\n\t\t\t}\n\t\t}\n\n\n\t\t//Build insert data the old way\n\t\t//\t$insertData = array(\n\t\t//'bibnumber' => $postData -> bibnumber,\n\t\t//'lastname' => $postData -> lastname,\n\t\t//'firstname' => $postData -> firstname,\n\t\t//'address1' => $postData -> address1,\n\t\t//'address2' => $postData -> address2,\n\t\t//'city' => $postData -> city,\n\t\t//'state' => $postData -> state,\n\t\t//'age' => $postData -> age,\n\t\t//'sex' => $postData -> sex,\n\t\t//'zipcode' => $postData -> zipcode,\n\t\t//'email' => $postData -> email,\n\t\t//'shirtsize' => $postData -> shirtsize,\n\t\t//'event' => $postData -> event,\n\t\t//'division' => $postData -> division,\n\t\t//'team' => $postData -> team,\n\t\t//'regtype' => $postData -> regtype );\n\n\t\tZend_Registry::get('session') -> postData[] = $insertData;\n\n\t\t// Insert the data and\n\t\t// Set the success/fail message $db -> insert('participant', $insertData)\n\t\t$valid = $this -> validate($insertData, 1);\n\n\t\tif ($this -> getRequest() -> getMethod() == 'POST' && $valid == \"valid\") {\n\t\t\t$db -> insert('participant', $insertData);\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'success', 'text' => 'Last Insert Was Successfull.');\n\t\t} else {\n\t\t\tZend_Registry::get('session') -> messages[] = array('type' => 'error', 'text' => 'Last Insert Failed: ' . $valid);\n\t\t}\n\n\t\t// Redirect back to page\n\t\t$this -> _redirect('/insert');\n\t}", "abstract public function post();", "public function createPostAction(){\n //redirect if unauthorized\n self::isUnauthorized();\n\n if ($_POST){\n $username = Input::get('username');\n $password = Input::get('password');\n $role_id = (int)Input::get('role_id');\n\n $name = Input::get('name');\n\n $gender = Input::get('gender');\n $phone = Input::get('phone');\n $email = Input::get('email');\n $address = Input::get('address');\n\n //$data = [$role_id, $name, $healCardNumber, $dob, $gender, $phone, $email, $address, $username, $password];\n //$user = User::all()->where('username', $username)->first();\n\n if (Validation::isUserExists($username)){\n $_SESSION['msg'] = \"<p class='alert-warning'>Username already exists</p>\";\n Router::redirect('nurse/create');\n }\n if (Nurse::isValidNurseData($role_id, $name, $gender, $phone,$email, $address, $username, $password)){\n $_SESSION['msg'] = \"<p class='alert alert-success'>New Nurse Account Added</p>\";\n\n $user_id = UserHelper::findUserIdByUsername($username);\n $nurse_id = Nurse::all()->where('user_id', $user_id)->first()->id;\n\n Router::redirect('nurse/profile/'.$nurse_id);\n }else{\n $_SESSION['msg'] = \"<p class='alert alert-danger'>Form contains erros</p>\";\n Router::redirect('nurse/create');\n }\n }else{\n Router::redirect('nurse/create');\n }\n }", "public function post();", "public function post();", "public function post();", "function doPost()\n{\n\n $user = Session::current_user();\n if (!is_object($user)) {\n header(\"Location: page-not-found.php\");\n return;\n }\n \n # If 'id' is set, then we're editing an existing board; otherwise\n # we're creating a new board.\n\n if (isset($_POST['board-id'])) {\n\n # Fetch the board and verify that the board exists and that the user\n # has permission to edit the board.\n $board_id = $_POST['board-id'];\n $board = Board::query_by_id($board_id);\n if (! (is_object($board) && $board->is_writable_by_user($user))) {\n header(\"Location: page-not-found.php\");\n return;\n }\n\n } else {\n\n $board = new Board($user->id);\n\n }\n\n # Apply the values from the post form to the datastore\n\n $board->title = $_POST['title-field'];\n $board->have_label = $_POST['have-label-field'];\n $board->want_label = $_POST['want-label-field'];\n $board->published = isset($_POST['publish-checkbox']) ? 'yes' : 'no';\n $board->open_to_posts = isset ($_POST['closed-checkbox']) ? 'no' : 'yes';\n $board->description = $_POST['description-field'];\n if ($board->put()) {\n header(\"Location: board.php?id=$board->id\");\n } else {\n echo \"Database error: \" . DB::error();\n }\n}", "function populateFromPost()\n\t{\n\t}", "public function index_post()\n {\n $input = $this->input->post();\n $this->write_db->insert($_table,$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "abstract public function post($data);", "public function run()\n {\n $param = [\n 'people_id' => '4',\n 'headware' => 'pc',\n 'mainpic' => 'octane',\n 'secondpic' => 'mirage',\n 'thirdpic' => 'crypto',\n 'require_rank' => 'dia',\n 'voice_chat' => '1',\n 'message' => '固定でマスター目指しましょう!',\n 'psid' => 'yamada'\n ];\n $post = new Post;\n $post->fill($param)->save();\n\n $param = [\n 'people_id' => '5',\n 'headware' => 'ps4',\n 'mainpic' => 'mirage',\n 'secondpic' => 'crypto',\n 'thirdpic' => 'octane',\n 'require_rank' => 'plat',\n 'voice_chat' => '0',\n 'message' => 'まったり',\n 'psid' => 'tanaka'\n ];\n $post = new Post;\n $post->fill($param)->save();\n }", "public function store()\n\t{\n\t\t$posting = new GearPosting;\n\t\t$posting->gear_title = Input::get('gear_title');\n\t\t$posting->gear_content = Input::get('gear_content');\n\t\t$posting->category = Input::get('category');\n\t\t$posting->save();\n\n\t\treturn Redirect::route('gear.index');\n\t}", "private function postGoal() {\r\n return self::insertOrUpdateGoal('POST');\r\n }", "public function p_add() {\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\t\t\n\t\t# Unix timestamp of when this post was created / modified\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t$_POST['created_by'] = $this->user['email'];\n\t\t$_POST['modified_by'] = $this->user['email'];\n\t\tunset($_POST['MAX_FILE_SIZE']);\n\n\t\t# Insert\n\t\t# Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n\t\tDB::instance(DB_NAME)->insert('teachers', $_POST);\n\n\t\t\n\t\t# Send them to the main page\n\t\tRouter::redirect(\"/\");\n\n\n\t}", "function viewerRecord($userId,$postId,$device){\n \n $sql = \"INSERT INTO viewers (user_id,post_id,device) VALUES ('$userId','$postId','$device')\";\n run_query($sql);\n}", "public function HandlePOST()\n\t\t{\n\t\t\t$fighter = Fighter::GetFighterById($this->id);\n\n\t\t\t$name = $_POST['name'];\n\t\t\t$age = $_POST['age'];\n\t\t\t$info = $_POST['info'];\n\t\t\t//$wins = $_POST['wins'];\n\t\t\t//$losses = $_POST['losses'];\n\t\t\t$img = $_FILES['img'];\n\n\t\t\tif ($name != null) {\n\t\t\t\t$fighter->name = $name;\n\t\t\t}\n\n\t\t\tif ($age != null && $age >= 0) {\n\t\t\t\t$fighter->age = $age;\n\t\t\t}\n\n\t\t\tif ($info != null) {\n\t\t\t\t$fighter->info = $info;\n\t\t\t}\n\n\t\t\tif (filesize($img['tmp_name']) != 0) {\n\t\t\t\t$path = $this->path.basename($img['name']);\n\t\t\t\tif (!move_uploaded_file($img['tmp_name'], $path)) return;\n\t\t\t}\n\n\t\t\treturn $fighter->UpdateDB();\n\t\t}", "function add_roster($data) {\n\n\t\t$query = $this -> db -> insert('Roster', $data);\n\n\t\treturn true;\n\t}", "public function inputPost(){\n\n \tpostInput::create(request([\n\t\t 'title',\n\t\t 'content',\n \t\t]));\n\n \t// Redirect to schedule\n \treturn redirect('index');\n }", "public function postAuthor() {\n $data = Request;\n //Add Author fields sent to Author Table\n //AuthorsController->AuthorsController::store($request);\n $p = sizeof($data);\n // $p = $data;\n //print_r($_POST);\n //$l = fopen('/home/sudipta/check.log','w+');\n //fwrite($l,\" SIZEOF \".$p);\n //Author::create($request);\n //AuthorsController->store($request);\n return;\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('mst_raw_material',$input);\n \n $this->response(['Item created successfully.','201'], REST_Controller::HTTP_OK);\n }", "public function ParsePostData() {}", "public function handleDataSubmission() {}", "public function RosterDetails_post() {\n /* Validation section */\n $this->form_validation->set_rules('SessionKey', 'SessionKey', 'trim|required|callback_validateSession');\n $this->form_validation->set_rules('RosterSize','RosterSize','trim|required|integer');\n $this->form_validation->validation($this); /* Run validation */\n /* Validation - ends */\n $this->Return['Message'] = \"Success.\";\n $this->Return['Data'] = GetRosterDetails($this->Post['RosterSize']);\n }", "function send_post()\n { \n $send = new send();\n\n $send->date_created = date('Y-m-d H:i:s');\n $send->createdbypk = $this->get_user()->user_id;\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_send_save($send, 'post'));\n }", "function item_post($key = null) {\n $record = json_decode($this->post(), true);\n\n if (($key == null) || ($key == 'id')) {\n $key = $this->get('id');\n $record = array_merge(array('id' => $key), $record);\n }\n $this->crud_post($record);\n }", "function post() \n {\n \n }", "function _post()\r\n\t\t{\r\n\t\t}", "protected function process() {\n $username = $this->app()->request->post(\"username\");\n $fullName = $this->app()->request->post(\"fullname\");\n $phone = $this->app()->request->post(\"phone\");\n $password = $this->app()->request->post(\"password\");\n $cpassword = $this->app()->request->post(\"cpassword\");\n $currentLocation = $this->app()->request->post(\"curr-location\");\n $preferredLocation = $this->app()->request->post(\"pref-location\");\n $experience = $this->app()->request->post(\"experience\");\n $skills = $this->app()->request->post(\"skills\");\n\n $skillSet = explode(',', $skills);\n\n // Validation stuff\n if(!($this->validateRegistration($username, $phone, $password, $cpassword,$currentLocation,$preferredLocation,$skills,$experience))) {\n $this->setRedirectUri(\"home\");\n }\n\n require_once 'libs/Auth.php';\n $volunteerId = Auth::userId();\n\n require_once 'models/Volunteer.php';\n \n $volunteer = new Volunteer($volunteerId);\n $volunteer->registerSeeker($username, $fullName, $phone, $password, $currentLocation, $preferredLocation, $experience, $skillSet);\n }", "function _submit_data()\n {\n\t$data = $this->_get_data_from_post();\n\t//$this->debug($_FILES);\n\tif (isset($_FILES['photo']) && $_FILES['photo']['name'] != NULL) {\n\t $data['image'] = Modules::run('upload_manager/upload', 'photo', 'profile');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data);\n\t Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data);\n\t redirect('login');\n\t}\n }", "public function post($post);", "function main() {\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tprint_r($_POST);\n\t\t\techo \"<br />\";\n\t\t\t\n\t\t\t// Required Fields in the POST data //\t\t\t\n\t\t\tif ( !isset($_POST['_type']) ) return;\n\t\t\tif ( !isset($_POST['_subtype']) ) return;\n\t\t\tif ( !isset($_POST['_name']) ) return;\n\t\t\tif ( !isset($_POST['_mail']) ) return;\n\t\t\tif ( !isset($_POST['_password']) ) return;\n\t\t\tif ( !isset($_POST['_publish']) ) return;\n\t\n\t\t\t// Node Type //\n\t\t\t$type = sanitize_NodeType($_POST['_type']);\n\t\t\tif ( empty($type) ) return;\t\n\n\t\t\t$subtype = sanitize_NodeType($_POST['_subtype']);\n\t\n\t\t\t// Name/Title //\n\t\t\t$name = $_POST['_name'];\t// TODO: Sanitize\n\t\t\t\n\t\t\t// Slug //\n\t\t\tif ( empty($_POST['_slug']) )\n\t\t\t\t$slug = $_POST['_name'];\n\t\t\telse\n\t\t\t\t$slug = $_POST['_slug'];\n\t\t\t$slug = sanitize_Slug($slug);\n\t\t\tif ( empty($slug) ) return;\n\t\t\t\n\t\t\t// TODO: Confirm slug is legal\n\t\t\t\t\n\t\t\t// Body //\n\t\t\t$body = $_POST['_body'];\t// TODO: Sanitize\n\t\t\t\n\t\t\t// Do we publish? //\n\t\t\t$publish = mb_strtolower($_POST['_publish']) == \"true\";\n\t\t\t\n\t\t\t// Email //\n\t\t\t$mail = sanitize_Email($_POST['_mail']);\n\t\t\tif ( empty($mail) ) return;\n\n\t\t\t// Password //\n\t\t\t$password = $_POST['_password'];\n\t\t\tif ( empty($password) ) return;\n\n\t\n\t\t\t$id = node_Add(\n\t\t\t\t$type,$subtype,$slug,$name,$body,\n\t\t\t\t0,2,\n\t\t\t\t$publish\n\t\t\t);\n\t\t\t\n\t\t\tuser_Add($id,$mail,$password);\n\t\n\t\t\techo \"Added \" . $id . \".<br />\";\n\t\t\techo \"<br />\";\n\t\t}\n\t}", "public function postAction()\n {\n \t$this->_object->title = $this->getRequest()->getParam('title');\n \t$this->_object->text = $this->getRequest()->getParam('text');\n \t$this->_object->answer = $this->getRequest()->getParam('answer');\n\t\t$this->_object->tag = $this->getRequest()->getParam('tags');\n\t\t$this->_objectMapper->save($this->_object);\n \t$this->getResponse()\n ->setHttpResponseCode(201);\n }", "private function readPost(){\n\t\tIF(isset($_POST['eventName'])) { \n\t\t $this->eventName = trim(strip_tags($_POST['eventName']));\n\t\t}\n\t\tIF(isset($_POST['senderName'])) { \n\t\t $this->senderName = trim(strip_tags($_POST['senderName']));\n\t\t}\n\t\tIF(isset($_POST['senderEmail'])) {\n\t\t $this->senderEmail = trim(strip_tags(preg_replace(\"/[^0-9a-zA-ZäöüÄÖÜÈèÉéÂâáÁàÀíÍìÌâÂ@ \\-\\+\\_\\.]/\", \" \", $_POST['senderEmail'])));\n\t\t}\n\t\tIF(isset($_POST['validateEmail'])){\n\t\t $this->validateEmail = trim(strip_tags($_POST['validateEmail']));\n\t\t}\n\t\tIF(isset($_POST['senderPhone'])){\n\t\t $this->senderPhone = trim(strip_tags($_POST['senderPhone']));\n\t\t}\n\t\tIF(isset($_POST['numberOfTickets'])){\n\t\t $this->numberOfTickets = trim(strip_tags($_POST['numberOfTickets']));\n\t\t}\n\t\tIF(isset($_POST['paymentOption'])){\n\t\t $this->paymentOption = trim(strip_tags($_POST['paymentOption']));\n\t\t}\n\t\tIF(isset($_POST['otherPartyNames'])){\n\t\t $this->otherPartyNames = trim(strip_tags($_POST['otherPartyNames']));\n\t\t}\n\t\tIF(isset($_POST['pickupPoint'])){\n\t\t $this->pickupPoint = trim(strip_tags($_POST['pickupPoint']));\n\t\t} \n\t\tIF(isset($_POST['sittingNear'])){\n\t\t $this->sittingNear = trim(strip_tags($_POST['sittingNear']));\n\t\t}\n\t\tIF(isset($_POST['specialNeeds'])){\n\t\t $this->specialNeeds = trim(strip_tags($_POST['specialNeeds']));\n\t\t}\n\t}", "function postReview($roomID,$review,$rating,$userID,$userName){\n\n $response = array();\n $add_data = array(\"roomID\"=>$roomID,\"review\"=>$review,\"rating\"=>$rating,\"userID\"=>$userID,\"userName\"=>$userName);\n\n if ($this->db->insert('room_reviews', $add_data))\n {\n $response['status'] = 'success';\n $response['code'] = 'added Successfuly';\n $roomQuery = $this->db->query(\"SELECT * FROM room_reviews where roomID = $roomID\");\n if($roomQuery->num_rows()>0)\n {\n $response['data']=$roomQuery->result_array();\n\n }\n else\n {\n $response['data']= array();\n }\n\n }\n else\n {\n $response['status'] = 'failure';\n $response['code'] = 'database failure';\n\n }\n\n return $response;\n\n }", "private function handlePostRequest() {\n $this->store();\n }", "public function add_post(){\n $response = $this->PersonM->add_person(\n $this->post('name'),\n $this->post('hp'),\n $this->post('email'),\n $this->post('message')\n );\n $this->response($response);\n }", "public function insert($post);", "public function add_new_exec($user,$location,$post){\n\t\tif(strcasecmp($post,'boss')==0){\n\t\t\t$query=\"INSERT INTO requisition_user SET user_id='$user', location_id='$location', post='$post', active='active'\";\n\t\t}\n\t\telse \n\t\t\t$query=\"INSERT INTO requisition_user SET user_id='$user', location_id='$location', post='$post', active='active'\";\n\t\t$result = $this->mysqli->query($query) or die(mysqli_connect_error().\"Data cannot be inserted\");\t\t\n\t\t\n\t\techo \"<span class='label label-success'>User added as '$post' for '$location' location.</span>\";\n\t\t//echo $this->mysqli->insert_id;\n\t}", "function submit_post($post)\n {\n $query = \"INSERT INTO messages(message, users_id)\n VALUES('{$post['content']}', {$_SESSION['user_id']})\";\n run_mysql_query($query);\n header('Location:wall.php');\n exit();\n }", "public function insert_post()\r {\r if ((!$this->post('email') || !$this->post('street') || !$this->post('number') || !$this->post('area')\r || !$this->post('tel_num') || !$this->post('zip_code') || !$this->post('token') || !$this->post('alias'))\r ) {\r $this->response([\r 'status' => FALSE,\r 'message' => 'You have not provided all the requested data!'\r ], REST_Controller::HTTP_BAD_REQUEST);\r }\r\r $this->load->model('Users_model');\r $user_id = $this->Users_model->get_user_id_by_email($this->post('email'));\r\r if (!$user_id) {\r $this->response([\r 'status' => FALSE,\r 'message' => 'User not found'\r ], REST_Controller::HTTP_FORBIDDEN);\r }\r\r $this->load->model('Logged_users_model');\r $returned_token = $this->Logged_users_model->getToken($user_id);\r\r if (!$returned_token) {\r $this->response([\r 'status' => FALSE,\r 'message' => 'Session not found.'\r ], REST_Controller::HTTP_BAD_REQUEST);\r }\r\r $token = $this->post('token');\r\r // Check user token\r if ($token != $returned_token) {\r $this->response([\r 'status' => FALSE,\r 'message' => 'Unauthorized action!'\r ], REST_Controller::HTTP_UNAUTHORIZED);\r }\r\r // Check if zip code has anything other than digits\r if ((is_numeric($this->post('zip_code')) === false)) {\r\r $this->response([\r 'status' => FALSE,\r 'message' => 'Zip Code is invalid!'\r ], REST_Controller::HTTP_BAD_REQUEST);\r }\r\r // Check if phone number has anything other than digits or is longer than 15 digits\r if ((is_numeric($this->post('tel_num')) === false)\r || strlen((string)$this->post('tel_num')) > 15\r ) {\r\r $this->response([\r 'status' => FALSE,\r 'message' => 'Phone number is invalid!'\r ], REST_Controller::HTTP_BAD_REQUEST);\r }\r\r $data = array();\r $data['user_id'] = $user_id;\r $data['street'] = $this->post('street');\r $data['number'] = $this->post('number');\r $data['area'] = $this->post('area');\r $data['tel_num'] = $this->post('tel_num');\r $data['zip_code'] = $this->post('zip_code');\r $data['alias'] = $this->post('alias');\r\r $this->load->model('Addresses_model');\r $addedAddressId = $this->Addresses_model->insert_address($data);\r\r if (!$addedAddressId) {\r $this->response([\r 'status' => FALSE,\r 'message' => 'An error occurred.Please try again!'\r ], REST_Controller::HTTP_BAD_REQUEST);\r } else {\r $this->response([\r 'status' => TRUE,\r 'message' => 'Address was successfully inserted!'\r ], REST_Controller::HTTP_OK);\r }\r }", "private function actionListPost() {\n $donneur = new Donneur;\n $donneur->first_name = $_POST['first_name'];\n $donneur->last_name = $_POST['last_name'];\n $donneur->age = $_POST['age'];\n $donneur->gender = $_POST['gender'];\n $donneur->address = $_POST['address'];\n $donneur->phone = $_POST['phone'];\n $donneur->groupe_sangun = $_POST['groupe_sangun'];\n $donneur->email = $_POST['email'];\n $donneur->vehicle = $_POST['vehicle'];\n \n $donneur->date_donation = ($_POST['date_donation']==='1970-01-01') ? null : $_POST['date_donation'];\n if ($donneur->save()) {\n echo CJSON::encode($donneur);\n } else {\n header(\"HTTP/1.1 501 Internal Server Error\");\n echo \"Update failed for Donneur: \";\n }\n }", "public function register_post(){\n // var_dump($this- >post());\n $info = array (\n 'ui_school_id' => $this->post('id'),\n 'ui_college' => $this->post('college'),\n 'ui_dept' => $this->post('dept'),\n 'ui_email' => $this->post('email'),\n 'ui_position' => $this->post('position'),\n 'ui_Fname'=> $this->post('fName'),\n 'ui_Mname'=> $this->post('mName'),\n 'ui_Lname'=> $this->post('lName'),\n 'ui_gender'=> $this->post('gender'),\n //'ui_age'=> $this->post(''),\n 'ui_contact_number'=> $this->post('cNumber'),\n 'ui_birthday' => $this->post('bDay')\n );\n\n $cred = array (\n 'user_school_id' => $this->post('id'),\n 'user_pass' => $this->post('pass'),\n 'user_type' => $this->post('type'),\n );\n\n\n\n $result = $this->user->register($info,$cred);\n $this->response($result);\n \n }", "function readFromPost() {\n\t\t$this->idt = requestVar('idt');\n\t\t$this->newIdt = requestVar('template');\n\t\t$this->description = requestVar('description');\n\t\t$this->postsHeader = requestVar('postListHeader');\n\t\t$this->postBody = requestVar('postBody');\n\t\t$this->postsFooter = requestVar('postListFooter');\n\t\t$this->formLogged = requestVar('formLogged');\n\t\t$this->form = requestVar('formNotLogged');\n\t\t$this->navigation = requestVar('navigation');\n\t\t$this->name = requestVar('nameNoUrl');\n\t\t$this->nameLin = requestVar('nameUrl');\n\t\t$this->memberName = requestVar('memberName');\n\t\t$this->date = requestVar('date');\n\t\t$this->time = requestVar('time'); \n\t\t$this->nextPage = requestVar('nextPage');\n\t\t$this->previousPage =requestVar('previousPage');\n\t\t$this->firstPage = requestVar('firstPage');\n\t\t$this->lastPage = requestVar('lastPage');\t\n\n\t\t$this->urlToLink = (requestVar('urlToLink') == 'yes') ? true : false;\n\t\t$this->emoToImg = \t (requestVar('emoToImg') == 'yes') ?true : false;\n\t\t$this->gravSize = \t (int)requestVar('gravSize');\n\t\t$this->gravDefault = requestVar('gravDefault');;\n\n\n\t\t\n\t\t$this->action = requestVar('action');\n\t}", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function post($data) {\n $result['statusMessage'] = \"error\";\n $result['errorMessage'] = \"na\";\n if ($this->currentUser->id() && isset($data['node']) && isset($data['trainee']) && is_numeric($data['trainee'])) {\n\t $uid = $this->currentUser->id();\n\t //Check trainee\n\t $ids = $this->entityQuery->get('user')\n\t\t->condition('field_trainee', $data['trainee'])\n\t\t->condition('uid', $uid)\n\t\t->range(0, 1)\n\t\t->execute();\n\t if(empty($ids)) {\n\t\t$result['errorMessage'] = \"Trainee and Trainer details are incorrect.\";\n $response = new ResourceResponse($result, 403);\n $response->addCacheableDependency($result);\n\t return $response;\n\t }\n\t //Decide Add or Edit\n\t if($data['node'] == 'edit') {\n\t if(!is_numeric($data['nid'])) {\n\t $result['errorMessage'] = \"Invalid Node ID\";\n $response = new ResourceResponse($result, 400);\n $response->addCacheableDependency($result);\n\t return $response;\n\t }\n\t }\n\t \n\t if($data['node'] == 'edit') {\n\t $node_data = $this->entityManager->getStorage('node')->load($data['nid']);\n\t \n\t //Cardiovascular Endurance\n\t $field_cardiovascular_endurance = $node_data->field_cardiovascular_endurance->getValue();\n\t if(count($field_cardiovascular_endurance) > 0) {\n\t foreach($field_cardiovascular_endurance as $key => $value) {\n\t $entity = \\Drupal::entityTypeManager()->getStorage('paragraph')->load($value['target_id']);\n if ($entity) $entity->delete();\n\t }\n\t }\n\t \n\t //Muscular Endurance\n\t $field_mus = $node_data->field_mus->getValue();\n\t if(count($field_mus) > 0) {\n\t foreach($field_mus as $key => $value) {\n\t $entity = \\Drupal::entityTypeManager()->getStorage('paragraph')->load($value['target_id']);\n if ($entity) $entity->delete();\n\t }\n\t } \n\t \n\t //Muscular Strength\n\t $field_muscular_strength = $node_data->field_muscular_strength->getValue();\n\t if(count($field_muscular_strength) > 0) {\n\t foreach($field_muscular_strength as $key => $value) {\n\t $entity = \\Drupal::entityTypeManager()->getStorage('paragraph')->load($value['target_id']);\n if ($entity) $entity->delete();\n\t }\n\t }\n\t \n\t }\n\t if($data['node'] == 'add') {\n\t //Check date\n\t $ids = $this->entityQuery->get('node')\n\t\t->condition('field_trainee_assessment', $data['trainee'])\n\t\t->condition('field_assessment_date', date('Y-m-d'))\n\t\t->range(0, 1)\n\t\t->execute();\n\t if(!empty($ids)) {\n\t $result['errorMessage'] = \"You have already a fiteness test for today.\";\n $response = new ResourceResponse($result, 403);\n $response->addCacheableDependency($result);\n\t return $response;\n\t }\n\t $node_data = Node::create([\n\t 'type' => 'assessment_form'\n\t ]);\n\t $node_data->set('field_assessment_date',date('Y-m-d'));\n\t }\n\t \n\t \n\t $cardiovascular_endurance_data_final = [];\n\t foreach($data['form']['cardio'] as $key => $value) {\n\t $cardiovascular_endurance_data = Paragraph::create([\n 'type' => 'cardiovascular_endurance'\n ]);\n\t foreach($value as $fieldkey => $fieldvalue) {\n\t $cardiovascular_endurance_data->set($fieldkey, $fieldvalue);\n\t }\n\t $cardiovascular_endurance_data->save();\n $cardiovascular_endurance_data_single = ['target_id' => $cardiovascular_endurance_data->id(), 'target_revision_id' => $cardiovascular_endurance_data->getRevisionId()];\n\t $cardiovascular_endurance_data_final[] = $cardiovascular_endurance_data_single;\n\t }\n\t \n\t // Other paragraph field names\n\t $bundleFields = [];\n\t $entity_type_id = 'paragraph';\n $bundle = ['muscular_endurance', 'muscular_strength'];\n\t foreach($bundle as $bundle_val) {\n\t foreach ($this->entityManager->getFieldDefinitions($entity_type_id, $bundle_val) as $field_name => $field_definition) {\n\t if (!empty($field_definition->getTargetBundle())) {\n\t\t$bundleFields[$bundle_val][] = $field_name;\n\t }\n }\n\t }\n\t \n\t //Muscular Endurance\n\t $muscular_endurance_data = Paragraph::create([\n 'type' => 'muscular_endurance'\n ]);\n\t $muscular_endurance_data_final = [];\n\t foreach($bundleFields['muscular_endurance'] as $value) {\n\t if($data['form'][$value][0] != \"\" ) {\n\t $muscular_endurance_data->set($value, $data['form'][$value]);\n\t }\n\t }\n\t $muscular_endurance_data->save();\n $muscular_endurance_data_final[] = ['target_id' => $muscular_endurance_data->id(), 'target_revision_id' => $muscular_endurance_data->getRevisionId()];\n\t \n\t //Muscular Strength\n\t $muscular_strength_data = Paragraph::create([\n 'type' => 'muscular_strength'\n ]);\n\t $muscular_strength_data_final = [];\n\t foreach($bundleFields['muscular_strength'] as $value) {\n\t if($data['form'][$value][0] != \"\" ) {\n\t $muscular_strength_data->set($value, $data['form'][$value]);\n\t }\n\t }\n\t $muscular_strength_data->save();\n $muscular_strength_data_final[] = ['target_id' => $muscular_strength_data->id(), 'target_revision_id' => $muscular_strength_data->getRevisionId()];\n\t \n\t \n\t //Form Save\n\t $node_data->set('field_cardiovascular_endurance', $cardiovascular_endurance_data_final);\n\t $node_data->set('field_mus', $muscular_endurance_data_final);\n\t $node_data->set('field_muscular_strength', $muscular_strength_data_final);\n\t $node_data->set('field_assessment_form_status_for', 1);\n\t $node_data->set('field_trainee_assessment', $data['trainee']);\n\t $node_data->save();\n\t \n\t \n\t $result['statusMessage'] = \"Form saved successfully\";\n $response = new ResourceResponse($result, 200);\n $response->addCacheableDependency($result);\n return $response;\n }\n else {\n $result['errorMessage'] = \"Invalid parameter provided.\";\n $response = new ResourceResponse($result, 400);\n $response->addCacheableDependency($result);\n\t return $response;\n }\n }", "public function saveAction(){\n //d'you post?\n if ($this->getRequest()->isPost()){\n $knight = $this->getKnight();\n $knight->setName( $this->getRequest()->getPost(\"name\") );\n $knight->setArmor( $this->getRequest()->getPost(\"armor\") );\n //persist the knight\n $this->getDM()->persist($knight);\n $this->getDM()->flush();\n }\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function store($post) { \n $now = date('Y-m-d h:i:s');\n \n $mileagechoice = ($post['mileagechoice_id']==0 ? R::dispense('mileagechoice') : R::load('mileagechoice', $post['mileagechoice_id']));\n $mileagechoice->mileage_choice = $post['mileage_choice'];\n \n if($post['mileagechoice_id']==0) {\n $mileagechoice->created = $now;\n $mileagechoice->created_by = $_SESSION['user_id'];\n } else {\n $mileagechoice->modified = $now;\n $mileagechoice->modified_by = $_SESSION['user_id'];\n }\n \n R::store($mileagechoice);\n }", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n agenc::updateOrCreate([\n 'name' => $this->name,\n 'code' => $this->code,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'email' => $this->email,\n 'address' => $this->address,\n 'country' => $this->country,\n 'status' => 1,\n ]);\n\n session()->flash('message',\n $this->agency_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');\n\n $this->resetInputFields();\n\n $this->emit('userStore');\n }", "public function postCreate()\n {\n if(Sentry::getUser()->isSuperUser())\n {\n $this->rank->rankname = Input::get( 'rankname' );\n \n // Save if valid. \n $this->rank->save();\n\n if ( $this->rank->id )\n {\n $this->fd_self_commision->rank_id = $this->rank->id;\n $this->fd_self_commision->save();\n\n $this->fd_team_commision->rank_id = $this->rank->id;\n $this->fd_team_commision->save();\n\n $this->rd_self_commision->rank_id = $this->rank->id;\n $this->rd_self_commision->save();\n\n $this->rd_team_commision->rank_id = $this->rank->id;\n $this->rd_team_commision->save();\n \n // Redirect to the new rank page\n return Redirect::to('admin/rank/'.$this->rank->id.'/edit')->with('success', \"Rank Created Successfully\");\n }\n else\n {\n // Get validation errors (see Ardent package)\n $error = $this->rank->errors()->all();\n \n return Redirect::to('admin/rank/create')\n ->with( 'error', $error );\n } \n }\n else\n {\n return Redirect::to('admin/rank')->with('error', \" You don't have enough permission to create a new Rank \"); \n }\n\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('items',$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function post()\n {\n if ($this->request->is('post')) {\n\n $this->Row->create();\n $this->request->data['Row']['feed_id'] = (int)$this->request->data['Row']['feed_id'];\n\n $this->Row->save(\n array(\n 'Row' => $this->request->data['Row']\n )\n );\n\n $this->log(\n 'created row by datatables, ' . '(' . __CLASS__ . ':' . __FUNCTION__ . '=' . $this->Row->id . ')',\n LOG_DEBUG\n );\n\n }\n die($this->Row->id); //datatables wants this\n }", "public function run()\r\n {\r\n $data = array(\r\n [\r\n 'name' => 'Taurus',\r\n 'slug' => 'taurus',\r\n 'address' => 'San Fermin #121',\r\n 'telephone' => '8181128823'\r\n ],\r\n [\r\n 'name' => 'Satori',\r\n 'slug' => 'satori',\r\n 'address' => 'Uranio #1220',\r\n 'telephone' => '8181234567'\r\n ]\r\n );\r\n\r\n Editorial::insert($data);\r\n \r\n }", "public function store(){\n\n //create a new post using the request data\n// $post = new Post();\n//\n// $post->title = request('title');\n// $post->body = request('body');\n\n $this->validate(request(),[\n 'name' => 'required|min:3',\n 'batch'=>'required|min:10',\n 'roll'=>'required',\n ]);\n\n Resource::create([\n 'name'=> request('name'),\n 'roll'=>request('roll'),\n 'batch'=> request('batch'),\n ]);\n//\n// //save it to database\n// $post->save();\n\n //redirect to home page\n return redirect('/');\n\n }", "function insert_record($post_data)\n {\n if (isset($post_data[\"user_agent\"])) {\n $user_agent = $post_data[\"user_agent\"];\n if ($user_agent == \"\" or $user_agent == \" \") {\n $this->invalid_data_format('[{\"user_agent\":\"SIPAgent\"}]');\n return;\n }\n } else {\n $this->invalid_data_format('[{\"user_agent\":\"SIPAgent\"}]');\n return;\n }\n $db = new DB();\n $conn = $db->connect();\n if (empty($conn)) {\n $statusCode = 404;\n $this->setHttpHeaders(\"application/json\", $statusCode);\n $rows = array(\n 'error' => 'No databases found!'\n );\n $response = json_encode($rows);\n echo $response;\n return;\n } else {\n $statusCode = 200;\n }\n $stmt = $conn->prepare(\"call insert_user_agent(?)\");\n $stmt->bind_param('s', $user_agent);\n $stmt->execute();\n $result = $db->get_result($stmt);\n $conn->close();\n $rows = array();\n while ($r = array_shift($result)) {\n $rows[] = $r;\n }\n if ($rows == Null) {\n $statusCode = 409;\n $rows = array(\n array(\n 'error' => \"user_agent(\" . $user_agent . \") already exists in table or table doesn't exist\"\n )\n );\n }\n $this->setHttpHeaders(\"application/json\", $statusCode);\n $response = json_encode($rows[0]);\n echo $response;\n }", "public function post() {\n $this->data = $this->param();\n foreach ($this->data as $ms) {\n $muestra = new Muestra();\n $muestra->tomamuestra_fecha = $ms['fechatoma'];\n $muestra->tomamuestra_hora = $ms['horatoma'];\n $muestra->recepcionmuestra_fecha = $ms['fecharecepcion'];\n $muestra->recepcionmuestra_hora = $ms['horarecepcion'];\n $muestra->tipomatrizanalizada_id = $ms['tipomatriz'];\n $muestra->tipomuestra_id = $ms['tipomuestra'];\n $muestra->codigomuestra = $ms['codigomuestra'];\n $muestra->lugartomamuestra_id = $ms['lugarmuestra'];\n $muestra->lugartomamuestratexto = $ms['lugartomamuestratexto'];\n $muestra->formato_id = $ms['formato_id'];\n $muestra->save();\n }\n }", "function postReview() {\n global $dbLink;\n $courseid = mysqli_real_escape_string($dbLink, $_POST['courseid']);\n $username = $_SESSION['username'];\n\t$reviewText = mysqli_real_escape_string($dbLink, $_POST['textReview']);\n\t$userid = $_SESSION['userid'];\n\t$postrate = 0;\n\t$date = date(\"d/m/Y\");\n\tif(isset($_POST['semester'])){\n\t\t$semester = $_POST['semester'] . ' ' . $_POST['year'];\n\t}\n $sqlString = \"INSERT INTO reviews(course_id, user_name, review_text, user_id, review_date, course_rating, course_semester)\n VALUES ('\" . $courseid .\"',\n\t\t\t\t '\" . $username .\"',\n\t\t\t\t '\" . $reviewText .\"',\n\t\t\t\t '\" . $userid .\"',\n\t\t\t\t '\" . $date .\"',\n\t\t\t\t '\" . $postrate .\"',\n\t\t\t\t '\" . $semester .\"')\";\n\n mysqli_query($dbLink, $sqlString) or die(\"Could not register new post..\" . mysqli_error($dbLink));\n\techo '<h3>Success!</h3>';\n\n\tif(isset($courseid )){\n\theader('Location: course.php?cid=' . $courseid .'');\n\t}else {\n\t\theader('Location: reviews.php');\n\t}\n}", "public function input($data) \n \t\t{\n \t \t\t#insert data\n \t\t$this->db->insert('table_post', $data);\n \t\t}", "public function handle($postData){\r\n\t\t\r\n\t}", "function ras_submit_db () {\n\n\t\textract(doSlash(psa(array('poll_id', 'name', 'prompt', 'n0', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9' ,'step', 'event', 'selection'))));\n\t\t$where = \"id='\".$poll_id.\"'\";\n\t\t\n\t\tif($step == 'poll_response') {\n\t\t\t$stat = 'r'.substr($selection, -1);\n\t\t\t\t$current = safe_field( $stat ,'txp_poll' , $where);\n\t\t\t\t\t$newstat = $current + 1;\n\t\t\t\t\t$what = $stat.'='.$newstat;\n\t\t\t\tsafe_update('txp_poll', $what ,$where);\n\t\t}\n}", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "function submitReview()\n\t{\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\n\t\t$comment = urldecode($_POST['comment']); \n\t\t$rating = intval(urldecode($_POST['rating'])); \n\t\t$book_id = intval(urldecode($_POST['book_id'])); \n\t\t$user_id = intval(urldecode($_POST['user_id'])); \n\t\t$anon = urldecode($_POST['anon']); \n\t\t\n\t\tif (empty($comment)){\n\t\t\t$comment = NULL;\n\t\t}\n\t\tif ($anon == 'true'){\n\t\t\t$anon = 1;\n\t\t}\n\t\telse if ($anon == 'false'){\n\t\t\t$anon = 0;\n\t\t}\n\t\telse {\n\t\t\techo \"anon not read\";\n\t\t}\n\n\t\t$sql = \"INSERT INTO `reviews` (`comment`, `rating`, `book_id`, `user_id`,`anon`)\n\t\t\t\t\tVALUES \n\t\t\t\t\t('$comment','$rating','$book_id','$user_id','$anon')\";\n\n\n\t\t//Executes query string\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t\techo \"New record created successfully\";\n\t\t} else {\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\t\t\n\t\t$conn->close();\n\n\t}", "function index_post(){\n\t\t$data = array(\n\t\t\t'pid' => $this->post('pid'),\n\t\t\t'name' => $this->post('name'),\n\t\t\t'email' => $this->post('email'),\n\t\t\t'description' => $this->post('description'));\n\t\t$insert = $this->db->insert('pendaftaran', $data);\n\n\t\t$this->response(array('result' =>$data, 200));\n\n\t}", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('activities', $_POST);\n\n # Send them back to home page\n Router::redirect('/activities/index');\n\n }", "public function store(Request $r) {\n // $post->title = $r->title;\n // $post->body = $r->body;\n // $post->save();\n\n $r->validate([\n 'title' => 'required|max:150',\n 'body' => 'required'\n ]);\n\n // Post::create([\n // 'title' => $r->title,\n // 'body' => $r->body,\n // 'user_id' => \\Auth::id()\n // ]);\n\n \\Auth::user()->publish(\n new Post([\n 'title' => $r->title,\n 'body' => $r->body\n ])\n );\n\n return redirect('/posts/create');\n }", "function tower_save_form_data($data) {\n // logic for data validation and saving.\n $post_type = 'tower_' . @$data->get_param('type');\n if (! array_key_exists($post_type, TOWER_CUSTOM_POSTS)) return null;\n\n // backend validation\n $fields = array_merge([\n 'name' => 'title',\n 'rules' => 'required',\n ], TOWER_CUSTOM_POSTS[$post_type]['fields']);\n \n // check if the form has any validation errors\n $validation_errors = tower_form_errors($data, $fields);\n\n $post_id = 0; // id for the new post\n \n if (count($validation_errors) == 0) {\n $post_id = wp_insert_post([\n 'post_type' => $post_type,\n 'post_title' => $data->get_param('title')\n ]);\n if ($post_id > 0) {\n foreach ($fields as $field) {\n update_post_meta(\n $post_id, \n $field['name'], \n sanitize_text_field($data->get_param($field['name']))\n );\n }\n }\n }\n \n echo json_encode([\n 'success' => $post_id > 0,\n 'errors' => $validation_errors,\n ]);\n}", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('users',$input);\n \n $this->response(['User created successfully.'], REST_Controller::HTTP_OK);\n }", "public function post($location, $body);", "public function parsePostData()\n {\n }", "function do_store_post_reply($post_id) {\r\n // echo '<pre>'; print_r($_POST); die();\r\n foreach(array(\"description\",\"replied_by\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n $replied_on = time();$status=1;\r\n $this->db->query(\"insert into m_stream_post_reply(description,post_id,replied_by,replied_on,status) values(?,?,?,?,?)\",array($this->prep($description),$post_id,$replied_by,$replied_on,$status));\r\n }", "function index_post() {\n\t\t\n\n\t\t$data = array(\n\t\t\t\t\t'username' \t\t=> $this->post('username'),\n\t\t\t\t\t'password' \t\t=> $this->post('password'),\n\t\t\t\t\t'kota'\t\t\t=> $this->post('kota'),\n\t\t\t\t\t'telepon' => $this->post('telepon'));\n\t\t\t\n\t\t$insert = $this->db->insert('cabang', $data2);\n\n\t\tif ($insert) {\n\t\t\t$this->response($data, 200);\n\t\t} else {\n\t\t\t$this->response(array('status' => 'fail', 502));\n\t\t}\n\t}", "function processPostRequest($user){\n\t\tif(!empty($_POST['boardSubmit'])){\n\t\t\t//set messsage text\n\t\t\t$text = strip_tags($_POST['boardTextAreaName']);\n\t\t\n\t\t\tif(self::validateSigh()){\n\t\t\t\t//set username\n\t\t\t\t$userName = null;\t\t\t\n\t\t\t\tif(null != $user && isSet($user)){\n\t\t\t\t\t$userName = $user->userName;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//set date\n\t\t\t\t$date = date('F jS Y h:i:s A');\n\t\t\t\n\t\t\t\t//do insert\n\t\t\t\t$query = \"insert into board (USER,MESSAGE,DATE) values('$user->userName','$text','$date')\";\t\n\t\t\t\tDataBaseHandler::query($query);\n\t\t\t\n\t\t\t\tself::display($user);\n\t\t\t}\n\t\t\telse{\t\t\t\t\t\n\t\t\t\techo(\"<div id=\\\"Board\\\">\");\t\t\t\t\t\n\t\t\t\tself::displayForm($text,$user);\n\t\t\t\tself::displaySighs(null,$user);\n\t\t\t\techo(\"</div>\");\n\t\t\t}\n\t\t}\n\t\telse{//just show board\t\t\t\t\t\n\t\t\techo(\"<div id=\\\"Board\\\">\");\t\t\t\t\t\n\t\t\tself::displayForm($text,$user);\n\t\t\tself::displaySighs(null,$user);\n\t\t\techo(\"</div>\");\n\t\t}\n\t}", "public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}", "protected function singlepost($data) {\n\t\t$pid \t\t\t= $data->pid;\n\t\t$reddit_id \t\t= $data->name;\n\t\t$sql \t\t\t= \"Select title, name, score, webmUrl, gifUrl, mp4Url, gfyname from reddit where name = '\".$reddit_id.\"'\";\n\t\t$query \t\t\t= $this->db->query($sql);\n if ($query->num_rows() > 0) {\n $datas['searchdata'] = $query->row_array();\n\t\t}\n\t\t\n\t\t$comment \t\t= \"select user_id, comment from appcomments where reddit_id = '\".$reddit_id.\"'\";\n\t\t$query \t\t\t= $this->db->query($comment);\n if($query->num_rows() > 0) { \n $data = $query->result_array();\n $i=0;\n foreach($data as $comment){\n\t\t\t\t$userid \t\t= $comment['user_id'];\n\t\t\t\t$username \t\t= \"Select username, name from users where id = \".$userid;\n\t\t\t\t$query \t\t\t= $this->db->query($username);\n\t\t\t\tif($query->num_rows() > 0) {\n\t\t\t\t\t$username \t\t\t\t\t\t= $query->row_array();\n\t\t\t\t\t$commentdata[$i]['user_id'] \t= $userid;\n\t\t\t\t\t$commentdata[$i]['username']\t= $username['username'];\n\t\t\t\t\t$commentdata[$i]['comment'] \t= $comment['comment'];\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$datas['commentdata'] = $commentdata;\n\t\t} else {\n\t\t\t$datas['commentdata'] = array();\n\t\t\t\n\t\t}\n\t\t// update the view count \n\t\t$stats \t\t\t= \"select viewcount, likecount, commentcount from appstats where reddit_id = '\".$reddit_id.\"'\";\t\t\n\t\t$query \t\t\t= $this->db->query($stats);\n\t\t//pr($query);\n if ($query->num_rows() > 0) {\n $datas['statsdata']\t\t\t\t= $query->row_array();\n $datas['statsdata']['viewcount']= $datas['statsdata']['viewcount']+1;\n $update_view \t= \"UPDATE appstats SET viewcount= \".$datas['statsdata']['viewcount'].\" WHERE reddit_id='\".$reddit_id.\"'\";\n $this->db->query($update_view);\n\t\t}else{ \n\t\t\t// insert for new record\n\t\t\t$like_entry = array(\n\t\t\t\t'reddit_id' \t=> $reddit_id,\n\t\t\t\t'post_id'\t\t=> $pid,\n\t\t\t\t'viewcount'\t\t=> '1',\n\t\t\t\t'likecount'\t\t=> 0,\n\t\t\t\t'commentcount'\t=> 0,\n\t\t\t\t); \n\t\t\t$result\t\t\t\t= $this->db->insert('appstats', $like_entry);\n\t\t\tif($result){\n\t\t\t\t$datas['statsdata']['viewcount']\t= 1;\n\t\t\t} else{\n\t\t\t\t$datas['statsdata']['viewcount']\t= 0;\n\t\t\t\t}\n\t\t\t\n\t\t\t//$datas['statsdata']['viewcount']\t= 0;\n\t\t\t$datas['statsdata']['likecount']\t= 0;\n\t\t\t$datas['statsdata']['commentcount']\t= 0;\n\t\t}\n\t\t$this->trueResponse($datas,'success',$encode = true); \n\t}", "public function postguardar() {\n PaisValidation::validate($_POST);\n $model = new Pais();\n $model->pais = $_POST['pais'];\n\n $rh = (new PaisRepository())->Guardar($model);\n if ($rh->response) {\n $rh->href = 'mantenimiento/paises';\n }\n print_r(json_encode($rh));\n }", "public function store(Requests\\PostRequest $request)\n {\n $name = $request->input('name');\n $body = $request->input('body');\n $slug = $request->input('slug');\n \n $command = new StorePostCommand($name,$body,$slug);\n\n $this->dispatch($command);\n\n return redirect()->route('post.index');\n}", "public function p_share() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('requests', $_POST);\n\n # send them to view list of active posts\n\n Router::redirect(\"/requests/index\");\n\n }", "public function post_professor(){\n $params = array(\n 'net_id' => Input::get('net_id'),\n 'email_addr' => Input::get('email_addr'),\n 'passwd' => Hash::make(Input::get('passwd'))\n ); \n\n // Make new user and add to users table\n $user = User::create(array('net_id' => $params['net_id'], 'passwd' => $params['passwd']));\n $user->save();\n\n $prof = new Professor;\n $prof->fill($params); \n $prof->save();\n\n Auth::login($user);\n\n // TO DO: CHANGE THIS TO SOMETHING ELSE\n return Redirect::to('special/prof_view_requests');\n }", "function index_post() {\n\t\t$data1 = array(\n\t\t\t\t'id_driver' => $this->post('id_driver') ,\n\t\t\t\t'status' => $this->post('status'),\n\t\t\t\t'fotoSim' => $this->post('fotoSim') \n\t\t);\n\t\t$insert = $this->db->insert('driver_detail',$data1);\n\n\t\tif ($insert) {\n\t\t\t$this->response($data,200);\n\t\t} else {\n\t\t\t$this->response(array('status' => 'fail', 502));\n\t\t}\n\t}", "protected function processPost() {\n\t\tif (isset($_POST['posted'])) {\n\t\t\t$this->is_save_request = TRUE;\n\t\t\tunset($_POST['posted']);\n\t\t}\n\n\t\t// process the remaining post vars\n\t\tif (0) deb(\"Survey1: processPost: POST = \", $_POST);\n\t\tforeach($_POST as $job_id=>$offer) {\n\t\t\tif ($job_id == 'username') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$job_name = get_job_name($job_id);\n\t\t\t// All offers except positive integers are treated as 0, meaning \"I don't want to do this job\"\n\t\t\tif ($offer == NULL || $offer < 0 || !is_numeric($offer)) $offer = 0;\n\t\t\tif (is_float($offer)) $offer = round($is_offer);\n\t\t\tif (0) deb(\"Survey1: processPost: job_name = offer: \", $job_name.\" = \".$offer);\n\t\t\t$this->results[$job_id] = $offer;\n\t\t}\n\t\tif (0) deb(\"Survey1: processPost: Results:\", $this->results);\n\t}", "public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}", "function post();", "public function store()\n {\n \t//Create a new post using the request data\n \t// dd( request( 'title' ) );\n\n \t// $post = new Post;\n\n \t//Doing some validation\n \t$this->validate( request(), [\n \t\t\t'title' => 'required',\n \t\t\t'body' \t=> 'required'\n \t\t]);\n\n \t//Creates and stores new entry to db\n \tPost::create( [ \n \t\t'title' => request( 'title' ), \n\n \t\t'body' \t=> request( 'body' ),\n\n 'user_id' => auth()->id() \n \t] );\n\n \t//And re-direct to the home page.\n \treturn redirect( '/' );\n }", "public function create_room ( $data ) {\n\t\t$room_slug = str_replace(\" \", \"-\", strtolower($data['name']));\n\t\t$new_slug = $data['trainer_id'] . \"-\" . $room_slug;\n\t\tif ($this->check_room($new_slug)) {\n\t\t\treturn array('success' => false, 'msg' => 'room exist' );\n\t\t}\n\t\telse {\n\t\t\tif ( $this->deactivate_rooms( $data['trainer_id'] ) == true ) {\n\t\t\t\tif ( $data['banner_type'] == 1 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, mc_api, mc_list, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['mc_api'].\"', '\".$data['mc_list'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse if ( $data['banner_type'] == 2 ) {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, banner_image, banner_type, banner_url, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['banner_image'].\"', '\".$data['banner_type'].\"', '\".$data['banner_url'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$sql = \"INSERT INTO rooms (name, session_id, trainer_id, guest_id, active, allow_guest_client, schedule_time, schedule_time_timestamp, is_sched, twitter_list_id, short_url, slug, date_added, fb_pixel, tt_pixel, ad_pixel) VALUES ('\".$data['name'].\"', '\".$data['session_id'].\"', '\".$data['trainer_id'].\"', '', '\".$data['active'].\"', '\".$data['allow_guest_client'].\"', '\".$data['schedule_time'].\"', '\".$data['schedule_time_timestamp'].\"', '\".$data['is_sched'].\"', '\".$data['twitter_list_id'].\"', '\".$data['short_url'].\"', '\".$new_slug.\"', '\".time().\"', '\".$data['fb_pixel'].\"', '\".$data['tt_pixel'].\"', '\".$data['ad_pixel'].\"')\";\n\t\t\t\t}\n\t\t\n\t\t\t\tif ($this->conn->query($sql) === TRUE) {\n\t\t\t\t return array('success' => true, 'slug' => $new_slug );\n\t\t\t\t} else {\n\t\t\t\t\treturn array('success' => false, 'msg' => 'database error', 'sql' => $sql );\n\t\t\t\t //echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function item_post(&$a) {\n\n\tif((! local_user()) && (! remote_user()))\n\t\treturn;\n\n\trequire_once('include/security.php');\n\n\t$uid = local_user();\n\n\t$parent = ((x($_POST,'parent')) ? intval($_POST['parent']) : 0);\n\n\t$parent_item = null;\n\n\tif($parent) {\n\t\t$r = q(\"SELECT * FROM `item` WHERE `id` = %d LIMIT 1\",\n\t\t\tintval($parent)\n\t\t);\n\t\tif(! count($r)) {\n\t\t\tnotice( t('Unable to locate original post.') . EOL);\n\t\t\tgoaway($a->get_baseurl() . \"/\" . $_POST['return'] );\n\t\t}\n\t\t$parent_item = $r[0];\n\t}\n\n\t$profile_uid = ((x($_POST,'profile_uid')) ? intval($_POST['profile_uid']) : 0);\n\n\n\tif(! can_write_wall($a,$profile_uid)) {\n\t\tnotice( t('Permission denied.') . EOL) ;\n\t\treturn;\n\t}\n\n\t$user = null;\n\n\t$r = q(\"SELECT * FROM `user` WHERE `uid` = %d LIMIT 1\",\n\t\tintval($profile_uid)\n\t);\n\tif(count($r))\n\t\t$user = $r[0];\n\t\n\n\t$str_group_allow = perms2str($_POST['group_allow']);\n\t$str_contact_allow = perms2str($_POST['contact_allow']);\n\t$str_group_deny = perms2str($_POST['group_deny']);\n\t$str_contact_deny = perms2str($_POST['contact_deny']);\n\n\t$title = notags(trim($_POST['title']));\n\t$body = escape_tags(trim($_POST['body']));\n\t$location = notags(trim($_POST['location']));\n\t$coord = notags(trim($_POST['coord']));\n\t$verb = notags(trim($_POST['verb']));\n\n\tif(! strlen($body)) {\n\t\tnotice( t('Empty post discarded.') . EOL );\n\t\tgoaway($a->get_baseurl() . \"/\" . $_POST['return'] );\n\n\t}\n\n\t// get contact info for poster\n\n\t$author = null;\n\n\tif(($_SESSION['uid']) && ($_SESSION['uid'] == $profile_uid)) {\n\t\t$r = q(\"SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1\",\n\t\t\tintval($_SESSION['uid'])\n\t\t);\n\t}\n\telse {\n\t\tif((x($_SESSION,'visitor_id')) && (intval($_SESSION['visitor_id']))) {\n\t\t\t$r = q(\"SELECT * FROM `contact` WHERE `id` = %d LIMIT 1\",\n\t\t\t\tintval($_SESSION['visitor_id'])\n\t\t\t);\n\t\t}\n\t}\n\n\tif(count($r)) {\n\t\t$author = $r[0];\n\t\t$contact_id = $author['id'];\n\t}\n\n\t// get contact info for owner\n\t\n\tif($profile_uid == $_SESSION['uid']) {\n\t\t$contact_record = $author;\n\t}\n\telse {\n\t\t$r = q(\"SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1\",\n\t\t\tintval($profile_uid)\n\t\t);\n\t\tif(count($r))\n\t\t\t$contact_record = $r[0];\n\t}\n\n\t$post_type = notags(trim($_POST['type']));\n\n\tif($post_type === 'net-comment') {\n\t\tif($parent_item !== null) {\n\t\t\tif($parent_item['type'] === 'remote') {\n\t\t\t\t$post_type = 'remote-comment';\n\t\t\t} \n\t\t\telse {\t\t\n\t\t\t\t$post_type = 'wall-comment';\n\t\t\t}\n\t\t}\n\t}\n\n\t$str_tags = '';\n\t$inform = '';\n\n\t$tags = get_tags($body);\n\n\n\tif(count($tags)) {\n\t\tforeach($tags as $tag) {\n\t\t\tif(strpos($tag,'@') === 0) {\n\t\t\t\t$name = substr($tag,1);\n\t\t\t\tif((strpos($name,'@')) || (strpos($name,'http://'))) {\n\t\t\t\t\t$newname = $name;\n\t\t\t\t\t$links = @lrdd($name);\n\t\t\t\t\tif(count($links)) {\n\t\t\t\t\t\tforeach($links as $link) {\n\t\t\t\t\t\t\tif($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')\n \t\t\t$profile = $link['@attributes']['href'];\n\t\t\t\t\t\t\tif($link['@attributes']['rel'] === 'salmon') {\n\t\t\t\t\t\t\t\tif(strlen($inform))\n\t\t\t\t\t\t\t\t\t$inform .= ',';\n \t\t\t$inform .= 'url:' . str_replace(',','%2c',$link['@attributes']['href']);\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\t$newname = $name;\n\t\t\t\t\tif(strstr($name,'_')) {\n\t\t\t\t\t\t$newname = str_replace('_',' ',$name);\n\t\t\t\t\t\t$r = q(\"SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1\",\n\t\t\t\t\t\t\tdbesc($newname),\n\t\t\t\t\t\t\tintval($profile_uid)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$r = q(\"SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1\",\n\t\t\t\t\t\t\tdbesc($name),\n\t\t\t\t\t\t\tintval($profile_uid)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif(count($r)) {\n\t\t\t\t\t\t$profile = $r[0]['url'];\n\t\t\t\t\t\tif(strlen($inform))\n\t\t\t\t\t\t\t$inform .= ',';\n\t\t\t\t\t\t$inform .= 'cid:' . $r[0]['id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($profile) {\n\t\t\t\t\t$body = str_replace($name,'[url=' . $profile . ']' . $newname\t. '[/url]', $body);\n\t\t\t\t\tif(strlen($str_tags))\n\t\t\t\t\t\t$str_tags .= ',';\n\t\t\t\t\t$profile = str_replace(',','%2c',$profile);\n\t\t\t\t\t$str_tags .= '@[url=' . $profile . ']' . $newname\t. '[/url]';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t$wall = 0;\n\tif($post_type === 'wall' || $post_type === 'wall-comment')\n\t\t$wall = 1;\n\n\tif(! strlen($verb))\n\t\t$verb = ACTIVITY_POST ;\n\n\t$gravity = (($parent) ? 6 : 0 );\n \n\t$notify_type = (($parent) ? 'comment-new' : 'wall-new' );\n\n\t$uri = item_new_uri($a->get_hostname(),$profile_uid);\n\n\t$r = q(\"INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`, \n\t\t`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`, \n\t\t`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)\n\t\tVALUES( %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )\",\n\t\tintval($profile_uid),\n\t\tdbesc($post_type),\n\t\tintval($wall),\n\t\tintval($gravity),\n\t\tintval($contact_id),\n\t\tdbesc($contact_record['name']),\n\t\tdbesc($contact_record['url']),\n\t\tdbesc($contact_record['thumb']),\n\t\tdbesc($author['name']),\n\t\tdbesc($author['url']),\n\t\tdbesc($author['thumb']),\n\t\tdbesc(datetime_convert()),\n\t\tdbesc(datetime_convert()),\n\t\tdbesc(datetime_convert()),\n\t\tdbesc($uri),\n\t\tdbesc($title),\n\t\tdbesc($body),\n\t\tdbesc($location),\n\t\tdbesc($coord),\n\t\tdbesc($str_tags),\n\t\tdbesc($inform),\n\t\tdbesc($verb),\n\t\tdbesc($str_contact_allow),\n\t\tdbesc($str_group_allow),\n\t\tdbesc($str_contact_deny),\n\t\tdbesc($str_group_deny)\n\t);\n\t$r = q(\"SELECT `id` FROM `item` WHERE `uri` = '%s' LIMIT 1\",\n\t\tdbesc($uri));\n\tif(count($r)) {\n\t\t$post_id = $r[0]['id'];\n\n\t\tif($parent) {\n\n\t\t\t// This item is the last leaf and gets the comment box, clear any ancestors\n\t\t\t$r = q(\"UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent` = %d \",\n\t\t\t\tdbesc(datetime_convert()),\n\t\t\t\tintval($parent)\n\t\t\t);\n\n\t\t\t// Inherit ACL's from the parent item.\n\t\t\t// TODO merge with subsequent UPDATE operation and save a db write \n\n\t\t\t$r = q(\"UPDATE `item` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'\n\t\t\t\tWHERE `id` = %d LIMIT 1\",\n\t\t\t\tdbesc($parent_item['allow_cid']),\n\t\t\t\tdbesc($parent_item['allow_gid']),\n\t\t\t\tdbesc($parent_item['deny_cid']),\n\t\t\t\tdbesc($parent_item['deny_gid']),\n\t\t\t\tintval($post_id)\n\t\t\t);\n\n\t\t\t// Send a notification email to the conversation owner, unless the owner is me and I wrote this item\n\t\t\tif(($user['notify-flags'] & NOTIFY_COMMENT) && ($contact_record != $author)) {\n\t\t\t\trequire_once('bbcode.php');\n\t\t\t\t$from = $author['name'];\n\t\t\t\t$tpl = load_view_file('view/cmnt_received_eml.tpl');\t\t\t\n\t\t\t\t$email_tpl = replace_macros($tpl, array(\n\t\t\t\t\t'$sitename' => $a->config['sitename'],\n\t\t\t\t\t'$siteurl' => $a->get_baseurl(),\n\t\t\t\t\t'$username' => $user['username'],\n\t\t\t\t\t'$email' => $user['email'],\n\t\t\t\t\t'$from' => $from,\n\t\t\t\t\t'$body' => strip_tags(bbcode($body))\n\t\t\t\t));\n\n\t\t\t\t$res = mail($user['email'], $from . t(\" commented on your item at \") . $a->config['sitename'],\n\t\t\t\t\t$email_tpl,t(\"From: Administrator@\") . $a->get_hostname() );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$parent = $post_id;\n\n\t\t\t// let me know if somebody did a wall-to-wall post on my profile\n\n\t\t\tif(($user['notify-flags'] & NOTIFY_WALL) && ($contact_record != $author)) {\n\t\t\t\trequire_once('bbcode.php');\n\t\t\t\t$from = $author['name'];\n\t\t\t\t$tpl = load_view_file('view/wall_received_eml.tpl');\t\t\t\n\t\t\t\t$email_tpl = replace_macros($tpl, array(\n\t\t\t\t\t'$sitename' => $a->config['sitename'],\n\t\t\t\t\t'$siteurl' => $a->get_baseurl(),\n\t\t\t\t\t'$username' => $user['username'],\n\t\t\t\t\t'$email' => $user['email'],\n\t\t\t\t\t'$from' => $from,\n\t\t\t\t\t'$body' => strip_tags(bbcode($body))\n\t\t\t\t));\n\n\t\t\t\t$res = mail($user['email'], $from . t(\" posted on your profile wall at \") . $a->config['sitename'],\n\t\t\t\t\t$email_tpl,t(\"From: Administrator@\") . $a->get_hostname() );\n\t\t\t}\n\t\t}\n\n\t\t$r = q(\"UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1\n\t\t\tWHERE `id` = %d LIMIT 1\",\n\t\t\tintval($parent),\n\t\t\tdbesc(($parent == $post_id) ? $uri : $parent_item['uri']),\n\t\t\tdbesc(datetime_convert()),\n\t\t\tintval($post_id)\n\t\t);\n\n\t\t// photo comments turn the corresponding item visible to the profile wall\n\t\t// This way we don't see every picture in your new photo album posted to your wall at once.\n\t\t// They will show up as people comment on them.\n\n\t\tif(! $parent_item['visible']) {\n\t\t\t$r = q(\"UPDATE `item` SET `visible` = 1 WHERE `id` = %d LIMIT 1\",\n\t\t\t\tintval($parent_item['id'])\n\t\t\t);\n\t\t}\n\t}\n\n\t$php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');\n\t$proc_debug = get_config('system','proc_debug');\n\n\tproc_close(proc_open(\"\\\"$php_path\\\" \\\"include/notifier.php\\\" \\\"$notify_type\\\" \\\"$post_id\\\" $proc_debug &\",\n\t\tarray(),$foo));\n\n\tgoaway($a->get_baseurl() . \"/\" . $_POST['return'] );\n\treturn; // NOTREACHED\n}", "public function store()\n\t{\n $user_ids = Input::get('user_id');\n $match_id = Input::get('match_id');\n $lineup_id = Input::get('lineup_id');\n $confirmed = (Input::get('confirmed') != null);\n $match = Match::findOrFail($match_id);\n\n if (count(array_unique($user_ids)) < count($user_ids)) {\n $errors = array(\"You are not allowed to play the same player twice\");\n return Redirect::route('roster.create', array('match_id' => $match_id, \n 'lineup_id' => $lineup_id))\n ->withInput()->withErrors($errors);\n }\n \n $roster = new Roster;\n $roster->match_id = $match_id;\n $roster->lineup_id = $lineup_id;\n $roster->confirmed = $confirmed;\n $roster->save();\n\n $i = 1;\n foreach ($user_ids as $user_id) {\n $entry = new RosterEntry;\n $entry->player_id = $user_id;\n $entry->map = $i;\n $entry->roster_id = $roster->id;\n $entry->save();\n\n $i++;\n }\n return Redirect::route('roster.index', $match->tournament->id); \n\t}", "public function post() {\n\t\t$data = self::getPostData();\n\t\t/*\n\t\t * Return not found by defaut, just in case you don't override it when \n\t\t * extending it.\n\t\t */\n\t\tHook::fire(Hook::EVENT_RESPONSE_NOT_FOUND);\n\t}", "public function store() {\n $film = $_POST['film_id'];\n $user = $_POST['user_id'];\n $review = $_POST['review_text'];\n $vote = $_POST['review_vote'];\n\n if (!$review == \"\") {\n\n DB::table('reviews')->insert(\n array(\n 'film_id' => $film,\n 'user_id' => $user,\n 'review_text' => $review,\n 'review_vote' => $vote\n )\n );\n }\n }", "function insert_data($cxn,$studentID,$fname,$lname,$points,$team_id) and insert data from new runner in database\n{\n //Check entered data for vulnerabilities\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\n {\n $fname = test_input($fname);\n $lname = test_input($lname);\n $points = test_input($points);\n $team_id = test_input($team_id);\n }\n\n $query3=\"INSERT INTO runner (student_id, fname, lname, points,team_id) VALUES (\\\"{$studentID}\\\",\\\"{$fname}\\\",\\\"{$lname}\\\",\\\"{$points}\\\",\\\"{$team_id}\\\")\";\n $insert = mysqli_query($cxn, $query3) or die(\"<p class='error'>The new runner can not be saved in the system.<br>Check if you entered all required fields!</p>\");\n if($insert) echo \"<p class='success'>Successfully saved!</p>\"; //when update is successful -> true\n\n}", "function insert_post()\n {\n\t\t$arrWhere = array();\n\t\t$dataInfo = array();\n\t\t\n $fname = $this->input->post('fname', TRUE);\n $fdisplay = $this->input->post('fdisplay', TRUE);\n $fenc = sha1($fname.\" \".$fdisplay);\n \n\t\t$dataInfo = array('group_name'=>$fname, 'group_display'=>$fdisplay, 'group_enc'=>$fenc);\n\t\t\t\n\t\t$arrWhere = array('group_name'=>$fname);\n\t\t$exist = $this->MUGroup->check_data_exists($arrWhere);\n\t\t\n\t\tif($exist > 0){\n $this->response([\n 'status' => FALSE,\n 'message' => 'Data already exist'\n ], REST_Controller::HTTP_OK);\n\t\t}else{\n\t\t\t$result = $this->MUGroup->insert_data($dataInfo);\n\t\t\t\n\t\t\tif($result > 0)\n\t\t\t{\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => TRUE,\n\t\t\t\t\t'message' => 'Data is successfully inserted'\n\t\t\t\t], REST_Controller::HTTP_OK);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->response([\n\t\t\t\t\t'status' => FALSE,\n\t\t\t\t\t'message' => 'Failed to insert data'\n\t\t\t\t], REST_Controller::HTTP_OK);\n\t\t\t}\n\t\t}\n }", "public function actionSave()\n\t{\n\t\t// Is this an existing entry or a new entry?\n\t\tif ($id = craft()->request->getPost('rerouteId')) {\n\t\t\t$model = craft()->reroute->getById($id);\n\t\t} else {\n\t\t\t$model = craft()->reroute->create();\n\t\t}\n\n\t\t// Get the submitted data\n\t\t$data = craft()->request->getPost('reroute');\n\t\t$model->oldUrl = $data['oldUrl'];\n\t\t$model->newUrl = $data['newUrl'];\n\t\t$model->method = $data['method'];\n\n\t\t// Did we pass validation?\n\t\tif($model->validate()) {\n\t\t\tcraft()->reroute->save($model);\n\n\t\t\tcraft()->userSession->setNotice(Craft::t('Reroute saved.'));\n\n\t\t\treturn $this->redirectToPostedUrl();\n\t\t} else {\n\t\t\tcraft()->userSession->setError(Craft::t('There was a problem with your submission, please check the form and try again!'));\n\t\t\tcraft()->urlManager->setRouteVariables(array('reroute' => $model));\n\t\t}\n\t}", "public function post()\n {\n //\n }", "function addPostingHandler() {\n global $inputs;\n\n $src = uploadFile();\n\n $lastId = insert('posting',[\n 'pic' => $src,\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n \t 'status' => $inputs['status']\n ]);\n\n insert('member_posting', [\n 'posting_id' => $lastId,\n 'member_id' => getLogin()['mid']\n ]);\n\n formatOutput(true, 'add success',$lastId);\n}" ]
[ "0.6381216", "0.6348381", "0.62722725", "0.61329746", "0.6066395", "0.6051743", "0.60353124", "0.5935081", "0.5933123", "0.59189874", "0.59185547", "0.58969754", "0.58969754", "0.58969754", "0.5879666", "0.58511734", "0.58409333", "0.5838517", "0.58144116", "0.5799708", "0.5770188", "0.5728805", "0.57267773", "0.57220745", "0.5653374", "0.5651853", "0.56500936", "0.56304634", "0.5626855", "0.56152445", "0.5602162", "0.5599921", "0.55895746", "0.5576759", "0.5574973", "0.5572566", "0.55662215", "0.55350983", "0.5534722", "0.55314326", "0.55296105", "0.5526983", "0.55224496", "0.5512996", "0.5497639", "0.54899377", "0.54816604", "0.5477131", "0.54747075", "0.54644316", "0.5457984", "0.5457084", "0.5454938", "0.5454662", "0.5451183", "0.5443676", "0.5440128", "0.54393184", "0.54239094", "0.54227036", "0.54141235", "0.5411101", "0.5409818", "0.54097724", "0.54071146", "0.53992534", "0.5367753", "0.5366342", "0.53599715", "0.5359327", "0.5356061", "0.5348705", "0.5340776", "0.5339966", "0.53364366", "0.5335517", "0.5331689", "0.5327115", "0.53232723", "0.53112316", "0.53087866", "0.53055036", "0.5298025", "0.5295738", "0.5294705", "0.5292917", "0.52824867", "0.52778536", "0.527153", "0.5269041", "0.52654797", "0.526499", "0.5264826", "0.525852", "0.5257204", "0.525334", "0.5247297", "0.5244658", "0.5244559", "0.52360195", "0.5234386" ]
0.0
-1
$sql = "SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id and quantity=1";
public function get_dd_price ( $sku_id ) { $sql = "SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id HAVING MIN( quantity )"; $query = $this->db->query( $sql ); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_unit_price($sku_id) {\n $sql = \"SELECT t1.outlet_lifting_price as price, t2.sku_code, t2.sku_description\n FROM `tbli_sku_mou_price_mapping` as t1 \n Inner JOIN `tbld_sku` as t2 On t1.sku_id=t2.id\n where sku_id=$sku_id and quantity=1\";\n $query = $this->db->query($sql)->result_array();\n\n return $query;\n }", "function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "function get_price($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$result=mysql_query(\"select price from $products where $serial=$pid\")\n or die (\"Query '$products' and '$pid' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row['price']; // products price\n}", "function getMaxprice(){\r\n $q = \"SELECT * FROM maximum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function getFoodbyID($sku){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n\r\n // YOUR CODE GOES HERE\r\n\r\n return $result;\r\n }", "function getTotalProductsSold() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantitysold) AS sqs FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function get_price($name)\n{\n $query_setting_price = mysql_query(\"SELECT `value` FROM `setting_seagods` WHERE `name` = '$name' LIMIT 0,1\");\n $row_setting_price = mysql_fetch_array($query_setting_price);\n return $row_setting_price['value'];\n}", "function getMinPrice(){\r\n $q = \"SELECT * FROM minimum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "function getTotalProductsAvailable() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantityavailable) AS sqa FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function mount_query($date){\n\n$query = \"SELECT product_quantity.quantity, product.price FROM table_order, product, product_quantity\nWHERE product.product_id = table_order.product_id\n\tAND product_quantity.pq_id = table_order.pq_id\n\tAND product_quantity.product_id = table_order.product_id\n\tAND table_order.order_date =\".$date.\";\";\n\nreturn $query;\n}", "public function getPatientChargesQTY($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT * from patientCharges where itemNo = '$itemNo' \");\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['quantity'];\n }\n\n}", "private function getProductSearchQuery(string $productSku): string\n {\n return <<<QUERY\n{\n products(filter: {sku: {eq: \"{$productSku}\"}}) {\n items {\n special_price\n }\n }\n}\nQUERY;\n }", "function get_price($name)\r\n{\r\n //Read data from DB table\r\n\r\n $servername = \"localhost\";\r\n $dbname = \"webservices\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n\t\r\n\r\n \r\n $sql = \"SELECT price, make, model, year FROM vehicles_pinefalls where make ='$name' order by price asc limit 1\";\r\n $result = $conn->query($sql);\r\n\r\n $info=mysqli_fetch_array($result,MYSQLI_ASSOC);\r\n\r\n return $info;\r\n}", "function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }", "private function getProductQuery(string $sku): string\n {\n return <<<QUERY\n{\n products(search: \"{$sku}\") {\n items {\n sku\n ... on BundleProduct {\n items {\n sku\n option_id\n uid\n required\n type\n title\n options {\n uid\n label\n product {\n sku\n }\n can_change_quantity\n id\n uid\n price\n quantity\n }\n }\n }\n }\n }\n}\nQUERY;\n }", "function es_product_bulk_price($price, $quantity, $sku) {\n\t/*\n\t* PUB41 - Your child’s first year at school Bulk discount\n\t* For orders of x >= 20 $12.95, x >= 50 $9.90\n\t*/\n\tif ($sku == 'PUB41') {\n\t\tif ($quantity >= 20 AND $quantity < 50) {\n\t\t\t$price = 12.95;\n\t\t}\n\t\telseif ($quantity >= 50) {\n\t\t\t$price = 9.95;\n\t\t}\n\t}\n\telseif($sku == 'SUND507') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 10.95;\n\t}\n\telseif($sku == 'SUND621') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 16.95;\n\t}\n\telseif($sku == 'SUND620') {\n\t\tif ($quantity >= 5)\n\t\t\t$price = 14.95;\n\t}\n\t\n\treturn $price;\n}", "public function get_prices ( $sku_id )\n {\n $sql = \"SELECT * FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id Order by quantity\";\n $query = $this->db->query( $sql );\n return $query->result_array();\n }", "function jumlah_powerdall(){\n\t\t// return $this->db->query($query)->result();\n\t\tdate_default_timezone_set(\"Asia/Makassar\");\n\t\t$kondisi=date(\"m\");\n\t\t$query = \"SELECT SUM(power) as powerm FROM power_s3d WHERE m=$kondisi\";\n\t\treturn $this->db->query($query)->result();\n\t}", "function _get_product_stock_bystkid($stock_id = 0)\r\n {\r\n return @$this->db->query(\"select available_qty as t from t_stock_info where stock_id = ? and available_qty >= 0 \",$stock_id)->row()->t;\r\n }", "function getStockQuantity($username, $symbol)\n{\n $mysql_server = '192.168.1.101';\n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n \n $qry = \"SELECT * FROM portfolio WHERE username='$username' and stockSymbol='$symbol'\";\n $result = $mysqli->query($qry);\n \n $totalQty = 0;\n \n \n if($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n \n $totalQty += $row['qty'];\n }\n }\n return $totalQty;\n}", "function low_price(){\n\tglobal $con;\t\n\t$get_lprice = \"SELECT * FROM items ORDER BY item_pice ASC\";\n\t$run_lprice = mysql_query($get_lprice);\t\n\tshow_item($run_lprice);\n\n}", "private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function fetchAllItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id\";\r\t$result8 = mysqli_query($link, $query);\rif($result8)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "function getStockQuantity($stock_id,$mysqli){\n\t$query = \"SELECT quantity_in_store FROM stocks WHERE id = '$stock_id'\";\n\tif ($result = mysqli_query($mysqli,$query)){\n\t\treturn mysqli_fetch_assoc($result)['quantity_in_store'];\n\t}else{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\n}", "function getProductById($itemId) {\r\n $itemId - intval($itemId);\r\n $sql = \"SELECT * FROM products WHERE id = '$itemId'\";\r\n//d($sql);\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n// d($rs);\r\n// d(mysqli_fetch_all($rs, MYSQLI_ASSOC));\r\n\r\n return mysqli_fetch_all($rs, MYSQLI_ASSOC);\r\n}", "public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }", "function SkuFromID($parametro){\n\t$db = new mysql();\n\t\n\t$result = $db->consulta(\"SELECT IDPRODUCTO,FECHA FROM \".PREFIX.\"productos WHERE IDPRODUCTO='\".$parametro.\"' LIMIT 1\");\n\t$row = $db->recuperar_array($result);\t\n\t$sku = $row['PRESKU'].$parametro;\n\treturn $sku;\n}", "public function getExternalSkuData ()\n {\n $sql = \"SELECT t1.id,t1.sku_name,t1.sku_creation_date,t1.sku_description,t3.sku_active_status_name,t4.unit_name FROM\n `tbld_sku` as t1 \n inner join `tbli_sku_mou_price_mapping` as t2 on t1.id=t2.sku_id\n left join `tbld_sku_active_status` as t3 on t1.sku_active_status_id=t3.id\n left join `tbld_unit` as t4 on t2.mou_id=t4.id\n where t1.sku_type_id=2\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "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}", "function getPrice($id,$rdvtype){\r global $bdd;\r\r $req4=$bdd->prepare(\"select * from packs where idpack=? \");\r $req4->execute(array($id));\r while($ar = $req4->fetch()){\r if($rdvtype == 'visio'){return $ar['prvisio'];}else if($rdvtype == 'public'){return $ar['prpublic'];}else if($rdvtype == 'domicile'){return $ar['prdomicile'];}\r }\r\r return 200;\r}", "public function getDdPrice($unit_id, $product_id) {\n $this->db->select('outlet_lifting_price as price');\n $this->db->from('tbli_sku_mou_price_mapping');\n $this->db->where('mou_id', $unit_id);\n $this->db->where('sku_id', $product_id);\n $query = $this->db->get()->result_array();\n\n return $query;\n }", "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}", "public function getDataJeux3($num) {\r\n\t\t$this->load->database('default');\r\n\t\t$sql=\"select sum(quantiteJeu) from concerner,reservation,festival where aRenvoyer=1 and concerner.numReservation=reservation.numReservation and reservation.numFestival=festival.numFestival and festival.numFestival=?\" ;\r\n\t\t$res=$this->db->query($sql,$num);\r\n\t\t$row = $res->row_array();\r\n\t\treturn $row;\r\n}", "function getProductInfo($pid) {\r\n global $conn;\r\n $select = \"SELECT * FROM product WHERE productid=\" . $pid . \";\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function getProductbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock` > 0 AND `id` = ?\");\n\t\t$sth \t->execute(array($id));\n\n\t\treturn \t$sth;\n\t}", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "function total_price2(){\n\tglobal $conn;\n\t$ip = getIp();\n\t$total=0;\n\t$get_cart =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip'\");\n\twhile ( $row_cart=mysqli_fetch_array($get_cart)) {\n\t\t# code...\n\n\t\t$quantity= $row_cart[\"qty\"];\n\t\t$product_id=$row_cart['p_id'];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\twhile ( $row_price = mysqli_fetch_array($get_price)) {\n\t\n\t\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\t$total +=$sub_total;\n\t}\n\t\n\t}\n\t\n\n\treturn $total;\n\n\t\n}", "function fetchAllMinimumItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.minimum_quantity,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id having sum(stock.current_stock)<(item.minimum_quantity)\";\r\t$result8 = mysqli_query($link, $query);\r\t$r=mysqli_num_rows($result8);\t\rif($r!=0)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "public function fetch_dec_qty($cart_id)\n {\n $this->db->select('selling_price,shipping_charge,qty');\n $this->db->from('rl_cart_tbl');\n $condition=array(\"cart_id\"=>$cart_id);\n $this->db->where($condition);\n $que=$this->db->get();\n return $que;\n echo $this->db->last_query();\n }", "function ierg4210_prod_fetchOne() {\n // DB manipulation\n global $db;\n $db = ierg4210_DB();\n $pid = (int)$_REQUEST['pid'];\n $q = $db->prepare(\"SELECT * FROM products WHERE pid = $pid;\");\n if ($q->execute())\n return $q->fetchAll();\n}", "public function getProductBySku($sku);", "function WselectSerialNumberForItemByID($OrderID,$item_id,$sku){\r\n\t\t\t $strSQLQuery = \"select SerialNumbers from p_order_item where OrderID='\".$OrderID.\"' and item_id='\".$item_id.\"' and sku='\".$sku.\"'\";\r\n\t\t\t return $this->query($strSQLQuery, 1);\r\n\t\t }", "function fetch_all_products ($in_stock) {\n $db = getDb();\n if ($in_stock) {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n WHERE\n inventory_count > 0\n \");\n } else {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n \");\n }\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_OBJ);\n return $result;\n}", "function getLeastAvailableProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantityavailable ASC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function high_price(){\n\n\tglobal $con;\t\n\t$get_hprice = \"SELECT * FROM items ORDER BY item_pice DESC\";\n\t$run_hprice = mysql_query($get_hprice);\t\n\tshow_item($run_hprice);\n\n}", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "public function get_Product($product){\r\n $sql = \"select Item From inventory WHERE Item = '$product'\";\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $result = $conn->query($sql);\r\n if ($result->num_rows > 0) {\r\n // output data of each row\r\n while($row = $result->fetch_assoc()) {\r\n /*\r\n * adding html can be done by calling the echo statement\r\n * example:\r\n * echo \"<tr class='TableRows'>\";\r\n * remember this is just html code just in a php format\r\n * more data can be added just a sample from my database\r\n * this function can become a key to our project and more advance\r\n * if you change any styling to this function its going to change the whole product page\r\n * you can delete these comments once we finish the product page and add needed information\r\n */\r\n $Item = $row[\"Item\"];\r\n echo $Item;\r\n }\r\n }\r\n }", "function get_info($item_kit_id) {\n $this->db->from('paket_sofa_items');\n $this->db->where('paket_id', $item_kit_id);\n \n //return an array of item kit items for an item\n return $this->db->get()->result_array();\n}", "function getAllProducts(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0\");\n\t\t$sth \t->execute();\n\t\t\n\t\treturn \t$sth;\n\t}", "public function get_base_mkprodid_by_mkid($mkid){\n $query = '\n SELECT \n ps.prodi_nama,\n ps.prodi_kode,\n mp.`mkkprod_id`,\n mp.`mkkprod_porsi_kelas`,\n mkk.`mkkur_pred_jml_peminat`,\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS t,\n mkkprod_porsi_kelas * (mkk.`mkkur_pred_jml_peminat` DIV\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n )) AS jml_porsi, \n mkk.`mkkur_pred_jml_peminat` MOD\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS sisa\n FROM program_studi ps\n LEFT JOIN mkkur_prodi mp ON ps.prodi_id = mp.mkkprod_prodi_id\n LEFT JOIN mata_kuliah_kurikulum mkk ON mp.`mkkprod_mkkur_id` = mkk.`mkkur_id`\n WHERE mp.mkkprod_mkkur_id = \"'.$mkid.'\"\n AND mp.`mkkprod_related_id` IS NULL \n AND mp.`mkkprod_porsi_kelas` <> 0\n ';\n\n $ret = $this->db->query($query);\n $ret = $ret->result_array();\n\n return $ret;\n }", "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 }", "function getItemsByPrice($dbh, $min, $max)\r\n{\r\n $stmt = $dbh->prepare ( \"SELECT * FROM items WHERE items.price >= ? and items.price <= ?\"); \r\n\r\n $stmt->bindParam(1,$min);\r\n $stmt->bindParam(2,$max);\r\n\r\n if ($stmt->execute()) \r\n {\r\n showItemsTable($stmt);\r\n }\r\n}", "public function modelTotalRecordSearchPrice(){\n\t\t\t$fromPrice = isset($_GET[\"fromPrice\"])?$_GET[\"fromPrice\"]:0;\n \t\t$toPrice = isset($_GET[\"toPrice\"])?$_GET[\"toPrice\"]:0;\n\t\t\t//lay bien ket noi\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->prepare(\"select id from products where price >= $fromPrice and price <= $toPrice\");\n\t\t\t//thuc thi truy van. Neu khong co tham so o cau truy van thi ghi array rong\n\t\t\t$query->execute(array());\n\t\t\t//tra ve so luong ban ghi\n\t\t\treturn $query->rowCount() > 0 ? $query->rowCount() : 1;\n\t\t}", "function discQuan($discQ)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT quanti FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discQ, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"quanti\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function total_price(){\n\n global $db;\n\n $ip_add = getRealIpUser();\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\n while($record= mysqli_fetch_array($run_cart)){\n\n $pro_id = $record['p_id'];\n\n $pro_qty =$record['quantity'];\n\n $get_price = \"select * from products where product_id='$pro_id'\";\n\n $run_price = mysqli_query($db, $get_price);\n\n while($row_price=mysqli_fetch_array($run_price)){\n\n $sub_total = $row_price['product_price'] * $pro_qty;\n\n $total += $sub_total; \n\n }\n }\n\n echo \"&#8358; \" . $total;\n}", "function getBestProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantitysold DESC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function get_qty_akhir($tanggal_akhir, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal < \".$tanggal_akhir;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_akhir >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_akhir.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function findPrice($tourId, $qty);", "function get_qty_awal($tanggal_awal, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal <= \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur < \".$tanggal_awal.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') <\".$tanggal_awal.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_awal.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function fetchrequestAllItemCurrentStock($id)\r{\r $link = parent::connectToDB();\r$query=\"select purchase_order.expected_date,purchase_order.purchase_order_id,purchase_order.status,stock.item_id,stock.quantity,stock.receive_date from purchase_order left outer join stock on purchase_order.purchase_order_id=stock.purchase_order_id where purchase_order.expected_date='$id'\";\r//echo $query;\r$result8 = mysqli_query($link, $query);\r$result11=mysqli_num_rows($result8);\r \rif($result11!=0)\r{\r//echo \"asdfgh\";\rreturn $result8;\r}\relse\r{\r//echo \"not\";\rreturn false;\r}\r\r}", "function getWorstProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantitysold ASC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\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}", "function getQtyAllDetails($pid, $qty) {\n $profileName = array('Allgroup', 'Guest');\n $this->db->select('p3.tier_qty, p3.tier_price');\n $this->db->from('profilegroup p1');\n $this->db->join('profilegroup_config p2', 'p1.id = p2.profile_id', 'INNER');\n $this->db->join('tier_price p3', 'p3.tier_profile_id = p2.profile_id', 'INNER');\n $this->db->where('p3.tier_product_id', intval($pid));\n $this->db->where('p3.tier_qty <=', intval($qty));\n $this->db->where('p2.profileconfig_ref', 'TIERPRICING');\n $this->db->where('p2.profileconfig_value', 1);\n $this->db->where_in('p1.profile_name', $profileName);\n $this->db->group_by('p3.tier_id');\n $this->db->order_by('p3.tier_qty', 'DESC');\n $query = $this->db->get();\n //die($this->db->last_query());\n if ($query->num_rows() > 0) {\n return $query->row_array();\n }\n return false;\n }", "function get_products_array( $sku ) {\n global $wpdb;\n $sku = implode(',' , $sku);\n $products = $wpdb->get_results( \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value IN ({$sku}) \");\n if ( $products ) return $products;\n return null;\n}", "function getProductInc()\n {\n $productInc = \"SELECT * from productincrements\";\n $productIncresult = $this->ds->select($productInc); \n //print_r($productIncresult);\n return $productIncresult;\n }", "function updateSnowQuantity($snowCode,$change){\n $getUserTypeQuery = \"SELECT qtyAvailable FROM snows WHERE code='\".$snowCode.\"'\";\n require_once 'model/dbConnector.php';\n $oldQuantity = executeQuerySelect($getUserTypeQuery)[0]['qtyAvailable'];\n $newQuantity = $oldQuantity-$change;\n $rentInsertQuery2 = \"UPDATE snows SET qtyAvailable=\".$newQuantity.\" WHERE code='\".$snowCode.\"'\";\n $queryResult2 = executeQueryInsert($rentInsertQuery2);\n}", "function get_all_product($conn)\n\t{\n\t\t$query = \"SELECT * FROM producten\";\n\t\treturn mysqli_query($conn,$query);\n\t}", "function shopsLatLongSelect($db) {\n $query = \"SELECT id_shop, name_shop, lat_shop, long_shop, description_shop FROM shop ORDER BY lat_shop ASC;\";\n return mysqli_query($db, $query);\n}", "function getProduct()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\tif(isset($_POST[\"trademarkID\"]) || isset($_POST[\"limit\"]))\n\t\t\t{\n\t\t\t\t$trademark_id=$_POST[\"trademarkID\"];\n\t\t\t\t$limit=$_POST[\"limit\"];\n\t\t\t}\n\t\t\t$query=\"SELECT * FROM product P, trademark T WHERE T.Trademark_id =\".$trademark_id.\" AND T.Trademark_id=P.Trademark_id ORDER BY P.Count_buy DESC LIMIT \".$limit.\",20\";\n\t\t\t$kq=mysqli_query($conn,$query);\n\t\t\t$chuoijson=array();\n\t\t\techo \"{\";\n\t\t\techo \"\\\"PRODUCT\\\":\";\n\t\t\tif($kq)\n\t\t\t{\n\t\t\t\twhile($dong=mysqli_fetch_array($kq))\n\t\t\t\t{\n\t\t\t\t\tarray_push($chuoijson, array(\"Product_id\"=>$dong[\"Product_id\"]\n\t\t\t\t\t,'Product_name'=>$dong[\"Product_name\"]\n\t\t\t\t\t,'Price'=>$dong[\"Price\"]\n\t\t\t\t\t,'Image'=>\"http://\".$_SERVER['SERVER_NAME'].\":82\".\"/webpasokon\".$dong[\"Big_Image\"]));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\techo json_encode($chuoijson,JSON_UNESCAPED_UNICODE);\n\t\t\techo \"}\";\n\t\t}", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "public function getPriceFromDatabase()\n {\n }", "function get_tax_cash_summary($from, $to)\n{\n\n $sql = \"SELECT SUM(gross_output) gross_output,\n SUM(net_output) net_output,\n SUM(payable) payable,\n SUM(gross_input) gross_input,\n SUM(net_input) net_input,\n SUM(collectible) collectible,\n rate,\n id,\n name\n FROM (\".tax_cash_sql($from, $to).\") taxrec\n GROUP BY id, name, rate\";\n//display_error($sql);\n return db_query($sql,\"Cannot retrieve tax summary\");\n}", "function update_cart_table($conx, $uid, $stock, $p, $q)\n{\n\t$pro_select_result = mysqli_query($conx, \"SELECT * FROM cart WHERE cart_product='$p' LIMIT 1\");\n\tif(mysqli_num_rows($pro_select_result)>0)\n\t{\n\t\tif(intval($q) > intval($stock))\n\t\t{\n\t\t\t$msg = \"fail: Can't select $q items because only $stock items in stock\";\n\t\t\techo $msg;\n\t\t\treturn;\n\t\t}\n\n\t\t$pro_update_result = mysqli_query($conx, \"UPDATE cart SET cart_quantity='$q' WHERE cart_product='$p'\");\n\t\tif(mysqli_affected_rows($conx)>0)\n\t\t{\n\t\t\techo \"success: Cart updated\";\n\t\t}else\n\t\t{\n\t\t\techo \"fail: Failed to update cart\";\n\t\t}\n\n\t}else\n\t{\n\t\techo \"faild:Product not in cart\";\n\t}\n}", "public function listProductprice($id){\n try{\n $sql = \"Select * from productforsale where id_productforsale = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n\n $result = $stm->fetch();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprice');\n $result = 2;\n }\n\n return $result;\n }", "public function getItemNo_total($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT cashUnpaid from patientCharges where itemNo = '$itemNo' \");\n\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['cashUnpaid'];\n }\n\n}", "function newsItem_PeriksaJudul( $tbl_news, $judul, $judulinggris ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE judul = '$judul' AND judulinggris = '$judulinggris'\");\n\t\treturn $sql;\t\n\t}", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }", "function subtrac_product_qty($id,$qty)\r\n{\r\n\t$sql = 'UPDATE products SET product_qty = product_qty - '.$qty.' WHERE `product_id` ='.$id.' and product_qty > 0';\r\n\t$results = mysql_query($sql);\r\n}", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "public function getQty();", "public function getQty();", "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 }", "function top_produit()\n{\n\t$sql = \"SELECT produit.id_produit,nom_produit,description_produit,desc_courte_produit,prix,qte,images from produit inner join commande_produit on produit.id_produit = commande_produit.id_produit\n\tinner join commande on commande_produit.id_commande = commande.id_commande limit 1\";\n\tglobal $connection;\n\treturn mysqli_query($connection, $sql);\n}", "function getUnitCost( $modelid, $dealerid, $cost )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select Cost from UnitModelCost where ModelID=$modelid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16562 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16562 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['Cost'] > 0 )\n\treturn $row['Cost'];\n\nreturn $cost;\n}", "public function getPriceById($uid)\n {\n $sql = \" SELECT price FROM slave_user WHERE uid = :uid \";\n return $this->_rdb->fetchOne($sql, array('uid' => $uid));\n }", "function get_movie_cost()\n {\n $query=\"select * from ticket_cost_tbl\";\n \n $qry = $this->db->query($query);\n // echo $this->db->last_query();exit();\n return $qry->result();\n \n \n }", "function get_shipping_by_band($shipping_profile_id, $product_price)\n\t{\n\t\t$shipping_profile_id = mysql_escape_string($shipping_profile_id);\n \t$product_price = mysql_escape_string($product_price);\n\t\t$sql = \"SELECT bp.*, r.region_name, sl.service_level_name, sm.service_desc\n\t\t\tFROM nm_shipping_band_profile as bp\n\t\t\tLEFT JOIN nm_shipping_master as sm ON sm.shipping_master_id = bp.shipping_master_id\n\t\t\tLEFT JOIN nm_shipping_region as r ON sm.region_id = r.region_id\n\t\t\tLEFT JOIN nm_shipping_service_level as sl ON sm.service_level_id = sl.service_level_id\n\t\t\tWHERE bp.shipping_profile_id = $shipping_profile_id\n\t\t\tAND bp.from_price <= $product_price\n\t\t\tAND bp.to_price > $product_price\n\t\t\tORDER BY bp.shipping_profile_id, bp.rate DESC\";\n\t\t$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n \t\treturn $result;\n\t}", "function car_hire(){\n //\n $sql= $this->chk(\n \"SELECT \n vehicle.reg_no,\n vehicle.model,\n vehicle.rate\n FROM \n vehicle \"\n );\n // \n $car_hire= $this->sqlData($sql);\n echo ($car_hire);\n }", "public function ready_take($quantity,$id,$bom_id){\n\n\t\t$sql6=\"Update bom set is_issued='2' WHERE bom_id='$bom_id'\";\n\t\t//$query6=$this->db->query($sql5);\n\t\t$query7=$this->db->query($sql6);\n\t\treturn $query7;\n\t}", "function query_select_seller_auctions($sellerUserId) {\n global $connection;\n\n //escape input\n $sellerUserId = mysqli_real_escape_string($connection, $sellerUserId);\n\n //prepare query\n $query = \"SELECT auctionId, title, imageName, description, startingPrice, \";\n $query .= \"expirationDate \";\n $query .= \"FROM auction \";\n $query .= \"WHERE seller={$sellerUserId} \";\n // $query .= \"AND NOW()>expirationDate\";\n\n //forward query to database\n $result = mysqli_query($connection, $query);\n\n //If set is not empty, return a number-indexed array, return 0 otherwise\n if($result)\n $result = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $result;\n}", "function searchPrice($price){\n\t\t//Connect to database. Include db_password.php with your MySQL or MariaDB credentials\n\t\n\t\ttry{\n\t\t\tif(!isset($pdo)){\n\t\t\t\t$pdo = new PDO('mysql:host=127.0.0.1;dbname=auction_site_db', $GLOBALS[\"user\"], $GLOBALS[\"pass\"]);\t//'root', 'pizza64');\n\t\t\t}\n\t\t\t$queryString = 'SELECT * FROM AuctionItems WHERE listPrice <= :listPrice'; //= :itemName'; \n\t\t\t//$queryString = \"SELECT * FROM AuctionItems\"; //for debugging\n\t\t\t\n\t\t\t$query = $pdo->prepare($queryString);\n\t\t\t\n\t\t\t//take name variable, add SQL wildcards to find more results\n\t\t\t//$wildcard = \"%\";\n\t\t\t//$iName = {$wildcard}{$GLOBALS[\"name\"]}{$wildcard};\n\t\t\t//print_r($iName);\n\t\t\t//$name = \"fdfd\";\n\t\t\t\n\t\t\t$query->execute(array(':listPrice' => $price));//$GLOBALS[\"name\"]));\t//$name));\n\t\t\t$query_result = $query->fetchAll(PDO::FETCH_BOTH);\n\t\t\t\n\t\t\tif($query_result){\n\t\t\t\t//echo json_encode(array_values($query_result));\n\t\t\t\treturn json_encode(array_values($query_result));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//echo \"No match was found\";\n\t\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\t}\n\t\t\t\n\t\t\t//make everything null so it closes the db connection\n\t\t\t$query = null; \n\t\t\t$pdo = null;\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\tdie();\n\t\t}\n\t\n\t}", "function select_quartermile_data($qmid)\n\t{\n\t\tglobal $db;\n\t\n\t \t$sql = \"SELECT qm.*, rr.id, rr.bhp, rr.bhp_unit, images.*, g.made_year, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \tFROM \" . GARAGE_QUARTERMILE_TABLE . \" AS qm\n\t\t \tLEFT JOIN \" . GARAGE_TABLE . \" AS g ON qm.garage_id = g.id\n\t\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = qm.image_id \n\t \t\tLEFT JOIN \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr ON rr.id = qm.rr_id \n \tWHERE qm.id = $qmid\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Quartermile Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function get_all_purchase_requests($db)\n{\n $sql = \"SELECT * FROM purchase_requests\";\n $st= $db->prepare($sql);\n $st->execute();\n $us = $st->fetchAll();\n return $us;\n}", "public function getMoreSixRate($panel_id, $flat_id, $cradle_id, $square_feet, $quantity, $width, $height)\n {\n // Create connection\n\t\t$dbh = new mysqli($this->servername, $this->username, $this->password, $this->dbname);\n\t\tif ($dbh->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $dbh->connect_error);\n\t\t}\n\n\t\t// values to build our query\n\t\t$price = '1234';\n\t\t$price_total = '0';\n\t\t$product_type = '1_2';\n\t\t$thickness = \"1/8\";\n\t\t$thicknessPlusPercentage = 0;\n\t\t$cradlePlusPercentage = 0;\n\t\t$db_price = 0;\n\t\t$debug_panel_price = 0;\n\t\t\n\t\t// debug - database price\n\t\t$d_db_price = 0;\n\t\t// debug - square foot price total\n\t\t$d_sf_price = 0;\n\t\t// debug - price after qualtity discount\n\t\t$d_after_quantity_price = 0;\n\t\t// debug - price per square inch\n\t\t$d_square_inch_price = 0;\n\t\t// debug - cradle price\n\t\t$d_cradle_price = 0;\n\t\t\n\t\t\n\t\tif($panel_id == 1 || $panel_id == 2 || $panel_id == 3 || $panel_id == 4)\n\t\t\t$product_type = '1_1';\n\t\t\t\n\t\t\t\n\t\tif($panel_id == 5 || $panel_id == 6)\n\t\t\t$product_type = '1_3';\n\t\t\t\n\t\tif($panel_id == 7)\n\t\t\t$product_type == '1_2';\n\t\t\n\t\t\n\t\tif($flat_id == 1)\n\t\t\t$thickness = \"1/8\";\n\t\tif($flat_id == 2)\n\t\t\t$thickness = \"1/4\";\n\t\t\n\t\t\t\n\t\t// STEPS\n\t\t\n\t\t// 1. Get price from nearest size\n\t\t$query = \"select * from tl_price_chart_large WHERE width = '\".$thickness.\"'\";\n\t\t$result = $dbh->query($query);\n\t\tif($result) {\n\t\t\t\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\t$price = $row[$product_type];\n\t\t\t\t$db_price = $row[$product_type];\n\t\t\t\t$d_db_price = $row[$product_type];\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Something has gone wrong! \".$sql->errorno;\n\t\t}\n\t\t\n\t\t// multiply the price based on the quantity\n\t\t$price = $price * $square_feet;\n\t\t\n\t\t$d_sf_price = $price;\n\t\t\n\t\t// add a quantity discount\n\t\t$quantity_discount = 0.10;\n\t\tif($quantity == 2)\n\t\t\t$quantity_discount = 0.20;\n\t\tif($quantity == 3)\n\t\t\t$quantity_discount = 0.30;\n\t\tif($quantity >= 4 && $quantity <= 9)\n\t\t\t$quantity_discount = 0.40;\n\t\tif($quantity >= 10)\n\t\t\t$quantity_discount = 0.50;\n\t\t\t\n\t\t$price = $price - ($price * $quantity_discount);\n\t\t\n\t\t$d_after_quantity_price = $price;\n\t\n\t\t\n\t\t// DETERMINE THE CRADLE PRICE\n\t\t\n\t\t// figure out the every X inch size\n\t\t$every_x_inches = 12.01;\n\t\tif( $cradle_id == 5 || $cradle_id == 6 || $cradle_id == 7 || $cradle_id == 8 )\n\t\t\t$every_x_inches = 24.01;\n\t\t\t\n\t\t// figure out the price per linear inch price\n\t\t$price_per_inch = 0;\n\t\t\n\t\t\n\t\t/*\n\t\tif($cradle_id == 3)\n\t\t\t$price_per_inch = 0.44;\n\t\tif($cradle_id == 4)\n\t\t\t$price_per_inch = 0.50;\n\t\tif($cradle_id == 5)\n\t\t\t$price_per_inch = 0.52;\n\t\tif($cradle_id == 6)\n\t\t\t$price_per_inch = 0.55;\n\t\tif($cradle_id == 7)\n\t\t\t$price_per_inch = 0.58;\n\t\tif($cradle_id == 8)\n\t\t\t$price_per_inch = 0.60;\n\t\t*/\n\t\t\n\t\t\n\t\t$cradle_table = '';\n\t\tswitch($cradle_id) {\n\t\t\tcase 3:\n\t\t\t\t$cradle_table = \"3_4_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$cradle_table = \"1_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$cradle_table = \"1_5_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$cradle_table = \"2_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$cradle_table = \"2_5_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$cradle_table = \"3_inch\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t$query = \"select * from tl_cradle_prices\";\n\t\t$result = $dbh->query($query);\n\t\tif($result) {\n\t\t\t\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\t$price_per_inch = $row[$cradle_table];\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Something has gone wrong! \".$sql->errorno;\n\t\t}\n\t\t\n\t\t//return $price_per_inch;\n\t\t$d_square_inch_price = $price_per_inch;\n\t\t\t\n\t\t// step one is divide width by every_x and divide height by every_y;\n\t\t$cross_width = ceil($width / $every_x_inches);\n\t\t$cross_height = ceil($height / $every_x_inches);\n\t\t\n\t\t$linear_inch_width = ($cross_width + 1) * $height;\n\t\t$linear_inch_height = ($cross_height + 1) * $width;\n\t\t\n\t\t$cradle_price = ($linear_inch_width + $linear_inch_height) * $price_per_inch;\n\t\t\n\t\t$d_cradle_price = $cradle_price;\n\t\t\n\t\t// if we have a cradle selected, take 15% off the panel\n\t\tif($cradle_id == 3 || $cradle_id == 4 || $cradle_id == 5 || $cradle_id == 6 || $cradle_id == 7 || $cradle_id == 8)\n\t\t\t$cradle_price = $cradle_price - ($cradle_price * 0.15);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// cradle price total is price multiplied by how many\n\t\t//$cradle_price = $cradle_price * $quantity;\n\t\t\n\t\t// price total is the price multiplied by how many\n\t\t//$price_total = $price * $quantity;\n\t\t\n\t\t\n\t\t$price_total = $price + $cradle_price;\n\t\t\n\t\t//if 48\" add ten percent;\n\t\tif($width == 48)\n\t\t\t$price_total = $price_total + ($price_total * 0.10);\n\t\t\t\n\t\t\t\n\t\t// multiply by quantity\n\t\t\n\t\t$price_total = $price_total * $quantity;\n\t\t\n\t\t// add the cradle price onto the total\n\t\t//$price_total = $price_total + $cradle_price;\n\t\t\n\t\t// if we see 9999 that means this function finished but we didnt get back what we wanted from it\n\t\t//return $price_total;\n\t\t//return $db_price;\n\t\t\n\t\t// Debug - send email with values\n\t\t//$this->pushDebugMessage($d_db_price, $d_sf_price, $d_after_quantity_price, $d_square_inch_price, $d_cradle_price);\n\t\t\n\t\treturn $price_total;\n\t\t//return $price_per_inch;\n\t\t\n\t\t\n\t\t\n }", "function getInventoryOrderedLow(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount, (amount / parAmount) AS orderAmount FROM inventory ORDER BY orderAmount ASC;\");\n \n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }", "public function getMyPriceForSKU($request);" ]
[ "0.721611", "0.6238702", "0.62143993", "0.61865956", "0.6131574", "0.6116619", "0.6051333", "0.6025234", "0.59959334", "0.59911424", "0.59887695", "0.5976927", "0.596946", "0.5967573", "0.5916602", "0.59155047", "0.59089005", "0.5861578", "0.58375883", "0.58290946", "0.5820259", "0.5788069", "0.5761079", "0.57468766", "0.57400435", "0.57193685", "0.5714658", "0.5710936", "0.56805956", "0.567372", "0.5666501", "0.5655953", "0.5649108", "0.56407976", "0.5638763", "0.56374073", "0.56202614", "0.56177956", "0.56131464", "0.5611894", "0.5611773", "0.5604622", "0.559108", "0.5582105", "0.55562377", "0.5545821", "0.5541334", "0.5532876", "0.5531594", "0.5502362", "0.5495556", "0.54855293", "0.5459584", "0.5458365", "0.5450331", "0.54491174", "0.544122", "0.5439075", "0.5436629", "0.5429468", "0.5425337", "0.5418896", "0.5418558", "0.54131114", "0.54103464", "0.5406911", "0.5397145", "0.5392311", "0.53922904", "0.53818524", "0.5371393", "0.53677815", "0.5366255", "0.5359172", "0.5344641", "0.5343028", "0.5337313", "0.5326443", "0.53198546", "0.531488", "0.53107643", "0.53049177", "0.5303209", "0.53019196", "0.53019196", "0.52970916", "0.5293037", "0.5292599", "0.5283669", "0.5282227", "0.52789277", "0.52770585", "0.52757865", "0.5274583", "0.5267935", "0.5263515", "0.5262499", "0.5259571", "0.5258625", "0.5257454" ]
0.64230317
1
$sql = "SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id and quantity=1";
public function get_prices ( $sku_id ) { $sql = "SELECT * FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id Order by quantity"; $query = $this->db->query( $sql ); return $query->result_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_unit_price($sku_id) {\n $sql = \"SELECT t1.outlet_lifting_price as price, t2.sku_code, t2.sku_description\n FROM `tbli_sku_mou_price_mapping` as t1 \n Inner JOIN `tbld_sku` as t2 On t1.sku_id=t2.id\n where sku_id=$sku_id and quantity=1\";\n $query = $this->db->query($sql)->result_array();\n\n return $query;\n }", "public function get_dd_price ( $sku_id )\n {\n $sql = \"SELECT db_lifting_price FROM `tbli_sku_mou_price_mapping` where sku_id=$sku_id HAVING MIN( quantity )\";\n $query = $this->db->query( $sql );\n return $query->result_array();\n }", "function getStocksPurchases($mysqli,$sale_id){\n\t$query = \"SELECT stocks.description,subsales.price_per_ton,subsales.quantity,subsales.subtotal FROM sales INNER join subsales ON sales.id = subsales.sale_id INNER JOIN stocks ON stocks.id = subsales.stock_id WHERE sales.id = '$sale_id'\";\n\n\tif($result = mysqli_query($mysqli,$query)){\n\t\treturn $result ;\n\t}\n\telse{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\t\n}", "function getPlayerWarehouseItem($player_id, $item_id)\n{\n global $db;\n return $db->where(\"player_id\", $player_id)\n ->where(\"item_id\", $item_id)\n ->getOne(\"warehouse\", \"quantity\");\n}", "function get_price($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$result=mysql_query(\"select price from $products where $serial=$pid\")\n or die (\"Query '$products' and '$pid' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row['price']; // products price\n}", "function getMaxprice(){\r\n $q = \"SELECT * FROM maximum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function getFoodbyID($sku){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n\r\n // YOUR CODE GOES HERE\r\n\r\n return $result;\r\n }", "function getTotalProductsSold() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantitysold) AS sqs FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function get_price($name)\n{\n $query_setting_price = mysql_query(\"SELECT `value` FROM `setting_seagods` WHERE `name` = '$name' LIMIT 0,1\");\n $row_setting_price = mysql_fetch_array($query_setting_price);\n return $row_setting_price['value'];\n}", "function getMinPrice(){\r\n $q = \"SELECT * FROM minimum\";\r\n $result = $this->query($q);\r\n return $result;\r\n }", "function getTotalProductsAvailable() {\r\n global $conn;\r\n $select = \"SELECT SUM(quantityavailable) AS sqa FROM product;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function mount_query($date){\n\n$query = \"SELECT product_quantity.quantity, product.price FROM table_order, product, product_quantity\nWHERE product.product_id = table_order.product_id\n\tAND product_quantity.pq_id = table_order.pq_id\n\tAND product_quantity.product_id = table_order.product_id\n\tAND table_order.order_date =\".$date.\";\";\n\nreturn $query;\n}", "public function getPatientChargesQTY($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT * from patientCharges where itemNo = '$itemNo' \");\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['quantity'];\n }\n\n}", "private function getProductSearchQuery(string $productSku): string\n {\n return <<<QUERY\n{\n products(filter: {sku: {eq: \"{$productSku}\"}}) {\n items {\n special_price\n }\n }\n}\nQUERY;\n }", "function get_price($name)\r\n{\r\n //Read data from DB table\r\n\r\n $servername = \"localhost\";\r\n $dbname = \"webservices\";\r\n $username = \"root\";\r\n $password = \"\";\r\n\r\n\r\n // Create connection\r\n $conn = new mysqli($servername, $username, $password, $dbname);\r\n // Check connection\r\n if ($conn->connect_error) {\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n } \r\n\t\r\n\r\n \r\n $sql = \"SELECT price, make, model, year FROM vehicles_pinefalls where make ='$name' order by price asc limit 1\";\r\n $result = $conn->query($sql);\r\n\r\n $info=mysqli_fetch_array($result,MYSQLI_ASSOC);\r\n\r\n return $info;\r\n}", "function _get_product_stock($product_id = 0)\r\n {\r\n return @$this->db->query(\"select sum(available_qty) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$product_id)->row()->t;\r\n }", "private function getProductQuery(string $sku): string\n {\n return <<<QUERY\n{\n products(search: \"{$sku}\") {\n items {\n sku\n ... on BundleProduct {\n items {\n sku\n option_id\n uid\n required\n type\n title\n options {\n uid\n label\n product {\n sku\n }\n can_change_quantity\n id\n uid\n price\n quantity\n }\n }\n }\n }\n }\n}\nQUERY;\n }", "function es_product_bulk_price($price, $quantity, $sku) {\n\t/*\n\t* PUB41 - Your child’s first year at school Bulk discount\n\t* For orders of x >= 20 $12.95, x >= 50 $9.90\n\t*/\n\tif ($sku == 'PUB41') {\n\t\tif ($quantity >= 20 AND $quantity < 50) {\n\t\t\t$price = 12.95;\n\t\t}\n\t\telseif ($quantity >= 50) {\n\t\t\t$price = 9.95;\n\t\t}\n\t}\n\telseif($sku == 'SUND507') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 10.95;\n\t}\n\telseif($sku == 'SUND621') {\n\t\tif ($quantity >= 3)\n\t\t\t$price = 16.95;\n\t}\n\telseif($sku == 'SUND620') {\n\t\tif ($quantity >= 5)\n\t\t\t$price = 14.95;\n\t}\n\t\n\treturn $price;\n}", "function jumlah_powerdall(){\n\t\t// return $this->db->query($query)->result();\n\t\tdate_default_timezone_set(\"Asia/Makassar\");\n\t\t$kondisi=date(\"m\");\n\t\t$query = \"SELECT SUM(power) as powerm FROM power_s3d WHERE m=$kondisi\";\n\t\treturn $this->db->query($query)->result();\n\t}", "function _get_product_stock_bystkid($stock_id = 0)\r\n {\r\n return @$this->db->query(\"select available_qty as t from t_stock_info where stock_id = ? and available_qty >= 0 \",$stock_id)->row()->t;\r\n }", "function getStockQuantity($username, $symbol)\n{\n $mysql_server = '192.168.1.101';\n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n \n $qry = \"SELECT * FROM portfolio WHERE username='$username' and stockSymbol='$symbol'\";\n $result = $mysqli->query($qry);\n \n $totalQty = 0;\n \n \n if($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n \n $totalQty += $row['qty'];\n }\n }\n return $totalQty;\n}", "function low_price(){\n\tglobal $con;\t\n\t$get_lprice = \"SELECT * FROM items ORDER BY item_pice ASC\";\n\t$run_lprice = mysql_query($get_lprice);\t\n\tshow_item($run_lprice);\n\n}", "private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function fetchAllItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id\";\r\t$result8 = mysqli_query($link, $query);\rif($result8)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}", "function getUpdateItem($product_id){\n\tglobal $conn;\n\t$ip = getIp();\n\t$get_qty =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip' AND `p_id`='$product_id'\");\n\t$row_qty=mysqli_fetch_array($get_qty);\n\t$quantity= $row_qty[\"qty\"];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\t$row_price = mysqli_fetch_array($get_price);\n\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\treturn $sub_total;\n}", "function getStockQuantity($stock_id,$mysqli){\n\t$query = \"SELECT quantity_in_store FROM stocks WHERE id = '$stock_id'\";\n\tif ($result = mysqli_query($mysqli,$query)){\n\t\treturn mysqli_fetch_assoc($result)['quantity_in_store'];\n\t}else{\n\t\tprintf(\"Notice: %s\", mysqli_error($mysqli));\n\t}\n\n}", "function getProductById($itemId) {\r\n $itemId - intval($itemId);\r\n $sql = \"SELECT * FROM products WHERE id = '$itemId'\";\r\n//d($sql);\r\n include '../config/db.php';\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n// d($rs);\r\n// d(mysqli_fetch_all($rs, MYSQLI_ASSOC));\r\n\r\n return mysqli_fetch_all($rs, MYSQLI_ASSOC);\r\n}", "public function showProductQty(){\n $sId = session_id();\n $query = \"SELECT * FROM tbl_cart WHERE sId = '$sId'\";\n $select_result = $this->db->select($query);\n\n if ($select_result) {\n $row = mysqli_num_rows($select_result);\n return $row;\n //return $select_result;\n }else {\n return 0;\n }\n\n }", "function SkuFromID($parametro){\n\t$db = new mysql();\n\t\n\t$result = $db->consulta(\"SELECT IDPRODUCTO,FECHA FROM \".PREFIX.\"productos WHERE IDPRODUCTO='\".$parametro.\"' LIMIT 1\");\n\t$row = $db->recuperar_array($result);\t\n\t$sku = $row['PRESKU'].$parametro;\n\treturn $sku;\n}", "public function getExternalSkuData ()\n {\n $sql = \"SELECT t1.id,t1.sku_name,t1.sku_creation_date,t1.sku_description,t3.sku_active_status_name,t4.unit_name FROM\n `tbld_sku` as t1 \n inner join `tbli_sku_mou_price_mapping` as t2 on t1.id=t2.sku_id\n left join `tbld_sku_active_status` as t3 on t1.sku_active_status_id=t3.id\n left join `tbld_unit` as t4 on t2.mou_id=t4.id\n where t1.sku_type_id=2\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "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}", "function getPrice($id,$rdvtype){\r global $bdd;\r\r $req4=$bdd->prepare(\"select * from packs where idpack=? \");\r $req4->execute(array($id));\r while($ar = $req4->fetch()){\r if($rdvtype == 'visio'){return $ar['prvisio'];}else if($rdvtype == 'public'){return $ar['prpublic'];}else if($rdvtype == 'domicile'){return $ar['prdomicile'];}\r }\r\r return 200;\r}", "public function getDdPrice($unit_id, $product_id) {\n $this->db->select('outlet_lifting_price as price');\n $this->db->from('tbli_sku_mou_price_mapping');\n $this->db->where('mou_id', $unit_id);\n $this->db->where('sku_id', $product_id);\n $query = $this->db->get()->result_array();\n\n return $query;\n }", "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}", "public function getDataJeux3($num) {\r\n\t\t$this->load->database('default');\r\n\t\t$sql=\"select sum(quantiteJeu) from concerner,reservation,festival where aRenvoyer=1 and concerner.numReservation=reservation.numReservation and reservation.numFestival=festival.numFestival and festival.numFestival=?\" ;\r\n\t\t$res=$this->db->query($sql,$num);\r\n\t\t$row = $res->row_array();\r\n\t\treturn $row;\r\n}", "function getProductInfo($pid) {\r\n global $conn;\r\n $select = \"SELECT * FROM product WHERE productid=\" . $pid . \";\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function getProductbyId($id){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT * \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock` > 0 AND `id` = ?\");\n\t\t$sth \t->execute(array($id));\n\n\t\treturn \t$sth;\n\t}", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "function total_price2(){\n\tglobal $conn;\n\t$ip = getIp();\n\t$total=0;\n\t$get_cart =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip'\");\n\twhile ( $row_cart=mysqli_fetch_array($get_cart)) {\n\t\t# code...\n\n\t\t$quantity= $row_cart[\"qty\"];\n\t\t$product_id=$row_cart['p_id'];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\twhile ( $row_price = mysqli_fetch_array($get_price)) {\n\t\n\t\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\t$total +=$sub_total;\n\t}\n\t\n\t}\n\t\n\n\treturn $total;\n\n\t\n}", "function fetchAllMinimumItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.minimum_quantity,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id having sum(stock.current_stock)<(item.minimum_quantity)\";\r\t$result8 = mysqli_query($link, $query);\r\t$r=mysqli_num_rows($result8);\t\rif($r!=0)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "public function fetch_dec_qty($cart_id)\n {\n $this->db->select('selling_price,shipping_charge,qty');\n $this->db->from('rl_cart_tbl');\n $condition=array(\"cart_id\"=>$cart_id);\n $this->db->where($condition);\n $que=$this->db->get();\n return $que;\n echo $this->db->last_query();\n }", "function ierg4210_prod_fetchOne() {\n // DB manipulation\n global $db;\n $db = ierg4210_DB();\n $pid = (int)$_REQUEST['pid'];\n $q = $db->prepare(\"SELECT * FROM products WHERE pid = $pid;\");\n if ($q->execute())\n return $q->fetchAll();\n}", "public function getProductBySku($sku);", "function WselectSerialNumberForItemByID($OrderID,$item_id,$sku){\r\n\t\t\t $strSQLQuery = \"select SerialNumbers from p_order_item where OrderID='\".$OrderID.\"' and item_id='\".$item_id.\"' and sku='\".$sku.\"'\";\r\n\t\t\t return $this->query($strSQLQuery, 1);\r\n\t\t }", "function fetch_all_products ($in_stock) {\n $db = getDb();\n if ($in_stock) {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n WHERE\n inventory_count > 0\n \");\n } else {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n \");\n }\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_OBJ);\n return $result;\n}", "function high_price(){\n\n\tglobal $con;\t\n\t$get_hprice = \"SELECT * FROM items ORDER BY item_pice DESC\";\n\t$run_hprice = mysql_query($get_hprice);\t\n\tshow_item($run_hprice);\n\n}", "function getLeastAvailableProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantityavailable ASC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "public function get_Product($product){\r\n $sql = \"select Item From inventory WHERE Item = '$product'\";\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $result = $conn->query($sql);\r\n if ($result->num_rows > 0) {\r\n // output data of each row\r\n while($row = $result->fetch_assoc()) {\r\n /*\r\n * adding html can be done by calling the echo statement\r\n * example:\r\n * echo \"<tr class='TableRows'>\";\r\n * remember this is just html code just in a php format\r\n * more data can be added just a sample from my database\r\n * this function can become a key to our project and more advance\r\n * if you change any styling to this function its going to change the whole product page\r\n * you can delete these comments once we finish the product page and add needed information\r\n */\r\n $Item = $row[\"Item\"];\r\n echo $Item;\r\n }\r\n }\r\n }", "function get_info($item_kit_id) {\n $this->db->from('paket_sofa_items');\n $this->db->where('paket_id', $item_kit_id);\n \n //return an array of item kit items for an item\n return $this->db->get()->result_array();\n}", "public function get_base_mkprodid_by_mkid($mkid){\n $query = '\n SELECT \n ps.prodi_nama,\n ps.prodi_kode,\n mp.`mkkprod_id`,\n mp.`mkkprod_porsi_kelas`,\n mkk.`mkkur_pred_jml_peminat`,\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS t,\n mkkprod_porsi_kelas * (mkk.`mkkur_pred_jml_peminat` DIV\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n )) AS jml_porsi, \n mkk.`mkkur_pred_jml_peminat` MOD\n (\n SELECT SUM(mpv.mkkprod_porsi_kelas)\n FROM mkkur_prodi mpv\n WHERE mpv.mkkprod_mkkur_id = mp.`mkkprod_mkkur_id`\n AND mpv.`mkkprod_related_id` IS NULL\n GROUP BY mkkprod_mkkur_id\n ) AS sisa\n FROM program_studi ps\n LEFT JOIN mkkur_prodi mp ON ps.prodi_id = mp.mkkprod_prodi_id\n LEFT JOIN mata_kuliah_kurikulum mkk ON mp.`mkkprod_mkkur_id` = mkk.`mkkur_id`\n WHERE mp.mkkprod_mkkur_id = \"'.$mkid.'\"\n AND mp.`mkkprod_related_id` IS NULL \n AND mp.`mkkprod_porsi_kelas` <> 0\n ';\n\n $ret = $this->db->query($query);\n $ret = $ret->result_array();\n\n return $ret;\n }", "function getAllProducts(){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0\");\n\t\t$sth \t->execute();\n\t\t\n\t\treturn \t$sth;\n\t}", "function getItemsByPrice($dbh, $min, $max)\r\n{\r\n $stmt = $dbh->prepare ( \"SELECT * FROM items WHERE items.price >= ? and items.price <= ?\"); \r\n\r\n $stmt->bindParam(1,$min);\r\n $stmt->bindParam(2,$max);\r\n\r\n if ($stmt->execute()) \r\n {\r\n showItemsTable($stmt);\r\n }\r\n}", "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 }", "public function modelTotalRecordSearchPrice(){\n\t\t\t$fromPrice = isset($_GET[\"fromPrice\"])?$_GET[\"fromPrice\"]:0;\n \t\t$toPrice = isset($_GET[\"toPrice\"])?$_GET[\"toPrice\"]:0;\n\t\t\t//lay bien ket noi\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->prepare(\"select id from products where price >= $fromPrice and price <= $toPrice\");\n\t\t\t//thuc thi truy van. Neu khong co tham so o cau truy van thi ghi array rong\n\t\t\t$query->execute(array());\n\t\t\t//tra ve so luong ban ghi\n\t\t\treturn $query->rowCount() > 0 ? $query->rowCount() : 1;\n\t\t}", "function discQuan($discQ)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT quanti FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discQ, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"quanti\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "function total_price(){\n\n global $db;\n\n $ip_add = getRealIpUser();\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\n while($record= mysqli_fetch_array($run_cart)){\n\n $pro_id = $record['p_id'];\n\n $pro_qty =$record['quantity'];\n\n $get_price = \"select * from products where product_id='$pro_id'\";\n\n $run_price = mysqli_query($db, $get_price);\n\n while($row_price=mysqli_fetch_array($run_price)){\n\n $sub_total = $row_price['product_price'] * $pro_qty;\n\n $total += $sub_total; \n\n }\n }\n\n echo \"&#8358; \" . $total;\n}", "function getBestProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantitysold DESC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "function get_qty_akhir($tanggal_akhir, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal < \".$tanggal_akhir;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_akhir >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_akhir.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function get_qty_awal($tanggal_awal, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal <= \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur < \".$tanggal_awal.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') <\".$tanggal_awal.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_awal.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public function findPrice($tourId, $qty);", "function fetchrequestAllItemCurrentStock($id)\r{\r $link = parent::connectToDB();\r$query=\"select purchase_order.expected_date,purchase_order.purchase_order_id,purchase_order.status,stock.item_id,stock.quantity,stock.receive_date from purchase_order left outer join stock on purchase_order.purchase_order_id=stock.purchase_order_id where purchase_order.expected_date='$id'\";\r//echo $query;\r$result8 = mysqli_query($link, $query);\r$result11=mysqli_num_rows($result8);\r \rif($result11!=0)\r{\r//echo \"asdfgh\";\rreturn $result8;\r}\relse\r{\r//echo \"not\";\rreturn false;\r}\r\r}", "function getWorstProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantitysold ASC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\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}", "function getQtyAllDetails($pid, $qty) {\n $profileName = array('Allgroup', 'Guest');\n $this->db->select('p3.tier_qty, p3.tier_price');\n $this->db->from('profilegroup p1');\n $this->db->join('profilegroup_config p2', 'p1.id = p2.profile_id', 'INNER');\n $this->db->join('tier_price p3', 'p3.tier_profile_id = p2.profile_id', 'INNER');\n $this->db->where('p3.tier_product_id', intval($pid));\n $this->db->where('p3.tier_qty <=', intval($qty));\n $this->db->where('p2.profileconfig_ref', 'TIERPRICING');\n $this->db->where('p2.profileconfig_value', 1);\n $this->db->where_in('p1.profile_name', $profileName);\n $this->db->group_by('p3.tier_id');\n $this->db->order_by('p3.tier_qty', 'DESC');\n $query = $this->db->get();\n //die($this->db->last_query());\n if ($query->num_rows() > 0) {\n return $query->row_array();\n }\n return false;\n }", "function getProductInc()\n {\n $productInc = \"SELECT * from productincrements\";\n $productIncresult = $this->ds->select($productInc); \n //print_r($productIncresult);\n return $productIncresult;\n }", "function get_products_array( $sku ) {\n global $wpdb;\n $sku = implode(',' , $sku);\n $products = $wpdb->get_results( \"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key='_sku' AND meta_value IN ({$sku}) \");\n if ( $products ) return $products;\n return null;\n}", "function updateSnowQuantity($snowCode,$change){\n $getUserTypeQuery = \"SELECT qtyAvailable FROM snows WHERE code='\".$snowCode.\"'\";\n require_once 'model/dbConnector.php';\n $oldQuantity = executeQuerySelect($getUserTypeQuery)[0]['qtyAvailable'];\n $newQuantity = $oldQuantity-$change;\n $rentInsertQuery2 = \"UPDATE snows SET qtyAvailable=\".$newQuantity.\" WHERE code='\".$snowCode.\"'\";\n $queryResult2 = executeQueryInsert($rentInsertQuery2);\n}", "function get_all_product($conn)\n\t{\n\t\t$query = \"SELECT * FROM producten\";\n\t\treturn mysqli_query($conn,$query);\n\t}", "function shopsLatLongSelect($db) {\n $query = \"SELECT id_shop, name_shop, lat_shop, long_shop, description_shop FROM shop ORDER BY lat_shop ASC;\";\n return mysqli_query($db, $query);\n}", "function getProduct()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\tif(isset($_POST[\"trademarkID\"]) || isset($_POST[\"limit\"]))\n\t\t\t{\n\t\t\t\t$trademark_id=$_POST[\"trademarkID\"];\n\t\t\t\t$limit=$_POST[\"limit\"];\n\t\t\t}\n\t\t\t$query=\"SELECT * FROM product P, trademark T WHERE T.Trademark_id =\".$trademark_id.\" AND T.Trademark_id=P.Trademark_id ORDER BY P.Count_buy DESC LIMIT \".$limit.\",20\";\n\t\t\t$kq=mysqli_query($conn,$query);\n\t\t\t$chuoijson=array();\n\t\t\techo \"{\";\n\t\t\techo \"\\\"PRODUCT\\\":\";\n\t\t\tif($kq)\n\t\t\t{\n\t\t\t\twhile($dong=mysqli_fetch_array($kq))\n\t\t\t\t{\n\t\t\t\t\tarray_push($chuoijson, array(\"Product_id\"=>$dong[\"Product_id\"]\n\t\t\t\t\t,'Product_name'=>$dong[\"Product_name\"]\n\t\t\t\t\t,'Price'=>$dong[\"Price\"]\n\t\t\t\t\t,'Image'=>\"http://\".$_SERVER['SERVER_NAME'].\":82\".\"/webpasokon\".$dong[\"Big_Image\"]));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\techo json_encode($chuoijson,JSON_UNESCAPED_UNICODE);\n\t\t\techo \"}\";\n\t\t}", "function find_all_sale(){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC\";\n return find_by_sql($sql);\n }", "public function getPriceFromDatabase()\n {\n }", "function get_tax_cash_summary($from, $to)\n{\n\n $sql = \"SELECT SUM(gross_output) gross_output,\n SUM(net_output) net_output,\n SUM(payable) payable,\n SUM(gross_input) gross_input,\n SUM(net_input) net_input,\n SUM(collectible) collectible,\n rate,\n id,\n name\n FROM (\".tax_cash_sql($from, $to).\") taxrec\n GROUP BY id, name, rate\";\n//display_error($sql);\n return db_query($sql,\"Cannot retrieve tax summary\");\n}", "function update_cart_table($conx, $uid, $stock, $p, $q)\n{\n\t$pro_select_result = mysqli_query($conx, \"SELECT * FROM cart WHERE cart_product='$p' LIMIT 1\");\n\tif(mysqli_num_rows($pro_select_result)>0)\n\t{\n\t\tif(intval($q) > intval($stock))\n\t\t{\n\t\t\t$msg = \"fail: Can't select $q items because only $stock items in stock\";\n\t\t\techo $msg;\n\t\t\treturn;\n\t\t}\n\n\t\t$pro_update_result = mysqli_query($conx, \"UPDATE cart SET cart_quantity='$q' WHERE cart_product='$p'\");\n\t\tif(mysqli_affected_rows($conx)>0)\n\t\t{\n\t\t\techo \"success: Cart updated\";\n\t\t}else\n\t\t{\n\t\t\techo \"fail: Failed to update cart\";\n\t\t}\n\n\t}else\n\t{\n\t\techo \"faild:Product not in cart\";\n\t}\n}", "public function listProductprice($id){\n try{\n $sql = \"Select * from productforsale where id_productforsale = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n\n $result = $stm->fetch();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprice');\n $result = 2;\n }\n\n return $result;\n }", "public function getItemNo_total($itemNo) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT cashUnpaid from patientCharges where itemNo = '$itemNo' \");\n\n\nwhile($row = mysqli_fetch_array($result))\n {\nreturn $row['cashUnpaid'];\n }\n\n}", "function newsItem_PeriksaJudul( $tbl_news, $judul, $judulinggris ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE judul = '$judul' AND judulinggris = '$judulinggris'\");\n\t\treturn $sql;\t\n\t}", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "function subtrac_product_qty($id,$qty)\r\n{\r\n\t$sql = 'UPDATE products SET product_qty = product_qty - '.$qty.' WHERE `product_id` ='.$id.' and product_qty > 0';\r\n\t$results = mysql_query($sql);\r\n}", "public function getQty();", "public function getQty();", "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 }", "function getUnitCost( $modelid, $dealerid, $cost )\n{\nglobal $db;\n\n//08.21.2015 ghh - first we're going to see if there is a dealer specific price for \n//this item and if so we'll just pass it back\n$query = \"select Cost from UnitModelCost where ModelID=$modelid and \n\t\t\t\tDealerID=$dealerid\";\nif (!$result = $db->sql_query($query))\n\t{\n\tRestLog(\"Error 16562 in query: $query\\n\".$db->sql_error());\n\tRestUtils::sendResponse(500,\"16562 - There was a problem attempting find the dealer cost\"); //Internal Server Error\n\treturn false;\n\t}\n\n$row = $db->sql_fetchrow( $result );\n\n//if there is a cost then lets just return it.\nif ( $row['Cost'] > 0 )\n\treturn $row['Cost'];\n\nreturn $cost;\n}", "function top_produit()\n{\n\t$sql = \"SELECT produit.id_produit,nom_produit,description_produit,desc_courte_produit,prix,qte,images from produit inner join commande_produit on produit.id_produit = commande_produit.id_produit\n\tinner join commande on commande_produit.id_commande = commande.id_commande limit 1\";\n\tglobal $connection;\n\treturn mysqli_query($connection, $sql);\n}", "public function getPriceById($uid)\n {\n $sql = \" SELECT price FROM slave_user WHERE uid = :uid \";\n return $this->_rdb->fetchOne($sql, array('uid' => $uid));\n }", "function get_movie_cost()\n {\n $query=\"select * from ticket_cost_tbl\";\n \n $qry = $this->db->query($query);\n // echo $this->db->last_query();exit();\n return $qry->result();\n \n \n }", "function get_shipping_by_band($shipping_profile_id, $product_price)\n\t{\n\t\t$shipping_profile_id = mysql_escape_string($shipping_profile_id);\n \t$product_price = mysql_escape_string($product_price);\n\t\t$sql = \"SELECT bp.*, r.region_name, sl.service_level_name, sm.service_desc\n\t\t\tFROM nm_shipping_band_profile as bp\n\t\t\tLEFT JOIN nm_shipping_master as sm ON sm.shipping_master_id = bp.shipping_master_id\n\t\t\tLEFT JOIN nm_shipping_region as r ON sm.region_id = r.region_id\n\t\t\tLEFT JOIN nm_shipping_service_level as sl ON sm.service_level_id = sl.service_level_id\n\t\t\tWHERE bp.shipping_profile_id = $shipping_profile_id\n\t\t\tAND bp.from_price <= $product_price\n\t\t\tAND bp.to_price > $product_price\n\t\t\tORDER BY bp.shipping_profile_id, bp.rate DESC\";\n\t\t$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n \t\treturn $result;\n\t}", "function car_hire(){\n //\n $sql= $this->chk(\n \"SELECT \n vehicle.reg_no,\n vehicle.model,\n vehicle.rate\n FROM \n vehicle \"\n );\n // \n $car_hire= $this->sqlData($sql);\n echo ($car_hire);\n }", "function query_select_seller_auctions($sellerUserId) {\n global $connection;\n\n //escape input\n $sellerUserId = mysqli_real_escape_string($connection, $sellerUserId);\n\n //prepare query\n $query = \"SELECT auctionId, title, imageName, description, startingPrice, \";\n $query .= \"expirationDate \";\n $query .= \"FROM auction \";\n $query .= \"WHERE seller={$sellerUserId} \";\n // $query .= \"AND NOW()>expirationDate\";\n\n //forward query to database\n $result = mysqli_query($connection, $query);\n\n //If set is not empty, return a number-indexed array, return 0 otherwise\n if($result)\n $result = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n return $result;\n}", "public function ready_take($quantity,$id,$bom_id){\n\n\t\t$sql6=\"Update bom set is_issued='2' WHERE bom_id='$bom_id'\";\n\t\t//$query6=$this->db->query($sql5);\n\t\t$query7=$this->db->query($sql6);\n\t\treturn $query7;\n\t}", "function searchPrice($price){\n\t\t//Connect to database. Include db_password.php with your MySQL or MariaDB credentials\n\t\n\t\ttry{\n\t\t\tif(!isset($pdo)){\n\t\t\t\t$pdo = new PDO('mysql:host=127.0.0.1;dbname=auction_site_db', $GLOBALS[\"user\"], $GLOBALS[\"pass\"]);\t//'root', 'pizza64');\n\t\t\t}\n\t\t\t$queryString = 'SELECT * FROM AuctionItems WHERE listPrice <= :listPrice'; //= :itemName'; \n\t\t\t//$queryString = \"SELECT * FROM AuctionItems\"; //for debugging\n\t\t\t\n\t\t\t$query = $pdo->prepare($queryString);\n\t\t\t\n\t\t\t//take name variable, add SQL wildcards to find more results\n\t\t\t//$wildcard = \"%\";\n\t\t\t//$iName = {$wildcard}{$GLOBALS[\"name\"]}{$wildcard};\n\t\t\t//print_r($iName);\n\t\t\t//$name = \"fdfd\";\n\t\t\t\n\t\t\t$query->execute(array(':listPrice' => $price));//$GLOBALS[\"name\"]));\t//$name));\n\t\t\t$query_result = $query->fetchAll(PDO::FETCH_BOTH);\n\t\t\t\n\t\t\tif($query_result){\n\t\t\t\t//echo json_encode(array_values($query_result));\n\t\t\t\treturn json_encode(array_values($query_result));\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//echo \"No match was found\";\n\t\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\t}\n\t\t\t\n\t\t\t//make everything null so it closes the db connection\n\t\t\t$query = null; \n\t\t\t$pdo = null;\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t\t//echo json_encode(array_values([\"itemName\"=>\"failed\", \"itemDescription\"=>\"db query\", \"itemPrice\"=>\"match\"]));\n\t\t\tdie();\n\t\t}\n\t\n\t}", "function select_quartermile_data($qmid)\n\t{\n\t\tglobal $db;\n\t\n\t \t$sql = \"SELECT qm.*, rr.id, rr.bhp, rr.bhp_unit, images.*, g.made_year, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \tFROM \" . GARAGE_QUARTERMILE_TABLE . \" AS qm\n\t\t \tLEFT JOIN \" . GARAGE_TABLE . \" AS g ON qm.garage_id = g.id\n\t\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = qm.image_id \n\t \t\tLEFT JOIN \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr ON rr.id = qm.rr_id \n \tWHERE qm.id = $qmid\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Quartermile Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function get_all_purchase_requests($db)\n{\n $sql = \"SELECT * FROM purchase_requests\";\n $st= $db->prepare($sql);\n $st->execute();\n $us = $st->fetchAll();\n return $us;\n}", "public function getMoreSixRate($panel_id, $flat_id, $cradle_id, $square_feet, $quantity, $width, $height)\n {\n // Create connection\n\t\t$dbh = new mysqli($this->servername, $this->username, $this->password, $this->dbname);\n\t\tif ($dbh->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $dbh->connect_error);\n\t\t}\n\n\t\t// values to build our query\n\t\t$price = '1234';\n\t\t$price_total = '0';\n\t\t$product_type = '1_2';\n\t\t$thickness = \"1/8\";\n\t\t$thicknessPlusPercentage = 0;\n\t\t$cradlePlusPercentage = 0;\n\t\t$db_price = 0;\n\t\t$debug_panel_price = 0;\n\t\t\n\t\t// debug - database price\n\t\t$d_db_price = 0;\n\t\t// debug - square foot price total\n\t\t$d_sf_price = 0;\n\t\t// debug - price after qualtity discount\n\t\t$d_after_quantity_price = 0;\n\t\t// debug - price per square inch\n\t\t$d_square_inch_price = 0;\n\t\t// debug - cradle price\n\t\t$d_cradle_price = 0;\n\t\t\n\t\t\n\t\tif($panel_id == 1 || $panel_id == 2 || $panel_id == 3 || $panel_id == 4)\n\t\t\t$product_type = '1_1';\n\t\t\t\n\t\t\t\n\t\tif($panel_id == 5 || $panel_id == 6)\n\t\t\t$product_type = '1_3';\n\t\t\t\n\t\tif($panel_id == 7)\n\t\t\t$product_type == '1_2';\n\t\t\n\t\t\n\t\tif($flat_id == 1)\n\t\t\t$thickness = \"1/8\";\n\t\tif($flat_id == 2)\n\t\t\t$thickness = \"1/4\";\n\t\t\n\t\t\t\n\t\t// STEPS\n\t\t\n\t\t// 1. Get price from nearest size\n\t\t$query = \"select * from tl_price_chart_large WHERE width = '\".$thickness.\"'\";\n\t\t$result = $dbh->query($query);\n\t\tif($result) {\n\t\t\t\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\t$price = $row[$product_type];\n\t\t\t\t$db_price = $row[$product_type];\n\t\t\t\t$d_db_price = $row[$product_type];\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Something has gone wrong! \".$sql->errorno;\n\t\t}\n\t\t\n\t\t// multiply the price based on the quantity\n\t\t$price = $price * $square_feet;\n\t\t\n\t\t$d_sf_price = $price;\n\t\t\n\t\t// add a quantity discount\n\t\t$quantity_discount = 0.10;\n\t\tif($quantity == 2)\n\t\t\t$quantity_discount = 0.20;\n\t\tif($quantity == 3)\n\t\t\t$quantity_discount = 0.30;\n\t\tif($quantity >= 4 && $quantity <= 9)\n\t\t\t$quantity_discount = 0.40;\n\t\tif($quantity >= 10)\n\t\t\t$quantity_discount = 0.50;\n\t\t\t\n\t\t$price = $price - ($price * $quantity_discount);\n\t\t\n\t\t$d_after_quantity_price = $price;\n\t\n\t\t\n\t\t// DETERMINE THE CRADLE PRICE\n\t\t\n\t\t// figure out the every X inch size\n\t\t$every_x_inches = 12.01;\n\t\tif( $cradle_id == 5 || $cradle_id == 6 || $cradle_id == 7 || $cradle_id == 8 )\n\t\t\t$every_x_inches = 24.01;\n\t\t\t\n\t\t// figure out the price per linear inch price\n\t\t$price_per_inch = 0;\n\t\t\n\t\t\n\t\t/*\n\t\tif($cradle_id == 3)\n\t\t\t$price_per_inch = 0.44;\n\t\tif($cradle_id == 4)\n\t\t\t$price_per_inch = 0.50;\n\t\tif($cradle_id == 5)\n\t\t\t$price_per_inch = 0.52;\n\t\tif($cradle_id == 6)\n\t\t\t$price_per_inch = 0.55;\n\t\tif($cradle_id == 7)\n\t\t\t$price_per_inch = 0.58;\n\t\tif($cradle_id == 8)\n\t\t\t$price_per_inch = 0.60;\n\t\t*/\n\t\t\n\t\t\n\t\t$cradle_table = '';\n\t\tswitch($cradle_id) {\n\t\t\tcase 3:\n\t\t\t\t$cradle_table = \"3_4_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$cradle_table = \"1_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$cradle_table = \"1_5_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$cradle_table = \"2_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$cradle_table = \"2_5_inch\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t$cradle_table = \"3_inch\";\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t$query = \"select * from tl_cradle_prices\";\n\t\t$result = $dbh->query($query);\n\t\tif($result) {\n\t\t\t\n\t\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t\t$price_per_inch = $row[$cradle_table];\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"Something has gone wrong! \".$sql->errorno;\n\t\t}\n\t\t\n\t\t//return $price_per_inch;\n\t\t$d_square_inch_price = $price_per_inch;\n\t\t\t\n\t\t// step one is divide width by every_x and divide height by every_y;\n\t\t$cross_width = ceil($width / $every_x_inches);\n\t\t$cross_height = ceil($height / $every_x_inches);\n\t\t\n\t\t$linear_inch_width = ($cross_width + 1) * $height;\n\t\t$linear_inch_height = ($cross_height + 1) * $width;\n\t\t\n\t\t$cradle_price = ($linear_inch_width + $linear_inch_height) * $price_per_inch;\n\t\t\n\t\t$d_cradle_price = $cradle_price;\n\t\t\n\t\t// if we have a cradle selected, take 15% off the panel\n\t\tif($cradle_id == 3 || $cradle_id == 4 || $cradle_id == 5 || $cradle_id == 6 || $cradle_id == 7 || $cradle_id == 8)\n\t\t\t$cradle_price = $cradle_price - ($cradle_price * 0.15);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// cradle price total is price multiplied by how many\n\t\t//$cradle_price = $cradle_price * $quantity;\n\t\t\n\t\t// price total is the price multiplied by how many\n\t\t//$price_total = $price * $quantity;\n\t\t\n\t\t\n\t\t$price_total = $price + $cradle_price;\n\t\t\n\t\t//if 48\" add ten percent;\n\t\tif($width == 48)\n\t\t\t$price_total = $price_total + ($price_total * 0.10);\n\t\t\t\n\t\t\t\n\t\t// multiply by quantity\n\t\t\n\t\t$price_total = $price_total * $quantity;\n\t\t\n\t\t// add the cradle price onto the total\n\t\t//$price_total = $price_total + $cradle_price;\n\t\t\n\t\t// if we see 9999 that means this function finished but we didnt get back what we wanted from it\n\t\t//return $price_total;\n\t\t//return $db_price;\n\t\t\n\t\t// Debug - send email with values\n\t\t//$this->pushDebugMessage($d_db_price, $d_sf_price, $d_after_quantity_price, $d_square_inch_price, $d_cradle_price);\n\t\t\n\t\treturn $price_total;\n\t\t//return $price_per_inch;\n\t\t\n\t\t\n\t\t\n }", "public function getMyPriceForSKU($request);", "function getInventoryOrderedLow(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount, (amount / parAmount) AS orderAmount FROM inventory ORDER BY orderAmount ASC;\");\n \n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }" ]
[ "0.72178304", "0.64239246", "0.6239215", "0.6213493", "0.6187477", "0.6133494", "0.6118541", "0.6052696", "0.6024721", "0.5998372", "0.599308", "0.5988375", "0.5975512", "0.5969427", "0.59683347", "0.59193027", "0.5915092", "0.5909641", "0.58617216", "0.5830128", "0.5820433", "0.578864", "0.5762576", "0.5746408", "0.57398826", "0.57184494", "0.5715424", "0.5710964", "0.56796265", "0.56759804", "0.56685317", "0.56568795", "0.5651335", "0.5641542", "0.5639548", "0.56382775", "0.5620871", "0.5618282", "0.5613568", "0.5612028", "0.5610914", "0.5604097", "0.5590177", "0.55817765", "0.55570644", "0.5546117", "0.55400294", "0.55331355", "0.55325127", "0.5502927", "0.54954326", "0.54850924", "0.5460389", "0.5459343", "0.5450337", "0.5446723", "0.54432195", "0.54402775", "0.5437205", "0.54294175", "0.5426063", "0.541969", "0.54175276", "0.5413402", "0.5410361", "0.54075056", "0.53956246", "0.53935623", "0.5393253", "0.53813815", "0.53718776", "0.5370252", "0.5367204", "0.5358285", "0.53463906", "0.5343859", "0.533595", "0.5327229", "0.53208447", "0.53158", "0.5312798", "0.53031254", "0.53026634", "0.52996427", "0.52996427", "0.5296746", "0.5294592", "0.529379", "0.5286404", "0.5283265", "0.52804124", "0.52793574", "0.52762604", "0.52732897", "0.5269063", "0.5264281", "0.5263228", "0.5259579", "0.52589476", "0.5258637" ]
0.5838623
19
sku Hierarchy start Gent All Sku Hierarchy table Data //
public function getSkuHierarchy () { $sql = "select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id," . " (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id "; $query = $this->db->query( $sql )->result_array(); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "function startCountingAddedLevels()\n {\n\tforeach ($this->getSchema()->getLevels() as $level)\n\t{\n\t $select = $this->getReadAdapter()->select()->from('elite_level_' . $this->getSchema()->id() .'_' . str_replace(' ', '_', $level), 'count(*)');\n\t $result = $select->query()->fetchColumn();\n\t $this->start_count_added_by_level[$level] = $result;\n\t}\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}", "function ext_tree($parent_id, $con, $lev, $info) {\n\n // rows selection from TBSM tables\n $sel = \"SELECT SERVICEINSTANCEID, SERVICEINSTANCENAME, DISPLAYNAME, SERVICESLANAME, TIMEWINDOWNAME\n\t\t\t\tFROM TBSMBASE.SERVICEINSTANCE, TBSMBASE.SERVICEINSTANCERELATIONSHIP\n\t\t\t\tWHERE PARENTINSTANCEKEY = '$parent_id' AND SERVICEINSTANCEID = CHILDINSTANCEKEY\";\n $stmt = db2_prepare($con, $sel);\n $result = db2_execute($stmt);\n\n $values = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n $values++;\n $info[$lev] = array (\n 'level' => $lev,\n 'endpoint' => false,\n 'id' => $row['SERVICEINSTANCEID'],\n 'service' => $row['SERVICEINSTANCENAME'],\n 'display' => $row['DISPLAYNAME'],\n 'template' => $row['SERVICESLANAME'],\n 'maintenance' => $row['TIMEWINDOWNAME'],\n );\n // unique value\n if (!in_array($row['SERVICEINSTANCEID'], array_column($GLOBALS['results'], 'id')))\n $GLOBALS['results'][] = $info[count($info)-1];\n\n // recursive function call\n ext_tree($row['SERVICEINSTANCEID'], $con, $lev+1, $info);\n }\n\n return ($values > 0);\n}", "function get_sitetree(&$massiv, $start, $level){\n\t\tglobal $web;\n\t\t\n\t\t$list \t= '';\n\t\t$class \t= '';\n\t\tif (!isset($massiv[$start])) return;\n\t\t\n\t\tif ($level == 1) {\n\t\t\t$class \t= 'sub';\n\t\t} elseif ($level == 2) {\n\t\t\t$class = 'subsub';\n\t\t}\n\t\t\n\t\tforeach($massiv[$start] as $key=>$value){\n\t\t\t$list .= '<a class=\"'.$class.'\" href=\"'.SmartUrlEncode(WBG::crosslink($value)).'\">'.$value['title'].'</a>';\n\t\t\t$list .= get_sitetree($massiv, $key, $level+1);\n\t }\n\t \n\t\treturn $list;\n\t}", "public function getSelectedBranchStudentData($start){\n $start = ($start-1)*10 ;\n $end = $start + 10;\n if($this->databaseConnection()){\n $query = $this->db_connection->prepare('select * from branch limit :start , :end');\n $query->bindValue(':start', $start ,PDO::PARAM_INT);\n $query->bindValue(':end', $end ,PDO::PARAM_INT);\n $query->execute();\n return $query; \n }\n }", "public function ddl_parentdetails()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id, label\r\n\t\t\t\t\t\t\tFROM parents\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow['label'] =$row[2];\r\n\t\t\t\t\t$fsow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $fsow_arr;\r\n\t\t}", "function iso639families_complete_by_table($records) {\n\t$hierarchies =array();\n\t$loc_to_spip = $GLOBALS['iso_service']['iso639families']['add_fields']['loc'];\n\n\t// On récupère la page de description de la famille sur le site SIL.\n\tinclude_spip('inc/distant');\n\t$url = _CODELANG_LOC_ISO639_5_HIERARCHY;\n\t$options = array('transcoder' => true);\n\t$flux = recuperer_url($url, $options);\n\n\t// On décrypte la page et principalement le tableau pour en extraire la colonne hiérarchie\n\t// de chaque famille et créer la colonne parent dans la table iso639families.\n\tinclude_spip('inc/filtres');\n\t$table = extraire_balise($flux['page'], 'table');\n\tif ($table) {\n\t\t// On extrait la première table de la page qui contient les données voulues\n\t\t$rows = extraire_balises($table, 'tr');\n\t\tif ($rows) {\n\t\t\t// La première ligne du tableau est celle des titres de colonnes : on la supprime.\n\t\t\tarray_shift($rows);\n\t\t\tforeach ($rows as $_row) {\n\t\t\t\t// Chaque ligne de la table est composée de deux colonnes, le première le libellé\n\t\t\t\t// et la deuxième la valeur.\n\t\t\t\t$columns = extraire_balises($_row, 'td');\n\t\t\t\t$columns = array_map('supprimer_tags', $columns);\n\t\t\t\tif (count($columns) >= 2) {\n\t\t\t\t\t// La première colonne contient la hiérarchie et la seconde le code alpha-3 de la famille.\n\t\t\t\t\t$code = trim($columns[1]);\n\t\t\t\t\t$hierarchies[$code] = str_replace(array(' ', ':'), array('', ','), trim($columns[0]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// On complète maintenant le tableau des enregistrements avec la colonne additionnelle hierarchy et la colonne\n\t// dérivée parent qui ne contient que le code alpha-3 de la famille parente si elle existe.\n\tforeach($records as $_cle => $_record) {\n\t\t$code = $_record['code_639_5'];\n\t\t$records[$_cle]['parent'] = '';\n\t\tif (isset($hierarchies[$code])) {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = $hierarchies[$code];\n\t\t\t// Calcul du parent : si la hierarchie ne contient qu'un code c'est qu'il n'y a pas de parent.\n\t\t\t// Sinon, le parent est le premier code qui précède le code du record.\n\t\t\t$parents = explode(',', $hierarchies[$code]);\n\t\t\tif (count($parents) > 1) {\n\t\t\t\tarray_pop($parents);\n\t\t\t\t$records[$_cle]['parent'] = array_pop($parents);\n\t\t\t}\n\t\t} else {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = '';\n\t\t}\n\t}\n\n\treturn $records;\n}", "function display_node($parent, $level) {\n global $tam1;\n $tam2=array();\n global $leafnodes; \n global $responce;\n if($parent >0) {\n foreach ($tam1 as $row){\n\t if($row['ID_Parent']==$parent){\n\t\t $tam2[]=$row;\n\t }\n }\n } else {\n \n\t foreach ($tam1 as $row){\n\t if($row['ID_Parent']==''){\n\t\t $tam2[]=$row;\n\t }\n }\n }\n\n foreach ($tam2 as $row) {\n\tif(!$row['ID_Parent']) $valp = 'NULL'; else $valp = $row['ID_Parent'];\t\n\t//kiem tra node co phai lead\n\tif(array_key_exists($row['ID_Control'], $leafnodes)) $leaf='true'; else $leaf = 'false';\t\n\t$responce[] = array('ID_Control' => $row[\"ID_Control\"], 'ID_Parent' => $row[\"ID_Parent\"], 'Caption' => $row[\"Caption\"],'KieuControl' => $row[\"KieuControl\"],'IsBarButton' => $row[\"IsBarButton\"] ,'Icon' =>$row[\"Icon\"],'Active' =>$row[\"Active\"],'STT' =>$row[\"STT\"],'PageOpen' =>$row[\"PageOpen\"],'OpenType' =>$row[\"OpenType\"],'TenControl' =>$row[\"TenControl\"] , 'level' => $level, 'parent' => $valp, 'isLeaf' => $leaf, 'expanded' => \"true\", 'loaded' => \"true\");\n\t\n\t display_node($row['ID_Control'],$level+1);\n\t \n\t} \n \n return $responce;\n \n}", "private function _readSubTableData() {}", "function beginChildren()\n {\n echo \"<tr>\";\n }", "public function loadStudents(){\n $data=$this->studentsInRiskForThis();\n $cantidad=count($data);\n $contador=0;\n foreach($data as $fila){\n IF(Talleresdet::firstOrCreateStatic([\n 'talleres_id'=>$this->id,\n 'codalu'=>$fila['codalu'],\n ], Talleresdet::SCENARIO_BATCH ))\n $contador++; \n }\n return ['total'=>$cantidad,'contador'=>$contador];\n }", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "protected function loadParentId(){return 0;}", "function buildFamilyTrees() {\n\t\t\n\t\taddToDebugLog(\"getZerothGen(), Function Entry - no parameters, INFO\");\n\t\t\n\t\t$sql = \"SELECT * FROM hackcess.character WHERE generation = 0;\";\n\t\t$result = search($sql);\n\t\t$rows = count($result);\n\t\t\n\t\t$gen = 0;\n\t\t\n\n\t\t\n\t\tfor ($z = 0; $z < $rows; $z++) {\n\t\t\techo \"<table cellpadding=3 cellspacing=0 border=1 align=center width=1000px>\";\n\t\t\techo \"<tr bgcolor=#bbb><td align=center>Gen<td>Name<td align=right>Average Fight Length<td>Fights</tr>\";\n\t\t\t$character_id = $result[$z][0];\n\t\t\techo \"<tr><td width=50px align=center>\" . $gen . \"<td>\" . $result[$z][2] . \"<td align=right width=300px>\" . barGraph(getAverageRounds($character_id), 'char') . \"<td width=300px align=left>\" . barGraph(characterFightCount($character_id), \"enemy\") . \"</tr>\";\n\n\t\t\t$rows2 = 1;\n\t\t\t\n\t\t\twhile ($rows2 == 1) {\n\t\t\t\t\n\t\t\t\t$gen++;\n\t\t\t\t\n\t\t\t\t$sql2 = \"SELECT * FROM hackcess.character WHERE parent_id = \" . $character_id . \";\";\n\t\t\t\t$result2 = search($sql2);\n\t\t\t\t$rows2 = count($result2);\n\t\t\t\tif ($rows2 == 1) {\n\t\t\t\t\techo \"<tr><td width=50px align=center>\" . $gen . \"<td>\" . $result2[0][2] . \"<td align=right width=300px>\" . barGraph(getAverageRounds($character_id), 'char') . \"<td width=300px align=left>\" . barGraph(characterFightCount($character_id), \"enemy\") . \"</tr>\";\n\t\t\t\t\t$character_id = $result2[0][0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\techo \"</table><P>\";\n\t\t\t$gen = 0;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function run()\n {\n $items = [\n \t['id' => 1, 'name' => 'Skincare'],\n \t['id' => 2, 'name' => 'Cleansing'],\n \t['id' => 3, 'name' => 'Base'],\n \t['id' => 4, 'name' => 'Eyes|Lips|Cheek'],\n \t['id' => 5, 'name' => 'Masks'],\n \t['id' => 6, 'name' => 'Suncare'],\n \t['id' => 7, 'name' => 'Special Care'],\n \t['id' => 8, 'name' => 'Body|Hand|Foot'],\n \t['id' => 9, 'name' => 'Hair Care'],\n \t['id' => 10, 'name' => 'Nail Care'],\n \t['id' => 11, 'name' => 'Contact Lenses'],\n \t['id' => 12, 'name' => 'Perfumes'],\n \t['id' => 13, 'name' => 'Tools|Others'],\n\n \t['id' => 14, 'parent' => 1, 'name' => 'Toner'],\n \t['id' => 15, 'parent' => 1, 'name' => 'Lotion'],\n \t['id' => 16, 'parent' => 1, 'name' => 'Essence'],\n \t['id' => 17, 'parent' => 1, 'name' => 'Cream'],\n \t['id' => 18, 'parent' => 2, 'name' => 'Cleansing Water'],\n \t['id' => 19, 'parent' => 2, 'name' => 'Cleansing Wipes'],\n \t['id' => 20, 'parent' => 3, 'name' => 'Primer'],\n \t['id' => 21, 'parent' => 3, 'name' => 'Foundation'],\n \t['id' => 22, 'parent' => 3, 'name' => 'Concealer'],\n \t['id' => 23, 'parent' => 3, 'name' => 'Powder'],\n \t['id' => 24, 'parent' => 4, 'name' => 'Blush'],\n \t['id' => 25, 'parent' => 4, 'name' => 'Contour'],\n \t['id' => 26, 'parent' => 4, 'name' => 'Highlighter'],\n \t['id' => 27, 'parent' => 4, 'name' => 'Eyebrow'],\n \t['id' => 28, 'parent' => 4, 'name' => 'Eyeshadow'],\n \t['id' => 29, 'parent' => 4, 'name' => 'Eyeliner'],\n \t['id' => 30, 'parent' => 4, 'name' => 'Mascara'],\n \t['id' => 31, 'parent' => 4, 'name' => 'Lipstick'],\n \t['id' => 32, 'parent' => 4, 'name' => 'Lip Tint'],\n \t['id' => 33, 'parent' => 5, 'name' => 'Sheet Mask'],\n \t['id' => 34, 'parent' => 6, 'name' => 'Sunblock'],\n \t['id' => 35, 'parent' => 7, 'name' => 'Wrinkle Care'],\n \t['id' => 36, 'parent' => 7, 'name' => 'Acne Care'],\n \t['id' => 37, 'parent' => 8, 'name' => 'Body Wash'],\n \t['id' => 38, 'parent' => 9, 'name' => 'Hair Color'],\n \t['id' => 39, 'parent' => 10, 'name' => 'Nail Polish'],\n \t['id' => 40, 'parent' => 11, 'name' => 'Color Lenses'],\n \t['id' => 41, 'parent' => 12, 'name' => 'Candles'],\n \t['id' => 42, 'parent' => 13, 'name' => 'Brush'],\n \t['id' => 43, 'parent' => 13, 'name' => 'Lashes'],\n ];\n\n foreach ($items as $item) {\n \tCategory::updateOrCreate(['id' => $item['id']], $item);\n }\n }", "function getScos()\n\t{\n\t\tif ($this->chap > 0)\n\t\t{\n\t\t\t$nodes = $this->tree->getChilds($this->chap);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nodes = $this->tree->getSubTree($this->tree->getNodeData($this->tree->root_id),true,array('sco'));\n\t\t}\n\n\t\t$scos = array();\n\n\t\t$nr = 1;\n\t\tforeach($nodes as $node)\n\t\t{\n\t\t\tif ($node[\"type\"] == \"sco\")\n\t\t\t{\n\t\t\t\t$node[\"nr\"] = $nr++;\n\t\t\t\t$scos[] = $node;\n\t\t\t}\n\t\t}\n\n\t\t$this->setDefaultOrderField(\"nr\");\n\t\t$this->setDefaultOrderDirection(\"asc\");\n\t\t$this->setData($scos);\n\t}", "function get_hierarchy_data($optparent=null,$branchparent=0,$published=null,$maxlevel=9999)\n {\n\n /*\n chu y khi lay du lieu\n Khi lay ta len nhom du lieu theo parent id de qua trinh su li phia sau duoc nhanh chong\n */\n $data=$this->_prepareData(null,$optparent,$published) ;\n //pr($data);\n $children=$this->_make_relation($data) ;\n // echo \"<br>---list Child----<br>\"; print_r($children);\n\n $list = $this->_data_recurse($branchparent, $children, array(), $maxlevel,0,'',$data);\n //echo \"<br>---list ----<br>\"; print_r($list);\n\n return $list;\n }", "function cognitivefactory_get_subtree_list($table, $id) {\n global $DB;\n \n $res = $DB->get_records_menu($table, array('fatherid' => $id));\n $ids = array();\n if (is_array($res)) {\n foreach (array_keys($res) as $aSub) {\n $ids[] = $aSub;\n $subs = cognitivefactory_get_subtree_list($table, $aSub);\n if (!empty($subs)) $ids[] = $subs;\n }\n }\n return(implode(',', $ids));\n}", "function getDetailAllAcIDUIDNext($admin_id1,$DbConnection)\n{\n\t$query =\"SELECT account.account_id,account.user_id FROM account,account_detail USE INDEX(ad_acamdid) WHERE account.user_type='substation' AND account.status=1 and account.account_id=account_detail.account_id AND account_detail.account_admin_id='$admin_id1'\";\n\t$result = mysql_query($query,$DbConnection);\t\n\twhile($row = mysql_fetch_object($result))\n\t{\n\t\t/*$account_id_sub = $row->account_id;\n\t\t$user_id_sub = $row->user_id;*/\n\t\t\n\t\t$data[]=array('account_id_sub'=>$row->account_id,'user_id_sub'=>$row->user_id);\t\n\t}\n\treturn $data;\t\n}", "function get_prefix($CategoryID)\n{\n global $tpl, $template, $config, $mysql, $lang, $twig, $prefixed;\n $ParentID = $mysql->result('SELECT parent_id FROM '.prefix.'_eshop_categories WHERE id = '.$CategoryID.' ');\n \n $prefixed[$CategoryID]['f'] .= '&nbsp;&nbsp;&nbsp;';\n #$add_prefix .= '&nbsp;&nbsp;&nbsp;'; \n {\n if ($ParentID == 0) \n { \n $add_prefix .= ''; \n }\n else\n {\n $prefixed[$CategoryID]['s'] .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n $add_prefix .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n \n foreach ($mysql->select(\"SELECT * FROM \".prefix.\"_eshop_categories WHERE id=\".$ParentID.\" \") as $row2)\n {\n $CategoryID2 = $row2['id']; \n $ParentID2 = $row2['parent_id'];\n }\n\n get_prefix($CategoryID2);\n }\n }\n #var_dump($prefixed[$CategoryID]);\n return $add_prefix;\n}", "function root() \n\t{\n\t\t$sql\t=\"select * from tab_gene_user\";\n\t\t$res = $this->db->readValues($sql); \n\t\tif(count($res)> 0 )\n\t\t{\n return $res;\n\t\t}\n\t}", "function do_offset($level){\r\n $offset = \"\"; // offset for subarry\r\n for ($i=1; $i<$level;$i++){\r\n $offset = $offset . \"<td></td>\";\r\n }\r\n return $offset;\r\n}", "public function test_ouwiki_build_up_sub_index() {\n $index = [\n 1 => (object) ['linksto' => [2]],\n 2 => (object) ['linksto' => [1]]\n ];\n $subtree = [];\n ouwiki_build_up_sub_index(1, $index,$subtree);\n $this->assertEquals($index, $subtree);\n }", "public function populateRegionTables() {\n\t\t$scrapeLog = $this->addLog(COUNTY_TABLE);\n\t\t\n\t\t$counties = $this->countyRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . COUNTY_PATH);\n\t\tforeach($counties as $county) {\n\t\t\t$this->countyRepository->add($county);\n\t\t\t\n\t\t\t$municipalities = $this->municipalityRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . MUNICIPALITY_PATH . $county->getCountyId(), $county->getCountyId());\n\t\t\t\n\t\t\tforeach($municipalities as $municipality) {\n\t\t\t\t$this->municipalityRepository->add($municipality);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}", "public function myHierarchy_get(){\n\t\t$userId = $this->token_payload[\"user_id\"];\n\t\tresponse($this,true,200,$this->getAllAccessibleProfiles($userId));\n\t}", "protected function startTable() {}", "public function getExternalSkuData ()\n {\n $sql = \"SELECT t1.id,t1.sku_name,t1.sku_creation_date,t1.sku_description,t3.sku_active_status_name,t4.unit_name FROM\n `tbld_sku` as t1 \n inner join `tbli_sku_mou_price_mapping` as t2 on t1.id=t2.sku_id\n left join `tbld_sku_active_status` as t3 on t1.sku_active_status_id=t3.id\n left join `tbld_unit` as t4 on t2.mou_id=t4.id\n where t1.sku_type_id=2\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "function _getRubriekFromDb()\n {\n $menuData = array('items' => array(), 'parents' => array());\n\n $conn = getConn();\n $sql = \"SELECT RubriekID, Rubrieknaam, SuperRubriekID FROM Rubriek ORDER BY SuperRubriekID, Rubrieknaam\";\n $stmt = sqlsrv_prepare($conn, $sql);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n while ($menuItem = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $menuData['items'][$menuItem['RubriekID']] = $menuItem;\n $menuData['parents'][$menuItem['SuperRubriekID']][] = $menuItem['RubriekID'];\n }\n }\n return $menuData;\n }", "public function Enumerate()\r\n {\r\n $query = \"select a.*, b.name as subsector, c.name as sector from actividad_comercial a \r\n inner join subsector b on a.subsector_id = b.id \r\n inner join sector c on b.sector_id = c.id order by a.name asc, b.name asc, c.name asc $sql_add\";\r\n $this->Util()->DB()->setQuery($query);\r\n $result = $this->Util()->DB()->GetResult();\r\n $data[\"items\"] = $result;\r\n // $data[\"pages\"] = $pages;\r\n return $data;\r\n }", "public function getVTGK($start,$length,$data,$order,$dir) {\n\t\t\t$this->db->select('IDTGK,UNITAP,UNITUP,TB_TUNGGAKAN.IDPEL,NAMA_PEL AS NAMA,TARIF,DAYA,KOGOL,GARDU,ALAMAT,KOORDX,KOORDY,LEMBAR,RPPTL,RPBPJU,RPPPN,RPMAT,TAGSUS,UJL,BP,TRAFO,SEWATRAFO,SEWAKAP,RPTAG,RPBK,TGL_AKHIR AS TANGGAL_TGK,KALITGK');\n\t\t\t$this->db->from('TB_TUNGGAKAN');\n\t\t\t$this->db->join('TB_PELANGGAN', 'TB_TUNGGAKAN.IDPEL = TB_PELANGGAN.IDPEL');\n\t\t\t$this->db->where_not_in('TB_TUNGGAKAN.IDPEL', '0');\n\n\t\t\tif ($data['search']) {\n\t\t\t\t$this->db->like('NAMA_PEL', $data['search']);\n\t\t\t\t$this->db->or_like('TB_TUNGGAKAN.IDPEL', $data['search']);\n\t\t\t\t$this->db->or_like('TB_PELANGGAN.TARIF', $data['search']);\n\t\t\t}\n\n\t\t\t// Check if UNITAP and/or UNITUP has a value of 1 (All)\n\t\t\tif ($data['idap'] == '1') {\n\t\t\t\t// Get All UNITAP & UNITUP\n\t\t\t} else {\n\t\t\t\t$this->db->where('UNITAP', $data['idap']);\n\t\t\t\tif ($data['idup'] == '1') {\n\t\t\t\t\t// Get All UNITUP\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where('UNITUP', $data['idup']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($data['stats'] == '3') {\n\t\t\t\t$this->db->where('LEMBAR >=', $data['stats']);\n\t\t\t} else if ($data['stats'] == '1' || $data['stats'] == '2') {\n\t\t\t\t$this->db->where('LEMBAR', $data['stats']);\n\t\t\t}\n\n\t\t\tif ($data['kalitgk'] == '3') {\n\t\t\t\t$this->db->where('KALITGK >=', $data['kalitgk']);\n\t\t\t} else if ($data['kalitgk'] == '1' || $data['kalitgk'] == '2') {\n\t\t\t\t$this->db->where('KALITGK', $data['kalitgk']);\n\t\t\t}\n\n\t\t\tif ($data['kogols']) {\n\t\t\t\t$this->db->where('KOGOL', $data['kogols']);\n\t\t\t}\n\t\t\t\n\t\t\tif ($order != null) {\n\t\t\t\t$this->db->order_by($order, $dir);\n\t\t\t}\n\n\t\t\treturn $this->db->limit($length,$start)->get();\n\t\t}", "function getDirectorHierarchy($director_id = TOP_DIRECTOR_ID)\t// March 17, 2008: 151 (Mike Woodard)\t\n {\n\t $sql = 'select distinct ';\n\t \n\t // Initialize column filters\n\t for ($lvl = 1; $lvl <= MAX_DIRECTOR_LEVELS; $lvl++)\n\t {\n\t\t $sql .= 'table'.$lvl.'.director_id as dir_lvl'.$lvl.',';\n\t\t $sql .= 'table'.$lvl.'.staff_id as staff_lvl'.$lvl.',';\n\t }\n\t $sql = substr($sql,0,-1);\t// remove comma\n\t $init_val = 1;\n\t $sql .= ' from '.RowManager_StaffDirectorManager::DB_TABLE.' as table'.$init_val;\n\t \n\t\t // Setup join portion of the SQL query \n\t for ($level = 2; $level <= MAX_DIRECTOR_LEVELS; $level++)\n\t {\t \n\t\t $sql .= ' LEFT JOIN '.RowManager_StaffDirectorManager::DB_TABLE.' as table'.$level;\n\t\t $sql .= ' on table'.$level.'.director_id = table'.(--$level).'.staff_id';\n\t\t $level++;\n\t }\n\t \n\t $sql .= ' where table'.$init_val.'.director_id = '.$director_id;\t \n\t\t\t\n// \t echo 'hier. = <br>'.$sql.'<BR><BR>';\n\t \n // create a new DB object\n $db = new Database_Site();\n $databaseName = $this->dbName;\n if ( $databaseName == '' )\n {\n $databaseName = SITE_DB_NAME;\n }\n $db->connectToDB( $databaseName, $this->dbPath, $this->dbUser, $this->dbPword );\n \n// echo \"<BR>sql = \".$sql;\n \n // run the sql\n $db->runSQL( $sql );\n \n // create a new ReadOnlyResultSet using current db object\n $recordSet = new ReadOnlyResultSet( $db );\n \n // return this record set\n return $recordSet;\t\t\t\n }", "function subMenuNavigasi($menu,$user){\n\t\t$smenu = mysql_query(\"select * from ms_menu where parent='$menu' order by urut asc\");\n\t\t$ada\t\t= mysql_num_rows($smenu);\n\t\tif($ada==0){\n\t\t\t$data[]=$ada;\n\t\t\tif (isset($data)){\n\t\t\t\treturn false;\n\t\t\t} \n\t\t}else{\n\t\t\twhile($row=mysql_fetch_array($smenu))\n\t\t\t\t$data[]=$row;\n\t\t\tif (isset($data)){\n\t\t\t\treturn($data);\n\t\t\t}\n\t\t}\n\t}", "public function run(): void\n {\n FrontendUserLevel::insert(\n [\n [\n 'name' => 'VIP1',\n 'level' => 1,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 1000,\n 'experience_max' => 1999,\n 'promotion_gift' => 5.88,\n 'weekly_gift' => 5.88,\n ],\n [\n 'name' => 'VIP2',\n 'level' => 2,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 2000,\n 'experience_max' => 2999,\n 'promotion_gift' => 10.88,\n 'weekly_gift' => 10.88,\n ],\n [\n 'name' => 'VIP3',\n 'level' => 3,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 3000,\n 'experience_max' => 3999,\n 'promotion_gift' => 15.88,\n 'weekly_gift' => 15.88,\n ],\n [\n 'name' => 'VIP4',\n 'level' => 4,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 4000,\n 'experience_max' => 4999,\n 'promotion_gift' => 20.88,\n 'weekly_gift' => 20.88,\n ],\n [\n 'name' => 'VIP5',\n 'level' => 5,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 5000,\n 'experience_max' => 5999,\n 'promotion_gift' => 25.88,\n 'weekly_gift' => 25.88,\n ],\n [\n 'name' => 'VIP6',\n 'level' => 6,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 6000,\n 'experience_max' => 6999,\n 'promotion_gift' => 30.88,\n 'weekly_gift' => 30.88,\n ],\n [\n 'name' => 'VIP7',\n 'level' => 7,\n 'platform_sign' => 'JHHY',\n 'experience_min' => 7000,\n 'experience_max' => 7999,\n 'promotion_gift' => 35.88,\n 'weekly_gift' => 35.88,\n ],\n ],\n );\n }", "protected function loadTreeData() {}", "public function getSKUPartsData() {\n $partsData = DB::table('part_number')->select('SKU', 'id')->get();\n $sku = '';\n $sku .=\"<option value='\" . '' . \"' selected='selected' > select sku</option>\";\n foreach ($partsData as $key => $value) {\n $sku .=\"<option value='\" . $value->id . \"'>\" . $value->SKU . \"</option>\";\n }\n return $sku;\n }", "function achieve_get_sub_category()\r\n{\r\n global $sql;\r\n\r\n $sub_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC\");\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n while ($sub_cat[$temp[\"ParentID\"]][$temp[\"ID\"]] = $temp[\"Name\"])\r\n {\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n }\r\n return $sub_cat;\r\n}", "public function get_segment_value()\n\t{\n\n\t\t$struc_id = $this->session->userdata('struc_id');//4\n\t\t$segment_no = $this->session->userdata('segment_no');//5\n\t\t$qualifier_id = $this->session->userdata('qualifier_id');//7\n // var_dump($qualifier_id);\n // exit;\n \n $segment_id = $this->uri->segment(4);\n // var_dump($struc_id);\n // exit;\n\n \n \n\t\t\n\t\t $segmet_val = $this->db->query(\"SELECT SEGMENT_VAL_NATURE_ID,SEGMENT_NATURE_DESC FROM WIZ_SEGMENT_VALUE_NATURE_MT \n\t\t \t\t\t\t\t\t\twhere QUALIFIER_ID =$qualifier_id\");\n\t\t\t \n\t\t $nature_id=$segmet_val->result_array();\n\t\t\t\n\t\t\t// on click of any child or parent on tree get its description on usegform\n\n\t\t$qry1 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT01 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry2 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT02 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry3 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT03 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry4 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT04 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry5 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT05 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry6 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT06 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry7 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT07 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry8 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT08 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry9 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT09 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry10 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT10 WHERE STRUCTURE_ID=$struc_id\");\n\n\t\t\tif($segment_no == 1)\n\t\t\t{\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry1.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry1;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\t\t\telse if($segment_no == 2)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry2.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry2;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse if($segment_no == 3)\n\t\t\t{\t\t\t\n\t\t\t\t\n\t\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry3.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry3;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 4)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry4.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry4;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 5)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry5.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry5;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 6)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry6.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry6;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 7)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry7.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry7;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 8)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry8.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry8;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 9)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry9.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry9;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 10)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry10.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry10;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn array('nature_id'=>$nature_id,'seg_id',$seg_id);\n\n\t\t\t\n\n\t\t\t \n\t}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "private function tree_getRendered()\n {\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n $arr_result = array();\n\n static $firstCallDrsTreeview = true;\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n\n\n // Add first item\n // SWITCH display first item\n switch ( $conf_array[ 'first_item' ] )\n {\n case( true ):\n // Set hits\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $sum_hits = ( int ) $this->hits_sum[ $this->curr_tableField ];\n $this->pObj->cObj->data[ $hitsField ] = $sum_hits;\n // Set hits\n // Render uid and value of the first item\n $first_item_uid = $conf_array[ 'first_item.' ][ 'option_value' ];\n $tsValue = $conf_array[ 'first_item.' ][ 'cObject' ];\n $tsConf = $conf_array[ 'first_item.' ][ 'cObject.' ];\n $first_item_value = $this->pObj->cObj->cObjGetSingle( $tsValue, $tsConf );\n // Render uid and value of the first item\n $tmpOneDim = array( 'uid' => $first_item_uid ) +\n array( 'value' => $first_item_value );\n if ( !empty( $this->tmpOneDim ) )\n {\n $tmpOneDim = $tmpOneDim +\n $this->tmpOneDim;\n }\n // Render uid and value of the first item\n break;\n case( false ):\n default:\n $tmpOneDim = $this->tmpOneDim;\n break;\n }\n // SWITCH display first item\n // Add first item\n // Move one dimensional array to an iterator\n $tmpArray = $this->pObj->objTyposcript->oneDim_to_tree( $tmpOneDim );\n $rcrsArrIter = new RecursiveArrayIterator( $tmpArray );\n $iterator = new RecursiveIteratorIterator( $rcrsArrIter );\n // Move one dimensional array to an iterator\n // HTML id\n $cObj_name = $conf_array[ 'treeview.' ][ 'html_id' ];\n $cObj_conf = $conf_array[ 'treeview.' ][ 'html_id.' ];\n $html_id = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // HTML id\n //////////////////////////////////////////////////////\n //\n // Loop values\n // Initial depth\n // SWITCH display first item\n switch ( $conf_array[ 'first_item' ] )\n {\n case( true ):\n $last_depth = -1;\n break;\n case( false ):\n default:\n $last_depth = 0;\n break;\n }\n // SWITCH display first item\n // Initial depth\n // LOOP\n $bool_firstLoop = true;\n $loops = 0;\n foreach ( $iterator as $key => $value )\n {\n // CONTINUE $key is the uid. Save the uid.\n if ( $key == 'uid' )\n {\n $curr_uid = $value;\n continue;\n }\n // CONTINUE $key is the uid. Save the uid.\n\n if ( $bool_firstLoop )\n {\n $first_item_uid = $curr_uid;\n }\n\n\n // CONTINUE ERROR $key isn't value\n if ( $key != 'value' )\n {\n echo 'ERROR: key != value.' . PHP_EOL . __METHOD__ . ' (Line: ' . __LINE__ . ')' . PHP_EOL;\n continue;\n }\n // CONTINUE ERROR $key isn't value\n // Render the value\n//$this->pObj->dev_var_dump( $value )\n $item = $this->get_filterItem( $curr_uid, $value );\n //$item = '<a href=\"leglis-bid/?tx_browser_pi1%5Btx_leglisbasis_sector.brc_text%5D=1657&cHash=579a339049d1ca24815eadf0cd53371d\">\n // Baugewerbe (132)\n // </a>';\n//$this->pObj->dev_var_dump( $item );\n // CONTINUE: item is empty\n if ( empty( $item ) )\n {\n // DRS\n if ( $firstCallDrsTreeview && ( $this->pObj->b_drs_filter || $this->pObj->b_drs_cObjData ) )\n {\n $prompt = 'No value: [' . $key . '] won\\'t displayed! Be aware: this log won\\'t displayed never again.';\n t3lib_div :: devlog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n $prompt = 'Maybe TS configuration for [' . $key . '] is: display it only with a hit at least.';\n t3lib_div :: devlog( '[INFO/FILTER] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'There is a workaround: please take a look in the manual for ' . $this->pObj->prefixId . '.flag_treeview.';\n t3lib_div :: devlog( '[HELP/FILTER] ' . $prompt, $this->pObj->extKey, 1 );\n $firstCallDrsTreeview = false;\n }\n // DRS\n continue;\n }\n // CONTINUE: item is empty\n\n $loops++;\n\n // Vars\n $curr_depth = $iterator->getDepth();\n $indent = str_repeat( ' ', ( $iterator->getDepth() + 1 ) );\n // Vars\n // Render the start tag\n switch ( true )\n {\n case( $curr_depth > $last_depth ):\n // Start of sublevel\n $delta_depth = $curr_depth - $last_depth;\n $startTag = PHP_EOL .\n str_repeat\n (\n $this->htmlSpaceLeft . $indent . '<ul id=\"' . $html_id . '_ul_' . $curr_uid . '\">' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . ' <li id=\"' . $html_id . '_li_' . $curr_uid . '\">', $delta_depth\n );\n $last_depth = $curr_depth;\n break;\n // Start of sublevel\n case( $curr_depth < $last_depth ):\n // Stop of sublevel\n $delta_depth = $last_depth - $curr_depth;\n $startTag = '</li>' . PHP_EOL .\n str_repeat\n (\n $this->htmlSpaceLeft . $indent . ' </ul>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</li>', $delta_depth\n ) .\n PHP_EOL .\n $this->htmlSpaceLeft . $indent . '<li id=\"' . $html_id . '_li_' . $curr_uid . '\">';\n $last_depth = $curr_depth;\n break;\n // Stop of sublevel\n default:\n $startTag = '</li>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '<li id=\"' . $html_id . '_li_' . $curr_uid . '\">';\n break;\n }\n // Render the start tag\n // Result array\n $arr_result[ $curr_uid ] = $startTag . $item;\n\n $bool_firstLoop = false;\n }\n // LOOP\n // Loop values\n // Render the end tag of the last item\n $endTag = '</li>' .\n str_repeat\n (\n '</ul>' . PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</li>', $curr_depth\n ) .\n PHP_EOL .\n $this->htmlSpaceLeft . $indent . '</ul>';\n $arr_result[ $curr_uid ] = $arr_result[ $curr_uid ] . $endTag . PHP_EOL .\n $this->htmlSpaceLeft . '</div>';\n // Render the end tag of the last item\n\n $arr_result[ $first_item_uid ] = $this->htmlSpaceLeft . '<div id=\"' . $html_id . '\">' . $arr_result[ $first_item_uid ];\n\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n\n // RETURN the result\n return $arr_result;\n }", "function navi_array()\n\t{\n\t\t$navifromdb = $this->connection->db_assoc(\"SELECT * FROM `$this->navi_table` ORDER BY `id` ASC\");\n\n\t\t$navi = array();\n\t\tfor ($i=0;$i<count($navifromdb);$i++)\n\t\t{\n\t\t\t$rubrik_key = $navifromdb[$i]['Rubrik_key'];\n\t\t\tif ($navifromdb[$i]['Hierarchy']==0)\n\t\t\t{\n\t\t\t\t$navi[$rubrik_key]['Rubrik'] = $navifromdb[$i]['Rubrik'];\n\t\t\t\t$navi[$rubrik_key]['Show'] = $navifromdb[$i]['Show'];\n\t\t\t\t$navi[$rubrik_key]['Show_to'] = ($navifromdb[$i]['Show_to'] != '') ? explode(',',$navifromdb[$i]['Show_to']):'';\n\t\t\t\t$navi[$rubrik_key]['Modul'] = $navifromdb[$i]['Modul'];\n\t\t\t\t$navi[$rubrik_key]['ext_link'] = $navifromdb[$i]['ext_link'];\n\n\n\t\t\t\t$navi[$rubrik_key]['Subnavi'] = array();\n\t\t\t}\n\t\t\telse if ($navifromdb[$i]['Hierarchy']==1)\n\t\t\t{\n\t\t\t\t$page_key = $navifromdb[$i]['Page_key'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Seite'] = $navifromdb[$i]['Seite'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Show'] = $navifromdb[$i]['Show'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Show_to'] = ($navifromdb[$i]['Show_to'] != '') ? explode(',',$navifromdb[$i]['Show_to']):'';\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Modul'] = $navifromdb[$i]['Modul'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['ext_link'] = $navifromdb[$i]['ext_link'];\n\n\t\t\t}\n\n\t\t}\n\t\treturn $navi;\n\t}", "function rst_load_parents($appGlobals,$keyType, $keyValue) {\n // includes kidProgram data when not using kidId (maybe need flag for this)\n $fields = array();\n $fields = dbRecord_parentFamilyCombo::stdRec_addFieldList($fields);\n $fields = stdData_kidProgram_exRecord::stdRec_addFieldList($fields);\n $fieldList = \"`\".implode(\"`,`\",$fields).\"`\";\n $sql = array();\n //???????? need kid program so can load all parents for program\n $sql[] = \"SELECT \".$fieldList;\n switch ($keyType) {\n case ROSTERKEY_KIDID:\n $sql[] = \"FROM `ro:kid`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"WHERE `rKd:KidId` ='{$keyValue}'\";\n break;\n case ROSTERKEY_KIDPERIODID:\n $sql[] = \"FROM `ro:kid_period`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPe:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPe:KidPeriodId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentId`\"; // each row is a unique parent\n break;\n case ROSTERKEY_KIDPROGRAMID:\n $sql[] = \"FROM `ro:kid_program`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPr:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPr:KidProgramId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentIdt`\"; // each row is a unique parent\n break;\n }\n $sql[] = \"ORDER BY `rPU:ContactPriority`\";\n $query = implode( $sql, ' ');\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n while ($row=$result->fetch_array()) {\n $kidId = $row['rKd:KidId'];\n $kidProgramId = $row['rKPr:KidProgramId'];\n $kid = $this->rst_get_kid($kidId);\n if ( $kid->rstKid_parent == NULL) {\n $kid->rstKid_parent = new dbRecord_parentFamilyCombo;\n if ( !isset($this->rst_map_kidProgram[$kidProgramId]) ) {\n $kidProgram = new stdData_kidProgram_exRecord;\n $kidProgram->stdRec_loadRow($row);\n $this->rst_map_kidProgram[$kidProgramId] = $kidProgram;\n }\n }\n $kid->rstKid_parent->stdRec_loadRow($row);\n }\n}", "function get_category_tree_control_shop($current_category_id, $user_id, $control = false, $params = array())\n {\n //print_r($params);\n //echo '$current_category_id = '.$current_category_id;\n $category_structure = $this->loadCategoryStructure();\n $data_structure = $this->load_data_structure_shop($user_id, $params);\n //echo '<pre>';\n //print_r($data_structure);\n //print_r($category_structure);\n\n foreach ($category_structure['catalog'] as $cat_point) {\n $ch = 0;\n $this->getChildsItemsCount($cat_point['id'], $category_structure['childs'], $data_structure['data'][$user_id], $ch);\n\n $data_structure['data'][$user_id][$cat_point['id']] += $ch;\n }\n\n\n $level = 0;\n $rs = '';\n $rs .= '<table border=\"0\">';\n $rs .= '<tr>';\n $rs .= '<td class=\"row_title\">' . Multilanguage::_('L_TEXT_TITLE') . '</td>';\n $rs .= '<td class=\"row_title\"></td>';\n $rs .= '</tr>';\n foreach ($category_structure['childs'][0] as $item_id => $catalog_id) {\n //echo $catalog_id.'<br>';\n $rs .= $this->get_row_control($catalog_id, $category_structure, $level, 'row1', $user_id, $control, $data_structure, $current_category_id, $params);\n $rs .= $this->get_child_nodes_row_control($catalog_id, $category_structure, $level + 1, $current_category_id, $user_id, $control, $data_structure, $params);\n }\n $rs .= '</table>';\n return $rs;\n }", "function get_fancy_data($data)\n {\n /*\n * Initialize value\n */\n $collection = array();\n $basemodel = NULL;\n $i = 0;\n\n /*\n * Outer loop to run untill the data array end\n */\n foreach ($data as $k => $v) {\n /* Ndoe generator */\n $node = array();\n\n /*\n * Preserver first instance of the row in to a dummy variable\n */\n foreach ($v as $key => $val) {\n if (!is_numeric($key)) {\n $keys = explode(\".\", $key);\n $basemodel = isset($basemodel) ? $basemodel : $keys[0];\n $node[$keys[0]][$keys[1]] = $val;\n }\n }\n\n /*\n * Collect the first node baded model id\n */\n $key_cur = isset($key_cur) ? $key_cur : $v[\"$basemodel.id\"];\n\n /*\n * Set the values in correct place of the the node array\n */\n foreach ($node as $y => $z) {\n if ($y == $basemodel) {\n /* For princilple model it save in to a single array */\n $collection[$v[\"$basemodel.id\"]][$y] = $z;\n }\n else {\n if (implode(\"\", $z) != \"\") {\n /* For relational model it save in to a nulti dymantional array array */\n $collection[$v[\"$basemodel.id\"]][$y][] = $z;\n }\n else if (!isset($collection[$v[\"$basemodel.id\"]][$y])) {\n /* Create an empty array of no data found in a relational model */\n $collection[$v[\"$basemodel.id\"]][$y] = array();\n }\n }\n }\n\n /*\n * Reset the array index in a normal sequence\n */\n if ($key_cur != $v[\"$basemodel.id\"]) {\n $collection[$i++] = $collection[$key_cur];\n unset($collection[$key_cur]);\n $key_cur = $v[\"$basemodel.id\"];\n }\n }\n\n /* Reset the last node of the array */\n $collection[$i] = $collection[$key_cur];\n unset($collection[$key_cur]);\n\n return $collection;\n }", "private function set_firstItemTreeView()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // RETURN current filter isn't a tree view\n // #i0117, 141223, dwildt, 1-/+\n //if ( !in_array( $table, $this->arr_tablesWiTreeparentfield ) )\n if ( !in_array( $this->curr_tableField, $this->arr_tablesWiTreeparentfield ) )\n {\n return;\n }\n // RETURN current filter isn't a tree view\n // Prepend the first item to class var $rows\n $this->set_firstItem();\n\n return;\n }", "function traverse_gallery_items($GalleryID, $Level=0) // find all GalleryItems within Gallery GalleryID\n{\n\t$GalleryTitle\t\t\t= db_sfq(\"SELECT Title FROM tblGalleries WHERE ID='{$GalleryID}'\");\n\t$NumGIChildren\t \t\t= db_sfq(\"SELECT COUNT(ID) FROM tblGalleryItems \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ParentGalleryID='{$GalleryID}'\");\n//\techo str_repeat(\". \",$Level) . \"G[$GalleryID]<b>{$GalleryTitle}</b> -{$Level}- &nbsp;GI children:$NumGIChildren<br>\";\n\t\n\t\n\t\n\t\n// ----------------------------------------\t GALLERY RECORD ---------------------------------------------\n ?>\n<tr style=\"background-color: yellow; color: blue;\">\n <td style='background-color:pink;'><a href=\"http://jazzhistorymuseum.org/db/admin/tblGalleries_view.php?SelectedID=<?=$GalleryID?>#detail-view\" target=\"_blank\">E</a></td>\n <td style=\"font-weight:bold;font-size:110%;color:white;background-color: brown;\">G</td>\n <td style=\"padding-left:<?=($Level*16) ?>px; text-indent:<?=(-$Level*16) ?>px;\"><b><?=str_repeat(\".&nbsp;&nbsp;&nbsp;\",$Level) . $GalleryTitle?></b></td>\n <td align=\"right\"><!-- need GI ID a href='<?=GalleryBaseURL.\"?gallery={$GalleryID}\"?>' --><?=$GalleryID?><!-- /a --></td> <!------------------------>\n <td></td><td></td><td></td>\n <td><?=db_sfq(\"SELECT COUNT(ID) FROM tblGalleryItems WHERE ParentGalleryID='{$GalleryID}'\")?></td> </tr>\n<?\n// ----------------------------------------\t END GALLERY RECORD ---------------------------------------------\n\n\n \n \n\t$Results = db_sql(\"SELECT * FROM tblGalleryItems WHERE ParentGalleryID='{$GalleryID}' ORDER BY Sort ASC, ID\");\n\tif (mysqli_num_rows($Results)==0) echo \"<tr><td colspan=7>&nbsp;&nbsp;&nbsp;<i>[no GalleryItems found for ParentGalleryID=={$GalleryID}]</i></td></tr>\";\n\t\n\t\n\t\n\twhile ($Row=mysqli_fetch_assoc($Results))\n\t{ // -------------------------------------------- FOR EACH GALLERY ITEM in this gallery $GalleryID -----------------------------------------\n\n\n\t\t$GalleryItemID\t\t\t= $Row['ID'];\n\t\t$GalleryItemURL\t\t\t= $Row['URL'];\n\t\t$SubGalleryID\t\t\t= $Row['SubGalleryID'];\n\t\t$ParentGalleryID\t\t= $Row['ParentGalleryID']; \n\t\t$GIPageTitle\t\t\t= $Row['PageTitle'];\n\t\t$GIContentTypeID\t\t= $Row['GIContentTypeID'];\n\t\t$SubGalleryTypeDisplay\t= $GIContentTypeID;\n\t\t\tif ($GIContentTypeID==GIContentType_RemoteURL OR $GIContentTypeID==GIContentType_JHDBURL) \t\n\t\t\t\t\t\t$SubGalleryTypeDisplay = \"<a href='$GalleryItemURL' target='_blank'>URL</a>\"; // complete URL self-contained\n\t\t\tif ($GIContentTypeID==GIContentType_ContentURL) \t$SubGalleryTypeDisplay = \"<a href='\".GalleryBaseURL.\"?u={$GalleryItemURL}' target='_blank'>URL</a>\";\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery) \t$SubGalleryTypeDisplay = \"SubGallery\";\n\t\t\tif ($GIContentTypeID==GIContentType_Image) \t\t\t$SubGalleryTypeDisplay = \"Image\";\n\t\t\tif ($GIContentTypeID==GIContentType_Audio) \t\t\t$SubGalleryTypeDisplay = \"Audio\";\n\t\t\tif ($GIContentTypeID==GIContentType_Video) \t\t\t$SubGalleryTypeDisplay = \"Video\";\n\t\tif ($GIContentTypeID==GIContentType_SubGallery AND ($SubGalleryID <= 0 OR $SubGalleryID == $GalleryID)) \n\t\t{\n\t\t\t?><tr><td colspan=8>Warning traverse_gallery_items(<?=$GalleryID?>) GalleryItemsID(<?=$GalleryItemID?>): ParentGalleryID=<?=$GalleryID?> with SubGalleryID=<?=$SubGalleryID?> </td></tr>\n <?\n\t\t} else //no error\n\t\t{\n\t\t\t$NextLevelGalleryInfo \t= \"\";\n\t\t\t//if ($SubGalleryTypeID==MediaType_SubGallery) FIX ME\n\t\t\t\t$NextLevelGalleryExists = db_sfq(\"SELECT COUNT(ID) FROM tblGalleries WHERE ID='{$SubGalleryID}'\");\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery AND $NextLevelGalleryExists==0) $NextLevelGalleryInfo \t= \"(SubGallery entry does not exist yet) \";\n\t\t\n\t\t\n\t\t\n\t\t\n// ----------------------------------------\t GALLERY ITEM RECORD ---------------------------------------------\n\t\t?>\n<tr <?= ($GIContentTypeID==GIContentType_SubGallery?\"style='background-color:lightblue;'\":\"style='background-color:lightgrey;'\")?>>\n<td style='background-color:cyan;'><a href=\"http://jazzhistorymuseum.org/db/admin/tblGalleryItems_view.php?SelectedID=<?=$GalleryItemID?>#detail-view\" target=\"_blank\">E</a></td>\n<td>GI</td><td style=\"padding-left:<?=($Level*16) ?>px; text-indent:<?=(-$Level*16) ?>px;\"><?=str_repeat(\".&nbsp;&nbsp;&nbsp;\",$Level) . $GIPageTitle?></td>\n<td align=\"left\" style='color:grey;' ><em><a href='<?=GalleryBaseURL.\"?gi={$GalleryItemID}\"?>'><?=$GalleryItemID?></a>\n</em></td><td><?=$ParentGalleryID?></td><td><?=$SubGalleryID?></td>\n<td><?=$SubGalleryTypeDisplay?></td><td><?=$NextLevelGalleryInfo?></td> </tr>\n \t<?\t\n// ----------------------------------------\t END GALLERY ITEM RECORD ---------------------------------------------\n\n\t\t\n\t\t\n\t\t\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery)\n\t\t\t\ttraverse_gallery_items($SubGalleryID, $Level+1 );\n\t\t} // end else no error \n\t}// end while\n\t\n}", "public function importUsaLevelStates()\n {\n return $this->importData('USA_adm/USA_adm1.shp', 0);\n }", "function cognitivefactory_tree_up($cognitivefactoryid, $userid, $groupid, $id, $istree = 1) {\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if (!$res) return;\n $operator = ($istree) ? 'hierarchize' : 'order' ;\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n if ($res->intvalue > 1) {\n $newordering = $res->intvalue - 1;\n\n $sql = \"\n SELECT \n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}' AND\n intvalue = {$newordering}\n {$treeClause}\n {$accessClause}\n \";\n // echo $sql;\n $result = $DB->get_record_sql($sql);\n $resid = $result->id;\n\n // swapping\n $opdata = new StdClass();\n $opdata->id = $resid;\n $opdata->intvalue = $res->intvalue;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "function cognitivefactory_tree_get_upper_branch($id, $includeStart = false, $returnordering = false) {\n global $CFG, $DB;\n\n $nodelist = array();\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if ($includeStart) $nodelist[] = ($returnordering) ? $res->intvalue : $id ; \n while($res->itemdest != 0) {\n $res = $DB->get_record($table, array('id' => $res->itemdest, 'operatorid' => 'hierarchize'));\n $nodelist[] = ($returnordering) ? $res->intvalue : $res->itemdest;\n }\n $nodelist = array_reverse($nodelist);\n return $nodelist;\n}", "public function fetch_sub_classes($limit,$start)\n {\n $table = $this->return_table();\n $this->db->order_by(\"id\", \"DESC\");\n $this->db->limit($limit, $start);\n $query = $this->db->get($table);\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function getSiteData ()\n {\n //sections selected in order with all top level sections ordered first, then all 2nd level sections next\n $q = 'SELECT section_id, section_name, section_level, section_id, parent_id, order_num, active FROM sections where page_type_id=\"1\" or page_type_id=\"2\" order by section_level, order_num';\n $sections = tdb::getInstance()->getFromQ ( $q );\n array_pop ( $sections );\n $sections_hierachy = array();\n //$sectionIndexById is an associative array where you can find the index of a section in the $secions array by using the section_id as the array key \n $sectionIndexById = array();\n foreach ( $sections as $k => $v ) {\n //if this is a top level section / menu item\n if ( $v [ 'section_level' ] == '1' ) {\n //store its index in $sections_hierachy so it can be called using it's section_id as a key\n $sectionIndexById [ $v ['section_id'] ] = $k;\n //this section goes straight in the final array\n $sections_hierachy [ $k ] = $v;\n } elseif ( $v [ 'section_level' ] == '2' ) {\n //get the index of this sections parent in $sections_hierachy by using this sections PARENT_ID (corresponds to the section_id stored above)\n $parent_index = $sectionIndexById [ $v [ 'parent_id' ] ];\n if ( !$sections_hierachy [ $parent_index ] [ 'subsections' ] ) {\n //create the array if it doesn't exists\n $sections_hierachy [ $parent_index ] [ 'subsections' ] = array();\n }\n //store the subsection\n $sections_hierachy [ $parent_index ] [ 'subsections' ] [] = $v;\n }\n }\n $this->jsonSend [ 'sections' ] = $sections_hierachy;\n\n //get the IMAGE DATA\n $q = 'select images.image_id, images.section_id, images.order_num, images.image_orig_width, images.image_orig_height, images.image_has_sizes, sections.section_name from images inner join sections on sections.section_id=images.section_id where active_status=\"1\" order by section_name, images.order_num limit 0,9999';\n $images = tdb::getInstance()->getFromQ ( $q );\n array_pop ( $images );\n\n $this->jsonSend [ 'image_ids' ] = array();\n foreach ( $images as $k=>$v )\n {\n //$this->jsonSend [] = array ( $v [ 'image_id'], $v ['image_orig_width'], $v ['image_orig_height'], $v [ 'image_has_sizes'], $v [ 'section_name'] );\n $this->jsonSend [ 'image_ids' ] [] = array ( $v [ 'image_id'], $v [ 'image_has_sizes'], $v [ 'section_name'] );\n }\n\n $this->sendJson();\n }", "function ods_analyze_data() {\n $results_level1 = array();\n foreach ($this->schema['named-range'] as $range) {\n $range_name = $range['name'];\n switch ($range['level']) {\n case 1:\n if (!empty($this->data[$range_name])) {\n // get all rows elements on this range\n //foreach($this->data[ $range_name ] as $data_level1){\n //row cycle\n $results_level1[$range_name]['rows'] = $this->ods_render_range($range_name, $this->data);\n }\n break;\n }\n }\n if ($results_level1){\n $sheet = $this->dom\n ->getElementsByTagName('table')\n ->item(0);\n \n foreach ($results_level1 as $range_name => $result){\n \n //delete template on the sheet\n $in_range = false;\n foreach ($sheet->getElementsByTagName('table-row') as $row){\n if ($row->hasAttribute('range_name')\n && $row->getAttribute('range_name') == $range_name\n && $row->hasAttribute('range_start')\n \n ){\n $results_level1[ $range_name ]['start'] = $row;\n $in_range = true;\n }\n \n if ($in_range){\n $row->setAttribute('remove_me_please', 'yes');\n }\n \n if ($row->hasAttribute('range_name')\n \n && $row->hasAttribute('range_end')\n && in_array($range_name, explode(',', $row->getAttribute('range_end')) )\n ){\n $results_level1[ $range_name ]['end'] = $row;\n $in_range = false;\n } \n \n }\n \n //insert data after end \n foreach ( $results_level1[$range_name]['rows'] as $row ){\n $results_level1[ $range_name ]['start']\n ->parentNode\n ->insertBefore($row, $results_level1[ $range_name ]['start']);\n }\n \n }\n \n //clear to_empty rows\n $remove_rows = array();\n \n foreach ($sheet->getElementsByTagName('table-row') as $row){\n if ($row->hasAttribute('remove_me_please')){\n $remove_rows[] = $row;\n }\n }\n \n foreach ($remove_rows as $row){\n $row->parentNode->removeChild($row);\n }\n \n //after this - rows count is CONSTANT\n if (!empty( $this->hasFormula )){\n $this->ods_recover_formula();\n }\n \n }\n }", "function sci_building_level($userid,$id)\n {\n $db3 = new cl_extended_database;\n $db3->query(\"SELECT level FROM user_sci WHERE userid=$userid AND sciid=$id\"); $this->err();\n if($db3->numrows() <= 0)\n {\n unset($db3);\n //echo \"level 0<br>\";\n return 0;\n }\n else\n {\n $row = $db3->fetch();\n unset($db3);\n // echo \"level is \".$row['level'].\"<br>\";\n return $row['level'];\n }\n return -1;\n }", "private function tree_setOneDim( $uid_parent )\n {\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n switch ( true )\n {\n case( count( $this->arr_rowsTablefield ) == 1 ):\n $this->tree_setOneDimOneRow( $uid_parent );\n break;\n default:\n $this->tree_setOneDimDefault( $uid_parent );\n break;\n }\n\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n }", "function GetStructureInArray( $spr, $level_start = 0, $lang_id = NULL, $default_val = NULL, $spacer = NULL, $show_shortname = 1, $show_name = 1, $show_sublevels = 1, $front_back = 'back', $mas=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n if( $show_sublevels==0){\n $rows = 0;\n }\n else\n {\n if($level_start!=0)\n {\n $q = \"SELECT `node` FROM `\".$spr.\"` WHERE `level`='$level_start' group by level\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row=$db->db_FetchAssoc();\n $curr_node = $row['node'];\n }\n else\n $curr_node = 0;\n $q = \"SELECT MAX(`node`) as max FROM `\".$spr.\"`\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row = $db->db_FetchAssoc();\n $max_node = $row['max'];\n $rows = $max_node - $curr_node;\n }\n $q='SELECT t0.node as node0, t0.cod as cod0 ';\n if ($show_shortname==1) $q.=', t0.short as short0';\n if ($show_name==1) $q.=', t0.name as name0';\n for($i=1; $i<=$rows;$i++)\n {\n $q.=', '.'t'.$i.'.node as node'.$i.', '.'t'.$i.'.cod as cod'.$i;\n if ($show_shortname==1) $q.=', t'.$i.'.short as short'.$i;\n if ($show_name==1) $q.=', t'.$i.'.name as name'.$i;\n }\n $q.= ' FROM '.$spr.' AS t0 ';\n for($i=1; $i<=$rows;$i++)\n {\n $q.='LEFT JOIN '.$spr.' AS t'.$i.' ON ( t'.$i.'.level = t'.($i-1).'.cod AND t'.$i.'.lang_id = t'.($i-1).'.lang_id) ';\n }\n $q.=' WHERE 1 ';\n $q = $q.\" AND t0.level = '\".$level_start.\"' AND t0.lang_id='\".$lang_id.\"' ORDER BY t0.move \";\n $res = $db->db_Query( $q );\n //echo '<br>q='.$q.' res='.$res.' $db->result='.$db->result;\n if( !$res )return false;\n $rows_count = $db->db_GetNumRows();\n //echo '<br> $rows='.$rows;\n $mas[''] = $default_val;\n for( $i = 0; $i < $rows_count; $i++ )\n {\n $row=$db->db_FetchAssoc();\n for($j=0;$j<=$rows;$j++){\n if(!isset($mas[$row['cod'.$j]]) && !is_null($row['cod'.$j]))\n {\n $output_str = $spacer;\n for($k=1;$k<=$row['node'.$j];$k++){\n $output_str.= $spacer;\n }\n if( $show_shortname ) $output_str = $output_str.' '.stripslashes($row['short'.$j]);\n if( $show_name ) $output_str = $output_str.' '.stripslashes($row['name'.$j]);\n\n $mas[$row['cod'.$j]] = $output_str;\n }\n }\n }\n return $mas;\n }", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "public function drawGrandparent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT title FROM pages WHERE guid = {$this->getGrandparent()}'\"); \n\t\t\treturn $data;\n\t\t}", "function generate_data() {\n\t// Boss map, employees array, queue array and ceo array\n\t$boss_map = array();\n\t$employees = array();\n\t$queue = array();\n\t$ceo = array();\n\t//Get all employees\n\t$sql = \"SELECT * FROM employees\";\n\t$res = query($sql);\n\twhile($j = fetch($res)) {\n\t\t//Map employee id to name\n\t\t$employees[$j['id']] = $j['name'];\n\t\t//Add all employees to boss_map except ceo\n\t\tif($j['bossId'] !== $j['id'])\n\t\t\t$boss_map[$j['bossId']][] = $j['id'];\n\t\telse\n\t\t\t$ceo = $j;\n\t}\n\t//If no employees or no ceo, return empty array so dataTables shows error message\n\tif(empty($employees) || empty($ceo))\n\t\treturn json_encode(array());\n\n\t//Set up CEO obj - Root of the tree\n\t$ceoObj = new Employee($ceo['id'], $ceo['name'], $ceo['id'], 0);\n\n\t//Add the ceo to the queue\n\t$queue[] = $ceoObj;\n\t$i = 0;\n\t$total_employees = count($employees);\n\t//Loop through every employee\n\twhile($i < $total_employees) {\n\t\t//If corrupt data/missing employees, return empty array\n\t\tif(!array_key_exists($i, $queue))\n\t\t\treturn json_encode(array());\n\t\t//Get boss from queue\n\t\t$boss = $queue[$i];\n\t\t//Set boss name\n\t\t$boss->setBossName($employees[$boss->getBossId()]);\n\t\t$subordinates = array();\n\t\t//Check if bossId is in the boss_map to get all direct subordinates\n\t\tif(array_key_exists($boss->getId(), $boss_map)) {\n\t\t\t$subordinates = $boss_map[$boss->getId()];\n\t\t}\n\t\t//Loop through direct subordinates and create new employee objects for each while increasing the depth from ceo by bosses depth+1\n\t\tforeach ($subordinates as $subordinateId) {\n\t\t\t$employeeObj = new Employee($subordinateId, $employees[$subordinateId], $boss->getId(), $boss->getDepth()+1);\n\t\t\t//Add newly created employee objects as subordinates of current boss object\n\t\t\t$boss->addSubordinate($employeeObj);\n\t\t\t//Push the employee object on to the queue\n\t\t\t$queue[] = $employeeObj;\n\t\t}\n\t\t$i++;\n\t}\n\t//Assign numSubordinates count\n\tassign_subordinate_count($ceoObj);\n\n\treturn json_encode($queue);\n}", "public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }", "private function prepareNewSkuData($sku)\n {\n $data = [];\n foreach ($this->getExistingSku($sku) as $key => $value) {\n $data[$key] = $value;\n }\n\n $data['attr_set_code'] = $this->_attrSetIdToName[$this->getExistingSku($sku)['attr_set_id']];\n\n return $data;\n }", "public function getItemPath($item_id,$start=true){\n\n if($item_id != 0) {\n $sql=\"SELECT * FROM `\".$this->db_table.\"` WHERE `\".$this->item_identifier_field_name.\"`='\".$item_id.\"' \";\n $res=mysql_query($sql);\n $itemdata=mysql_fetch_assoc($res);\n array_push($this->item_path,$itemdata); \n\n if($itemdata[$this->parent_identifier_field_name]!=0) {\n $this->item_path=$this->getItemPath($itemdata[$this->parent_identifier_field_name],false);\n } \n if ($start) {\n $this->item_path=array_reverse($this->item_path);\n }\n }\n return $this->item_path;\n\n }", "protected function initTree()\n {\n Table9Peer::doDeleteAll();\n $ret = array();\n // shuffling the results so the db order is not the natural one\n $fixtures = array(\n 't2' => array(2, 3, 1),\n 't5' => array(7, 12, 2),\n 't4' => array(5, 6, 2),\n 't7' => array(10, 11, 3),\n 't1' => array(1, 14, 0),\n 't6' => array(8, 9, 3),\n 't3' => array(4, 13, 1),\n );\n /* in correct order, this is:\n 't1' => array(1, 14, 0),\n 't2' => array(2, 3, 1),\n 't3' => array(4, 13, 1),\n 't4' => array(5, 6, 2),\n 't5' => array(7, 12, 2),\n 't6' => array(8, 9, 3),\n 't7' => array(10, 11, 3),\n */\n foreach ($fixtures as $key => $data) {\n $t = new PublicTable9();\n $t->setTitle($key);\n $t->setLeftValue($data[0]);\n $t->setRightValue($data[1]);\n $t->setLevel($data[2]);\n $t->save();\n $ret[$key]= $t;\n }\n // reordering the results in the fixtures\n ksort($ret);\n\n return array_values($ret);\n }", "function generateallActiveTreeArray() {\n $tree = array();\n $this->db->select('id,name,shortdesc,status,parentid,page_uri,orderr');\n $this->db->where ('status','active');\n $this->db->order_by('parentid asc, orderr asc');\n $query = $this->db->get('adminmenu');\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $index = (isset($tree[$row->parentid]))?count($tree[$row->parentid]):0; \n $tree[$row->parentid][$index] = $row;\n }\n }\n \n return $tree;\n }", "function neraca_search($buku_periode, $buku_tglawal, $buku_tglakhir, $buku_bulan, \r\n\t\t\t\t\t\t\t\t$buku_tahun, $buku_akun, $start,$end, $neraca_jenis){\r\n\r\n\t\t\tif($neraca_jenis=='Aktiva'){\r\n\t\t\t\t$neraca_jenis\t= 1;\r\n\t\t\t\t$neraca_jenis3\t= 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$neraca_jenis\t= 2;\r\n\t\t\t\t$neraca_jenis3\t= 3;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//AKUN LEVEL 1\r\n\t\t\t$sql = \"SELECT \r\n\t\t\t\t\t\tA.akun_id, A.akun_saldo, A.akun_kode, A.akun_jenis, A.akun_nama, A.akun_level,\r\n\t\t\t\t\t\tB.akun_id as akun_parent_id, B.akun_nama as akun_parent\r\n\t\t\t\t\tFROM akun A, akun B\r\n\t\t\t\t\tWHERE \r\n\t\t\t\t\t\tA.akun_level=3 AND \r\n\t\t\t\t\t\tA.akun_parent_kode=B.akun_kode AND \r\n\t\t\t\t\t\tA.akun_jenis='BS' AND \r\n\t\t\t\t\t\tB.akun_level=2 AND \r\n\t\t\t\t\t\t(A.akun_kode LIKE '__.\".$neraca_jenis.\"%' OR A.akun_kode LIKE '__.\".$neraca_jenis3.\"%')\r\n\t\t\t\t\tORDER by A.akun_kode ASC\";\r\n\r\n\t\t\t$master=$this->db->query($sql);\r\n\t\t\t//$this->firephp->log($sql);\r\n\t\t\t$nbrows=$master->num_rows();\r\n\r\n\t\t\t$saldo=0;\r\n\t\t\t$saldo_akhir=0;\r\n\t\t\t$i=0;\r\n\t\t\t$total_nilai_periode=0;\r\n\t\t\t$total_nilai=0;\r\n\t\t\t\r\n\t\t\tforeach($master->result() as $row){\r\n\t\t\t\r\n\t\t\t\t//s/d bulan ini\r\n\t\t\t\t\r\n/*\t\t\t\t$sql=\"SELECT A.akun_kode,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\";\r\n*/\r\n\t\t\t\t$sql = \"SELECT \r\n\t\t\t\t\t\t\tA.akun_kode,\r\n\t\t\t\t\t\t\tsum(B.buku_debet) as debet,\r\n\t\t\t\t\t\t\tsum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\tFROM buku_besar B, akun A\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tB.buku_akun=A.akun_id\r\n\t\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\";\r\n\t\t\t\t\t\r\n\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m')<='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t}elseif($buku_periode==\"tanggal\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m-%d')<='\".$buku_tglakhir.\"'\";\r\n\t\t\t\t}\r\n\t\t\t\t//$sql.=\"GROUP BY A.akun_kode\";\r\n\t\t\t\t$sql.=\"\tORDER BY A.akun_kode ASC\";\r\n\t\t\t\t//$this->firephp->log($sql);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//GET SALDO BEFORE\r\n\t\t\t\t$data[$i][\"neraca_saldo\"]=0;\r\n\r\n\t\t\t\t$sqlsaldo = \"SELECT \r\n\t\t\t\t\t\t\t\t\tA.akun_kode, sum(A.akun_debet) as debet, sum(A.akun_kredit) as kredit, A.akun_saldo\r\n\t\t\t\t\t\t\t\tFROM vu_akun A\r\n\t\t\t\t\t\t\t\tWHERE replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\";\r\n\t\t\t\t\r\n\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\t\r\n\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\t$rowsaldo=$rssaldo->row();\r\n\t\t\t\t\tif($rowsaldo->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t$saldo_akhir= ($rowsaldo->debet-$rowsaldo->kredit);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$saldo_akhir= ($rowsaldo->kredit-$rowsaldo->debet);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//$saldo_akhir=0;\r\n\t\t\t\t//$this->firephp->log($sqlsaldo.' '.$saldo_akhir.'<br/>');\r\n\t\t\t\t//----->\r\n\r\n\t\t\t\t$isi=$this->db->query($sql);\r\n\t\t\t\t//$this->firephp->log($sql);\r\n\t\t\t\t\r\n\t\t\t\tif($isi->num_rows()){\r\n\t\t\t\t\t$rowisi=$isi->row();\r\n\t\t\t\t\t$data[$i][\"neraca_akun\"]=$row->akun_id;\r\n\t\t\t\t\t$data[$i][\"neraca_level\"]=$row->akun_level;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis\"]=$row->akun_parent;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis_id\"]=$row->akun_parent_id;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_kode\"]=$row->akun_kode;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_nama\"]=$row->akun_nama;\r\n\r\n\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir+($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir+($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$i][\"neraca_akun\"]=$row->akun_id;\r\n\t\t\t\t\t$data[$i][\"neraca_level\"]=$row->akun_level;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis\"]=$row->akun_parent;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis_id\"]=$row->akun_parent_id;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_kode\"]=$row->akun_kode;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_nama\"]=$row->akun_nama;\r\n\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//bulan ini --> tidak dipakai\r\n\t\t\t\t$sql=\"SELECT A.akun_kode,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\";\r\n\r\n\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m')='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t}\r\n\t\t\t\t//$sql.=\"GROUP BY A.akun_kode\";\r\n\t\t\t\t$sql.=\"\tORDER BY A.akun_kode ASC\";\r\n\r\n\t\t\t\t$isi=$this->db->query($sql);\r\n\t\t\t\tif($isi->num_rows()){\r\n\t\t\t\t\t$rowisi=$isi->row();\r\n\t\t\t\t\tif($row->akun_saldo=='Debet')\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir+($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir+($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=0;\r\n\t\t\t\t}\r\n\t\t\t\t$total_nilai+=$data[$i][\"neraca_saldo\"];\r\n\t\t\t\t$total_nilai_periode+=$data[$i][\"neraca_saldo_periode\"];\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\r\n\t\t\t//LAPORAN LABA RUGI\r\n\t\t\t//2011-11-02, hendri: sementara ditutup dulu, karena belum tahu kegunaannya, sepertinya sudah terwakilkan oleh neraca_jenis3 = 3\r\n\t\t\t\r\n\t\t\tif($neraca_jenis==2) {\r\n\t\t\t\t$sql=\"SELECT\tA.akun_id,A.akun_saldo,A.akun_kode,A.akun_jenis,A.akun_nama,A.akun_level,B.akun_id as akun_parent_id,\r\n\t\t\t\t\t\t\t\tB.akun_nama as akun_parent\r\n\t\t\t\t\t\tFROM \takun A, akun B\r\n\t\t\t\t\t\tWHERE \tA.akun_level=2\r\n\t\t\t\t\t\t\t\tAND A.\takun_parent_kode=B.akun_kode\r\n\t\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\r\n\t\t\t\t\t\t\t\tAND B.akun_level=1\r\n\t\t\t\t\t\tORDER by A.akun_kode ASC\";\r\n\t\r\n\t\t\t\t$master=$this->db->query($sql);\r\n\t\t\t\t$nbrows=$master->num_rows();\r\n\t\t\t\t\r\n\t\t\t\t//$this->firephp->log(\"sql=\".$sql);\r\n\t\t\t\t\r\n\t\t\t\t$saldo=0;\r\n\t\t\t\t$saldo_akhir=0;\r\n\t\t\t\t$saldo_akhir_periode=0;\r\n\t\t\t\t$saldo_akun=0;\r\n\t\t\t\t$saldo_buku=0;\r\n\t\t\t\t\r\n\t\t\t\t//SALDO AWAL\r\n\t\t\t\t$sqlsaldo = \"SELECT\r\n\t\t\t\t\t\t\t\t\tA.akun_kode, sum(A.akun_debet) as debet, sum(A.akun_kredit) as kredit, A.akun_saldo\r\n\t\t\t\t\t\t\t\tFROM vu_akun A\r\n\t\t\t\t\t\t\t\tWHERE akun_jenis='R/L'\r\n\t\t\t\t\t\t\t\tGROUP BY A.akun_saldo\";\r\n\t\t\t\t\r\n\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\t\r\n\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\tforeach($rssaldo->result() as $rs){\r\n\t\t\t\t\t\t\tif($rs->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_akhir-= ($rs->debet-$rs->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_akhir+= ($rs->kredit-$rs->debet);\r\n\t\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\r\n\t\t\t\t$saldo_akhir_periode=$saldo_akhir;\r\n\t\t\t\t\r\n\t\t\t\t//print_r('Saldo Awal'); print_r($saldo_akhir_periode);\r\n\t\t\t\t\r\n\t\t\t\t$test=\"\";\r\n\t\t\t\t\r\n\t\t\t\tforeach($master->result() as $row){\r\n\t\t\t\t\t//SALDO AWAL\r\n/*\t\t\t\t\t$saldo_akun=0;\r\n\t\t\t\t\t$sqlsaldo=\"SELECT \tA.akun_kode,sum(A.akun_debet) as debet,\r\n\t\t\t\t\t\t\t\t\t\tsum(A.akun_kredit) as kredit, \r\n\t\t\t\t\t\t\t\t\t\tA.akun_saldo\r\n\t\t\t\t\t\t\t\tFROM\takun A\r\n\t\t\t\t\t\t\t\tWHERE akun_jenis='R/L'\r\n\t\t\t\t\t\t\t\tAND \treplace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \r\n\t\t\t\t\t\t\t\tGROUP BY A.akun_saldo\";\r\n\t\t\r\n\t\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\t\tforeach($rssaldo->result() as $rs){\r\n\t\t\t\t\t\t\tif($rs->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_akun+= ($rs->debet-$rs->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_akun+= ($rs->kredit-$rs->debet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//$this->firephp->log(\"saldo group : \".$row->akun_kode.\" => \".$saldo_akun);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($saldo_akun<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir-$saldo_akun;\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode-$saldo_akun;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir+$saldo_akun;\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode+$saldo_akun;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n*/\t\t\t\t\t\r\n\r\n\t\t\t\t\t//saldo dari buku besar\r\n\t\t\t\t\t$sql=\"SELECT A.akun_kode,\r\n\t\t\t\t\t\t\tsum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit, A.akun_saldo\r\n\t\t\t\t\t\t\tFROM buku_besar B, akun A\r\n\t\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\r\n\t\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \";\r\n\t\t\t\t\t\t\t/*GROUP BY A.akun_kode, A.akun_saldo\";*/\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t\t$sql.=\"\tAND date_format(B.buku_tanggal,'%Y-%m')<='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t\t}elseif($buku_periode==\"tanggal\"){\r\n\t\t\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m-%d')<='\".$buku_tglakhir.\"'\";\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$rlisi=$this->db->query($sql);\r\n\t\t\t\t\tif($rlisi->num_rows()){\r\n\t\t\t\t\t\tforeach($rlisi->result() as $rowisi){\r\n\t\t\t\t\t\t\r\n\t\t/*\t\t\t\t\tprint_r($sql);\r\n\t\t\t\t\t\t\tprint_r(', akun_kode: '); print_r($rowisi->akun_kode);\r\n\t\t\t\t\t\t\tprint_r(', debet: '); print_r($rowisi->debet);\r\n\t\t\t\t\t\t\tprint_r(', kredit: '); print_r($rowisi->kredit);\t\t\t\t\t\r\n\t\t*/\t\t\t\t\t\r\n/*\t\t\t\t\t\t\tif($rowisi->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t\t}\r\n*/\r\n\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//print_r($rowisi->akun_saldo); print_r(' '); print_r($saldo_buku);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//print_r('Saldo Akhir: '); print_r($saldo_akhir);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$saldo_akhir = $saldo_akhir + $saldo_buku;\r\n\r\n// tidak perlu, karena sudah dihitung di atas\t\t\t\r\n/*\t\t\t\t\tif($saldo_buku<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir-$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir+$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\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//bulan ini\r\n\t\t\t\t\t$saldo=0;\r\n\t\t\t\t\t$sql=\"SELECT A.akun_kode,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit, A.akun_saldo\r\n\t\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \r\n\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\";\r\n\t\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t\t$sql.=\"\tAND date_format(B.buku_tanggal,'%Y-%m')='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t\t}elseif($buku_periode==\"tanggal\"){\r\n\t\t\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m-%d')<='\".$buku_tglakhir.\"'\";\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t$sql.=\" GROUP BY A.akun_kode, A.akun_saldo\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($rlisi->num_rows()){\r\n\t\t\t\t\t\tforeach($rlisi->result() as $rowisi){\r\n/*\t\t\t\t\t\t\tif($rowisi->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n*/\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t$saldo_akhir_periode = $saldo_akhir_periode + $saldo_buku;\r\n\t\t\t\t\t\r\n// tidak perlu, karena sudah dihitung di atas\t\t\t\t\t\r\n/*\t\t\t\t\tif($saldo_buku<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode-$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode+$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n*/\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$data[$i][\"neraca_akun\"]=777;\r\n\t\t\t\t$data[$i][\"neraca_jenis\"]='RUGI/LABA BERSIH';\r\n\t\t\t\t$data[$i][\"neraca_level\"]=1;\r\n\t\t\t\t$data[$i][\"neraca_jenis_id\"]=777;\r\n\t\t\t\t$data[$i][\"neraca_akun_kode\"]=\"777.\";\r\n\t\t\t\t$data[$i][\"neraca_akun_nama\"]=\"LABA/RUGI BERSIH\";\t\t\t\r\n\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir;\r\n\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir_periode;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t//$this->firephp->log($test);\r\n\t\t\t\t\r\n\t\t\t\t$total_nilai+=$data[$i][\"neraca_saldo\"];\r\n\t\t\t\t$total_nilai_periode+=$data[$i][\"neraca_saldo_periode\"];\r\n\t\t\t\t$i++;\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$data[$i][\"neraca_akun\"]=9999;\r\n\t\t\t$data[$i][\"neraca_jenis\"]='TOTAL';\r\n\t\t\t$data[$i][\"neraca_level\"]=2;\r\n\t\t\t$data[$i][\"neraca_jenis_id\"]=9999;\r\n\t\t\t$data[$i][\"neraca_akun_kode\"]=\"999.\";\r\n\t\t\t$data[$i][\"neraca_akun_nama\"]=\"TOTAL\";\t\t\t\r\n\t\t\t$data[$i][\"neraca_saldo\"]=$total_nilai;\r\n\t\t\t$data[$i][\"neraca_saldo_periode\"]=$total_nilai_periode;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif($nbrows>0){\r\n\t\t\t\t$jsonresult = json_encode($data);\r\n\t\t\t\treturn '({\"total\":\"'.$nbrows.'\",\"results\":'.$jsonresult.'})';\r\n\t\t\t} else {\r\n\t\t\t\treturn '({\"total\":\"0\", \"results\":\"\"})';\r\n\t\t\t}\r\n\t\t}", "function drugSiteTable($semaine)\n{\n\n $jourDebutSemaine = getdate2($semaine); // récupère les jours de la semaine en fonction de la date sélectionnée\n $stupSheetId = GetSheetbyWeek($semaine, $_SESSION[\"Selectsite\"])[\"stupsheet_id\"]; // la feuille de stupéfiants à afficher\n $novas = getNovasForSheet($stupSheetId); // Obtient la liste des ambulances utilisées par cette feuille\n $drugs = getDrugs(); // Obtient la liste des drugs\n $BatchesForSheet = getBatchesForSheet($stupSheetId); // Obtient la liste des batches utilisées par cette feuille\n\n // preparer un tableau de batchs par médicament pour faciliter le travail de la vue\n foreach ($BatchesForSheet as $p) {\n $batchesByDrugId[$p[\"drug_id\"]][] = $p;\n }\n\n $listofbaseid = getListOfStupSheets($_SESSION[\"Selectsite\"]);\n $date = strtotime($jourDebutSemaine);\n $site = getbasebyid($_SESSION[\"Selectsite\"])[\"name\"];\n $jours = array(\"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"vendredi\", \"samedi\", \"dimanche\");\n require_once 'view/Drug/drugSiteTable.php';\n}", "private function setLevel()\n\t{\n\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_level` WHERE 1\");\n\t\tif ($level_count > 1) // binary level\n\t\t{\n\t\t\t$this->levelType = 1;\n\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_level` WHERE 1\");\n\t\t}else{\n\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_serial_type` WHERE 1\");\n\t\t\tif ($level_count > 1)\n\t\t\t{\n\t\t\t\t$this->levelType = 2;\n\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_serial_type` WHERE 1\");\n\t\t\t}else{\n\t\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\tif ($level_count > 2) // user group level\n\t\t\t\t{\n\t\t\t\t\t$this->levelType = 3;\n\t\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function GetTopLevel( $spr, $level, $lang_id=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n $q = \"SELECT * FROM `\".$spr.\"` WHERE `cod`='\".$level.\"'\";\n if( !empty($lang_id) ) $q = $q.\" AND `lang_id`='\".$lang_id.\"'\";\n $q = $q.\" GROUP BY `cod`\";\n $res = $db->db_Query( $q );\n //echo '<br> $q='.$q.' $res='.$res.' $db->result='.$db->result;\n if( !$res OR !$db->result )return false;\n $row = $db->db_FetchAssoc();\n return $row;\n }", "function FetchSubItemArray($s_menu,$s_p1)\r\n{\r\n\tmytrace(\"FetchSubItemArray: s_menu=$s_menu and s_p1=$s_p1\");\r\n\t\r\n\t$arrReturn = array();\r\n\t\r\n\t// mfindlay 7/1/10 : because of the inadequate database structure of the drupal database, we need to first fetch all of the \r\n\t// depath=1 items, then for each row, fetch the child items and append to our final returned table\r\n\t\r\n\t//$result = db_query(\"SELECT * FROM menu_links left outer join url_alias on url_alias.src = menu_links.link_path \r\n\t// WHERE hidden=0 and menu_name=\\\"primary-links\\\" and depth=1 order by weight\");\r\n\t$sSQL = \"SELECT * FROM menu_links left outer join url_alias on url_alias.src = menu_links.link_path WHERE module=\\\"menu\\\" AND hidden=0 AND p1=$s_p1 AND depth=2 \";\r\n\t\tif (strlen($s_menu)>0) $sSQL .= \" AND menu_name=\\\"$s_menu\\\" \"; \r\n\t$sSQL .= \"ORDER BY depth, weight\";\r\n\t\r\n\tmytrace($sSQL);\r\n\t\r\n\t// fetch the intermediate WORK results\r\n\t$result = db_query($sSQL);\r\n\t\r\n\t// WORK array loop\r\n\t// First load each returned row into the WORK array\r\n\twhile ($arg = db_fetch_array($result)) \r\n\t{\r\n\t\t// fetch an array of subitems for this top level item\r\n\t\t$arrWork = FetchThirdItemArray($s_menu,$arg['p1'],$arg['p2']);\r\n\t\t\r\n\t\t// write out the DEPTH=2 record\r\n\t\t$arrReturn[] = $arg;\r\n\t\t\r\n\t\t// now fetch and write out each subitem to the final output array\r\n\t\t$nCount = count($arrWork);\r\n\t\tfor ($x=0; $x<$nCount; $x++)\r\n\t\t{\r\n\t\t\t// write out the subitem to the final output array\r\n\t\t\t$arrReturn[] = $arrWork[$x];\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\treturn $arrReturn;\r\n}", "private function getGrupoSubgrupo() {\n\n $oGrupo = new stdClass();\n $oGrupo->codigo = 0;\n $oGrupo->estrutural = \"\";\n $oGrupo->descricao = \"\";\n $oGrupo->grupoPai = 0;\n $oGrupo->nivel = 1;\n $oGrupo->totalPeriodo = 0.0;\n $oGrupo->mediaPeriodo = 0.0;\n $oGrupo->itens = array();\n $oGrupo->meses = array();\n $this->processaMeses($oGrupo);\n\n $aGrupos[$oGrupo->codigo] = $oGrupo;\n $this->aGrupos = $aGrupos;\n\n if ($this->lAgruparGrupoSubgrupo) {\n\n $aGrupos = array();\n\n $oDaoGrupoSubGrupo = new cl_materialestoquegrupo();\n\n /**\n * Busca todos os grupos e subgrupos e seus respectivos grupos pais.\n */\n $sCampos = \" db121_sequencial, m65_sequencial, db121_estrutural, db121_descricao, db121_estruturavalorpai, db121_nivel \";\n $sWhere = \" db121_sequencial in ({$this->sGrupoSubgrupo}) \";\n $sOrdem = \" db121_estrutural \";\n $sql = $oDaoGrupoSubGrupo->sql_query(null, $sCampos, $sOrdem, $sWhere);\n $rsGrupoSubgrupo = $oDaoGrupoSubGrupo->sql_record($sql);\n\n for ($i = 0; $i < $oDaoGrupoSubGrupo->numrows; $i++) {\n\n $oGrupoAux = db_utils::fieldsMemory($rsGrupoSubgrupo, $i);\n $oGrupoMaterial = new MaterialGrupo($oGrupoAux->m65_sequencial);\n $oGrupo = new stdClass();\n $oGrupo->codigo = $oGrupoAux->m65_sequencial;\n $oGrupo->estrutural = $oGrupoAux->db121_estrutural;\n $oGrupo->descricao = $oGrupo->estrutural . \" - \" . $oGrupoAux->db121_descricao;\n $oGrupo->grupoPai = 0;\n if ($oGrupoMaterial->getEstruturaPai() != '') {\n $oGrupo->grupoPai = $oGrupoMaterial->getEstruturaPai()->getCodigo();\n }\n $oGrupo->nivel = $oGrupoAux->db121_nivel;\n $oGrupo->totalPeriodo = 0.0;\n $oGrupo->mediaPeriodo = 0.0;\n $oGrupo->itens = array();\n $oGrupo->meses = array();\n $this->processaMeses($oGrupo);\n\n $aGrupos[$oGrupo->codigo] = $oGrupo;\n }\n\n $this->aGrupos = $aGrupos;\n /**\n * Agrupamos os grupos conforme sua organizacao\n */\n foreach ($this->aGrupos as $oGrupo) {\n $this->criarGrupoPai($oGrupo);\n }\n uasort($this->aGrupos,\n function ($oGrupo, $oGrupoDepois) {\n return $oGrupo->estrutural > $oGrupoDepois->estrutural;\n }\n );\n }\n\n foreach ($this->aDepartamentos as $oDepartamento) {\n\n foreach ($this->aGrupos as $oGrupo) {\n $oDepartamento->itens[$oGrupo->codigo] = clone $oGrupo;\n }\n }\n return $this->aGrupos;\n }", "public function selectTaxDataByUid($uid) {\n \n // query preparation\n $select = 'NUMMER, STEUERSATZCODE, STEUERSATZPROZ, GUELTIGABTTMMJJJJ'.\n ($this->oldTaxTableExists() == true ? ', st.BEMERKUNG AS BEMERKUNG' : '').' ';\n $from = $this->getTableName('BHSTEUER').' bh'. \n ($this->oldTaxTableExists() == true ? ' LEFT JOIN '.$this->getTableName('STEUER').' st ON bh.STEUERSATZCODE LIKE st.CODE' : '');\n $where = 'bh.NUMMER = '.intval($uid);\n $groupBy = '';\n $orderBy = '';\n $limit = '';\n \n // exec query using TYPO3 DB API\n $res = $this->gsaDbObj->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n if ($res == false) {\n throw new tx_pttools_exception('Query failed', 1, $this->gsaDbObj->sql_error());\n }\n \n $a_row = $this->gsaDbObj->sql_fetch_assoc($res);\n $this->gsaDbObj->sql_free_result($res);\n \n // if enabled, do charset conversion of all non-binary string data \n if ($this->charsetConvEnabled == 1) {\n $a_row = tx_pttools_div::iconvArray($a_row, $this->gsaCharset, $this->siteCharset);\n }\n \n trace($a_row); \n return $a_row;\n \n }", "function neraca_print($buku_periode, $buku_tglawal, $buku_tglakhir, $buku_bulan, \r\n\t\t\t\t\t\t\t\t$buku_tahun, $buku_akun, $start,$end, $neraca_jenis){\r\n\r\n\t\t\tif($neraca_jenis=='Aktiva')\r\n\t\t\t\t$neraca_jenis=1;\r\n\t\t\telse \r\n\t\t\t\t$neraca_jenis=2;\r\n\t\t\t\t\r\n\t\t\t//AKUN LEVEL 1\r\n\t\t\t$sql=\"SELECT A.akun_id,A.akun_saldo,A.akun_kode,A.akun_jenis,A.akun_nama,A.akun_level,B.akun_id as akun_parent_id, B.akun_nama as akun_parent\r\n\t\t\t\t\tFROM akun A, akun B\r\n\t\t\t\t\tWHERE A.akun_level=2\r\n\t\t\t\t\tAND A.akun_parent_kode=B.akun_kode\r\n\t\t\t\t\tAND A.akun_jenis='BS'\r\n\t\t\t\t\tAND B.akun_level=1\r\n\t\t\t\t\tAND A.akun_kode LIKE '\".$neraca_jenis.\"%'\r\n\t\t\t\t\tORDER by A.akun_kode ASC\";\r\n\r\n\t\t\t$master=$this->db->query($sql);\r\n\t\t\t$nbrows=$master->num_rows();\r\n\r\n\t\t\t$saldo=0;\r\n\t\t\t$saldo_akhir=0;\r\n\t\t\t$i=0;\r\n\t\t\t$total_nilai_periode=0;\r\n\t\t\t$total_nilai=0;\r\n\t\t\t\r\n\t\t\tforeach($master->result() as $row){\r\n\t\t\t\r\n\t\t\t\t//s/d bulan ini\r\n\t\t\t\t$sql=\"SELECT A.akun_kode,A.akun_saldo,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\";\r\n\r\n\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m')<='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t}elseif($buku_periode==\"tanggal\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m-%d')<='\".$buku_tglakhir.\"'\";\r\n\t\t\t\t}\r\n\t\t\t\t//$sql.=\"GROUP BY A.akun_kode\";\r\n\t\t\t\t$sql.=\"\tORDER BY A.akun_kode ASC\";\r\n\t\t\t\t//$this->firephp->log($sql);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//GET SALDO BEFORE\r\n\t\t\t\t$data[$i][\"neraca_saldo\"]=0;\r\n\r\n\t\t\t\t$sqlsaldo=\"SELECT \tA.akun_kode,sum(A.akun_debet) as debet,sum(A.akun_kredit) as kredit, A.akun_saldo\r\n\t\t\t\t\t\t\tFROM\tvu_akun A\r\n\t\t\t\t\t\t\tWHERE replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\";\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\t$rowsaldo=$rssaldo->row();\r\n\t\t\t\t\tif($rowsaldo->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t$saldo_akhir= ($rowsaldo->debet-$rowsaldo->kredit);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$saldo_akhir= ($rowsaldo->kredit-$rowsaldo->debet);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//$this->firephp->log($sqlsaldo.' '.$saldo_akhir.'<br/>');\r\n\t\t\t\t//----->\r\n\r\n\t\t\t\t$isi=$this->db->query($sql);\r\n\t\t\t\t//$this->firephp->log($sql);\r\n\t\t\t\t\r\n\t\t\t\tif($isi->num_rows()){\r\n\t\t\t\t\t$rowisi=$isi->row();\r\n\t\t\t\t\t$data[$i][\"neraca_akun\"]=$row->akun_id;\r\n\t\t\t\t\t$data[$i][\"neraca_level\"]=$row->akun_level;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis\"]=$row->akun_parent;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis_id\"]=$row->akun_parent_id;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_kode\"]=$row->akun_kode;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_nama\"]=$row->akun_nama;\r\n\r\n\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir+($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir+($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$i][\"neraca_akun\"]=$row->akun_id;\r\n\t\t\t\t\t$data[$i][\"neraca_level\"]=$row->akun_level;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis\"]=$row->akun_parent;\r\n\t\t\t\t\t$data[$i][\"neraca_jenis_id\"]=$row->akun_parent_id;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_kode\"]=$row->akun_kode;\r\n\t\t\t\t\t$data[$i][\"neraca_akun_nama\"]=$row->akun_nama;\r\n\t\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//bulan ini\r\n\t\t\t\t$sql=\"SELECT A.akun_kode,A.akun_saldo,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%'\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\";\r\n\r\n\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m')='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t}\r\n\t\t\t\t//$sql.=\"GROUP BY A.akun_kode\";\r\n\t\t\t\t$sql.=\"\tORDER BY A.akun_kode ASC\";\r\n\r\n\t\t\t\t$isi=$this->db->query($sql);\r\n\t\t\t\tif($isi->num_rows()){\r\n\t\t\t\t\t$rowisi=$isi->row();\r\n\t\t\t\t\tif($row->akun_saldo=='Debet')\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir+($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir+($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\r\n\t\t\t//LAPORAN LABA RUGI\r\n\t\t\t\r\n\t\t\tif($neraca_jenis==2) {\r\n\t\t\t\t$sql=\"SELECT\tA.akun_id,A.akun_saldo,A.akun_kode,A.akun_jenis,A.akun_nama,A.akun_level,B.akun_id as akun_parent_id,\r\n\t\t\t\t\t\t\t\tB.akun_nama as akun_parent\r\n\t\t\t\t\t\tFROM \takun A, akun B\r\n\t\t\t\t\t\tWHERE \tA.akun_level=2\r\n\t\t\t\t\t\t\t\tAND A.\takun_parent_kode=B.akun_kode\r\n\t\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\r\n\t\t\t\t\t\t\t\tAND B.akun_level=1\r\n\t\t\t\t\t\tORDER by A.akun_kode ASC\";\r\n\t\r\n\t\t\t\t$master=$this->db->query($sql);\r\n\t\t\t\t$nbrows=$master->num_rows();\r\n\t\t\t\t\r\n\t\t\t\t//$this->firephp->log(\"sql=\".$sql);\r\n\t\t\t\t\r\n\t\t\t\t$saldo=0;\r\n\t\t\t\t$saldo_akhir=0;\r\n\t\t\t\t$saldo_akhir_periode=0;\r\n\t\t\t\t$saldo_akun=0;\r\n\t\t\t\t$saldo_buku=0;\r\n\t\t\t\t\r\n\t\t\t\t//SALDO AWAL\r\n\t\t\t\t/*$sqlsaldo=\"SELECT \tA.akun_kode,sum(A.akun_debet) as debet,\r\n\t\t\t\t\t\t\t\t\tsum(A.akun_kredit) as kredit, \r\n\t\t\t\t\t\t\t\t\tA.akun_saldo\r\n\t\t\t\t\t\t\tFROM\takun A\r\n\t\t\t\t\t\t\tWHERE akun_jenis='R/L'\r\n\t\t\t\t\t\t\tGROUP BY A.akun_saldo\";\r\n\t\t\t\t\r\n\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\tforeach($rssaldo->result() as $rs){\r\n\t\t\t\t\t\t\tif($rs->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_akhir-= ($rs->debet-$rs->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_akhir+= ($rs->kredit-$rs->debet);\r\n\t\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\r\n\t\t\t\t$saldo_akhir_periode=$saldo_akhir;\r\n\t\t\t\t\r\n\t\t\t\t$this->firephp->log($saldo_akhir);*/\r\n\t\t\t\t\r\n\t\t\t\t$test=\"\";\r\n\r\n\t\t\t\tforeach($master->result() as $row){\r\n\t\t\t\t\t//SALDO AWAL\r\n\t\t\t\t\t$saldo_akun=0;\r\n\t\t\t\t\t$sqlsaldo=\"SELECT \tA.akun_kode,sum(A.akun_debet) as debet,\r\n\t\t\t\t\t\t\t\t\t\tsum(A.akun_kredit) as kredit, \r\n\t\t\t\t\t\t\t\t\t\tA.akun_saldo\r\n\t\t\t\t\t\t\t\tFROM\tvu_akun A\r\n\t\t\t\t\t\t\t\tWHERE akun_jenis='R/L'\r\n\t\t\t\t\t\t\t\tAND \treplace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \r\n\t\t\t\t\t\t\t\tGROUP BY A.akun_saldo\";\r\n\t\t\r\n\t\t\t\t\t$rssaldo=$this->db->query($sqlsaldo);\r\n\t\t\t\t\tif($rssaldo->num_rows()){\r\n\t\t\t\t\t\tforeach($rssaldo->result() as $rs){\r\n\t\t\t\t\t\t\tif($rs->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_akun+= ($rs->debet-$rs->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_akun+= ($rs->kredit-$rs->debet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//$this->firephp->log(\"saldo group : \".$row->akun_kode.\" => \".$saldo_akun);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($saldo_akun<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir-$saldo_akun;\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode-$saldo_akun;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir+$saldo_akun;\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode+$saldo_akun;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t//saldo dari buku besar\r\n\t\t\t\t\t$sql=\"SELECT A.akun_kode, A.akun_saldo,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\r\n\t\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \r\n\t\t\t\t\t\t\tGROUP BY A.akun_kode\";\r\n\t\t\t\t\t$rlisi=$this->db->query($sql);\r\n\t\t\t\t\tif($rlisi->num_rows()){\r\n\t\t\t\t\t\tforeach($rlisi->result() as $rowisi){\r\n\t\t\t\t\t\t\tif($rowisi->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($saldo_buku<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir-$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir=$saldo_akhir+$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//bulan ini\r\n\t\t\t\t\t$saldo=0;\r\n\t\t\t\t\t$sql=\"SELECT A.akun_kode,A.akun_saldo,sum(B.buku_debet) as debet,sum(B.buku_kredit) as kredit\r\n\t\t\t\t\t\t\tFROM\tbuku_besar B, akun A\r\n\t\t\t\t\t\t\tWHERE B.buku_akun=A.akun_id\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')>=date_format('\".$_SESSION[\"periode_awal\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND date_format(buku_tanggal,'%Y-%m-%d')<=date_format('\".$_SESSION[\"periode_akhir\"].\"','%Y-%m-%d')\r\n\t\t\t\t\t\t\tAND replace(A.akun_kode,'.','') like '\".str_replace(\".\",\"\",$row->akun_kode).\"%' \r\n\t\t\t\t\t\t\tAND A.akun_jenis='R/L'\";\r\n\t\t\t\t\tif($buku_periode==\"bulan\"){\r\n\t\t\t\t\t\t$sql.=\"\tAND date_format(B.buku_tanggal,'%Y-%m')='\".$buku_tahun.\"-\".$buku_bulan.\"'\";\r\n\t\t\t\t\t}elseif($buku_periode==\"tanggal\"){\r\n\t\t\t\t\t\t\t$sql.=\"\tAND date_format(buku_tanggal,'%Y-%m-%d')<='\".$buku_tglakhir.\"'\";\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\t$sql.=\" GROUP BY A.akun_kode\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($rlisi->num_rows()){\r\n\t\t\t\t\t\tforeach($rlisi->result() as $rowisi){\r\n\t\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->debet-$rowisi->kredit);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$saldo_buku= ($rowisi->kredit-$rowisi->debet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($saldo_buku<>0){\r\n\t\t\t\t\t\tif($row->akun_saldo=='Debet'){\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode-$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"-\".$saldo_akun;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$saldo_akhir_periode=$saldo_akhir_periode+$saldo_buku;\r\n\t\t\t\t\t\t\t$test.=\"+\".$saldo_akun;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$data[$i][\"neraca_akun\"]=777;\r\n\t\t\t\t$data[$i][\"neraca_jenis\"]='RUGI/LABA BERSIH';\r\n\t\t\t\t$data[$i][\"neraca_level\"]=2;\r\n\t\t\t\t$data[$i][\"neraca_jenis_id\"]=777;\r\n\t\t\t\t$data[$i][\"neraca_akun_kode\"]=\"777.\";\r\n\t\t\t\t$data[$i][\"neraca_akun_nama\"]=\"LABA/RUGI BERSIH\";\t\t\t\r\n\t\t\t\t$data[$i][\"neraca_saldo\"]=$saldo_akhir;\r\n\t\t\t\t$data[$i][\"neraca_saldo_periode\"]=$saldo_akhir_periode;\r\n\t\t\t}\r\n\r\n\t\t\tif($master->num_rows()>0){\r\n\t\t\t\treturn $data;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}", "function SetUpStartGroup() {\n\tglobal $PHP_SESSION, $PHP_GET;\n\tglobal $nStartGrp, $nTotalGrps, $nDisplayGrps;\n\n\t// Check for a START parameter\n\tif (@$PHP_GET[EW_TABLE_START_GROUP] != \"\") {\n\t\t$nStartGrp = $PHP_GET[EW_TABLE_START_GROUP];\n\t\t$PHP_SESSION[EW_TABLE_SESSION_START_GROUP] = $nStartGrp;\n\t} elseif (@$PHP_GET[\"pageno\"] != \"\") {\n\t\t$nPageNo = $PHP_GET[\"pageno\"];\n\t\tif (is_numeric($nPageNo)) {\n\t\t\t$nStartGrp = ($nPageNo-1)*$nDisplayGrps+1;\n\t\t\tif ($nStartGrp <= 0) {\n\t\t\t\t$nStartGrp = 1;\n\t\t\t} elseif ($nStartGrp >= intval(($nTotalGrps-1)/$nDisplayGrps)*$nDisplayGrps+1) {\n\t\t\t\t$nStartGrp = intval(($nTotalGrps-1)/$nDisplayGrps)*$nDisplayGrps+1;\n\t\t\t}\n\t\t\t$PHP_SESSION[EW_TABLE_SESSION_START_GROUP] = $nStartGrp;\n\t\t} else {\n\t\t\t$nStartGrp = @$PHP_SESSION[EW_TABLE_SESSION_START_GROUP];\n\t\t\tif (!is_numeric($nStartGrp) || $nStartGrp == \"\") {\n\t\t\t\t$nStartGrp = 1; // Reset start record counter\n\t\t\t\t$PHP_SESSION[EW_TABLE_SESSION_START_GROUP] = $nStartGrp;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$nStartGrp = @$PHP_SESSION[EW_TABLE_SESSION_START_GROUP];\n\t\tif (!is_numeric($nStartGrp) || $nStartGrp == \"\") {\n\t\t\t$nStartGrp = 1; // Reset start record counter\n\t\t\t$PHP_SESSION[EW_TABLE_SESSION_START_GROUP] = $nStartGrp;\n\t\t}\n\t}\n}", "private function get_ancestry($html, $rec) //$rec here is just for debug\n {\n $final = array();\n if(preg_match(\"/<div id=\\'totaxonomicTree\\'(.*?)<\\/div>/ims\", $html, $arr)) {\n if(preg_match_all(\"/<li>(.*?)<\\/li>/ims\", $arr[1], $arr2)) {\n foreach($arr2[1] as $str) {\n $str = str_replace(\" \", \"\", $str);\n $tmp = explode(\":\", $str);\n $tmp = array_map('trim', $tmp);\n $final[strtolower($tmp[0])] = $tmp[1];\n }\n // print_r($final); exit;\n return $final;\n }\n }\n else { //this else block is just for debug purposes\n /*\n if(in_array($rec['taxon_id'], array(95039, 95040, 78183, 108068, 107786, 92832, 107788, 90892, 90245, 108160, 87383, 108067, 106720, 102603, 108161))) {} //these taxon_id's are for dieseases names e.g. 'African swine fever' OR non-taxon names\n elseif(in_array($rec['taxon_id'], array(121671, 120803, 120994, 109730))) {} //acceptable to have no ancestry e.g. 'Bothriocephalus acheilognathi infection' but with ranges\n else {\n print_r($rec);\n echo(\"\\nInvestigate no ancestry\\n\");\n }\n if($rec['taxon_ranges']) {\n echo(\"\\nInvestigate no ancestry. Ranges total: \".count($rec['taxon_ranges']).\"\\n\");\n }\n */\n }\n return $final;\n }", "public function index(){\n// $body = model('Oracle')->getOracleData($sql);\n\n $b_data = ['B_SS323','B_SS388','B_SS370','B_SS413','B_SS396','B_SS406'];\n $body = [];\n foreach($b_data as $v_b_data)\n {\n $body[]['prd_name'] = $v_b_data;\n }\n\n// var_dump($body);die;\n //BODY层\n foreach($body as &$val)\n {\n $val['level'] = 1;\n $val['children'] = [];\n $val['name'] = $val['prd_name'];\n unset($val['prd_name']);\n }\n //WF层\n foreach($body as &$val1)\n {\n\n $sql1 = \"select IMA01 as prd_name from DATA.IMA_FILE A,DATA.IMAICD_FILE B where IMA06='1_WF' AND A.IMA01=B.IMAICD00 AND IMAICD01='\".$val1['name'].\"'\";\n $wf = model('Oracle')->getOracleData($sql1);\n if(!$wf){\n continue;\n }\n foreach($wf as &$val_wf)\n {\n $val_wf['name'] = $val_wf['prd_name'];\n unset($val_wf['prd_name']);\n }\n $val1['children'] = $wf;\n //CP层\n foreach($val1['children'] as &$val_cp)\n {\n $val_cp['level'] = 2;\n $sql2 = \"SELECT BMB01 as prd_name FROM DATA.BMB_FILE WHERE BMB03 = '\".$val_cp['name'].\"' \";\n $cp = model('Oracle')->getOracleData($sql2);\n if(!$cp){\n continue;\n }\n foreach($cp as &$val_cp_1)\n {\n $val_cp_1['name'] = $val_cp_1['prd_name'];\n unset($val_cp_1['prd_name']);\n }\n $val_cp['children'] = $cp;\n\n //PKG段\n foreach($val_cp['children'] as &$val_pkg)\n {\n $val_pkg['level'] = 3;\n $sql3 = \"SELECT BMB01 as prd_name FROM DATA.BMB_FILE WHERE BMB03 = '\".$val_pkg['name'].\"'\";\n $pkg = model('Oracle')->getOracleData($sql3);\n\n if(!$pkg){\n continue;\n }\n\n foreach($pkg as &$val_pkg_1)\n {\n $val_pkg_1['name'] = $val_pkg_1['prd_name'];\n unset($val_pkg_1['prd_name']);\n }\n $val_pkg['children'] = $pkg;\n //FT段\n foreach($val_pkg['children'] as &$val_ft)\n {\n $val_ft['level'] = 4;\n $sql4 = \"SELECT BMB01 as prd_name FROM DATA.BMB_FILE WHERE BMB03 = '\".$val_ft['name'].\"'\";\n $ft = model('Oracle')->getOracleData($sql4);\n\n if(!$ft){\n continue;\n }\n\n foreach($ft as &$val_ft_1)\n {\n $val_ft_1['level'] = 5;\n $val_ft_1['name'] = $val_ft_1['prd_name'];\n\n unset($val_ft_1['prd_name']);\n }\n $val_ft['children'] = $ft;\n// //最终段\n foreach($val_ft['children'] as &$val_fl)\n {\n $sql5 = \"SELECT BMB01 as prd_name FROM DATA.BMB_FILE WHERE BMB03 = '\".$val_fl['name'].\"'\";\n $fl = model('Oracle')->getOracleData($sql5);\n if(!$fl){\n continue;\n }\n foreach($fl as &$val_fl_1)\n {\n $val_fl_1['level'] = 6;\n $val_fl_1['name'] = $val_fl_1['prd_name'];\n unset($val_fl_1['prd_name']);\n }\n// var_dump($val_ft);\n\n $val_fl['children'] = $fl;\n\n }\n }\n }\n }\n }\n $json_body = json_encode($body);\n return $this->fetch('',[\n 'body'=> $json_body\n ]);\n }", "function grgd(){\n\t\t$grid = $this->jqdatagrid;\n\t\t// CREA EL WHERE PARA LA BUSQUEDA EN EL ENCABEZADO\n\t\t$mWHERE = $grid->geneTopWhere('spregr');\n\t\t$response = $grid->getData('spregr', array(array()), array(), false, $mWHERE );\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}", "public function getList($sku);", "private function tree_setOneDimOneRow( $uid_parent )\n {\n // Prompt the expired time to devlog\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n\n foreach ( $this->arr_rowsTablefield as $row )\n {\n $tsPath = $uid_parent . '.';\n $this->tmpOneDim[ $tsPath . 'uid' ] = $row[ $this->uidField ];\n $this->tmpOneDim[ $tsPath . 'value' ] = $row[ $this->valueField ];\n break;\n }\n\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end' );\n }", "function menuNavigasi($user){\n\t\t$menu = mysql_query(\"select * from ms_menu where parent='0' order by urut asc\");\n\t\twhile($row=mysql_fetch_array($menu))\n\t\t\t$data[]=$row;\n\t\tif (isset($data)){\n\t\t\treturn($data);\n\t\t}\n\t}", "private function tree_setOneDimDefault( $uid_parent )\n {\n static $tsPath = null;\n static $level = 0;\n static $loops = 0;\n\n // Prompt the expired time to devlog\n if ( $level == 0 )\n {\n $debugTrailLevel = 1;\n $this->pObj->timeTracking_log( $debugTrailLevel, 'begin' );\n }\n\n // LOOP rows\n //#i0116, 141223, dwildt, 1-/+\n //foreach ( $this->arr_rowsTablefield as $key => $row )\n foreach ( ( array ) $this->arr_rowsTablefield as $key => $row )\n {\n // CONTINUE current row isn't row with current $uid_parent\n if ( $row[ $this->treeParentField ] != $uid_parent )\n {\n continue;\n }\n // CONTINUE current row isn't row with current $uid_parent\n\n $lastPath = $tsPath;\n $tsPath = $tsPath . $key . '.';\n $this->tmpOneDim[ $tsPath . 'uid' ] = $row[ $this->uidField ];\n $this->tmpOneDim[ $tsPath . 'value' ] = $row[ $this->valueField ];\n $level++;\n $loops++;\n $this->tree_setOneDimDefault( $row[ $this->uidField ] );\n $level--;\n $tsPath = $lastPath;\n }\n // LOOP rows\n //\n // Prompt the expired time to devlog\n if ( $level == 0 )\n {\n $this->pObj->timeTracking_log( $debugTrailLevel, 'end ( loops: ' . $loops . ')' );\n }\n }", "private static function refreshNestings(): void\n {\n if ($ids = array_keys (self::$instancesById)) {\n $rows = Application::getInstance()->getVxPDO()->doPreparedQuery(\n sprintf(\"SELECT foldersid, l, r, level FROM folders WHERE foldersid IN (%s)\", implode(',', array_fill(0, count($ids), '?'))),\n $ids\n );\n\n foreach($rows as $row) {\n $instance = self::$instancesById[$row['foldersid']];\n $instance->level = $instance->data['level'] = $row['level'];\n $instance->r = $instance->data['r'] = $row['r'];\n $instance->l = $instance->data['l'] = $row['l'];\n }\n }\n\t}", "function ingresar_subdetalles($data){\n\t\t$this->db->insert('mantenciones_subdetalles',$data);\n\t\treturn $this->db->insert_id();\n\t}", "function startCountingAdded()\n {\n\t$this->resetCountAdded();\n\t$this->startCountingAddedLevels();\n\t$this->startCountingAddedVehicles();\n\t$this->doStartCountingAdded();\n }", "public function run()\n {\n // base tables\n Menu::truncate();\n Menu::insert(\n [\n [\n \"parent_id\" => 0,\n \"order\" => 1,\n \"title\" => \"Dashboard\",\n \"icon\" => \"fas fa-chart-pie\",\n \"uri\" => \"/\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 0,\n \"order\" => 11,\n \"title\" => \"Admin\",\n \"icon\" => \"fas fa-user-secret\",\n \"uri\" => NULL,\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 2,\n \"order\" => 13,\n \"title\" => \"Users\",\n \"icon\" => \"fas fa-user\",\n \"uri\" => \"auth/users\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 2,\n \"order\" => 14,\n \"title\" => \"Menu\",\n \"icon\" => \"fas fa-tree\",\n \"uri\" => \"auth/menu\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 2,\n \"order\" => 12,\n \"title\" => \"ProductUnits\",\n \"icon\" => \"fab fa-codiepie\",\n \"uri\" => \"product-units\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 10,\n \"order\" => 5,\n \"title\" => \"SKU管理\",\n \"icon\" => \"fas fa-align-center\",\n \"uri\" => \"stock-units\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 0,\n \"order\" => 4,\n \"title\" => \"供应链\",\n \"icon\" => \"fas fa-ambulance\",\n \"uri\" => NULL,\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 10,\n \"order\" => 6,\n \"title\" => \"供应商\",\n \"icon\" => \"fas fa-bars\",\n \"uri\" => \"suppliers\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 10,\n \"order\" => 7,\n \"title\" => \"采购单\",\n \"icon\" => \"fas fa-shopping-cart\",\n \"uri\" => \"purchase-orders\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 0,\n \"order\" => 2,\n \"title\" => \"销售\",\n \"icon\" => \"fab fa-sellsy\",\n \"uri\" => NULL,\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 13,\n \"order\" => 3,\n \"title\" => \"订单\",\n \"icon\" => \"fab fa-first-order\",\n \"uri\" => \"/shop-orders\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 10,\n \"order\" => 8,\n \"title\" => \"仓库管理\",\n \"icon\" => \"fas fa-warehouse\",\n \"uri\" => \"/warehouses\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 17,\n \"order\" => 10,\n \"title\" => \"省市区\",\n \"icon\" => \"fas fa-city\",\n \"uri\" => \"china-areas\",\n \"group\" => NULL\n ],\n [\n \"parent_id\" => 0,\n \"order\" => 9,\n \"title\" => \"其他\",\n \"icon\" => \"fas fa-circle\",\n \"uri\" => NULL,\n \"group\" => NULL\n ]\n ]\n );\n // finish\n }", "public function populateParentFromSortedByParentIdList() {\n for ($i = 0; $i < sizeof($this->nodeList); $i++) {\n $node = $this->nodeList[$i];\n// echo \"<br>Text: \".$node->getText();\n $this->insertNode($node);\n }\n }", "public function treeAction() {\n $request = Request::createFromGlobals();\n $stopped = $request->get('stopped');\n \n $folder = 'live';\n // $this->syncAction($folder);\n $dhtmlx = $this->container->get('arii_core.dhtmlx');\n $data = $dhtmlx->Connector('data');\n /* On prend l'historique */\n $Fields = array (\n '{spooler}' => 'sh.SPOOLER_ID', \n '{job_chain}' => 'sh.JOB_CHAIN',\n// '{order}' => 'sh.ORDER_ID',\n '{start_time}' => 'sh.START_TIME' );\n\n $sql = $this->container->get('arii_core.sql');\n $tools = $this->container->get('arii_core.tools');\n\n $qry = $sql->Select(array('sh.ORDER_ID','sh.HISTORY_ID','sh.SPOOLER_ID','sh.JOB_CHAIN','sh.START_TIME','sh.END_TIME','sh.STATE' ))\n .$sql->From(array('SCHEDULER_ORDER_HISTORY sh'))\n .$sql->Where($Fields)\n .$sql->OrderBy(array('sh.SPOOLER_ID','sh.JOB_CHAIN','sh.START_TIME desc')); \n \n $res = $data->sql->query( $qry );\n $Chains = $Orders = array();\n \n while ( $line = $data->sql->get_next($res) ) {\n $id = $line['HISTORY_ID'];\n $chain = \"/\".$line['SPOOLER_ID'].'/'.$line['JOB_CHAIN'];\n $dir = $chain.'/'.$line['ORDER_ID'];\n \n if (!isset($Chains[$chain])) {\n $key_files[$chain] = $chain;\n $Chains[$chain]=1; \n }\n \n if (isset($Orders[$dir])) continue;\n $Orders[$dir] = $line; \n \n // On ccompte les erreurs\n $key_files[$dir] = $dir;\n }\n \n // Prend on en compte les suspended ?\n $Fields = array (\n '{spooler}' => 'SPOOLER_ID', \n '{job_chain}' => 'PATH' /*,\n '{order}' => 'sh.ID'*/ );\n $qry = $sql->Select(array('SPOOLER_ID','PATH' ))\n .$sql->From(array('SCHEDULER_JOB_CHAINS'))\n .$sql->Where($Fields); \n\n $res = $data->sql->query( $qry );\n while ( $line = $data->sql->get_next($res) ) {\n $dir = '/'.$line['SPOOLER_ID'].'/'.$line['PATH'];\n \n $Chains[$dir]='STOPPED';\n }\n \n /*\n print_r($Info);\n exit();\n */\n \n $tools = $this->container->get('arii_core.tools');\n $tree = $tools->explodeTree($key_files, \"/\");\n \n $response = new Response();\n $response->headers->set('Content-Type', 'text/xml');\n $list = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $list .= \"<tree id='0'>\\n\";\n \n $list .= $this->Folder2XML( $tree, '', $Chains, $Orders );\n $list .= \"</tree>\\n\";\n $response->setContent( $list );\n return $response;\n }", "public function show()\n {\n switch (request('parent')) {\n case 1:\n return '[{\"id\":2,\"shopId\":null,\"code\":\"110000\",\"province\":\"北京\",\"city\":\"北京市\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":19,\"shopId\":null,\"code\":\"120000\",\"province\":\"天津\",\"city\":\"天津市\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":36,\"shopId\":null,\"code\":\"130000\",\"province\":\"河北省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":230,\"shopId\":null,\"code\":\"140000\",\"province\":\"山西省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":372,\"shopId\":null,\"code\":\"150000\",\"province\":\"内蒙古自治区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":496,\"shopId\":null,\"code\":\"210000\",\"province\":\"辽宁省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":625,\"shopId\":null,\"code\":\"220000\",\"province\":\"吉林省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":703,\"shopId\":null,\"code\":\"230000\",\"province\":\"黑龙江省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":857,\"shopId\":null,\"code\":\"310000\",\"province\":\"上海\",\"city\":\"上海市\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":875,\"shopId\":null,\"code\":\"320000\",\"province\":\"江苏省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1001,\"shopId\":null,\"code\":\"330000\",\"province\":\"浙江省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1114,\"shopId\":null,\"code\":\"340000\",\"province\":\"安徽省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1252,\"shopId\":null,\"code\":\"350000\",\"province\":\"福建省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1356,\"shopId\":null,\"code\":\"360000\",\"province\":\"江西省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1479,\"shopId\":null,\"code\":\"370000\",\"province\":\"山东省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1651,\"shopId\":null,\"code\":\"410000\",\"province\":\"河南省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1845,\"shopId\":null,\"code\":\"420000\",\"province\":\"湖北省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":1975,\"shopId\":null,\"code\":\"430000\",\"province\":\"湖南省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2125,\"shopId\":null,\"code\":\"440000\",\"province\":\"广东省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2285,\"shopId\":null,\"code\":\"450000\",\"province\":\"广西壮族自治区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2425,\"shopId\":null,\"code\":\"460000\",\"province\":\"海南省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2459,\"shopId\":null,\"code\":\"500000\",\"province\":\"重庆\",\"city\":\"重庆市\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2498,\"shopId\":null,\"code\":\"510000\",\"province\":\"四川省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2721,\"shopId\":null,\"code\":\"520000\",\"province\":\"贵州省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2824,\"shopId\":null,\"code\":\"530000\",\"province\":\"云南省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":2978,\"shopId\":null,\"code\":\"540000\",\"province\":\"西藏自治区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3063,\"shopId\":null,\"code\":\"610000\",\"province\":\"陕西省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3191,\"shopId\":null,\"code\":\"620000\",\"province\":\"甘肃省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3304,\"shopId\":null,\"code\":\"630000\",\"province\":\"青海省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3358,\"shopId\":null,\"code\":\"640000\",\"province\":\"宁夏回族自治区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3391,\"shopId\":null,\"code\":\"650000\",\"province\":\"新疆维吾尔自治区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3512,\"shopId\":null,\"code\":\"710000\",\"province\":\"台湾省\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3891,\"shopId\":null,\"code\":\"810000\",\"province\":\"香港特别行政区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":3913,\"shopId\":null,\"code\":\"820000\",\"province\":\"澳门特别行政区\",\"city\":\"\",\"district\":\"\",\"parent\":1,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null}]';\n break;\n case 875:\n return '[{\"id\":876,\"shopId\":null,\"code\":\"320100\",\"province\":\"\",\"city\":\"南京市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":889,\"shopId\":null,\"code\":\"320200\",\"province\":\"\",\"city\":\"无锡市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":899,\"shopId\":null,\"code\":\"320300\",\"province\":\"\",\"city\":\"徐州市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":911,\"shopId\":null,\"code\":\"320400\",\"province\":\"\",\"city\":\"常州市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":920,\"shopId\":null,\"code\":\"320500\",\"province\":\"\",\"city\":\"苏州市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":931,\"shopId\":null,\"code\":\"320600\",\"province\":\"\",\"city\":\"南通市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":941,\"shopId\":null,\"code\":\"320700\",\"province\":\"\",\"city\":\"连云港市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":949,\"shopId\":null,\"code\":\"320800\",\"province\":\"\",\"city\":\"淮安市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":959,\"shopId\":null,\"code\":\"320900\",\"province\":\"\",\"city\":\"盐城市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":970,\"shopId\":null,\"code\":\"321000\",\"province\":\"\",\"city\":\"扬州市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":978,\"shopId\":null,\"code\":\"321100\",\"province\":\"\",\"city\":\"镇江市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":986,\"shopId\":null,\"code\":\"321200\",\"province\":\"\",\"city\":\"泰州市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":994,\"shopId\":null,\"code\":\"321300\",\"province\":\"\",\"city\":\"宿迁市\",\"district\":\"\",\"parent\":875,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null}]';\n break;\n case 889:\n return '[{\"id\":891,\"shopId\":null,\"code\":\"320202\",\"province\":\"\",\"city\":\"\",\"district\":\"崇安区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":892,\"shopId\":null,\"code\":\"320203\",\"province\":\"\",\"city\":\"\",\"district\":\"南长区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":893,\"shopId\":null,\"code\":\"320204\",\"province\":\"\",\"city\":\"\",\"district\":\"北塘区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":894,\"shopId\":null,\"code\":\"320205\",\"province\":\"\",\"city\":\"\",\"district\":\"锡山区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":895,\"shopId\":null,\"code\":\"320206\",\"province\":\"\",\"city\":\"\",\"district\":\"惠山区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":896,\"shopId\":null,\"code\":\"320211\",\"province\":\"\",\"city\":\"\",\"district\":\"滨湖区\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":897,\"shopId\":null,\"code\":\"320281\",\"province\":\"\",\"city\":\"\",\"district\":\"江阴市\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null},{\"id\":898,\"shopId\":null,\"code\":\"320282\",\"province\":\"\",\"city\":\"\",\"district\":\"宜兴市\",\"parent\":889,\"street\":null,\"isStreet\":0,\"createByAdm\":null,\"createTime\":null,\"updateTime\":null,\"updateByAdm\":null,\"menuId\":null,\"page\":null}]';\n default:\n # code...\n break;\n }\n return [];\n }", "function setLevelAgent2()\n {\n $nickname = $this->input->post('nickname');\n $status = $this->input->post('status');\n $parentid = $this->input->post('parentid');\n if(empty($parentid)){\n echo \"1001\";die;\n }\n $optinfo = $this->curl->simple_get($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=' . $status.\"&pr=\".$this->input->post('parent'));\n $datainfo = json_decode($optinfo);\n $num_daily2 = $this->curl->simple_get($this->config->item('api_portal') . '?c=10');\n $numdl2 = json_decode($num_daily2)->number_dl2;\n date_default_timezone_set('Asia/Ho_Chi_Minh');\n $info = $this->useragent_model->get_info_admin($this->input->post('username'));\n $admin_login = $this->session->userdata('user_admindaily_login');\n $admin_info = $this->useragent_model->get_info($admin_login);\n\n $input = array();\n $input['where'] = array(\"parentid\" => $parentid, \"active\" => 1);\n $total = $this->useragent_model->get_total($input);\n\n // insert vao db\n $data = array(\n 'username' => $this->input->post('username'),\n 'nickname' => $this->input->post('nickname'),\n 'email' => $this->input->post('email'),\n 'phone' => $this->input->post('mobile'),\n 'status' => \"D\",\n 'parentid' => $parentid,\n 'createtime' => date(\"Y-m-d H:i:s\"),\n 'updatetime' => date(\"Y-m-d H:i:s\"),\n 'parent' => $this->input->post('parent'),\n 'key' => $this->rand_string(2),\n );\n if ($optinfo) {\n if ($info != false) {\n $this->curl->simple_get($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=0'.'&pr='.$this->input->post('parent'));\n\n $this->session->set_flashdata('message', ' <div class=\"form-group has-error\"><label class=\"control-label\" for=\"inputSuccess\"><i class=\"fa fa-check\"></i> Nick name đã là đại lý </label></div>');\n\n echo json_encode(\"0\");\n\n die();\n } else if ($total >= $numdl2) {\n $this->curl->simple_get($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=0'.'&pr='.$this->input->post('parent'));\n $this->session->set_flashdata('message', ' <div class=\"form-group has-error\"><label class=\"control-label\" for=\"inputSuccess\"><i class=\"fa fa-check\"></i> Bạn đã thêm quá ' . $numdl2 . ' đại lý </label></div>');\n echo json_encode(\"1\");\n die();\n } else if ($total < $numdl2 && $datainfo->errorCode == 0) {\n $this->logadmin_model->create($this->logadmindata(1, $this->input->post('nickname'), $admin_info->username));\n if(!$this->useragent_model->create($data)){\n $this->curl->simple_get($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=0'.'&pr='.$this->input->post('parent'));\n $this->session->set_flashdata('message', ' <div class=\"form-group has-error\"><label class=\"control-label\" for=\"inputSuccess\"><i class=\"fa fa-check\"></i> Thêm đại lý không thất bại. </label></div>');\n echo json_encode(\"1\");\n die();\n }\n $this->session->set_flashdata('message', ' <div class=\"form-group has-success successful\"><label class=\"control-label\" for=\"inputSuccess\"><i class=\"fa fa-check\"></i> Bạn thêm đại lý thành công</label></div>');\n echo json_encode(\"2\");\n }else if($datainfo->errorCode == 1001){\n $this->curl->simple_get($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=0'.'&pr='.$this->input->post('parent'));\n var_dump($this->config->item('api_url') . '?c=103&nn=' . $nickname . '&st=0'.'&pr='.$this->input->post('parent'));\n $this->session->set_flashdata('message', ' <div class=\"form-group has-error\"><label class=\"control-label\" for=\"inputSuccess\"><i class=\"fa fa-check\"></i> Nick name không tồn tại </label></div>');\n echo json_encode(\"3\");\n die();\n }\n\n\n } else {\n echo \"1001\";\n }\n }", "function displaySNPsStrains($source_id,$is_table,&$strainIndex){\n $strains=array(); $strains=getSNPsStrains($source_id);$rows=\"\";$block=\"\";$count=1;\n if($is_table!=1)$rows=\"<div class='sh'>Strains Selection</div><div id='str-list'>\";\n $strain_keys=array_keys($strains); sort($strain_keys);$j=4;\n foreach($strain_keys as $name){\n $values=$strains[\"$name\"]; $id=$values[\"id\"]; \n if($is_table!=1){ \n $li=\"<li><input type='checkBox' name='strain' value=\\\"t$id\\\" id=\\\"$id\\\" \n onclick=\\\"toggleColumn(this,'snptable',1);\\\" disabled='true'/>&nbsp;$name&nbsp;</li>\";\n if($values[\"display\"]==1)\n $li=\"<li><input type='checkBox' name='strain' value=\\\"t$id\\\" id=\\\"$id\\\" \n onclick=\\\"toggleColumn(this,'snptable',1);\\\" />&nbsp;$name&nbsp;</li>\";\n if($count%25==0){$rows.=\"<ul>$block</ul>\";$block=\"\";}\n else $block.=$li; ++$count;\n }else{\n $len=strlen($name);$verticalName=\"\"; //<ul>\";\r\n for($p=0;$p<=$len-1;++$p){\n if(!empty($name[$p]))$verticalName.=\"$name[$p]<br/>\"; //</li>\";\n }\n //$verticalName.=\"</ul>\";\n $strainIndex[$j]=$id; $rows.=\"<th class='strainlabel' id='t$j'>$verticalName</th>\";\r\n ++$j;\n \n }\n }\n if($is_table!=1){if(!empty($block))$rows.=\"<ul>$block</ul>\";$block=\"\";}\n if($is_table!=1)$rows.=\"</div>\";\n return $rows; \n}", "function SetUpStartGroup() {\n\t\tglobal $deals_details;\n\n\t\t// Exit if no groups\n\t\tif ($this->DisplayGrps == 0)\n\t\t\treturn;\n\n\t\t// Check for a 'start' parameter\n\t\tif (@$_GET[EWRPT_TABLE_START_GROUP] != \"\") {\n\t\t\t$this->StartGrp = $_GET[EWRPT_TABLE_START_GROUP];\n\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t} elseif (@$_GET[\"pageno\"] != \"\") {\n\t\t\t$nPageNo = $_GET[\"pageno\"];\n\t\t\tif (is_numeric($nPageNo)) {\n\t\t\t\t$this->StartGrp = ($nPageNo-1)*$this->DisplayGrps+1;\n\t\t\t\tif ($this->StartGrp <= 0) {\n\t\t\t\t\t$this->StartGrp = 1;\n\t\t\t\t} elseif ($this->StartGrp >= intval(($this->TotalGrps-1)/$this->DisplayGrps)*$this->DisplayGrps+1) {\n\t\t\t\t\t$this->StartGrp = intval(($this->TotalGrps-1)/$this->DisplayGrps)*$this->DisplayGrps+1;\n\t\t\t\t}\n\t\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t\t} else {\n\t\t\t\t$this->StartGrp = $deals_details->getStartGroup();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->StartGrp = $deals_details->getStartGroup();\n\t\t}\n\n\t\t// Check if correct start group counter\n\t\tif (!is_numeric($this->StartGrp) || $this->StartGrp == \"\") { // Avoid invalid start group counter\n\t\t\t$this->StartGrp = 1; // Reset start group counter\n\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t} elseif (intval($this->StartGrp) > intval($this->TotalGrps)) { // Avoid starting group > total groups\n\t\t\t$this->StartGrp = intval(($this->TotalGrps-1)/$this->DisplayGrps) * $this->DisplayGrps + 1; // Point to last page first group\n\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t} elseif (($this->StartGrp-1) % $this->DisplayGrps <> 0) {\n\t\t\t$this->StartGrp = intval(($this->StartGrp-1)/$this->DisplayGrps) * $this->DisplayGrps + 1; // Point to page boundary\n\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t}\n\t}", "public function fetchData(){\n \n // init needed libs\n $nedded_libs = array( \n 'models' => array(array('trk_user_model', 'trk_user_model'),\n array('trk_photo_model', 'trk_photo_model'),\n array('trk_uploadactivity_model', 'trk_uploadactivity_model'))\n );\n\n // load needed libs\n SHIN_Core::postInit($nedded_libs);\n \n include(SHIN_Core::isConfigExists('limitations.php'));\n \n $count = 0;\n $statList = '';\n $dataList = array(); \n $userList = SHIN_Core::$_models['trk_user_model']->getUserList();\n \n $search = SHIN_Core::$_input->globalarr('sSearch'); \n $start = SHIN_Core::$_input->globalarr('iDisplayStart'); \n $length = SHIN_Core::$_input->globalarr('iDisplayLength');\n \n $column = SHIN_Core::$_input->globalarr('iSortCol_0');\n $type = SHIN_Core::$_input->globalarr('sSortDir_0'); \n \n\t\t\n\t\t//dump($column);\n switch($column) {\n case 0:\n $name = 'name';\n break;\n case 1:\n $name = 'total_photo';\n break;\n// case 2:\n// $name = 'total_gallery';\n// break;\n case 2:\n $name = 'total_file_size';\n break;\n case 3:\n $name = 'remaining_quota';\n break;\n case 4:\n $name = 'remaining_month_quota';\n break;\n case 5:\n $name = 'total_space_quota';\n break;\n default:\n $name = 'name';\n \n }\n \n\t\t//dump($name);\n $this->orderBy = array($name => $type); \n \n foreach($userList as $user) {\n\t\t\n $totalPhoto = SHIN_Core::$_models['trk_photo_model']->getPhotoCount($user['userId']);\n //\n $totalFileSize = SHIN_Core::$_models['trk_uploadactivity_model']->getTotalUploadedSize($user['userId']);\n $monthBandwidth = SHIN_Core::$_models['trk_uploadactivity_model']->getUsersBandWidth(SHIN_Core::$_user->idUser, date('Y-m-d'));\n \n $remainingQuota = $limitations['lim_total_space_quota'] - $totalFileSize; \n $remainingMonthQuota = $limitations['lim_total_space_quota'] - $monthBandwidth; \n\t\t\t\n \n if(empty($search)) {\n $dataList[] = array('name' => $user['sys_user_name'],\n 'total_photo' => $totalPhoto,\n 'total_file_size' => $this->formatSize($totalFileSize),\n 'remaining_quota' => $this->formatSize($remainingQuota),\n 'remaining_month_quota' => $this->formatSize($remainingMonthQuota),\n 'total_space_quota' => $this->formatSize($limitations['lim_total_space_quota']));\n \n } elseif(stristr($user['name'], $search)) {\n \n $dataList[] = array('name' => $user['name'],\n 'total_photo' => $totalPhoto,\n 'total_file_size' => $this->formatSize($totalFileSize),\n 'remaining_quota' => $this->formatSize($remainingQuota),\n 'remaining_month_quota' => $this->formatSize($remainingMonthQuota),\n 'total_space_quota' => $this->formatSize($limitations['lim_total_space_quota'])); \n } \n }\n \n // 2. make sorting\n\t\t\n usort($dataList, array($this, '_sort_array'));\n // 3. make pagination using array_slice()\n $dataList = array_slice($dataList, $start, $length);\n \n // 4. prepare data for json\n foreach($dataList as $data)\n\t\t{\n $statList .= '[' . implode(',', array('\"' . $data['name'] . '\"',\n '\"' . $data['total_photo'] . '\"',\n '\"' . $data['total_file_size'] . '\"',\n '\"' . $data['remaining_quota'] . '\"',\n '\"' . $data['remaining_month_quota'] . '\"',\n '\"' . $data['total_space_quota'] . '\"')) . '],';\n \n }\n \n \n // json return value \n $sOutput = '{';\n $sOutput .= '\"sEcho\": '.intval(SHIN_Core::$_input->post('sEcho')).', ';\n $sOutput .= '\"iTotalRecords\": '. count($userList) . ', ';\n $sOutput .= '\"iTotalDisplayRecords\": ' . count($dataList) . ', ';\n $sOutput .= '\"aaData\": [' . substr($statList, 0, -1) . '] }'; \n \n echo $sOutput; exit(); \n }", "function __construct(){\n parent::__construct('drq_father_data');\n }", "function cognitivefactory_tree_left($cognitivefactoryid, $userid, $groupid, $id) {\n global $CFG, $DB;\n\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n\n $sql = \"\n SELECT \n itemdest, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n id = $id\n \";\n $res = $DB->get_record_sql($sql);\n $ordering = $res->intvalue;\n $fatherid = $res->itemdest;\n\n $sql = \"\n SELECT \n id,\n itemdest\n FROM \n {cognitivefactory_opdata} as od\n WHERE \n id = $fatherid\n \";\n $resfatherid = $DB->get_record_sql($sql);\n if (!$resfatherid) return; // this protects against bouncing left request\n $fatheridbis = $resfatherid->itemdest; //id grandpa...\n\n $sql = \"\n SELECT \n id,\n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n intvalue > $ordering AND \n itemdest = $fatherid\n {$accessClause}\n ORDER BY \n intvalue\n \";\n $newbrotherordering = $ordering;\n\n if ($ress = $DB->get_records_sql($sql)) {\n foreach ($ress as $res) {\n $opdata = new StdClass();\n $opdata->id = $res->id;\n $opdata->intvalue = $newbrotherordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n $newbrotherordering = $newbrotherordering + 1;\n }\n }\n\n // getting father's ordering\n $sql = \"\n SELECT\n id, \n intvalue\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = 'hierarchize' AND\n id = $fatherid\n {$accessClause}\n \";\n $resorderingfather = $DB->get_record_sql($sql);\n $orderingfather = $resorderingfather->intvalue;\n\n // reordering uncles\n $select = \"\n cognitivefactoryid = ? AND\n operatorid = 'hierarchize' AND\n intvalue > ? AND \n itemdest = ?\n {$accessClause}\n \";\n if ($resbrotherfathers = $DB->get_records_select('cognitivefactory_opdata', $select, array($cognitivefactoryid, $orderingfather, $fatheridbis), 'id, intvalue', 'intvalue')) {\n foreach ($resbrotherfathers as $resbrotherfather) {\n $idbrotherfather = $resbrotherfather->id;\n $nextordering = $resbrotherfather->intvalue + 1;\n\n $opdata = new StdClass();\n $opdata->id = $idbrotherfather;\n $opdata->intvalue = $nextordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n }\n\n // reordering\n $newordering = $orderingfather + 1;\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $opdata->itemdest = $fatheridbis;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n}", "function get_suite_by_folder_depth($depth, $db)\n{\n $length = $depth * TL_NODE_ABS_LENGTH;\n $sql = \"select nh.`name` as `name`, nh.id as id, \" .\n \"nh.parent_id as parent_id, nh.node_depth_abs as abs from \".\n $db->get_table('nodes_hierarchy') . \" nh \" .\n \" where \" .\n \"length(nh.node_depth_abs) = \". $length . \" and nh.node_type_id = 2\";\n $result = $db->fetchRowsIntoMap($sql, 'id');\n \n return $result;\n}", "function getHourlyLevelData($prefix_arr, $start_date)\n {\n $this->load->model(\"building_model\");\n $arr_levels = $prefix_arr;\n $totalData = array();\n $labels = array();\n $l_arr = array();\n $dataset = array();\n\n for ($i = 0; $i < count($arr_levels); $i++) {\n $labels = array();\n $daily_data = array();\n $line_name = \"\";\n $filter = \"('\" . $arr_levels[$i] . \"')\";\n $length = strlen($arr_levels[$i]);\n $queryStr = \"select day,hour,left(mapped_location,$length) as level,count(distinct(id)) \n from $this->ana_schemas.$this->hourly_table \n where left(mapped_location,$length) in \" . $filter . \" and day='\" . $start_date . \"' \n group by day,hour,left(mapped_location,$length) \n order by hour;\";\n\n $query = $this->db->query($queryStr);\n foreach ($query->result_array() as $row) {\n array_push($labels, $row['hour']);\n array_push($daily_data, $row['count']);\n }\n\n //get line name\n $result = $this->building_model->get_level_by_prefix($arr_levels[$i]);\n if ($result != NULL)\n $line_name = $result[0]->name;\n else {\n $line_name = \"\";\n }\n \n //if today is not start date do... 24 hours\n // else today is start_date do only current hour time\n $d1 = new DateTime($start_date);\n $now = new DateTime(\"now\");\n\n //\n $l_arr = array();\n $data_arr = array();\n\n //\n if($d1->format(\"Y-m-d\") == $now->format(\"Y-m-d\")){\n //todo get time now\n $var = intval(date('H'));\n for($k = 0; $k < $var; $k++){\n array_push($l_arr, $k.\":00\");\n $index = $this->isContain($k,$labels);\n if($index != -1){\n array_push($data_arr,$daily_data[$index]);\n } else {\n array_push($data_arr,0); //add 0 if there is no data at $k hour\n }\n }\n } else if($d1->format(\"Y-m-d\") < $now->format(\"Y-m-d\")){\n $h_max = 24;\n for($k = 0; $k < $h_max; $k++){\n array_push($l_arr, $k.\":00\");\n $index = $this->isContain($k,$labels);\n if($index != -1){\n array_push($data_arr,$daily_data[$index]);\n } else {\n array_push($data_arr,0); //add 0 if there is no data at $k hour\n }\n }\n }\n\n if(count($arr_levels) > 1){ //try to build total line\n $k = 0;\n foreach ($data_arr as $value) { \n if (isset($totalData[$k])){\n $totalData[$k] += $value;\n } else {\n $totalData[$k] = $value;\n }\n $k++;\n }\n }\n\n // assembly data\n $data = array('label' => $line_name,\n 'data' => $data_arr,\n 'fill'=> false,\n 'pointRadius'=> 5,\n 'pointHitRadius'=> 10,\n 'borderColor' => $this->fillColor[$i],\n 'backgroundColor' => $this->fillColor[$i], // transparent background\n 'pointBorderColor' => $this->fillColor[$i],\n 'pointBackgroundColor' => $this->fillColor[$i], // strokeColor(line color),strokeColor and pointColor should be the same\n \"pointStrokeColor\" => $this->fillColor[$i]);\n array_push($dataset, $data);\n }\n\n \n if(count($arr_levels) > 1){\n $temp_arr = array();\n foreach ($totalData as $key => $value) {\n array_push($temp_arr,strval($value));\n }\n //\n $total_arr = array('label'=>\"Total\",\n 'data'=>$totalData,\n 'fill'=> false,\n 'pointRadius'=> 5,\n 'pointHitRadius'=> 10,\n 'borderColor' => $this->transFillColor,\n 'backgroundColor' => $this->transFillColor, // transparent background\n 'pointBorderColor' => $this->transFillColor,\n 'pointBackgroundColor' => $this->transFillColor, // strokeColor(line color),strokeColor and pointColor should be the same\n \"pointStrokeColor\" => $this->transFillColor);\n \n array_push($dataset, $total_arr); \n }\n //\n $result = array('labels' => $l_arr, \"datasets\" => $dataset);\n return $result;\n }", "private function getSkuSelectionList() {\r\n //$this->jsonOutput[\"skuSelectionList\"] = $this->settingVars->pageArray[\"SKU_SELECTION_LIST\"];\r\n\t\tif(isset($this->jsonOutput[\"settings\"]['sku_settings']) && $this->jsonOutput[\"settings\"]['sku_settings'] != \"\")\r\n\t\t\t$this->jsonOutput[\"skuSelectionList\"] = $this->jsonOutput[\"settings\"]['sku_settings'];\r\n }" ]
[ "0.62438357", "0.570148", "0.5421934", "0.5420962", "0.53625095", "0.517409", "0.51523143", "0.5120516", "0.510346", "0.5090855", "0.5054749", "0.5049899", "0.50401324", "0.50165623", "0.4974641", "0.4960896", "0.49574587", "0.49430105", "0.49391395", "0.49017552", "0.48735732", "0.48642552", "0.48486948", "0.48475167", "0.4842885", "0.4830023", "0.4812148", "0.48118097", "0.47862357", "0.47740147", "0.47700667", "0.47634602", "0.47555682", "0.47551566", "0.47430196", "0.47399464", "0.47395954", "0.47342724", "0.47283205", "0.4708779", "0.47081482", "0.47059512", "0.47059512", "0.47051156", "0.4701336", "0.4699119", "0.46934256", "0.4687689", "0.46856698", "0.46834594", "0.4677549", "0.46775293", "0.46743372", "0.46618894", "0.4661083", "0.4658098", "0.46488842", "0.46459725", "0.4645182", "0.46325645", "0.4629541", "0.46287292", "0.46283185", "0.46259823", "0.46255025", "0.46245503", "0.46172333", "0.46118087", "0.4605353", "0.45986196", "0.459398", "0.45913476", "0.45896164", "0.45862707", "0.45837325", "0.45815396", "0.457501", "0.45608854", "0.45589307", "0.4556647", "0.4555573", "0.45512864", "0.45480296", "0.45455083", "0.4543525", "0.4539096", "0.45357063", "0.45289528", "0.45276985", "0.45246193", "0.45242923", "0.45227608", "0.4522702", "0.45217794", "0.45125577", "0.4505234", "0.45038426", "0.45036754", "0.45029214", "0.45015153" ]
0.6380823
0
Gent Individual Id Sku Hierarchy Code From table Data //
public function getSkuLayerIdByCode ( $hierarchy_code ) { $this->db->select( 'id' ); $this->db->where( 'layer_code', $hierarchy_code ); $query = $this->db->get( 'tbld_sku_hierarchy' )->result_array(); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSkuHierarchy ()\n {\n $sql = \"select t1.id,t1.layer_name,t1.layer_code,t1.layer_description,t1.parent_layer_id,t2.id as parent_layer_id,\"\n . \" (Select b.layer_name from tbld_sku_hierarchy as b where t2.id = b.id) as parent_layer_name from tbld_sku_hierarchy as t1 left join tbld_sku_hierarchy as t2 on t2.id = t1.parent_layer_id \";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "public function getSkuHierarchyElements ()\n{\n\n// $sql = \"select t1.id as sku_hierarchy_element_by_id,t1.element_name,t1.element_code,t1.element_description,t1.element_category_id,t1.parent_element_id,\n// t2.id as parent_layer_id,t3.id,t3.layer_name as element_category,\n// (Select b.element_name from tbld_sku_hierarchy_elements as b where t2.id = b.id)\n// as parent_element_name from tbld_sku_hierarchy_elements\n// as t1 left join tbld_sku_hierarchy_elements as t2 on t2.id = t1.parent_element_id\n// left join tbld_sku_hierarchy as t3 on t2.element_category_id = t3.id \";\n $sql = \"SELECT t1.*,t1.id as sku_hierarchy_element_by_id,t2.layer_name as element_category,t3.element_name as parent_element_name FROM `tbld_sku_hierarchy_elements` as t1\n left join `tbld_sku_hierarchy` as t2 on t1.element_category_id=t2.id\n left join `tbld_sku_hierarchy_elements` as t3 on t1.parent_element_id=t3.id\";\n $query = $this->db->query( $sql )->result_array();\n\n return $query;\n\n}", "function cognitivefactory_get_subtree_list($table, $id) {\n global $DB;\n \n $res = $DB->get_records_menu($table, array('fatherid' => $id));\n $ids = array();\n if (is_array($res)) {\n foreach (array_keys($res) as $aSub) {\n $ids[] = $aSub;\n $subs = cognitivefactory_get_subtree_list($table, $aSub);\n if (!empty($subs)) $ids[] = $subs;\n }\n }\n return(implode(',', $ids));\n}", "public function getSkuName ()\n {\n $sql = \" SELECT t1.id,sku_name,sku_description,sku_code,sku_weight_id,sku_lpc,sku_volume,sku_launch_date,t8.sku_type_name,\n GROUP_CONCAT(t5.unit_name SEPARATOR '<br /><br />') AS unit,t2.quantity,\n GROUP_CONCAT(ROUND(t2.db_lifting_price,2) SEPARATOR '<br /><br />') as db_lifting_price ,\n GROUP_CONCAT(ROUND(t2.outlet_lifting_price,2) SEPARATOR '<br /><br />') AS outlet_lifting_price,\n GROUP_CONCAT(ROUND(t2.mrp_lifting_price,2) SEPARATOR '<br /><br /> ') AS mrp_lifting_price ,\n t3.element_name,t4.sku_active_status_name,t5.unit_name,t6.element_name as product,\n t7.element_name as catagory\n FROM tbld_sku AS t1\n INNER JOIN\n `tbli_sku_mou_price_mapping` AS t2\n ON t1.id = t2.sku_id\n INNER JOIN\n tbld_sku_active_status AS t4\n ON t1.sku_active_status_id = t4.id\n INNER JOIN\n tbld_sku_hierarchy_elements AS t3\n ON t1.parent_id = t3.id\n INNER JOIN\n tbld_unit AS t5\n ON t5.id= t2.mou_id\n left join tbld_sku_hierarchy_elements as t6\n on t6.id = t3.parent_element_id\n left join tbld_sku_hierarchy_elements as t7\n on t7.id = t6.parent_element_id\n left Join `tbld_sku_type` as t8\n On t1.sku_type_id=t8.id\n GROUP BY t2.sku_id\n ORDER BY t2.sku_id,t2.quantity asc\";\n $query = $this->db->query( $sql )->result_array();\n return $query;\n }", "function get_prefix($CategoryID)\n{\n global $tpl, $template, $config, $mysql, $lang, $twig, $prefixed;\n $ParentID = $mysql->result('SELECT parent_id FROM '.prefix.'_eshop_categories WHERE id = '.$CategoryID.' ');\n \n $prefixed[$CategoryID]['f'] .= '&nbsp;&nbsp;&nbsp;';\n #$add_prefix .= '&nbsp;&nbsp;&nbsp;'; \n {\n if ($ParentID == 0) \n { \n $add_prefix .= ''; \n }\n else\n {\n $prefixed[$CategoryID]['s'] .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n $add_prefix .= '<img src=\"/engine/plugins/eshop/tpl/img/tree.gif\">&nbsp;&nbsp;&nbsp;';\n \n foreach ($mysql->select(\"SELECT * FROM \".prefix.\"_eshop_categories WHERE id=\".$ParentID.\" \") as $row2)\n {\n $CategoryID2 = $row2['id']; \n $ParentID2 = $row2['parent_id'];\n }\n\n get_prefix($CategoryID2);\n }\n }\n #var_dump($prefixed[$CategoryID]);\n return $add_prefix;\n}", "function iso639families_complete_by_table($records) {\n\t$hierarchies =array();\n\t$loc_to_spip = $GLOBALS['iso_service']['iso639families']['add_fields']['loc'];\n\n\t// On récupère la page de description de la famille sur le site SIL.\n\tinclude_spip('inc/distant');\n\t$url = _CODELANG_LOC_ISO639_5_HIERARCHY;\n\t$options = array('transcoder' => true);\n\t$flux = recuperer_url($url, $options);\n\n\t// On décrypte la page et principalement le tableau pour en extraire la colonne hiérarchie\n\t// de chaque famille et créer la colonne parent dans la table iso639families.\n\tinclude_spip('inc/filtres');\n\t$table = extraire_balise($flux['page'], 'table');\n\tif ($table) {\n\t\t// On extrait la première table de la page qui contient les données voulues\n\t\t$rows = extraire_balises($table, 'tr');\n\t\tif ($rows) {\n\t\t\t// La première ligne du tableau est celle des titres de colonnes : on la supprime.\n\t\t\tarray_shift($rows);\n\t\t\tforeach ($rows as $_row) {\n\t\t\t\t// Chaque ligne de la table est composée de deux colonnes, le première le libellé\n\t\t\t\t// et la deuxième la valeur.\n\t\t\t\t$columns = extraire_balises($_row, 'td');\n\t\t\t\t$columns = array_map('supprimer_tags', $columns);\n\t\t\t\tif (count($columns) >= 2) {\n\t\t\t\t\t// La première colonne contient la hiérarchie et la seconde le code alpha-3 de la famille.\n\t\t\t\t\t$code = trim($columns[1]);\n\t\t\t\t\t$hierarchies[$code] = str_replace(array(' ', ':'), array('', ','), trim($columns[0]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// On complète maintenant le tableau des enregistrements avec la colonne additionnelle hierarchy et la colonne\n\t// dérivée parent qui ne contient que le code alpha-3 de la famille parente si elle existe.\n\tforeach($records as $_cle => $_record) {\n\t\t$code = $_record['code_639_5'];\n\t\t$records[$_cle]['parent'] = '';\n\t\tif (isset($hierarchies[$code])) {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = $hierarchies[$code];\n\t\t\t// Calcul du parent : si la hierarchie ne contient qu'un code c'est qu'il n'y a pas de parent.\n\t\t\t// Sinon, le parent est le premier code qui précède le code du record.\n\t\t\t$parents = explode(',', $hierarchies[$code]);\n\t\t\tif (count($parents) > 1) {\n\t\t\t\tarray_pop($parents);\n\t\t\t\t$records[$_cle]['parent'] = array_pop($parents);\n\t\t\t}\n\t\t} else {\n\t\t\t$records[$_cle][$loc_to_spip['Hierarchy']] = '';\n\t\t}\n\t}\n\n\treturn $records;\n}", "public function getTreeId() {}", "function cognitivefactory_tree_up($cognitivefactoryid, $userid, $groupid, $id, $istree = 1) {\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if (!$res) return;\n $operator = ($istree) ? 'hierarchize' : 'order' ;\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n if ($res->intvalue > 1) {\n $newordering = $res->intvalue - 1;\n\n $sql = \"\n SELECT \n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}' AND\n intvalue = {$newordering}\n {$treeClause}\n {$accessClause}\n \";\n // echo $sql;\n $result = $DB->get_record_sql($sql);\n $resid = $result->id;\n\n // swapping\n $opdata = new StdClass();\n $opdata->id = $resid;\n $opdata->intvalue = $res->intvalue;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "public function ddl_parentdetails()\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id, label\r\n\t\t\t\t\t\t\tFROM parents\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow['label'] =$row[2];\r\n\t\t\t\t\t$fsow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $fsow_arr;\r\n\t\t}", "function sci_building_level($userid,$id)\n {\n $db3 = new cl_extended_database;\n $db3->query(\"SELECT level FROM user_sci WHERE userid=$userid AND sciid=$id\"); $this->err();\n if($db3->numrows() <= 0)\n {\n unset($db3);\n //echo \"level 0<br>\";\n return 0;\n }\n else\n {\n $row = $db3->fetch();\n unset($db3);\n // echo \"level is \".$row['level'].\"<br>\";\n return $row['level'];\n }\n return -1;\n }", "protected function loadParentId(){return 0;}", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "public function getDataWithTypeLeveluid() {}", "function ingresar_subdetalles($data){\n\t\t$this->db->insert('mantenciones_subdetalles',$data);\n\t\treturn $this->db->insert_id();\n\t}", "function setLevel($level, $id = null){\n $arrLevel = ['', \"Super Admin\", \"Admin\", \"OPD\"];\n $nama = $arrLevel[$level];\n\n if($level == 3){\n\n // $this->db->join(\"tb_user_opd\", \"tb_user_opd.id_tb_user = tb_user.id_tb_user\", \"left\");\n\n // $this->db->join(\"tb_user_opd\", \"tb_user_opd.id_tb_user = tb_user.id_tb_user\", \"left\");\n\n // $this->db->where(\"id_tb_user\", $id);\n // $data = $this->db->get(\"tb_user\")->row();\n }\n\n return $nama;\n}", "function _getRubriekFromDb()\n {\n $menuData = array('items' => array(), 'parents' => array());\n\n $conn = getConn();\n $sql = \"SELECT RubriekID, Rubrieknaam, SuperRubriekID FROM Rubriek ORDER BY SuperRubriekID, Rubrieknaam\";\n $stmt = sqlsrv_prepare($conn, $sql);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n while ($menuItem = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $menuData['items'][$menuItem['RubriekID']] = $menuItem;\n $menuData['parents'][$menuItem['SuperRubriekID']][] = $menuItem['RubriekID'];\n }\n }\n return $menuData;\n }", "public function getModelID($data) {\n\t\t\t$this->db->select('IDTGK,UNITAP,UNITUP,IDPEL,NAMA,TARIF,DAYA,KOGOL,GARDU,ALAMAT,LEMBAR,RPPTL,RPBPJU,RPPPN,RPMAT,TAGSUS,UJL,BP,TRAFO,SEWATRAFO,SEWAKAP,RPTAG,RPBK,TANGGAL_TGK');\n\t\t\t$this->db->from('VIEW_TUNGGAKAN');\n\t\t\t$this->db->like('IDPEL', $data);\n\t\t\t$query = $this->db->get();\n\t\t\treturn $query->result_array();\n\t\t}", "function getDirectorHierarchy($director_id = TOP_DIRECTOR_ID)\t// March 17, 2008: 151 (Mike Woodard)\t\n {\n\t $sql = 'select distinct ';\n\t \n\t // Initialize column filters\n\t for ($lvl = 1; $lvl <= MAX_DIRECTOR_LEVELS; $lvl++)\n\t {\n\t\t $sql .= 'table'.$lvl.'.director_id as dir_lvl'.$lvl.',';\n\t\t $sql .= 'table'.$lvl.'.staff_id as staff_lvl'.$lvl.',';\n\t }\n\t $sql = substr($sql,0,-1);\t// remove comma\n\t $init_val = 1;\n\t $sql .= ' from '.RowManager_StaffDirectorManager::DB_TABLE.' as table'.$init_val;\n\t \n\t\t // Setup join portion of the SQL query \n\t for ($level = 2; $level <= MAX_DIRECTOR_LEVELS; $level++)\n\t {\t \n\t\t $sql .= ' LEFT JOIN '.RowManager_StaffDirectorManager::DB_TABLE.' as table'.$level;\n\t\t $sql .= ' on table'.$level.'.director_id = table'.(--$level).'.staff_id';\n\t\t $level++;\n\t }\n\t \n\t $sql .= ' where table'.$init_val.'.director_id = '.$director_id;\t \n\t\t\t\n// \t echo 'hier. = <br>'.$sql.'<BR><BR>';\n\t \n // create a new DB object\n $db = new Database_Site();\n $databaseName = $this->dbName;\n if ( $databaseName == '' )\n {\n $databaseName = SITE_DB_NAME;\n }\n $db->connectToDB( $databaseName, $this->dbPath, $this->dbUser, $this->dbPword );\n \n// echo \"<BR>sql = \".$sql;\n \n // run the sql\n $db->runSQL( $sql );\n \n // create a new ReadOnlyResultSet using current db object\n $recordSet = new ReadOnlyResultSet( $db );\n \n // return this record set\n return $recordSet;\t\t\t\n }", "function get_uraian($kode, $level)\n{\n switch ($level) {\n case 5:\n $where = \"\";\n break;\n case 4:\n $where = \" and SubSub is null\";\n break;\n case 3:\n $where = \" and sub is null and SubSub is null\";\n break;\n case 2:\n $where = \" and kelompok is null and sub is null and SubSub is null\";\n break;\n case 1:\n $where = \" and bidang is null and kelompok is null and sub is null and SubSub is null\";\n break;\n\n default:\n break;\n }\n $query = \"select Uraian from kelompok where Kode like '$kode%' $where limit 1\";\n $result = mysql_query ($query) or die(mysql_error());\n while ($row = mysql_fetch_array ($result)) {\n $Uraian = $row[ Uraian ];\n }\n return $Uraian;\n}", "function achieve_get_sub_category()\r\n{\r\n global $sql;\r\n\r\n $sub_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC\");\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n while ($sub_cat[$temp[\"ParentID\"]][$temp[\"ID\"]] = $temp[\"Name\"])\r\n {\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n }\r\n return $sub_cat;\r\n}", "public function grn_id(){\n return parent::get_fk_object(\"grn_id\");\n }", "public function myHierarchy_get(){\n\t\t$userId = $this->token_payload[\"user_id\"];\n\t\tresponse($this,true,200,$this->getAllAccessibleProfiles($userId));\n\t}", "public function getParentId(): string;", "function GetSubLevelsInStr( $spr, $level, $lang_id=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n if($level!=0)\n {\n $q = \"SELECT `node` FROM `\".$spr.\"` WHERE `level`='$level' group by level\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row=$db->db_FetchAssoc();\n $curr_node = $row['node'];\n }\n else\n $curr_node = 0;\n $q = \"SELECT MAX(`node`) as max FROM `\".$spr.\"`\";\n $res = $db->db_Query( $q );\n if( !$res )return false;\n $row = $db->db_FetchAssoc();\n $max_node = $row['max'];\n $rows = $max_node - $curr_node;\n $q='SELECT t0.cod as cod0 ';\n for($i=1; $i<=$rows;$i++)\n {\n $q.=', '.'t'.$i.'.cod as cod'.$i;\n }\n $q.= ' FROM '.$spr.' AS t0 ';\n for($i=1; $i<=$rows;$i++)\n {\n $q.='LEFT JOIN '.$spr.' AS t'.$i.' ON ( t'.$i.'.level = t'.($i-1).'.cod AND t'.$i.'.lang_id = t'.($i-1).'.lang_id) ';\n }\n $q.=' WHERE 1 ';\n $q = $q.\" AND t0.level = $level AND t0.lang_id='\".$lang_id.\"' ORDER BY t0.move \";\n $res = $db->db_Query( $q );\n// echo '<br>q='.$q.' res='.$res.' $db->result='.$db->result;\n if( !$res )return false;\n $rows_count = $db->db_GetNumRows();\n //echo '<br> $rows='.$rows;\n $mas = array();\n for( $i = 0; $i < $rows_count; $i++ )\n {\n $row=$db->db_FetchAssoc();\n for($j=0;$j<=$rows;$j++){\n if(!isset($mas[$row['cod'.$j]]) && !is_null($row['cod'.$j]))\n {\n $mas[$row['cod'.$j]] = $row['cod'.$j];\n }\n }\n }\n return implode(\",\",$mas);\n }", "function ext_tree($parent_id, $con, $lev, $info) {\n\n // rows selection from TBSM tables\n $sel = \"SELECT SERVICEINSTANCEID, SERVICEINSTANCENAME, DISPLAYNAME, SERVICESLANAME, TIMEWINDOWNAME\n\t\t\t\tFROM TBSMBASE.SERVICEINSTANCE, TBSMBASE.SERVICEINSTANCERELATIONSHIP\n\t\t\t\tWHERE PARENTINSTANCEKEY = '$parent_id' AND SERVICEINSTANCEID = CHILDINSTANCEKEY\";\n $stmt = db2_prepare($con, $sel);\n $result = db2_execute($stmt);\n\n $values = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n $values++;\n $info[$lev] = array (\n 'level' => $lev,\n 'endpoint' => false,\n 'id' => $row['SERVICEINSTANCEID'],\n 'service' => $row['SERVICEINSTANCENAME'],\n 'display' => $row['DISPLAYNAME'],\n 'template' => $row['SERVICESLANAME'],\n 'maintenance' => $row['TIMEWINDOWNAME'],\n );\n // unique value\n if (!in_array($row['SERVICEINSTANCEID'], array_column($GLOBALS['results'], 'id')))\n $GLOBALS['results'][] = $info[count($info)-1];\n\n // recursive function call\n ext_tree($row['SERVICEINSTANCEID'], $con, $lev+1, $info);\n }\n\n return ($values > 0);\n}", "private function MenusData($id_parent=0) {\n $i=0;\n $id_group = id_auth_group();\n if (!$id_group) {\n return;\n }\n $this->CI =& get_instance();\n $this->CI->load->database();\n $data = $this->CI->db\n ->join('auth_menu','auth_menu.id_auth_menu=auth_menu_group.id_auth_menu','left')\n ->where('auth_menu_group.id_auth_group',$id_group)\n ->where('auth_menu.parent_auth_menu',$id_parent)\n ->order_by('auth_menu.position','asc')\n ->order_by('auth_menu.id_auth_menu','asc')\n ->get('auth_menu_group')\n ->result_array();\n foreach ($data as $row => $val) {\n $data[$row]['children'] = $this->MenusData($val['id_auth_menu']);\n $i++;\n }\n return $data;\n }", "function get_alt_par_id($pri_id){\n\t\t$this->db->where('parentPrimary_uacc_id',$pri_id);\n\t\t$this->db->select('parentAlt_uacc_id',$pri_id);\n\t\t\n\t\t$qres=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($qres->num_rows()==1) {\n\t\t\t$row=$qres->row();\n\t\t\treturn ($row->parentAlt_uacc_id);\n\t\t}else{\n\t\t\t$this->firephp->log(\"Could not retrieve alt_parent user id\");\n\t\t\treturn 0;\n\t\t}\n\t}", "function SkuFromID($parametro){\n\t$db = new mysql();\n\t\n\t$result = $db->consulta(\"SELECT IDPRODUCTO,FECHA FROM \".PREFIX.\"productos WHERE IDPRODUCTO='\".$parametro.\"' LIMIT 1\");\n\t$row = $db->recuperar_array($result);\t\n\t$sku = $row['PRESKU'].$parametro;\n\treturn $sku;\n}", "public function codeByLevelId() {\n return $this->belongsTo('App\\Code', 'level_id', 'id')->select('id', 'txt');\n }", "function getRecursiveDamCat($id,$level=0) {\n $result = $id.','; # add id of 1st level \n $idList = explode(',',$id);\n \n if ($level > 0) {\n $level--;\n \n foreach ($idList as $key=>$value) {\n $where = 'hidden=0 AND deleted=0 AND parent_id='.$id;\n $res= $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'tx_dam_cat', $where);\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\t\n $all[$row['uid']]=$row['uid'];\n $rec = $this->getRecursiveDamCat($row['uid'],$level);\n if ($rec!='') {\n $result.=$rec.',';\n }\n }\n } # end for each\n } # end if level\n \t\n $result = str_replace(',,',',',$result);\n $result = substr($result,0,-1);\n return $result;\n }", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "function traverse_gallery_items($GalleryID, $Level=0) // find all GalleryItems within Gallery GalleryID\n{\n\t$GalleryTitle\t\t\t= db_sfq(\"SELECT Title FROM tblGalleries WHERE ID='{$GalleryID}'\");\n\t$NumGIChildren\t \t\t= db_sfq(\"SELECT COUNT(ID) FROM tblGalleryItems \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ParentGalleryID='{$GalleryID}'\");\n//\techo str_repeat(\". \",$Level) . \"G[$GalleryID]<b>{$GalleryTitle}</b> -{$Level}- &nbsp;GI children:$NumGIChildren<br>\";\n\t\n\t\n\t\n\t\n// ----------------------------------------\t GALLERY RECORD ---------------------------------------------\n ?>\n<tr style=\"background-color: yellow; color: blue;\">\n <td style='background-color:pink;'><a href=\"http://jazzhistorymuseum.org/db/admin/tblGalleries_view.php?SelectedID=<?=$GalleryID?>#detail-view\" target=\"_blank\">E</a></td>\n <td style=\"font-weight:bold;font-size:110%;color:white;background-color: brown;\">G</td>\n <td style=\"padding-left:<?=($Level*16) ?>px; text-indent:<?=(-$Level*16) ?>px;\"><b><?=str_repeat(\".&nbsp;&nbsp;&nbsp;\",$Level) . $GalleryTitle?></b></td>\n <td align=\"right\"><!-- need GI ID a href='<?=GalleryBaseURL.\"?gallery={$GalleryID}\"?>' --><?=$GalleryID?><!-- /a --></td> <!------------------------>\n <td></td><td></td><td></td>\n <td><?=db_sfq(\"SELECT COUNT(ID) FROM tblGalleryItems WHERE ParentGalleryID='{$GalleryID}'\")?></td> </tr>\n<?\n// ----------------------------------------\t END GALLERY RECORD ---------------------------------------------\n\n\n \n \n\t$Results = db_sql(\"SELECT * FROM tblGalleryItems WHERE ParentGalleryID='{$GalleryID}' ORDER BY Sort ASC, ID\");\n\tif (mysqli_num_rows($Results)==0) echo \"<tr><td colspan=7>&nbsp;&nbsp;&nbsp;<i>[no GalleryItems found for ParentGalleryID=={$GalleryID}]</i></td></tr>\";\n\t\n\t\n\t\n\twhile ($Row=mysqli_fetch_assoc($Results))\n\t{ // -------------------------------------------- FOR EACH GALLERY ITEM in this gallery $GalleryID -----------------------------------------\n\n\n\t\t$GalleryItemID\t\t\t= $Row['ID'];\n\t\t$GalleryItemURL\t\t\t= $Row['URL'];\n\t\t$SubGalleryID\t\t\t= $Row['SubGalleryID'];\n\t\t$ParentGalleryID\t\t= $Row['ParentGalleryID']; \n\t\t$GIPageTitle\t\t\t= $Row['PageTitle'];\n\t\t$GIContentTypeID\t\t= $Row['GIContentTypeID'];\n\t\t$SubGalleryTypeDisplay\t= $GIContentTypeID;\n\t\t\tif ($GIContentTypeID==GIContentType_RemoteURL OR $GIContentTypeID==GIContentType_JHDBURL) \t\n\t\t\t\t\t\t$SubGalleryTypeDisplay = \"<a href='$GalleryItemURL' target='_blank'>URL</a>\"; // complete URL self-contained\n\t\t\tif ($GIContentTypeID==GIContentType_ContentURL) \t$SubGalleryTypeDisplay = \"<a href='\".GalleryBaseURL.\"?u={$GalleryItemURL}' target='_blank'>URL</a>\";\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery) \t$SubGalleryTypeDisplay = \"SubGallery\";\n\t\t\tif ($GIContentTypeID==GIContentType_Image) \t\t\t$SubGalleryTypeDisplay = \"Image\";\n\t\t\tif ($GIContentTypeID==GIContentType_Audio) \t\t\t$SubGalleryTypeDisplay = \"Audio\";\n\t\t\tif ($GIContentTypeID==GIContentType_Video) \t\t\t$SubGalleryTypeDisplay = \"Video\";\n\t\tif ($GIContentTypeID==GIContentType_SubGallery AND ($SubGalleryID <= 0 OR $SubGalleryID == $GalleryID)) \n\t\t{\n\t\t\t?><tr><td colspan=8>Warning traverse_gallery_items(<?=$GalleryID?>) GalleryItemsID(<?=$GalleryItemID?>): ParentGalleryID=<?=$GalleryID?> with SubGalleryID=<?=$SubGalleryID?> </td></tr>\n <?\n\t\t} else //no error\n\t\t{\n\t\t\t$NextLevelGalleryInfo \t= \"\";\n\t\t\t//if ($SubGalleryTypeID==MediaType_SubGallery) FIX ME\n\t\t\t\t$NextLevelGalleryExists = db_sfq(\"SELECT COUNT(ID) FROM tblGalleries WHERE ID='{$SubGalleryID}'\");\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery AND $NextLevelGalleryExists==0) $NextLevelGalleryInfo \t= \"(SubGallery entry does not exist yet) \";\n\t\t\n\t\t\n\t\t\n\t\t\n// ----------------------------------------\t GALLERY ITEM RECORD ---------------------------------------------\n\t\t?>\n<tr <?= ($GIContentTypeID==GIContentType_SubGallery?\"style='background-color:lightblue;'\":\"style='background-color:lightgrey;'\")?>>\n<td style='background-color:cyan;'><a href=\"http://jazzhistorymuseum.org/db/admin/tblGalleryItems_view.php?SelectedID=<?=$GalleryItemID?>#detail-view\" target=\"_blank\">E</a></td>\n<td>GI</td><td style=\"padding-left:<?=($Level*16) ?>px; text-indent:<?=(-$Level*16) ?>px;\"><?=str_repeat(\".&nbsp;&nbsp;&nbsp;\",$Level) . $GIPageTitle?></td>\n<td align=\"left\" style='color:grey;' ><em><a href='<?=GalleryBaseURL.\"?gi={$GalleryItemID}\"?>'><?=$GalleryItemID?></a>\n</em></td><td><?=$ParentGalleryID?></td><td><?=$SubGalleryID?></td>\n<td><?=$SubGalleryTypeDisplay?></td><td><?=$NextLevelGalleryInfo?></td> </tr>\n \t<?\t\n// ----------------------------------------\t END GALLERY ITEM RECORD ---------------------------------------------\n\n\t\t\n\t\t\n\t\t\n\t\t\tif ($GIContentTypeID==GIContentType_SubGallery)\n\t\t\t\ttraverse_gallery_items($SubGalleryID, $Level+1 );\n\t\t} // end else no error \n\t}// end while\n\t\n}", "function plexIDToUsername($id, $data) {\n\t foreach ($data->User as $usr){\n\t\tif ($usr->attributes()['id'] == $id) {\n\t\t\treturn $usr->attributes()['username'];\n\t\t\tbreak;\n\t\t}\n\t }\n }", "public function drawGrandparent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT title FROM pages WHERE guid = {$this->getGrandparent()}'\"); \n\t\t\treturn $data;\n\t\t}", "public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }", "function objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $curid)\r\n{\r\n\t$ret = $curid;\r\n\r\n\tif ($curid)\r\n\t{\r\n\t\t$result = $dbh->Query(\"select $parentfld from $tbl where $idfld='$curid'\");\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$val = $dbh->GetValue($result, 0, $parentfld);\r\n\t\t\tif ($val)\r\n\t\t\t{\r\n\t\t\t\t$ret = objFldHeiarchRoot($dbh, $idfld, $parentfld, $tbl, $val);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $ret;\r\n}", "private function getExistingKinInfo($id) \n {\n $this->db->select('kin_name, kin_relationship, kin_telephone');\n //where $id = GUID \n $this->db->where('GUID', $id);\n //from the users table\n $query = $this->db->get('users');\n return $query;\n \n }", "function getParentClassificationId($classId,$parentId=0) {\n\n $conn = $this->dbConnection();\n\n\n $sql = \"SELECT ClassificationId,T_ParentClassificationId FROM t2_sa_classifications.T_Classifications\n WHERE ClassificationId = \".$classId;\n\n $res = $conn->query($sql);\n if(isset($res) && $res->num_rows > 0) {\n\n while($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $classId = $row['ClassificationId'];\n $parent = $row['T_ParentClassificationId'];\n }\n }\n // echo $parent.\"<br/>\";\n if(isset($parentId) && $parentId !='') {\n $parentLevel = $parentId;\n } else {\n $parentLevel=0;\n }\n\n if($parent <= $parentLevel) {\n $this->classParentId = $classId;\n } else {\n $this->getParentClassificationId($parent);\n }\n\n return true;\n }", "function rst_load_parents($appGlobals,$keyType, $keyValue) {\n // includes kidProgram data when not using kidId (maybe need flag for this)\n $fields = array();\n $fields = dbRecord_parentFamilyCombo::stdRec_addFieldList($fields);\n $fields = stdData_kidProgram_exRecord::stdRec_addFieldList($fields);\n $fieldList = \"`\".implode(\"`,`\",$fields).\"`\";\n $sql = array();\n //???????? need kid program so can load all parents for program\n $sql[] = \"SELECT \".$fieldList;\n switch ($keyType) {\n case ROSTERKEY_KIDID:\n $sql[] = \"FROM `ro:kid`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"WHERE `rKd:KidId` ='{$keyValue}'\";\n break;\n case ROSTERKEY_KIDPERIODID:\n $sql[] = \"FROM `ro:kid_period`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPe:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPe:KidPeriodId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentId`\"; // each row is a unique parent\n break;\n case ROSTERKEY_KIDPROGRAMID:\n $sql[] = \"FROM `ro:kid_program`\";\n $sql[] = \"JOIN `ro:kid` ON `rKd:KidId` = `rKPr:@KidId`\";\n $sql[] = \"JOIN `ro:family` ON `rFa:FamilyId` = `rKd:@FamilyId`\";\n $sql[] = \"JOIN `ro:parentalunit` ON `rPU:@FamilyId` = `rFa:FamilyId`\";\n $sql[] = \"JOIN `ro:kid_program` ON `rKPr:KidProgramId` = `rKPe:@KidProgramId`\";\n $sql[] = \"WHERE `rKPr:KidProgramId` ='{$keyValue}'\";\n $sql[] = \"GROUP BY `rPU:ParentIdt`\"; // each row is a unique parent\n break;\n }\n $sql[] = \"ORDER BY `rPU:ContactPriority`\";\n $query = implode( $sql, ' ');\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n while ($row=$result->fetch_array()) {\n $kidId = $row['rKd:KidId'];\n $kidProgramId = $row['rKPr:KidProgramId'];\n $kid = $this->rst_get_kid($kidId);\n if ( $kid->rstKid_parent == NULL) {\n $kid->rstKid_parent = new dbRecord_parentFamilyCombo;\n if ( !isset($this->rst_map_kidProgram[$kidProgramId]) ) {\n $kidProgram = new stdData_kidProgram_exRecord;\n $kidProgram->stdRec_loadRow($row);\n $this->rst_map_kidProgram[$kidProgramId] = $kidProgram;\n }\n }\n $kid->rstKid_parent->stdRec_loadRow($row);\n }\n}", "public function getLevel($idEntry);", "public function getSKUPartsData() {\n $partsData = DB::table('part_number')->select('SKU', 'id')->get();\n $sku = '';\n $sku .=\"<option value='\" . '' . \"' selected='selected' > select sku</option>\";\n foreach ($partsData as $key => $value) {\n $sku .=\"<option value='\" . $value->id . \"'>\" . $value->SKU . \"</option>\";\n }\n return $sku;\n }", "public function getRowTgkByID($data) {\n\t\t\t$this->db->select('IDTGK,UNITAP,UNITUP,TB_TUNGGAKAN.IDPEL,NAMA_PEL AS NAMA,TARIF,DAYA,KOGOL,GARDU,ALAMAT,LEMBAR,RPPTL,RPBPJU,RPPPN,RPMAT,TAGSUS,UJL,BP,TRAFO,SEWATRAFO,SEWAKAP,RPTAG,RPBK,TGL_AKHIR AS TANGGAL_TGK,KALITGK,KOORDX,KOORDY');\n\t\t\t$this->db->from('TB_TUNGGAKAN');\n\t\t\t$this->db->join('TB_PELANGGAN', 'TB_TUNGGAKAN.IDPEL = TB_PELANGGAN.IDPEL');\n\t\t\t$this->db->where_not_in('TB_TUNGGAKAN.IDPEL', '0');\n\t\t\t$this->db->like('TB_TUNGGAKAN.IDTGK', $data);\n\t\t\t$query = $this->db->get();\n\t\t\treturn $query->row_array();\n\t\t}", "public function hierarchy() : int\n {\n return DB::table('ranks')\n ->join('user_ranks', 'ranks.rank_id', '=', 'user_ranks.rank_id')\n ->where('user_id', $this->id)\n ->max('ranks.rank_hierarchy');\n }", "function get_user_role($u_id){\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'group_id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'id'),$u_id);\t\n\t\t$qres=$this->db->get($this->auth->tbl_user_account);\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_group_fk'].\"for email=\".$email);\n\t\t\tswitch ($row['uacc_group_fk']){\n\t\t\t\tcase (1):\n\t\t\t\t\treturn \"Parent\";\n\t\t\t\tcase (2):\n\t\t\t\t\treturn \"Student\";\n\t\t\t\tcase (3):\n\t\t\t\t\treturn \"Admin\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}", "public function get_segment_value()\n\t{\n\n\t\t$struc_id = $this->session->userdata('struc_id');//4\n\t\t$segment_no = $this->session->userdata('segment_no');//5\n\t\t$qualifier_id = $this->session->userdata('qualifier_id');//7\n // var_dump($qualifier_id);\n // exit;\n \n $segment_id = $this->uri->segment(4);\n // var_dump($struc_id);\n // exit;\n\n \n \n\t\t\n\t\t $segmet_val = $this->db->query(\"SELECT SEGMENT_VAL_NATURE_ID,SEGMENT_NATURE_DESC FROM WIZ_SEGMENT_VALUE_NATURE_MT \n\t\t \t\t\t\t\t\t\twhere QUALIFIER_ID =$qualifier_id\");\n\t\t\t \n\t\t $nature_id=$segmet_val->result_array();\n\t\t\t\n\t\t\t// on click of any child or parent on tree get its description on usegform\n\n\t\t$qry1 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT01 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry2 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT02 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry3 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT03 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry4 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT04 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry5 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT05 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry6 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT06 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry7 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT07 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry8 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT08 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry9 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT09 WHERE STRUCTURE_ID=$struc_id\");\n\t\t$qry10 = (\"SELECT SEGMENT_VALUE_DESC FROM WIZ_SEGMENT10 WHERE STRUCTURE_ID=$struc_id\");\n\n\t\t\tif($segment_no == 1)\n\t\t\t{\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry1.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry1;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\t\t\telse if($segment_no == 2)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry2.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry2;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telse if($segment_no == 3)\n\t\t\t{\t\t\t\n\t\t\t\t\n\t\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry3.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry3;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 4)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry4.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry4;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 5)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry5.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry5;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 6)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry6.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry6;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 7)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry7.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry7;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 8)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry8.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry8;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 9)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry9.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry9;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($segment_no == 10)\n\t\t\t{\t\t\t\n\t\t\t\tif(!empty($segment_id)){\n\t\t\t\t\t\t$queryy = $qry10.\" and SEGMENT_ID=$segment_id \";\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$queryy = $qry10;\n\t\t\t\t\t\t$qry_str = $this->db->query($queryy);\n\t\t\t\t\t\t$seg_id = $qry_str->result_array();\n\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t\treturn array('nature_id'=>$nature_id,'seg_id',$seg_id);\n\n\t\t\t\n\n\t\t\t \n\t}", "public function id_sub_kriteria()\n {\n $q = $this->db->query(\"select MAX(RIGHT(id_sub_kriteria,5)) as id_max from tbl_sub_kriteria\");\n $id = \"\";\n if ($q->num_rows() > 0) {\n foreach ($q->result() as $k) {\n $tmp = ((int) $k->id_max) + 1;\n $id = sprintf(\"%05s\", $tmp);\n }\n } else {\n $id = \"00001\";\n }\n return \"SKR-\" . $id;\n }", "private function get_ancestry($html, $rec) //$rec here is just for debug\n {\n $final = array();\n if(preg_match(\"/<div id=\\'totaxonomicTree\\'(.*?)<\\/div>/ims\", $html, $arr)) {\n if(preg_match_all(\"/<li>(.*?)<\\/li>/ims\", $arr[1], $arr2)) {\n foreach($arr2[1] as $str) {\n $str = str_replace(\" \", \"\", $str);\n $tmp = explode(\":\", $str);\n $tmp = array_map('trim', $tmp);\n $final[strtolower($tmp[0])] = $tmp[1];\n }\n // print_r($final); exit;\n return $final;\n }\n }\n else { //this else block is just for debug purposes\n /*\n if(in_array($rec['taxon_id'], array(95039, 95040, 78183, 108068, 107786, 92832, 107788, 90892, 90245, 108160, 87383, 108067, 106720, 102603, 108161))) {} //these taxon_id's are for dieseases names e.g. 'African swine fever' OR non-taxon names\n elseif(in_array($rec['taxon_id'], array(121671, 120803, 120994, 109730))) {} //acceptable to have no ancestry e.g. 'Bothriocephalus acheilognathi infection' but with ranges\n else {\n print_r($rec);\n echo(\"\\nInvestigate no ancestry\\n\");\n }\n if($rec['taxon_ranges']) {\n echo(\"\\nInvestigate no ancestry. Ranges total: \".count($rec['taxon_ranges']).\"\\n\");\n }\n */\n }\n return $final;\n }", "function cognitivefactory_tree_down($cognitivefactoryid, $userid, $groupid, $id, $istree=1) {\n global $CFG, $DB;\n\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n $operator = ($istree) ? 'hierarchize' : 'order' ;\n $accessClause = cognitivefactory_get_accessclauses($userid, $groupid, false);\n $treeClause = ($istree) ? \" AND itemdest = {$res->itemdest} \" : '';\n\n $sql = \"\n SELECT \n MAX(intvalue) AS ordering\n FROM \n {cognitivefactory_opdata} AS od\n WHERE\n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}'\n {$treeClause}\n {$accessClause}\n \";\n $resmaxordering = $DB->get_record_sql($sql);\n $maxordering = $resmaxordering->ordering;\n if ($res->intvalue < $maxordering) {\n $newordering = $res->intvalue + 1;\n\n $sql = \"\n SELECT \n id\n FROM \n {cognitivefactory_opdata} AS od\n WHERE \n cognitivefactoryid = {$cognitivefactoryid} AND\n operatorid = '{$operator}' AND\n intvalue = {$newordering}\n {$treeClause}\n {$accessClause}\n \";\n $result = $DB->get_record_sql($sql);\n $resid = $result->id;\n\n // swapping\n $opdata = new StdClass();\n $opdata->id = $resid;\n $opdata->intvalue = $res->intvalue;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n\n $opdata = new StdClass();\n $opdata->id = $id;\n $opdata->intvalue = $newordering;\n $DB->update_record('cognitivefactory_opdata', $opdata);\n }\n}", "function GetTopLevel( $spr, $level, $lang_id=NULL )\n {\n $db = DBs::getInstance();\n if( empty($lang_id) ) $lang_id = $this->lang_id;\n $q = \"SELECT * FROM `\".$spr.\"` WHERE `cod`='\".$level.\"'\";\n if( !empty($lang_id) ) $q = $q.\" AND `lang_id`='\".$lang_id.\"'\";\n $q = $q.\" GROUP BY `cod`\";\n $res = $db->db_Query( $q );\n //echo '<br> $q='.$q.' $res='.$res.' $db->result='.$db->result;\n if( !$res OR !$db->result )return false;\n $row = $db->db_FetchAssoc();\n return $row;\n }", "function get_menu_tree($parent_id) \n\t\t{\n\t\t\tinclude_once('connection.php');\n \t$obj=new connection();\n \t$obj->connect();\n\t\t\t$menu='';\n\t\t\t$obj->sql=\"SELECT * FROM register where referral_code='\".$parent_id.\"'\";\n\t\t\t$obj->select($obj->sql);\n\t\t\t//$no1=mysqli_num_rows($obj->res);\n\t\t\twhile($rows1=mysqli_fetch_array($obj->res))\n\t\t\t{\n\t\t\t\t//$rows1=mysqli_fetch_array($obj->res);\n\t\t\t\t$menu.=\"<li>\". $rows1['name'];\n\t\t\t\t$menu.=\"<ul>\".get_menu_tree($rows1['rid']).\"</ul>\";\n\t\t\t\t$menu.=\"</li>\";\n\t\t\t}\n\t\t\treturn $menu;\n\t\t}", "public function parentIdColumn($prefix = '');", "function navi_array()\n\t{\n\t\t$navifromdb = $this->connection->db_assoc(\"SELECT * FROM `$this->navi_table` ORDER BY `id` ASC\");\n\n\t\t$navi = array();\n\t\tfor ($i=0;$i<count($navifromdb);$i++)\n\t\t{\n\t\t\t$rubrik_key = $navifromdb[$i]['Rubrik_key'];\n\t\t\tif ($navifromdb[$i]['Hierarchy']==0)\n\t\t\t{\n\t\t\t\t$navi[$rubrik_key]['Rubrik'] = $navifromdb[$i]['Rubrik'];\n\t\t\t\t$navi[$rubrik_key]['Show'] = $navifromdb[$i]['Show'];\n\t\t\t\t$navi[$rubrik_key]['Show_to'] = ($navifromdb[$i]['Show_to'] != '') ? explode(',',$navifromdb[$i]['Show_to']):'';\n\t\t\t\t$navi[$rubrik_key]['Modul'] = $navifromdb[$i]['Modul'];\n\t\t\t\t$navi[$rubrik_key]['ext_link'] = $navifromdb[$i]['ext_link'];\n\n\n\t\t\t\t$navi[$rubrik_key]['Subnavi'] = array();\n\t\t\t}\n\t\t\telse if ($navifromdb[$i]['Hierarchy']==1)\n\t\t\t{\n\t\t\t\t$page_key = $navifromdb[$i]['Page_key'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Seite'] = $navifromdb[$i]['Seite'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Show'] = $navifromdb[$i]['Show'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Show_to'] = ($navifromdb[$i]['Show_to'] != '') ? explode(',',$navifromdb[$i]['Show_to']):'';\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['Modul'] = $navifromdb[$i]['Modul'];\n\t\t\t\t$navi[$rubrik_key]['Subnavi'][$page_key]['ext_link'] = $navifromdb[$i]['ext_link'];\n\n\t\t\t}\n\n\t\t}\n\t\treturn $navi;\n\t}", "function interface_ar_grp_data_get($gid,$pid,$mid)\n\t\t\t{\n\t\t\t\t$sql = 'SELECT ar.*, usr.usr as name FROM '. $this->tbl_usr_ar.' AS ar, '.$this->tbl_usr.' AS usr WHERE ar.mid='.$mid.' AND ar.pid = '.$pid.' AND ar.uid=usr.id AND usr.id = '.$uid;\n\t\t\t\t\n\t\t\t\t\t$sql = 'SELECT ar.*, grp.name FROM '. $this->tbl_grp_ar.' AS ar, '.$this->tbl_grp.' AS grp '.\n\t\t\t\t\t\t\t\t' WHERE ar.mid='.$mid.' AND ar.pid='.$pid.' AND ar.gid=grp.id AND grp.id = '.$gid;\n\t\t\t\t\n\t\t\t\t$usr_ar = $this->DB->query($sql);\n\t\t\t\t//-- wurden die rechte von anderer seite geerbet ?\n\t\t\t\t$inherit_pid = (int)$usr_ar->f('inherit_pid');\n\t\t\t\tif ($inherit_pid > 0 && $inherit_pid != $pid)\n\t\t\t\t{\n\t\t\t\t\t$inheritet_from = $this->_get_path_print($inherit_pid);\n\t\t\t\t}\t\n\t\t\t\twhile($usr_ar->next()) \n\t\t\t\t{\n\t\t\t\t\t$data['info']['usr'][$usr_ar->f('uid')] = array\n\t\t\t\t\t(\n\t\t\t\t\t\t'name' => $usr_ar->f('name'),\n\t\t\t\t\t\t'ar' => $usr_ar->f('ar'),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}", "function get_hierarchy_data($optparent=null,$branchparent=0,$published=null,$maxlevel=9999)\n {\n\n /*\n chu y khi lay du lieu\n Khi lay ta len nhom du lieu theo parent id de qua trinh su li phia sau duoc nhanh chong\n */\n $data=$this->_prepareData(null,$optparent,$published) ;\n //pr($data);\n $children=$this->_make_relation($data) ;\n // echo \"<br>---list Child----<br>\"; print_r($children);\n\n $list = $this->_data_recurse($branchparent, $children, array(), $maxlevel,0,'',$data);\n //echo \"<br>---list ----<br>\"; print_r($list);\n\n return $list;\n }", "function getTransDropDown(){\n\t\t $data = array();\n\t $this->db->select('*');\n\t\t\t$this->db->from('segment_name');\n\t\t\t$this->db->where('segment_type_id',6);\n\t\t\t $Q = $this->db->get();\n\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t\t {\n\t $data[$row['id']] = $row['segment_name'];\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t }", "function getClientDropdown2()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->parentname]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "function level($id) {\n\t\tif (exist(\"pages\", \"id\", $id)) {\n\t\t\t$nextPage = query(\"SELECT * FROM `pages` WHERE `id` = '{$id}'\");\n\t\t\treturn \"&nbsp;&nbsp;&nbsp;\" . level($nextPage['parentPage']);\n\t\t}\n\t}", "public function getOrganizerLevel() \n {\n $this->db->select(\"tol_code, tol_code ||' - '|| tol_desc as tol_code_desc\");\n $this->db->from('ims_hris.training_organizer_level');\n $this->db->order_by('tol_code');\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function getUnikKode($table) {\n $this->setConnection('dbsystem');\n $db = $this->getConnection(); \n $q = $db->query(\"SELECT MAX(RIGHT(kode_musrenbang,4)) AS kode FROM \".$table); $kd = \"\"; \n \n //kode awal \n if($q->num_rows()>0){ //jika data ada \n\n foreach($q->result() as $k){ \n //string kode diset ke integer dan ditambahkan 1 dari kode terakhir\n $tmp = ((int)$k->kode)+1;\n \n //kode ambil 4 karakter terakhir \n $kd = sprintf(\"%04s\", $tmp); \n } \n }else{ \n //jika data kosong diset ke kode awal \n $kd = \"0001\"; \n } \n\n //karakter depan kodenya\n $kar = \"MR\"; \n \n //gabungkan string dengan kode yang telah dibuat tadi \n return $kar.$kd; \n }", "public function parentmenus() {\n $this->db->where('menuparentid', \" \"); \n $this->db->order_by('serialid', \"asc\");\n $query = $this->db->get('menu');\n return $query->result();\n }", "public function getLevelId(){\n\t\treturn $this->level_id;\n\t}", "function genSMGrp($empId) {\n $select = ['employe_table_employe_id', 'employe_table_employe_name', 'employe_table_employe_hierarchy'];\n $this->db->select($select);\n $this->db->order_by('employe_table_employe_name', 'ASC');\n\n $empInfo = $this->db->get_where('employe_table', array('under_SM_EmpId' => $empId))->result_array();\n foreach ($empInfo as $value) {\n $empArr[$value['employe_table_employe_name']] = $value;\n }\n return $empInfo;\n }", "function dataset2htmloptions($ds, $selected_urns, $level=0, $selfId)\n{\n\t$h = '';\n\tforeach ($ds as $root)\n\t{\n\t\t$prefix = '';\n\t\tfor ($i=0; $i < $root->_level; $i++) \n\t\t{\n\t\t\tif ($i>=1) \n\t\t\t{\n\t\t\t\t$prefix .= \"-\";\n\t\t\t\t$suf = ' ';\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($selected_urns && in_array($root->urn, $selected_urns))\n\t\t\t$sel = 'SELECTED';\n\t\telse\n\t\t\t$sel = '';\n\t\t$t = '';\n\t\t//if ($root->uri) $t .= \"/{$root->uri}/ \";\n\t\tif ($root->adminview) $t .= $root->adminview;\n\t\telse if ($root->title) $t .= $root->title; // {$root->id} {$root->_parent}\t\t\n\t\telse if ($root->uri) $t .= $root->uri;\t\t\t\t\n\t\telse $t .= $root->urn;\n\t\t$disabled = '';\n\t\tif ($selfId == $root->id) $disabled = 'disabled=\"disabled\"';\n\t\t// style='background: red; color: green;'\n if (mb_strlen($t) > 40) $t = mb_substr($t,0,30).'...'.mb_substr($t,-10);\n\t\t$h .= \"<option $disabled data-level='{$root->_level}' $sel value='{$root->urn}'>{$prefix}{$suf}{$t}</option>\\n\"; // {$root->id}/{$root->_parent}\n\t\t/**\n\t\tDISABLE RECURSIVE LOADING\n\t\tif ($ds->entity->has_field('_parent')) $h .= load_taxonomy($ds->entity, $selected_urns, $root->id, $level, $selfId);\n\t\t*/\n\t}\n\t\n\treturn $h;\n}", "function do_offset($level){\r\n $offset = \"\"; // offset for subarry\r\n for ($i=1; $i<$level;$i++){\r\n $offset = $offset . \"<td></td>\";\r\n }\r\n return $offset;\r\n}", "public function GetSons($data,$id=0){\n $sons=array();\n foreach($data as $item){\n if($item->parent_id==$id)\n $sons[]=$item;\n }\n return $sons;\n }", "function get_pri_par_id($alt_id){\n\t\t$this->db->where('parentAlt_uacc_id',$alt_id);\n\t\t$this->db->select('parentPrimary_uacc_id');\n\t\t$qres=$this->db->get(TWELL_FAM_PROF_TBL);\n\t\tif ($qres->num_rows()==1) {\n\t\t\t$row=$qres->row();\n\t\t\t//$this->firephp->log(\"Pri id= \".$row->parentPrimary_uacc_id);\n\t\t\treturn ($row->parentPrimary_uacc_id);\n\t\t}else{\n\t\t\t$this->firephp->log(\"Could not retrieve pri_parent user id\");\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getModelUP($idup) {\n\t\t\t$this->db->select('UNITUP,RAYON');\n\t\t\t$this->db->from('TB_UNITUP');\n\t\t\t$this->db->where('UNITAP', $idup);\n\t\t\t$query = $this->db->get();\n\t\t\treturn $query->result_array();\n\t\t}", "function cekChildMenu2($id) {\n if ($this->session->userdata('group_id') == 99) {\n if ($this->input->get('extraparams') != '') {\n $xtraparam = explode(\":\", $this->input->get('extraparams'));\n\n //buang alias\n $pecah = explode(\".\", $xtraparam[0]);\n if (count($pecah) > 1) {\n $field = $pecah[1];\n } else {\n //gak pake alias\n $field = $xtraparam[0];\n }\n //\n\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => 99, $field => $xtraparam[1]));\n } else {\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => 99));\n }\n } else {\n if ($this->input->get('extraparams') != '') {\n $xtraparam = explode(\":\", $this->input->get('extraparams'));\n\n //buang alias\n $pecah = explode(\".\", $xtraparam[0]);\n if (count($pecah) > 1) {\n $field = $pecah[1];\n } else {\n //gak pake alias\n $field = $xtraparam[0];\n }\n //\n\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => 99, $field => $xtraparam[1]));\n } else \n {\n if($this->session->userdata('group_id')==1)\n {\n //administrator\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => $this->input->post('idunit')));\n } else {\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => $this->session->userdata('idunit')));\n }\n \n }\n }\n\n if ($this->input->get('idunit') != '') {\n //rekues dari input pembelian\n// echo $this->db->last_query();\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => $this->input->get('idunit')));\n } else if($this->input->get('namaunit')!='')\n {\n $qunit = $this->db->get_where('unit',array('namaunit'=>$this->input->get('namaunit')))->row();\n $q = $this->db->get_where('account', array('idparent' => $id, 'idunit' => $qunit->idunit));\n } else {\n $q = $this->db->get_where('account', array('idparent' => $id));\n }\n\n if ($q->num_rows() > 0) {\n return 'false';\n } else {\n return 'true';\n }\n }", "private function getPrefix($data)\n {\n if($data['type'] == 1)\n { \n return $this->courseRepository->find($data['course_id'])->abbr;\n } \n else if($data['type'] == 2)\n {\n return \"PROF\";\n }\n else\n {\n return \"ADMIN\";\n }\n }", "public function getSubclassId();", "function genTLGrp($empId) {\n $select = ['employe_table_employe_id', 'employe_table_employe_name', 'employe_table_employe_hierarchy'];\n $this->db->select($select);\n $this->db->order_by('employe_table_employe_name', 'ASC');\n\n $empInfo = $this->db->get_where('employe_table', array('under_TL_EmpId' => $empId))->result_array();\n foreach ($empInfo as $value) {\n $empArr[$value['employe_table_employe_name']] = $value;\n }\n return $empArr;\n }", "public function ddl_parent($var)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$search = \"SELECT DISTINCT parent_id, label_id\r\n\t\t\t\t\t\t\tFROM parents where label='\".$var.\"';\";\r\n\t\t\t\t$resultq = mysqli_query($link, $search);\r\n\t\t\t\t$sow = array();\r\n\t\t\t\t$sow_arr = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($resultq)) {\t\r\n\t\t\t\t\t$sow['parent_id'] =$row[0];\r\n\t\t\t\t\t$sow['label_id'] =$row[1];\r\n\t\t\t\t\t$sow_arr[] = $sow;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $sow_arr;\r\n\t\t}", "function getLevel($gid)\n {\n return 0;\n }", "function lisaa_sukulainen($heppa, $rowspan){\n\t\t\t\t\t\tif(!isset($heppa->id)){\n\t\t\t\t\t\t\treturn 'tuntematon';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$str = '<span>'.$heppa->nimi.'</span>';\n\n\n\t\t\t\t\t\tif($heppa->hae_url() != \"\"){\n\t\t\t\t\t\t\t$str = '<span><a href=\"'.$heppa->hae_url().'\" target=\"_blank\">'.$heppa->nimi.'</a></span>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($heppa->status != \"\" && $heppa->status != \"kuollut\" ){\n\t\t\t\t\t\t\t$str = $str.' <span class=\"status\">'.$heppa->status.'</span>';\n\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\tif($heppa->rotu_lyhenne != \"\"){\n\t\t\t\t\t\t\t$str = $str.\"<br /><small>\".$heppa->rotu_lyhenne.\"-\".$heppa->sukupuoli;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($heppa->saka){\n\t\t\t\t\t\t\t$str = $str.\", \".$heppa->saka.\" cm\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($heppa->vari != \"\"){\n\t\t\t\t\t\t\t$str = $str.\", \".$heppa->vari;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif($heppa->meriitit != \"\"){\n\t\t\t\t\t\t\t$str = $str.\"<br /><strong><small>\".$heppa->meriitit.'</small></strong>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $str;\n\t\t\t\t\t}", "function get_suite_by_folder_depth($depth, $db)\n{\n $length = $depth * TL_NODE_ABS_LENGTH;\n $sql = \"select nh.`name` as `name`, nh.id as id, \" .\n \"nh.parent_id as parent_id, nh.node_depth_abs as abs from \".\n $db->get_table('nodes_hierarchy') . \" nh \" .\n \" where \" .\n \"length(nh.node_depth_abs) = \". $length . \" and nh.node_type_id = 2\";\n $result = $db->fetchRowsIntoMap($sql, 'id');\n \n return $result;\n}", "private function value_source_uid($data){\n\t\t\tif(isset($data->id))\n\t\t\t\treturn $data->id;\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}", "public function addSkil($data,$table)\n {\n return $this->db->insert($table,$data);\n }", "function getChilds($id = NULL);", "function cognitivefactory_tree_get_upper_branch($id, $includeStart = false, $returnordering = false) {\n global $CFG, $DB;\n\n $nodelist = array();\n $res = $DB->get_record('cognitivefactory_opdata', array('id' => $id));\n if ($includeStart) $nodelist[] = ($returnordering) ? $res->intvalue : $id ; \n while($res->itemdest != 0) {\n $res = $DB->get_record($table, array('id' => $res->itemdest, 'operatorid' => 'hierarchize'));\n $nodelist[] = ($returnordering) ? $res->intvalue : $res->itemdest;\n }\n $nodelist = array_reverse($nodelist);\n return $nodelist;\n}", "function display_node($parent, $level) {\n global $tam1;\n $tam2=array();\n global $leafnodes; \n global $responce;\n if($parent >0) {\n foreach ($tam1 as $row){\n\t if($row['ID_Parent']==$parent){\n\t\t $tam2[]=$row;\n\t }\n }\n } else {\n \n\t foreach ($tam1 as $row){\n\t if($row['ID_Parent']==''){\n\t\t $tam2[]=$row;\n\t }\n }\n }\n\n foreach ($tam2 as $row) {\n\tif(!$row['ID_Parent']) $valp = 'NULL'; else $valp = $row['ID_Parent'];\t\n\t//kiem tra node co phai lead\n\tif(array_key_exists($row['ID_Control'], $leafnodes)) $leaf='true'; else $leaf = 'false';\t\n\t$responce[] = array('ID_Control' => $row[\"ID_Control\"], 'ID_Parent' => $row[\"ID_Parent\"], 'Caption' => $row[\"Caption\"],'KieuControl' => $row[\"KieuControl\"],'IsBarButton' => $row[\"IsBarButton\"] ,'Icon' =>$row[\"Icon\"],'Active' =>$row[\"Active\"],'STT' =>$row[\"STT\"],'PageOpen' =>$row[\"PageOpen\"],'OpenType' =>$row[\"OpenType\"],'TenControl' =>$row[\"TenControl\"] , 'level' => $level, 'parent' => $valp, 'isLeaf' => $leaf, 'expanded' => \"true\", 'loaded' => \"true\");\n\t\n\t display_node($row['ID_Control'],$level+1);\n\t \n\t} \n \n return $responce;\n \n}", "function categoryTree($id_parent= 0,$sub_mark =''){\n global $db;\n $query = $db->query(\"SELECT * FROM category WHERE id_parent = $id_parent ORDER BY name DESC \" );\n \n if ($query->num_rows > 0){\n while ($row = $query-> fetch_assoc()){\n \n echo '<option value=\"'.$row['id_c'].'\">'.$sub_mark.$row['name'].'</option>';\n \n categoryTree($row['id_c'],$sub_mark.'---');\n }\n \n }\n }", "public function drawParent() {\n\t\t\tglobal $db;\n\t\t\t$data = $db->get_var(\"SELECT title FROM pages WHERE guid = (SELECT parent FROM pages where guid = '{$this->guid}')\"); \n\t\t\treturn $data;\n\t\t}", "function ScriptOutRelatedData($strDatabase, $strTable, $pk, $strOurID, $depth, $tableprefix=\"\", $tablepostfix=\"\", $bwlNoDBMention=false, $bwlnullpks=false, $forceID=\"\")\n//inside a particular database, find all the tables that have a foreign key relationship with the given item and //and script out all the items in those tables connected to our item recursively\n//under some circumstances ($bwlnullpks), the PKs and FKs will have to be changed on insert, but there \n//is code for that too.\n//Judas Gutenberg February 21, 2008\n{\n\t$outscript=\"\";\n\t$numout=0;\n\t$thisset=0;\n\tif($strOurID!=\"\")\n\t{\n\t\t$sql=conDB();\n\t\t//the following query makes everything easy because I have a relation table!!!\n\t\t$strSQL=\"SELECT * FROM \" . $strDatabase . \".\" . tfpre . \"relation WHERE f_table_name='\" . $strTable . \"' AND relation_type_id=0 ORDER BY table_name ASC\";\n\t\t$fkrecords = $sql->query($strSQL);\n\t\t$intUnnameditemcount=1;\n\t\t$oldTable=\"\";\n\t\t$depth++;\n\t\t$intThisSpecialID=-2000;\n\t\t$intParallelPKCount=0;\n\n\t\tforeach ($fkrecords as $fkrecord)\n\t\t{\n\t\t\t$intSpecialIDCount=0;\n\t\t\t//i have to include depth in the names of the MySQL variables to avoid reuse\n\t\t\t$strThisSpecialID=\"@associatedpk\" . $intParallelPKCount . \"_\" . $depth ;\n\t\t\t\n\t\t\t$strTheirTable=$fkrecord[\"table_name\"];\n\t\t //now we have a tablename, let's look to see if there are foreign keys pointing back to our table\n\t\t\t$thistableinfo=\"\";\n\t\t\t$strTheirIDColumnName=PKLookup($strDatabase, $strTheirTable);\n\t\t\t$bwlThisIsAutoIncPK=hasautocount($strDatabase, $strTable);\n\t\t\tif($bwlnullpks && !contains($strTheirIDColumnName, \" \") && $bwlThisIsAutoIncPK)\n\t\t\t{\n\t\t\t\t//it isn't easy to generate fresh new AND compatible autoincrement IDs when inserting related\n\t\t\t\t//data. I do it by setting a MySQL variable to the next available PK during the insert and\n\t\t\t\t//rolling the numbers up from there, keeping track of them so I can be sure to have the\n\t\t\t\t//related data properly linked.\n\t\t\t\t$outscript.=\"\\nSET \" . $strThisSpecialID .\"=(SELECT MAX( \" . $strTheirIDColumnName . \" ) +1 FROM \" . IfAThenB(!$bwlNoDBMention, $strDatabase . \".\") . $strTheirTable . \");\";\n\t\t\t}\n\t\t\t$strSQL=\"SELECT * FROM \" . $strDatabase . \".\" . $strTheirTable . \" WHERE \" . $fkrecord[\"column_name\"] . \" = \" . $strOurID;\n\t\t\t$records = $sql->query($strSQL);\n\t\t\t$bwlColListCreated=false;\n\t\t\t$colList=\"\";\n\t\t \n\t\t\tforeach ($records as $record )\n\t\t\t{\n\t\t\t\t$idToUse=$record[$fkrecord[\"column_name\"]];\n\t\t\t\tif($bwlNoDBMention)\n\t\t\t\t{\n\t\t\t\t\t$outscript.=\"\\nINSERT INTO \" . $tableprefix . $strTheirTable . $tablepostfix . \"(\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$outscript.=\"\\nINSERT INTO \" . $strDatabase . \".\" . $tableprefix . $strTheirTable . $tablepostfix . \"(\";\n\t\t\t\t}\n\t\t\t\t$insertdata=\"\";\n\t\t\t\t$bwlFieldIsPK=false;\n\t\t\t\tforeach($record as $k=>$field)\n\t\t\t\t{\n\t\t\t\t\t$bwlFieldIsPK=false;\n\t\t\t\t\tif($k==$strTheirIDColumnName)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bwlFieldIsPK=true;\n\t\t\t\t\t\t$id=$field;\n\t\t\t\t\t\tif(!$bwlColListCreated)//i keep from doing the expensive lookup of hasautocount for every export row\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//if(!$bwlColListCreated && !(($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks))\n\t\t\t\t\t//trouble with single quotes::\n\t\t\t\t\t$field=str_replace( \"'\", \"\\\\'\", $field);\n\t\t\t\t\tif(!$bwlColListCreated && ((!($bwlFieldIsPK && $bwlThisIsAutoIncPK) || $forceID!=\"\") || !$bwlnullpks))\n\t\t\t\t\t{\n\t\t\t\t\t\t$colList.=\"`\" . $k . \"`,\";\n\t\t\t\t\t}\n\t\t\t\t\tif(($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks )\n\t\t\t\t\t{\n\t\t\t\t\t\t//$insertdata.= \"'\" . $intThisSpecialID . \"',\";\n\t\t\t\t\t\t$insertdata.= $strThisSpecialID . \" + \" . $intSpecialIDCount . \",\";\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if($forceID!=\"\" && $k==$pk && $bwlnullpks)\n\t\t\t\t\t{\n\t\t\t\t\t\t$insertdata.= $forceID . \",\";\n\t\t\t\t\t}\n\t\t\t\t\telse if(($bwlThisIsAutoIncPK && $bwlFieldIsPK) && $bwlnullpks)\n\t\t\t\t\t{\n\t\t\t\t\t}\n\t\t\t\t\telse if($bwlHTMLEsc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$insertdata.= \"'\" . str_replace(\"'\", \"&#39;\", $field). \"',\";\n\t\t\t\t\t}\n\t\t\t\t\telse if($bwlAddSlashes)\n\t\t\t\t\t{\n\t\t\t\t\t\t$insertdata.= \"'\" . addslashes($field). \"',\";\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$insertdata.= \"'\" . $field. \"',\";\n\t\t\t\t\t}\n\t\t\t\t\t$rowcount++;\n\t\t\t\t}\n\t\t\t\tif(!$bwlColListCreated)\n\t\t\t\t{\n\t\t\t\t\t$colList=RemoveEndCharactersIfMatch($colList, \",\");\n\t\t\t\t}\n\t\t\t\t$bwlColListCreated=true;\n\t\t\t\t$insertdata=RemoveEndCharactersIfMatch($insertdata, \",\");\n\t\t\t\t$outscript.=$colList . \") VALUES(\" . $insertdata . \");\";\n\t\t\t\t//$outscript.=$insertdata . \");\\n\";\n\t\t\t\tif($depth<5)\n\t\t\t\t{\n\t\t\t\t\tif($id!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$strThisSpecialIDToPass=$strThisSpecialID . \" + \" . $intSpecialIDCount;\n\t\t\t\t\t\tif(!$bwlnullpks)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$strThisSpecialIDToPass=\"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$outscript.=ScriptOutRelatedData($strDatabase, $strTheirTable, $strTheirIDColumnName, $id, $depth, $tableprefix , $tablepostfix, $bwlNoDBMention, $bwlnullpks, $strThisSpecialIDToPass);\n\t\t\t\t\t\t$intSpecialIDCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$intParallelPKCount++;\n\t\t}\n\t}\n\treturn $outscript;\n}", "public function get_id_subclase(){ \n return (isset($this->_id_subclase)) ? $this->_id_subclase: null;\n}", "function get_cat_sub($cat_id,$level=0) {\nglobal $table_catcontent, $db;\n$list_info_cat=($level==0)?\"(-1\":\"\";\n$list_info_cat = $list_info_cat.\",\".$cat_id;\n$subcat_num = Check_sub_info($table_catcontent,$db,\" WHERE parent_id = '\".$cat_id.\"'\");\nif ($subcat_num>0) {\n\t$sql_query = \"SELECT * FROM `\" . $table_catcontent . \"` WHERE parent_id='\".$cat_id.\"' ORDER BY priority_order ASC\";\n\t$sql_query = mysql_query($sql_query);\n\twhile($sql_query_rows = mysql_fetch_array($sql_query)) {\n\t\t$list_info_cat = $list_info_cat.get_cat_sub($sql_query_rows['id'],1);\n\t\t}\n\t}\nreturn ($level==0)?$list_info_cat.\")\":$list_info_cat;\n}", "function detailTienThuong($idTienThuong){\n\t\t\t$sql=\"SELECT GiaTri FROM tienthuong WHERE idTienThuong=$idTienThuong\";\n\t\t\t$kq=mysql_query($sql) or die(mysql_error());\n\t\t\treturn $kq;\n\t\t}", "function getWorksheetComp(){\n\t\t $sql=\"SELECT synonym.s_id, synonym.parentname FROM candidates RIGHT JOIN synonym ON candidates.prid=synonym.s_id WHERE candidates.put_in_worksheet='1' AND candidates.prid!='0' GROUP BY synonym.parentname\";\n\t\t $q = $this->db->query($sql);\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->s_id]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "function selectNameFromSighupTable($value)\n\t\t{\n\t\t\tglobal $CFG;\n\t\t\t$sqlsel \t= \"SELECT user_id FROM \".$CFG['table']['new_domain'].\" where newdomainid ='\".$this->filterInput($value).\"'\";\n\t\t $sqlres \t= $this->ExecuteQuery($sqlsel,'select');\n\t\t \n\t\t $sqlsel1 \t= \"SELECT username FROM \".$CFG['table']['register'].\" where user_id ='\".$this->filterInput($sqlres[0]['user_id']).\"'\";\n\t\t $sqlres1\t= $this->ExecuteQuery($sqlsel1,'select');\n\t\t \n\t\t return $sqlres1[0]['username'];\n\t\t}", "public function get_family_data($will_id){\n $query = $this->db->select('*')\n ->from('tbl_family_info')\n ->where('will_id',$will_id)\n ->order_by(\"FIELD(relationship,'Spouse','Son','Daughter')\",'',FALSE)\n ->get();\n $result = $query->result();\n return $result;\n }", "public function createHierarchy(){\n\t\tmysqli_query($this->db, \"TRUNCATE TABLE hierarchy\");\n\t\t\n\t\t$insert_sql = \"INSERT INTO hierarchy VALUES\";\n\t\tforeach ($this->structure as $key => $value) {\n\t\t\t$position = $value['number'] + 1;\n\t\t\t$rows[] = \"('', '{$key}', '{$position}')\";\n\t\t}\n\t\t$insert_sql = $insert_sql.implode(\",\", $rows);\n\t\tmysqli_query($this->db, $insert_sql);\n\t}", "function get_incharge_schoolid($userid)\n{\t\n\tglobal $DB;\n\t$sql =\"SELECT * FROM {user_school} mus join mdl_school ms on ms.id=mus.schoolid WHERE userid=$userid\";\n\t$result = $DB->get_record_sql($sql);\n\treturn $result;\n}", "function getGRDLVL(){\n\t\tglobal $_CON;\n\t\t$_SEC_ID = urldecode(base64_decode(SECT_ID())); \n\t\t$sqlSearch = mysqli_query($_CON,\"SELECT section_name, gradelvl, teacher_id FROM section_table WHERE section_id='$_SEC_ID' \");\n\t\t$row = mysqli_fetch_array($sqlSearch);\n\t\t$grdlvl = $row['gradelvl'];\n\t\t$sec_name = $row['section_name'];\n\t\treturn \"Grade \" . $grdlvl. \" - \" . $sec_name;\n\t}", "private function get_tcase_id_by_name($name, $parent_id)\r\n {\r\n $debugMsg='Class:' .__CLASS__ . ' - Method:' . __FUNCTION__ . ' :: ';\r\n \r\n if ($parent_id == null || $parent_id <= 0)\r\n {\r\n $msg = $debugMsg . ' FATAL Error $parentNodeID can not null and <= 0';\r\n throw new Exception($msg);\r\n }\r\n \r\n \r\n $sql = \"/* {$debugMsg} */ \" .\r\n \" SELECT NHA.id FROM \" . $this->db_handler->get_table('nodes_hierarchy') . \" NHA \" .\r\n \" WHERE NHA.node_type_id = 3 \" .\r\n \" AND NHA.name = '\" . $this->db_handler->prepare_string($name) . \"'\" .\r\n \" AND NHA.parent_id = \" . $this->db_handler->prepare_int($parent_id);\r\n \r\n $rs = $this->db_handler->get_recordset($sql);\r\n if (count($rs, COUNT_NORMAL) > 0 && isset($rs[0]['id']) && $rs[0]['id'] > 0)\r\n {\r\n return $rs[0]['id'];\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }", "public function getId_Entree()\n{\nreturn $this->Id_Entree;\n}", "public function getUcenike($skola){\n\t\t\t$this->db->where('skolaId',$skola);\n\t\t\t$ucenik = $this->db->get(\"ucenik\");\n\t\t\treturn $ucenik;\n\t\t}", "public function selectTaxDataByUid($uid) {\n \n // query preparation\n $select = 'NUMMER, STEUERSATZCODE, STEUERSATZPROZ, GUELTIGABTTMMJJJJ'.\n ($this->oldTaxTableExists() == true ? ', st.BEMERKUNG AS BEMERKUNG' : '').' ';\n $from = $this->getTableName('BHSTEUER').' bh'. \n ($this->oldTaxTableExists() == true ? ' LEFT JOIN '.$this->getTableName('STEUER').' st ON bh.STEUERSATZCODE LIKE st.CODE' : '');\n $where = 'bh.NUMMER = '.intval($uid);\n $groupBy = '';\n $orderBy = '';\n $limit = '';\n \n // exec query using TYPO3 DB API\n $res = $this->gsaDbObj->exec_SELECTquery($select, $from, $where, $groupBy, $orderBy, $limit);\n if ($res == false) {\n throw new tx_pttools_exception('Query failed', 1, $this->gsaDbObj->sql_error());\n }\n \n $a_row = $this->gsaDbObj->sql_fetch_assoc($res);\n $this->gsaDbObj->sql_free_result($res);\n \n // if enabled, do charset conversion of all non-binary string data \n if ($this->charsetConvEnabled == 1) {\n $a_row = tx_pttools_div::iconvArray($a_row, $this->gsaCharset, $this->siteCharset);\n }\n \n trace($a_row); \n return $a_row;\n \n }", "private function setLevel()\n\t{\n\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_level` WHERE 1\");\n\t\tif ($level_count > 1) // binary level\n\t\t{\n\t\t\t$this->levelType = 1;\n\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_level` WHERE 1\");\n\t\t}else{\n\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bin_serial_type` WHERE 1\");\n\t\t\tif ($level_count > 1)\n\t\t\t{\n\t\t\t\t$this->levelType = 2;\n\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bin_serial_type` WHERE 1\");\n\t\t\t}else{\n\t\t\t\t$level_count = $this->db->cacheGetOne(\"SELECT COUNT(*) FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\tif ($level_count > 2) // user group level\n\t\t\t\t{\n\t\t\t\t\t$this->levelType = 3;\n\t\t\t\t\t$this->levelArr = $this->db->getAssoc(\"SELECT `id`, `name` FROM `bbc_user_group` WHERE `is_admin`=0\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getServiceTypeTree_array($level, $parent_id)\n {\n global $_SESSION;\n $query = \"select st1.* from \" . DB_PREFIX . \"_service_type as st1 where st1.parent_id = \" . $parent_id . \"\";\n $arr = array();\n\n $DBC = DBC::getInstance();\n $stmt = $DBC->query($query);\n if ($stmt) {\n $j = 0;\n while ($ar = $DBC->fetch($stmt)) {\n $arr[$j]['name'] = $ar['name'];\n $arr[$j]['id'] = $ar['service_type_id'];\n $arr[$j]['level'] = $level;\n $j++;\n }\n }\n\n if (!empty($arr)) {\n foreach ($arr as $key => $value) {\n $arr[$key]['child'] = $this->getServiceTypeTree_array($arr[$key]['level'] + 1, $arr[$key]['id']);\n }\n }\n return $arr;\n }", "static public function getParentTableRelationalField(){\n return \"uid_empresa_superior\";\n }", "public function getLevelList()\n {\n $this->db->select(\"tl_code, tl_code ||' - '|| tl_desc as tl_code_desc\");\n $this->db->from(\"ims_hris.training_level\");\n $this->db->order_by(\"tl_code\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }" ]
[ "0.63171613", "0.6268051", "0.56313986", "0.55602306", "0.5334822", "0.5309512", "0.52848256", "0.5219678", "0.51957816", "0.5171037", "0.5168882", "0.51556", "0.5122436", "0.5102181", "0.50849676", "0.5084626", "0.5077614", "0.5076128", "0.5068086", "0.50285286", "0.5021309", "0.5012837", "0.50065404", "0.50011724", "0.49953443", "0.49947163", "0.4961965", "0.49591774", "0.49590424", "0.49501505", "0.49480587", "0.49348623", "0.49261263", "0.49211878", "0.49159136", "0.491253", "0.4905974", "0.49039117", "0.49003312", "0.48969755", "0.4895884", "0.4889498", "0.4887293", "0.48870957", "0.48805562", "0.48793948", "0.48705116", "0.48601985", "0.48583433", "0.4856623", "0.48538125", "0.48536596", "0.485225", "0.48287427", "0.48258844", "0.48166537", "0.4815004", "0.48148826", "0.48124766", "0.4800793", "0.4791644", "0.47914225", "0.4789724", "0.47844446", "0.477683", "0.47745493", "0.47688138", "0.47666925", "0.47659877", "0.47641566", "0.47629723", "0.47538266", "0.47434565", "0.4740756", "0.4739122", "0.47322652", "0.46994781", "0.4697761", "0.46962786", "0.4696064", "0.46927384", "0.46922433", "0.4691433", "0.46834525", "0.4680742", "0.46800345", "0.46768236", "0.46749318", "0.46742234", "0.4673926", "0.46719918", "0.4670392", "0.46635073", "0.46626866", "0.46593797", "0.4652097", "0.46520942", "0.4649919", "0.46478164", "0.4647483" ]
0.48589742
48