query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
( portfolio hooks ) Fire the 'udesign_single_portfolio_entry_before' action | function udesign_single_portfolio_entry_before() {
do_action('udesign_single_portfolio_entry_before');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_single_portfolio_entry_after() {\r\n do_action('udesign_single_portfolio_entry_after');\r\n}",
"function udesign_single_post_entry_before() {\r\n do_action('udesign_single_post_entry_before');\r\n}",
"function udesign_blog_entry_before() {\r\n do_action('udesign_blog_entry_before');\r\n}",
"function udesign_entry_before() {\r\n do_action('udesign_entry_before');\r\n}",
"function udesign_single_portfolio_entry_top() {\r\n do_action('udesign_single_portfolio_entry_top');\r\n}",
"function udesign_blog_post_content_before() {\r\n do_action('udesign_blog_post_content_before');\r\n}",
"function codex_portfolio_init() {\r\n\r\n $slug = get_theme_mod( 'sovenco_project_slug', 'portfolio' );\r\n if ( ! $slug ) {\r\n $slug = 'portfolio';\r\n }\r\n\r\n $labels = array(\r\n 'name' => _x( 'Portfolios', 'post type general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Portfolio', 'post type singular name', 'sovenco-plus' ),\r\n 'menu_name' => _x( 'Portfolios', 'admin menu', 'sovenco-plus' ),\r\n 'name_admin_bar' => _x( 'Portfolio', 'add new on admin bar', 'sovenco-plus' ),\r\n 'add_new' => _x( 'Add New', 'portfolio', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Portfolio', 'sovenco-plus' ),\r\n 'new_item' => __( 'New Portfolio', 'sovenco-plus' ),\r\n 'edit_item' => __( 'Edit Portfolio', 'sovenco-plus' ),\r\n 'view_item' => __( 'View Portfolio', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Portfolios', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Portfolios', 'sovenco-plus' ),\r\n 'parent_item_colon' => __( 'Parent Portfolios:', 'sovenco-plus' ),\r\n 'not_found' => __( 'No portfolios found.', 'sovenco-plus' ),\r\n 'not_found_in_trash' => __( 'No portfolios found in Trash.', 'sovenco-plus' )\r\n );\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => $slug ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => false,\r\n 'hierarchical' => false,\r\n 'menu_position' => null,\r\n 'supports' => array( 'title', 'editor', 'thumbnail' )\r\n );\r\n\r\n register_post_type( 'portfolio', $args );\r\n\r\n // Portfolio category\r\n $labels = array(\r\n 'name' => _x( 'Categories', 'taxonomy general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Category', 'taxonomy singular name', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Categories', 'sovenco-plus' ),\r\n 'popular_items' => __( 'Popular Categories', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Categories', 'sovenco-plus' ),\r\n 'parent_item' => null,\r\n 'parent_item_colon' => null,\r\n 'edit_item' => __( 'Edit Category', 'sovenco-plus' ),\r\n 'update_item' => __( 'Update Category', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Category', 'sovenco-plus' ),\r\n 'new_item_name' => __( 'New Category Name', 'sovenco-plus' ),\r\n 'separate_items_with_commas' => __( 'Separate categories with commas', 'sovenco-plus' ),\r\n 'add_or_remove_items' => __( 'Add or remove categories', 'sovenco-plus' ),\r\n 'choose_from_most_used' => __( 'Choose from the most used categories', 'sovenco-plus' ),\r\n 'not_found' => __( 'No categories found.', 'sovenco-plus' ),\r\n 'menu_name' => __( 'Categories', 'sovenco-plus' ),\r\n );\r\n\r\n $args = array(\r\n 'hierarchical' => false,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'update_count_callback' => '_update_post_term_count',\r\n 'query_var' => false,\r\n 'rewrite' => array( 'slug' => 'portfolio_cat' ),\r\n );\r\n\r\n register_taxonomy( 'portfolio_cat', 'portfolio', $args );\r\n\r\n}",
"function udesign_page_content_before() {\r\n do_action('udesign_page_content_before');\r\n}",
"function udesign_home_page_content_before() {\r\n do_action('udesign_home_page_content_before');\r\n}",
"function udesign_front_page_slider_before() {\r\n do_action('udesign_front_page_slider_before');\r\n}",
"public function onRun()\n {\n $this->property('slug');\n $this->portfolioItems = PortfolioItem::published();\n if ( is_int($this->property('categorySlug'))) $this->portfolioItems = Category::find( $this->property('categorySlug') )->items( );\n\n if ($this->property( 'maxItems' ) !='')\n $this->portfolioItems = $this->portfolioItems->take( $this->property( 'maxItems' ) );\n\n // if ($this->property( 'randomize' ))\n // $this->portfolioItems = $this->portfolioItems->get()->random($this->property( 'maxItems' ));\n // else\n $this->portfolioItems = $this->portfolioItems->get();\n\n }",
"public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}",
"function udesign_html_before() {\r\n do_action('udesign_html_before');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function udesign_footer_before() {\r\n do_action('udesign_footer_before');\r\n}",
"function x_remove_portfolio_cpt() { \n remove_action( 'init', 'x_portfolio_init'); \n}",
"public function inits() {\r\n\r\n\t\tadd_action( 'init', array($this, 'register_cpt_Market_Reports') );\r\n\t\tadd_action( 'init', array($this, 'create_market_reports_category'), 0 );\r\n\r\n\t\tadd_action( 'manage_market-reports_posts_columns', array($this, 'modify_column'));\r\n\t\tadd_action( 'manage_market-reports_posts_custom_column', array($this, 'modify_column_content'), 10, 2);\t\r\n\t\tadd_action( 'admin_enqueue_scripts', array($this, 'include_admin_assets'));\r\n\t\tadd_action( 'edit_form_after_editor', array($this, 'append_post_id_input') );\r\n\t\tadd_action( 'add_meta_boxes', array($this, 'remove_categories_meta_box'));\r\n\t\tadd_action( 'wp_ajax_load_parent_category_item_field_ajax', array($this, 'load_parent_category_item_field_ajax'));\r\n\t\tadd_action( 'acf/save_post', array($this, 'update_post_title'));\r\n\t\tadd_action( 'untrash_post', array($this, 'untrash_market_report') );\r\n\t\tadd_action( 'wp_ajax_upload_file', array($this, 'upload_file'));\r\n\t\tadd_action( 'admin_menu', array($this, 'add_upload_files_page'));\r\n\t\tadd_action( 'admin_menu', array($this, 'add_browse_files_page'));\r\n\t\tadd_action( 'wp_ajax_delete_files', array($this, 'delete_files'));\r\n\t\tadd_action( 'wp_ajax_add_to_top_page', array($this, 'add_to_top_page'));\r\n\t\tadd_action( 'admin_head', array($this, 'hide_delete_link'));\r\n\t\tadd_action( 'trashed_post', array($this, 'trashed_market_report_page') );\r\n\r\n\t\tadd_filter( 'page_row_actions', array($this, 'remove_quick_edit_and_view'), 10, 2 );\r\n\t\tadd_filter( 'acf/validate_value/name=mr_title', array($this, 'validate_title'), 10, 4);\r\n\t\tif(isset($_GET['page']) && $_GET['page'] == 'browse-files'){\r\n\t\t\tadd_filter( 'set-screen-option', array($this, 'set_screen'), 10, 3 );\t\r\n\t\t}\r\n\t\tadd_filter( 'market_reports_category_row_actions', array($this, 'remove_delete_and_view'), 10, 2 );\r\n\t}",
"function beuh_single_portfolio() {\r\n\tif( is_page_template( 'homepage-slider.php' ) || is_page_template( 'homepage-youtube.php' )|| is_page_template( 'homepage-video.php' )|| is_page_template( 'homepage-custom-layout.php' )){\r\n?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t(function ($) {\r\n\t\t\t\t\t\"use strict\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//portfolio ajax setting\r\n\t\t\t\t\t\t$(document).ready(function () {\r\n\t\t\t\t\t\t\t$('.port-ajax').click(function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar toLoad = $(this).attr('data-link') + ' .worksajax > *';\r\n\t\t\t\t\t\t\t\t$('.worksajax').slideUp('slow', loadContent);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfunction loadContent() {\r\n\t\t\t\t\t\t\t\t\t$('.worksajax').load(toLoad, '', showNewContent)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tfunction showNewContent() {\r\n\t\t\t\t\t\t\t\t\t$.getScript(\"<?php echo get_template_directory_uri(); ?>/js/portfolio.js\");\r\n\t\t\t\t\t\t\t\t\t$('.worksajax').slideDown('slow');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t//portfolio scrolling\r\n\t\t\t\t\t\t$(function () {\r\n\t\t\t\t\t\t\t$('.port-ajax').bind('click', function (event) {\r\n\t\t\t\t\t\t\t\tvar $anchor = $('#work-ajax');\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$('html, body').stop().animate({\r\n\t\t\t\t\t\t\t\t\tscrollTop: $($anchor).offset().top - 93\r\n\t\t\t\t\t\t\t\t}, 1000, 'linear');\r\n\t\t\t\t\t\t\t\tevent.preventDefault();\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\t//isotope setting(portfolio)\r\n\t\t\t\t\t\tvar $container = $('.portfolio-body');\r\n\t\t\t\t\t\t$container.imagesLoaded(function () {\r\n\t\t\t\t\t\t\t$container.isotope();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t// filter items when filter link is clicked\r\n\t\t\t\t\t\t$('.port-filter a').click(function () {\r\n\t\t\t\t\t\t\tvar selector = $(this).attr('data-filter');\r\n\t\t\t\t\t\t\t$container.isotope({\r\n\t\t\t\t\t\t\t\titemSelector: '.port-item',\r\n\t\t\t\t\t\t\t\tfilter: selector\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t//adding active state to portfolio filtr\r\n\t\t\t\t\t\t$(\".port-filter a\").click(function (e) {\r\n\t\t\t\t\t\t\t$(\".port-filter a\").removeClass(\"active\");\r\n\t\t\t\t\t\t\t$(this).addClass(\"active\");\r\n\t\t\t\t\t\t});\r\n\t\r\n\t\t\t\t\t})(jQuery);\r\n\t\t</script>\r\n<?php }\r\n}",
"public function registerHooks() {\n\t\t// Nothing to do here right now\n\t\t// Others might want to know about this and get a chance to do their own work (like messing with our's :) )\n\t\tdo_action( 'pixelgrade_portfolio_registered_hooks' );\n\t}",
"function horizon_portfolio_section() {\n\t\tget_template_part('inc/partials/homepage', 'portfolio');\n\t}",
"function custom_post_portfolio() {\n\n $labels = array(\n 'name' => _x( 'Proyectos', 'Post Type General Name', 'ohmarketingtravel' ),\n 'singular_name' => _x( 'Proyecto', 'Post Type Singular Name', 'ohmarketingtravel' ),\n 'menu_name' => __( 'Portafolio', 'ohmarketingtravel' ),\n 'name_admin_bar' => __( 'Portafolio', 'ohmarketingtravel' ),\n 'archives' => __( 'Item Archives', 'ohmarketingtravel' ),\n 'attributes' => __( 'Item Attributes', 'ohmarketingtravel' ),\n 'parent_item_colon' => __( 'Parent Item:', 'ohmarketingtravel' ),\n 'all_items' => __( 'All Items', 'ohmarketingtravel' ),\n 'add_new_item' => __( 'Add New Item', 'ohmarketingtravel' ),\n 'add_new' => __( 'Add New', 'ohmarketingtravel' ),\n 'new_item' => __( 'New Item', 'ohmarketingtravel' ),\n 'edit_item' => __( 'Edit Item', 'ohmarketingtravel' ),\n 'update_item' => __( 'Update Item', 'ohmarketingtravel' ),\n 'view_item' => __( 'View Item', 'ohmarketingtravel' ),\n 'view_items' => __( 'View Items', 'ohmarketingtravel' ),\n 'search_items' => __( 'Search Item', 'ohmarketingtravel' ),\n 'not_found' => __( 'Not found', 'ohmarketingtravel' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'ohmarketingtravel' ),\n 'featured_image' => __( 'Featured Image', 'ohmarketingtravel' ),\n 'set_featured_image' => __( 'Set featured image', 'ohmarketingtravel' ),\n 'remove_featured_image' => __( 'Remove featured image', 'ohmarketingtravel' ),\n 'use_featured_image' => __( 'Use as featured image', 'ohmarketingtravel' ),\n 'insert_into_item' => __( 'Insert into item', 'ohmarketingtravel' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'ohmarketingtravel' ),\n 'items_list' => __( 'Items list', 'ohmarketingtravel' ),\n 'items_list_navigation' => __( 'Items list navigation', 'ohmarketingtravel' ),\n 'filter_items_list' => __( 'Filter items list', 'ohmarketingtravel' ),\n );\n $args = array(\n 'label' => __( 'Proyecto', 'ohmarketingtravel' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-schedule',\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'Portafolio', $args );\n\n}",
"public function hook_before(&$postdata) {\n\n\t\t }",
"function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}",
"function udesign_top_wrapper_before() {\r\n do_action('udesign_top_wrapper_before');\r\n}",
"public function hook_before_add(&$postdata) { \n\t //Your code here\n\n\t }",
"public function hook_before_add(&$postdata) { \n\t //Your code here\n\n\t }",
"function udesign_single_post_entry_after() {\r\n do_action('udesign_single_post_entry_after');\r\n}",
"function udesign_page_title_before() {\r\n do_action('udesign_page_title_before');\r\n}",
"protected function executePreRenderHook() {}",
"function me_theme_jetpack_portfolio_cpt() {\n\tadd_theme_support( 'jetpack-portfolio' );\n}"
]
| [
"0.7460988",
"0.7396805",
"0.7301439",
"0.7292218",
"0.68888175",
"0.6637681",
"0.662463",
"0.64092284",
"0.6206531",
"0.6186026",
"0.61379707",
"0.6128096",
"0.60372365",
"0.6030973",
"0.597444",
"0.59646714",
"0.59439147",
"0.5937858",
"0.59279865",
"0.58924896",
"0.58710045",
"0.5807942",
"0.57959485",
"0.57940346",
"0.57551426",
"0.57551426",
"0.574441",
"0.5742332",
"0.57338744",
"0.5708795"
]
| 0.8924291 | 0 |
Fire the 'udesign_single_portfolio_entry_after' action. | function udesign_single_portfolio_entry_after() {
do_action('udesign_single_portfolio_entry_after');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_single_post_entry_after() {\r\n do_action('udesign_single_post_entry_after');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}",
"function udesign_entry_after() {\r\n do_action('udesign_entry_after');\r\n}",
"function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}",
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"function udesign_single_portfolio_entry_top() {\r\n do_action('udesign_single_portfolio_entry_top');\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function udesign_front_page_slider_after() {\r\n do_action('udesign_front_page_slider_after');\r\n}",
"function udesign_single_post_entry_bottom() {\r\n do_action('udesign_single_post_entry_bottom');\r\n}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_page_title_after() {\r\n do_action('udesign_page_title_after');\r\n}",
"public function hook_after($postdata,&$result) {\n\n\t\t }",
"public function hook_after($postdata,&$result) {\n\n\t\t }",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"function save_portfolio_postdata( $post_id ) {\n\tglobal $post, $new_meta_portfolio_boxes;\n\n\tif(isset($post) && $post->post_type==PEXETO_PORTFOLIO_POST_TYPE){\n\t\tpexeto_save_meta_data($new_meta_portfolio_boxes, $post_id);\n\t}\n}",
"public function hook_after($postdata,&$result) {\n\t\t\t\n\t\t }",
"function custom_post_portfolio() {\n\n $labels = array(\n 'name' => _x( 'Proyectos', 'Post Type General Name', 'ohmarketingtravel' ),\n 'singular_name' => _x( 'Proyecto', 'Post Type Singular Name', 'ohmarketingtravel' ),\n 'menu_name' => __( 'Portafolio', 'ohmarketingtravel' ),\n 'name_admin_bar' => __( 'Portafolio', 'ohmarketingtravel' ),\n 'archives' => __( 'Item Archives', 'ohmarketingtravel' ),\n 'attributes' => __( 'Item Attributes', 'ohmarketingtravel' ),\n 'parent_item_colon' => __( 'Parent Item:', 'ohmarketingtravel' ),\n 'all_items' => __( 'All Items', 'ohmarketingtravel' ),\n 'add_new_item' => __( 'Add New Item', 'ohmarketingtravel' ),\n 'add_new' => __( 'Add New', 'ohmarketingtravel' ),\n 'new_item' => __( 'New Item', 'ohmarketingtravel' ),\n 'edit_item' => __( 'Edit Item', 'ohmarketingtravel' ),\n 'update_item' => __( 'Update Item', 'ohmarketingtravel' ),\n 'view_item' => __( 'View Item', 'ohmarketingtravel' ),\n 'view_items' => __( 'View Items', 'ohmarketingtravel' ),\n 'search_items' => __( 'Search Item', 'ohmarketingtravel' ),\n 'not_found' => __( 'Not found', 'ohmarketingtravel' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'ohmarketingtravel' ),\n 'featured_image' => __( 'Featured Image', 'ohmarketingtravel' ),\n 'set_featured_image' => __( 'Set featured image', 'ohmarketingtravel' ),\n 'remove_featured_image' => __( 'Remove featured image', 'ohmarketingtravel' ),\n 'use_featured_image' => __( 'Use as featured image', 'ohmarketingtravel' ),\n 'insert_into_item' => __( 'Insert into item', 'ohmarketingtravel' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'ohmarketingtravel' ),\n 'items_list' => __( 'Items list', 'ohmarketingtravel' ),\n 'items_list_navigation' => __( 'Items list navigation', 'ohmarketingtravel' ),\n 'filter_items_list' => __( 'Filter items list', 'ohmarketingtravel' ),\n );\n $args = array(\n 'label' => __( 'Proyecto', 'ohmarketingtravel' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-schedule',\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'Portafolio', $args );\n\n}",
"public function after_main_content() {\n\t?>\n\n\t\t\t</div><!-- #bbp-content -->\n\t\t</div><!-- #bbp-container -->\n\n\t<?php\n\t}",
"function omega_entry_footer() {\n\n\tif ( 'post' == get_post_type() ) {\n\t\tget_template_part( 'partials/entry', 'footer' ); \n\t} \n\n\tif(is_singular()) {\n\t\techo omega_apply_atomic_shortcode( 'entry_meta', '<div class=\"entry-meta\">[post_edit]</div>' );\n\t}\n\t\n}",
"public function process_portfolio_export() {\n global $CFG;\n\n // Proces export requests.\n $export = optional_param('export', '', PARAM_TAGLIST); // Comma delimited entry ids or -1 for all entries in view\n if ($export and confirm_sesskey()) {\n if (!empty($CFG->enableportfolios)) {\n require_once(\"$CFG->libdir/portfoliolib.php\");\n $exportparams = array(\n 'ca_id' => $this->df->cm->id,\n 'ca_vid' => $this->id,\n 'ca_fid' => $this->filter->id,\n 'ca_eids' => null,\n 'sesskey' => sesskey(),\n 'callbackfile' => '/mod/dataform/locallib.php',\n 'callbackclass' => 'dataform_portfolio_caller',\n 'callerformats' => optional_param('format', 'spreadsheet,richhtml', PARAM_TAGLIST),\n );\n\n redirect(new \\moodle_url('/portfolio/add.php', $exportparams));\n }\n }\n }",
"function codex_portfolio_init() {\r\n\r\n $slug = get_theme_mod( 'sovenco_project_slug', 'portfolio' );\r\n if ( ! $slug ) {\r\n $slug = 'portfolio';\r\n }\r\n\r\n $labels = array(\r\n 'name' => _x( 'Portfolios', 'post type general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Portfolio', 'post type singular name', 'sovenco-plus' ),\r\n 'menu_name' => _x( 'Portfolios', 'admin menu', 'sovenco-plus' ),\r\n 'name_admin_bar' => _x( 'Portfolio', 'add new on admin bar', 'sovenco-plus' ),\r\n 'add_new' => _x( 'Add New', 'portfolio', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Portfolio', 'sovenco-plus' ),\r\n 'new_item' => __( 'New Portfolio', 'sovenco-plus' ),\r\n 'edit_item' => __( 'Edit Portfolio', 'sovenco-plus' ),\r\n 'view_item' => __( 'View Portfolio', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Portfolios', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Portfolios', 'sovenco-plus' ),\r\n 'parent_item_colon' => __( 'Parent Portfolios:', 'sovenco-plus' ),\r\n 'not_found' => __( 'No portfolios found.', 'sovenco-plus' ),\r\n 'not_found_in_trash' => __( 'No portfolios found in Trash.', 'sovenco-plus' )\r\n );\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => $slug ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => false,\r\n 'hierarchical' => false,\r\n 'menu_position' => null,\r\n 'supports' => array( 'title', 'editor', 'thumbnail' )\r\n );\r\n\r\n register_post_type( 'portfolio', $args );\r\n\r\n // Portfolio category\r\n $labels = array(\r\n 'name' => _x( 'Categories', 'taxonomy general name', 'sovenco-plus' ),\r\n 'singular_name' => _x( 'Category', 'taxonomy singular name', 'sovenco-plus' ),\r\n 'search_items' => __( 'Search Categories', 'sovenco-plus' ),\r\n 'popular_items' => __( 'Popular Categories', 'sovenco-plus' ),\r\n 'all_items' => __( 'All Categories', 'sovenco-plus' ),\r\n 'parent_item' => null,\r\n 'parent_item_colon' => null,\r\n 'edit_item' => __( 'Edit Category', 'sovenco-plus' ),\r\n 'update_item' => __( 'Update Category', 'sovenco-plus' ),\r\n 'add_new_item' => __( 'Add New Category', 'sovenco-plus' ),\r\n 'new_item_name' => __( 'New Category Name', 'sovenco-plus' ),\r\n 'separate_items_with_commas' => __( 'Separate categories with commas', 'sovenco-plus' ),\r\n 'add_or_remove_items' => __( 'Add or remove categories', 'sovenco-plus' ),\r\n 'choose_from_most_used' => __( 'Choose from the most used categories', 'sovenco-plus' ),\r\n 'not_found' => __( 'No categories found.', 'sovenco-plus' ),\r\n 'menu_name' => __( 'Categories', 'sovenco-plus' ),\r\n );\r\n\r\n $args = array(\r\n 'hierarchical' => false,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'update_count_callback' => '_update_post_term_count',\r\n 'query_var' => false,\r\n 'rewrite' => array( 'slug' => 'portfolio_cat' ),\r\n );\r\n\r\n register_taxonomy( 'portfolio_cat', 'portfolio', $args );\r\n\r\n}",
"function AfterAdd(&$values, &$keys, $inline, &$pageObject)\n{\n\n\t\t\n\t// We update the values that allow us to find the MEFE master user for this organization\n\n\t\t// what was the ID of the last inserted record?\n\n\t\t\t$rs_organization_id = $values['id_organization'];\n\t\t\n\t\t// We update the value\n\n\t\t\t$table_name = 'uneet_enterprise_organizations' ;\n\n\t\t\t$data = array();\n\t\t\t\t$data[\"mefe_master_user_external_person_id\"] = (0 . '-' . $rs_organization_id) ;\n\t\t\t\t$data[\"mefe_master_user_external_person_system\"] = 'Setup' ;\n\t\t\t\t$data[\"mefe_master_user_external_person_table\"] = 'Setup' ;\n\t\t\t$keyvalues = array();\n\t\t\t\t$keyvalues[\"id_organization\"] = $rs_organization_id;\n\n\t\t\t// Command to do the update\n\t\t\t\t\n\t\t\t\tDB::Update($table_name, $data, $keyvalues);\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}",
"function wp_after_insert_post($post, $update, $post_before)\n {\n }",
"function x_remove_portfolio_cpt() { \n remove_action( 'init', 'x_portfolio_init'); \n}",
"function toolbox_add_portfolio_meta_box() {\n add_meta_box(\n 'toolbox_portfolio_metabox', // Unique ID (ID of Div Tag ** Note: DO NOT NAME same as field(s) below **)\n esc_html__( 'Portfolio Entry', 'lorainccc' ), // Title & Text Domain\n 'toolbox_show_portfolio_meta_box', // Callback function\n 'portfolio', // Admin Page or Post Type\n 'normal', // Context (Position)\n 'default' // Priority\n );\n}",
"public function onRun()\n {\n $this->property('slug');\n $this->portfolioItems = PortfolioItem::published();\n if ( is_int($this->property('categorySlug'))) $this->portfolioItems = Category::find( $this->property('categorySlug') )->items( );\n\n if ($this->property( 'maxItems' ) !='')\n $this->portfolioItems = $this->portfolioItems->take( $this->property( 'maxItems' ) );\n\n // if ($this->property( 'randomize' ))\n // $this->portfolioItems = $this->portfolioItems->get()->random($this->property( 'maxItems' ));\n // else\n $this->portfolioItems = $this->portfolioItems->get();\n\n }",
"public function hook_after($postdata, &$result)\n {\n \n }",
"public function hook_after($postdata, &$result)\n {\n \n }"
]
| [
"0.7627744",
"0.74445504",
"0.74285185",
"0.7422484",
"0.66191375",
"0.6466844",
"0.6465393",
"0.61426324",
"0.5990034",
"0.59775335",
"0.5974928",
"0.5836552",
"0.57403",
"0.5612023",
"0.5612023",
"0.5575853",
"0.5568479",
"0.556595",
"0.5531649",
"0.55246925",
"0.5503199",
"0.5484406",
"0.5481848",
"0.54785573",
"0.54783905",
"0.53959113",
"0.53787214",
"0.537195",
"0.5366013",
"0.5366013"
]
| 0.8992753 | 0 |
Fire the 'udesign_single_portfolio_entry_top' action | function udesign_single_portfolio_entry_top() {
do_action('udesign_single_portfolio_entry_top');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_single_post_entry_top() {\r\n do_action('udesign_single_post_entry_top');\r\n}",
"function udesign_entry_top() {\r\n do_action('udesign_entry_top');\r\n}",
"function udesign_blog_entry_top() {\r\n do_action('udesign_blog_entry_top');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function udesign_page_content_top() {\r\n do_action('udesign_page_content_top');\r\n}",
"function udesign_single_portfolio_entry_after() {\r\n do_action('udesign_single_portfolio_entry_after');\r\n}",
"function udesign_single_portfolio_entry_before() {\r\n do_action('udesign_single_portfolio_entry_before');\r\n}",
"function udesign_home_page_content_top() {\r\n do_action('udesign_home_page_content_top');\r\n}",
"function udesign_head_top() {\r\n do_action('udesign_head_top');\r\n}",
"function udesign_top_wrapper_top() {\r\n do_action('udesign_top_wrapper_top');\r\n}",
"function udesign_body_top() {\r\n do_action('udesign_body_top');\r\n}",
"public function topAction();",
"function udesign_main_content_top( $is_front_page ) {\r\n do_action('udesign_main_content_top', $is_front_page);\r\n}",
"function udesign_page_title_top() {\r\n do_action('udesign_page_title_top');\r\n}",
"public function hookTop(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'_scroll.tpl');\n }",
"public function display_top_story() {\n\t\tif ( is_admin() || ! is_single() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$top_post = $this->get_newest_post();\n\t\t$top_author = get_userdata( $top_post->post_author );\n\t\t$cat = get_the_category( $top_post->ID )[0]->cat_name;\n\n\t\t// Get time stamp data and make sure termanology matches specs.\n\t\t$timestamp_time = human_time_diff( get_the_time( 'U', $top_post->ID ), current_time( 'timestamp' ) );\n\t\t$m_timestamp = str_replace( array( ' mins', ' min' ), 'm', $timestamp_time ) . ' ago';\n\t\t$timestamp = $timestamp_time . ' ago';\n\n\t\t// Search for min(s).\n\t\tif ( false !== strpos( $timestamp_time, 'min' ) ) {\n\t\t\t$timestamp = str_replace( 'min', 'minute', $timestamp_time ) . ' ago';\n\t\t} elseif ( false !== strpos( $timestamp_time, 'mins' ) ) {\n\t\t\t$timestamp = str_replace( 'mins', 'minutes', $timestamp_time ) . ' ago';\n\t\t}\n\n\t\tinclude_once( \"{$this->plugin->dir_path}/templates/top-story-box.php\" );\n\t}",
"function udesign_blog_post_top_area_inside() {\r\n do_action('udesign_blog_post_top_area_inside');\r\n}",
"function udesign_sidebar_top() {\r\n do_action('udesign_sidebar_top');\r\n}",
"function grve_print_recent_portfolio_items() {\n\n\t$exclude_ids = array( get_the_ID() );\n\t$args = array(\n\t\t'post_type' => 'portfolio',\n\t\t'post_status'=>'publish',\n\t\t'post__not_in' => $exclude_ids ,\n\t\t'posts_per_page' => 3,\n\t\t'paged' => 1,\n\t);\n\n\n\t$query = new WP_Query( $args );\n\n\tif ( $query->have_posts() && $query->found_posts > 1 ) {\n?>\n\t<div class=\"grve-related-post\">\n\t\t<h5 class=\"grve-related-title\"><?php _e( 'Recent Entries', GRVE_THEME_TRANSLATE ); ?></h5>\n\t\t<ul>\n\n<?php\n\n\t\tif ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();\n\t\t\techo '<li>';\n\t\t\tget_template_part( 'templates/portfolio', 'recent' );\n\t\t\techo '</li>';\n\t\tendwhile;\n\t\telse :\n\t\tendif;\n?>\n\t\t</ul>\n\t</div>\n<?php\n\t\twp_reset_postdata();\n\t}\n}",
"public static function entries_top () \n {\n $html = null; \n\n load::view( 'admin/entries/top' );\n $html .= entries_top::form();\n \n return $html;\n }",
"public function topAction()\n {\n $this->view->title = 'FENS様検索エンジン管理システム|FENS';\n $this->render();\n }",
"function udesign_bottom_section_top() {\r\n do_action('udesign_bottom_section_top');\r\n}",
"function udesign_top_elements_inside( $is_front_page ) {\r\n do_action('udesign_top_elements_inside', $is_front_page);\r\n}",
"function wsu_news_top_stories( $query ) {\n\tif ( is_home() && $query->is_main_query() )\n\t\t$query->set( 'category_name', 'top-stories' );\n\n}",
"public function actionTopmembers()\n\t{\t\t\n\t\t$this->layout='front_layout';\n\t\tYii::app()->clientScript->registerCoreScript('jquery');\t\t\n\t\t$allusersphotos = array();\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->select = 't.* , (SELECT COUNT(*) FROM log_photos_hearts b WHERE b.owner_id = t.user_id) AS totalcount';\n\t\t$criteria->group = 't.user_id';\n\t\t$criteria->order = 'totalcount DESC';\n\t\t$criteria->limit=$this->cartlimit;\t\t\n\t\t$country = Yii::app()->user->getState('usercountry');\n\t\tif(!empty($country)){\n\t\t\t//Show Only User's Country\n\t\t\t$criteria->condition = \"userLocation.user_location_country='$country' AND userDetails.user_unique_url<>'poslyadmin'\";\t\t\t\n\t\t\t$allusersphotos=Photos::model()->with('user', 'user.userDetails','user.userLocation')->findAll($criteria);\n\t\t}\t\t\n\t\telse{\n\t\t\t//If Not, Show World Wide\n\t\t\t$criteria->condition = 'exists(select * from photos where user_id=t.user_id) AND userDetails.user_unique_url<>\"poslyadmin\"';\t\t\t\n\t\t\t$allusersphotos=Photos::model()->with('user', 'user.userDetails')->findAll($criteria);\n\t\t}\t\n\t\tunset($criteria);\t\t\t\t\n\t\t//Get Hash Tags Listings for sidebar, this action define in Controller class\n\t\t$limit = (Yii::app()->user->isGuest)?9:6; //HashTag Limit\t\t\n\t\t$hash_tags = $this->actionHashtaglist($limit);\n\t\t$this->render('index', array('photos'=>$allusersphotos,'hash_tags'=>$hash_tags,'menulink'=>'topmember'));\t\t\n\t}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"public static function process_content_top($p_catdata)\n {\n if (isys_maintenance_dao::instance(isys_application::instance()->database)->is_in_maintenance($p_catdata['isys_obj__id']))\n {\n global $index_includes;\n\n $index_includes['contenttopobjectdetail'][] = __DIR__ . '/templates/contenttop/main_objectdetail.tpl';\n } // if\n }",
"function show_topquartermile()\n\t{\n\t\tglobal $required_position, $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\tif ( $garage_config['topquartermile_on'] != TRUE )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$template_block = 'block_'.$required_position;\n\t\t$template_block_row = 'block_'.$required_position.'.row';\n\t\t$template->assign_block_vars($template_block, array(\n\t\t\t'BLOCK_TITLE' => $lang['Top_Quartermile_Runs'],\n\t\t\t'COLUMN_1_TITLE' => $lang['Vehicle'],\n\t\t\t'COLUMN_2_TITLE' => $lang['Owner'],\n\t\t\t'COLUMN_3_TITLE' => $lang['Quartermile'])\n\t\t);\n\t\n\t // What's the count? Default to 10\n\t $limit = $garage_config['topquartermile_limit'] ? $garage_config['topquartermile_limit'] : 10;\n\t\n\t\t//First Query To Return Top Time For All Or For Selected Filter...\n\t\t$sql = \"SELECT qm.garage_id, MIN(qm.quart) as quart\n\t\t\tFROM \" . GARAGE_QUARTERMILE_TABLE .\" AS qm\n\t\t\t\tLEFT JOIN \" . GARAGE_TABLE .\" AS g ON qm.garage_id = g.id\n\t\t\t\tLEFT JOIN \" . USERS_TABLE .\" AS user ON g.member_id = user.user_id\n\t\t\t LEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n\t \t\t\tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n\t\t\tWHERE\t(qm.sixty IS NOT NULL\n\t\t\t\tOR qm.three IS NOT NULL\n\t\t\t\tOR qm.eight IS NOT NULL\n\t\t\t\tOR qm.eightmph IS NOT NULL\n\t\t\t\tOR qm.thou IS NOT NULL\n\t\t\t\tOR qm.rt IS NOT NULL\n\t\t\t\tOR qm.quartmph IS NOT NULL) AND ( qm.pending = 0 )\n\t\t\t\tAND ( makes.pending = 0 AND models.pending = 0 )\n\t\t\tGROUP BY qm.garage_id\n\t\t\tORDER BY quart ASC LIMIT $limit \";\n\t\n\t\tif( !($first_result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Error Selecting Top Quartermile Time', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\t\n\t\t//Now Process All Rows Returned And Get Rest Of Required Data\t\n\t\t$i = 0;\n\t\twhile ($row = $db->sql_fetchrow($first_result) )\n\t\t{\n\t\t\t$sql = \"SELECT g.id, g.member_id, user.username, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle,\n\t\t\t\t\tqm.rt, qm.sixty, qm.three, qm.eight, qm.eightmph, qm.thou, qm.quart, qm.quartmph, qm.rr_id,\n\t\t\t\t\trr.bhp, rr.bhp_unit, rr.torque, rr.torque_unit, rr.boost, rr.boost_unit, rr.nitrous\n\t\t\t\tFROM \" . GARAGE_QUARTERMILE_TABLE .\" AS qm\n\t\t\t\t\tLEFT JOIN \" . GARAGE_TABLE .\" AS g ON qm.garage_id = g.id\n\t\t\t\t\tLEFT JOIN \" . USERS_TABLE .\" AS user ON g.member_id = user.user_id\n\t\t\t\t\tLEFT JOIN \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr ON qm.rr_id = rr.id\n\t\t\t\t LEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n\t \t\t\t\tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n\t\t\t\tWHERE qm.garage_id = \" . $row['garage_id'] . \" AND qm.quart = \" . $row['quart'];\n\t\n\t \t\tif(!$result = $db->sql_query($sql))\n\t\t\t{\n\t\t\t\tmessage_die(GENERAL_ERROR, \"Could not query vehicle information\", \"\", __LINE__, __FILE__, $sql);\n\t\t\t}\n\t \t\t \n\t\t \t$vehicle_data = $db->sql_fetchrow($result);\n\t\n\t\t\t$mph = (empty($vehicle_data['quartmph'])) ? 'N/A' : $vehicle_data['quartmph'];\n\t \t$quartermile = $vehicle_data['quart'] .' @ ' . $mph . ' '. $lang['Quartermile_Speed_Unit'];\n\t\n\t\t\t$template->assign_block_vars($template_block_row, array(\n\t\t\t\t'U_COLUMN_1' => append_sid(\"garage.$phpEx?mode=view_vehicle&CID=\".$vehicle_data['id'].\"\"),\n\t\t\t\t'U_COLUMN_2' => append_sid(\"profile.$phpEx?mode=viewprofile&\".POST_USERS_URL.\"=\".$vehicle_data['member_id'].\"\"),\n\t\t\t\t'COLUMN_1_TITLE' => $vehicle_data['vehicle'],\n\t\t\t\t'COLUMN_2_TITLE' => $vehicle_data['username'],\n\t\t\t\t'COLUMN_3' => $quartermile)\n\t\t\t);\n\t \t}\n\t\n\t\t$required_position++;\n\t\treturn ;\n\t}",
"public function actionTop() {\n $limit = 5;\n $model = new $this->modelClass;\n $results = $model::find()->limit($limit)->orderBy(['Data' => SORT_DESC, 'Nome' => SORT_ASC])->all();\n return['limite' => $limit, 'results' => $results];\n }"
]
| [
"0.7634179",
"0.76229507",
"0.7539794",
"0.7029643",
"0.6550606",
"0.6467601",
"0.6436312",
"0.6421846",
"0.6341648",
"0.6213171",
"0.616924",
"0.60957086",
"0.60762626",
"0.60298204",
"0.5913238",
"0.5875949",
"0.5850527",
"0.58422214",
"0.5820594",
"0.5777779",
"0.57564014",
"0.57273626",
"0.5578055",
"0.5560679",
"0.5542257",
"0.55312043",
"0.54907346",
"0.54849446",
"0.5457813",
"0.54544747"
]
| 0.88724357 | 0 |
Fire the 'udesign_single_portfolio_entry_bottom' action. | function udesign_single_portfolio_entry_bottom() {
do_action('udesign_single_portfolio_entry_bottom');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_single_post_entry_bottom() {\r\n do_action('udesign_single_post_entry_bottom');\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_single_portfolio_entry_after() {\r\n do_action('udesign_single_portfolio_entry_after');\r\n}",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_single_portfolio_entry_top() {\r\n do_action('udesign_single_portfolio_entry_top');\r\n}",
"function udesign_single_post_entry_after() {\r\n do_action('udesign_single_post_entry_after');\r\n}",
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"function udesign_sidebar_bottom() {\r\n do_action('udesign_sidebar_bottom');\r\n}",
"function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}",
"function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}",
"function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}",
"function udesign_entry_after() {\r\n do_action('udesign_entry_after');\r\n}",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"public function executeFooterPanel()\n {\n }",
"function omega_entry_footer() {\n\n\tif ( 'post' == get_post_type() ) {\n\t\tget_template_part( 'partials/entry', 'footer' ); \n\t} \n\n\tif(is_singular()) {\n\t\techo omega_apply_atomic_shortcode( 'entry_meta', '<div class=\"entry-meta\">[post_edit]</div>' );\n\t}\n\t\n}",
"function footer() {\n }",
"function footer()\r\n{\r\n}",
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"function udesign_top_wrapper_bottom( $is_front_page ) {\r\n do_action('udesign_top_wrapper_bottom', $is_front_page);\r\n}",
"public function footer() {\n\t}",
"function cera_grimlock_footer() {\n\t\tdo_action( 'grimlock_prefooter', array(\n\t\t\t'callback' => 'cera_grimlock_prefooter_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_footer', array(\n\t\t\t'callback' => 'cera_grimlock_footer_callback',\n\t\t) );\n\t}",
"function rovoko_portfolio_sidebar_position(){\n return apply_filters('rovoko_portfolio_sidebar_position','bottom');\n}",
"public function on_admin_footer() {\n\t\tif ( $this->is_on_our_own_pages() ) {\n\t\t\t/**\n\t\t\t * Similar to action WordPress action `admin_footer`,\n\t\t\t * but only fired from pages with Simple History.\n\t\t\t *\n\t\t\t * @param Simple_History $instance This class.\n\t\t\t */\n\t\t\tdo_action( 'simple_history/admin_footer', $this );\n\t\t}\n\t}",
"public function do_footer_items()\n {\n }",
"public function do_footer_items()\n {\n }"
]
| [
"0.7778329",
"0.76148087",
"0.7567678",
"0.7533594",
"0.698226",
"0.69144386",
"0.65032864",
"0.6476119",
"0.64070517",
"0.6361044",
"0.633269",
"0.6323686",
"0.6236785",
"0.6146676",
"0.60773873",
"0.6032739",
"0.6002001",
"0.5981179",
"0.5816979",
"0.5780938",
"0.56822133",
"0.56449",
"0.5541084",
"0.55016387",
"0.548492",
"0.548174",
"0.54676867",
"0.54428935",
"0.54391444",
"0.54391444"
]
| 0.88689995 | 0 |
( hooks ) Fire the 'udesign_bottom_section_top' action | function udesign_bottom_section_top() {
do_action('udesign_bottom_section_top');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_body_top() {\r\n do_action('udesign_body_top');\r\n}",
"function udesign_top_wrapper_top() {\r\n do_action('udesign_top_wrapper_top');\r\n}",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_page_content_top() {\r\n do_action('udesign_page_content_top');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_entry_top() {\r\n do_action('udesign_entry_top');\r\n}",
"function udesign_home_page_content_top() {\r\n do_action('udesign_home_page_content_top');\r\n}",
"function udesign_head_top() {\r\n do_action('udesign_head_top');\r\n}",
"function udesign_sidebar_top() {\r\n do_action('udesign_sidebar_top');\r\n}",
"function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}",
"function udesign_sidebar_bottom() {\r\n do_action('udesign_sidebar_bottom');\r\n}",
"function udesign_blog_post_top_area_inside() {\r\n do_action('udesign_blog_post_top_area_inside');\r\n}",
"function udesign_top_wrapper_bottom( $is_front_page ) {\r\n do_action('udesign_top_wrapper_bottom', $is_front_page);\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function udesign_single_post_entry_top() {\r\n do_action('udesign_single_post_entry_top');\r\n}",
"function udesign_blog_entry_top() {\r\n do_action('udesign_blog_entry_top');\r\n}",
"function main_section() {\n\t\t\t\t// GNDN\n\t\t}",
"function saju_jukebox_echo_section_top() {\n\n\t_e( 'Configure the general settings for the Jukebox', SAJU_LANGUAGE_DOMAIN );\n\n}",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"function udesign_page_title_top() {\r\n do_action('udesign_page_title_top');\r\n}",
"function finalizeTopSection() {\n\t$returnVal = \"\";\n\t$returnVal .= '<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3E/ihU7zmQxVncDAy5uIKz4rEkgIXeM>';\n\t$returnVal .= \"<!doctype html>\\n\";\n\t$returnVal .= \"<html lang=\\\"en\\\">\\n\";\n\t$returnVal .= \"<head><title>\";\n\t$returnVal .= $this->_title;\n\t$returnVal .= \"</title>\\n\";\n $returnVal .= $this->_headSection;\n\t$returnVal .= \"</head>\\n\";\n\t$returnVal .= \"<body>\\n\";\n\n\t$this->_top = $returnVal;\n\n}",
"function udesign_top_wrapper_before() {\r\n do_action('udesign_top_wrapper_before');\r\n}",
"function udesign_single_post_entry_bottom() {\r\n do_action('udesign_single_post_entry_bottom');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function udesign_main_content_top( $is_front_page ) {\r\n do_action('udesign_main_content_top', $is_front_page);\r\n}",
"function cera_grimlock_header_callback() {\n\t\tif ( apply_filters( 'grimlock_navigation_has_position_top', true ) ) :\n\t\t\tdo_action( 'grimlock_navigation' );\n\t\tendif;\n\n\t\tdo_action( 'grimlock_custom_header' );\n\n\t\tif ( apply_filters( 'grimlock_navigation_has_position_bottom', true ) ) :\n\t\t\tdo_action( 'grimlock_navigation' );\n\t\tendif;\n\t}"
]
| [
"0.8349524",
"0.738864",
"0.71261615",
"0.7036555",
"0.69438994",
"0.69296926",
"0.6926172",
"0.6815512",
"0.6804111",
"0.6761335",
"0.6560166",
"0.6553668",
"0.65340936",
"0.6533866",
"0.6495414",
"0.64897",
"0.64630544",
"0.63505316",
"0.6203133",
"0.61791897",
"0.61083",
"0.6028081",
"0.6025683",
"0.6017958",
"0.6004845",
"0.5983331",
"0.5980812",
"0.59614706",
"0.5948385",
"0.5855982"
]
| 0.89455444 | 0 |
Fire the 'udesign_bottom_section_bottom' action. | function udesign_bottom_section_bottom() {
do_action('udesign_bottom_section_bottom');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_bottom_section_top() {\r\n do_action('udesign_bottom_section_top');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"function udesign_sidebar_bottom() {\r\n do_action('udesign_sidebar_bottom');\r\n}",
"function udesign_single_post_entry_bottom() {\r\n do_action('udesign_single_post_entry_bottom');\r\n}",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}",
"public function atBottom() {\n }",
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"public static function show_box_bottom() {\n require Config::get('prefix') . '/templates/show_box_bottom.inc.php';\n }",
"public function control_panel__add_to_foot()\n\t{\n\t\tif (URL::getCurrent(false) !== '/publish') {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\treturn $this->js->link('section_links');\n\t}",
"public function executeFooterPanel()\n {\n }",
"public function sectionEnd() {}",
"public function sectionEnd() {}",
"function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}",
"function udesign_top_wrapper_bottom( $is_front_page ) {\r\n do_action('udesign_top_wrapper_bottom', $is_front_page);\r\n}",
"function display_section_after( $retval, $section ) {\n\t$layout = get_field( 'section_layout', $section );\n\tswitch ( $layout ) {\n\t\tcase 'courses':\n\t\t\t$retval = display_courses_after( $section );\n\t\t\tbreak;\n\t\tcase 'timeline':\n\t\t\t$retval = display_timeline_after( $section );\n\t\t\tbreak;\n\t\tcase 'default':\n\t\tdefault:\n\t\t\t$retval = \\UCF_Section_Common::ucf_section_display_after( $section );\n\t\t\tbreak;\n\t}\n\n\treturn $retval;\n}",
"public function footerAction() {$this->_helper->viewRenderer->setResponseSegment('footer');}",
"function section_end(){\n\techo '</div>';\n\techo '</div>';\n}",
"public function section_footer(){\n\t\tinclude 'secciones/'.$this->seccion['footer'].'.php'; \n\t}",
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"public function on_admin_footer() {\n\t\tif ( $this->is_on_our_own_pages() ) {\n\t\t\t/**\n\t\t\t * Similar to action WordPress action `admin_footer`,\n\t\t\t * but only fired from pages with Simple History.\n\t\t\t *\n\t\t\t * @param Simple_History $instance This class.\n\t\t\t */\n\t\t\tdo_action( 'simple_history/admin_footer', $this );\n\t\t}\n\t}",
"function client_portal_move_yoast_to_bottom() {\n\t\treturn 'low';\n\t}",
"public function footer() {\n\t}"
]
| [
"0.7692421",
"0.7486269",
"0.74860847",
"0.7480541",
"0.7474261",
"0.70968676",
"0.69182026",
"0.6901982",
"0.6880689",
"0.66537917",
"0.65192395",
"0.6293894",
"0.6259447",
"0.6174138",
"0.60782176",
"0.60220665",
"0.5909533",
"0.5831497",
"0.58130014",
"0.58130014",
"0.57836694",
"0.57428586",
"0.5739566",
"0.5699881",
"0.56801766",
"0.5631272",
"0.5594949",
"0.5548717",
"0.5478046",
"0.5421626"
]
| 0.8852064 | 0 |
( hooks ) Fire the 'udesign_footer_before' action | function udesign_footer_before() {
do_action('udesign_footer_before');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"protected function after_filter()\n {\n $this->render('footer.php');\n }",
"function kickstart_before_footer() {\n\tgenesis_widget_area( 'before-footer', array(\n\t\t'before' => '<section class=\"before-footer\"><div class=\"wrap\">',\n\t\t'after' => '</div></section>',\n\t) );\n}",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function publisher_inject_location_post_before_footer() {\n\n\t\tpublisher_inject_location( 'post_before_footer' );\n\t}",
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function quasar_before_footer_hook(){\n\t//Do Nothing\n}",
"public function admin_footer__sync()\n {\n }",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"public function on_admin_footer() {\n\t\tif ( $this->is_on_our_own_pages() ) {\n\t\t\t/**\n\t\t\t * Similar to action WordPress action `admin_footer`,\n\t\t\t * but only fired from pages with Simple History.\n\t\t\t *\n\t\t\t * @param Simple_History $instance This class.\n\t\t\t */\n\t\t\tdo_action( 'simple_history/admin_footer', $this );\n\t\t}\n\t}",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function cera_grimlock_footer() {\n\t\tdo_action( 'grimlock_prefooter', array(\n\t\t\t'callback' => 'cera_grimlock_prefooter_callback',\n\t\t) );\n\n\t\tdo_action( 'grimlock_footer', array(\n\t\t\t'callback' => 'cera_grimlock_footer_callback',\n\t\t) );\n\t}",
"function afterLayout() { \t\t\n }",
"public function after() {\n $this->template->header = View::factory('manage/partial/header')\n ->set('user', Auth::instance()->get_user());\n $this->template->menu = View::factory('manage/partial/menu');\n parent::after();\n }",
"function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}",
"public function my_addition_to_login_footer() {\n }",
"function my_footer_shh() {\n remove_filter( 'update_footer', 'core_update_footer' );\n}",
"protected function footer()\n {\n\n }",
"function opinionstage_settings_load_footer(){\n}",
"public function footerAction() {$this->_helper->viewRenderer->setResponseSegment('footer');}",
"public function hookFooter(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'.tpl');\n }",
"public function initPageFooter()\n\t{\n\t\tinclude_once('view/main_page_footer.php');\n\t}",
"function footer() {\n\t\trequire ('views/partial/footer.php');\n\t}"
]
| [
"0.8307305",
"0.8133413",
"0.7422944",
"0.7370173",
"0.71765405",
"0.71765405",
"0.71765405",
"0.71765405",
"0.71765405",
"0.7167088",
"0.7101153",
"0.703564",
"0.6987211",
"0.6979943",
"0.69759494",
"0.6973632",
"0.6971524",
"0.6940069",
"0.6935306",
"0.69126517",
"0.69054544",
"0.68954283",
"0.68828714",
"0.6859777",
"0.6828167",
"0.6765669",
"0.67619234",
"0.67531914",
"0.67328674",
"0.672293"
]
| 0.8791675 | 0 |
Fire the 'udesign_footer_after' action. | function udesign_footer_after() {
do_action('udesign_footer_after');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_entry_after() {\r\n do_action('udesign_entry_after');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"protected function after_filter()\n {\n $this->render('footer.php');\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function udesign_footer_before() {\r\n do_action('udesign_footer_before');\r\n}",
"function display_portal_footer()\r\n {\r\n Display :: footer();\r\n }",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}",
"public function executeFooterPanel()\n {\n }",
"public function on_admin_footer() {\n\t\tif ( $this->is_on_our_own_pages() ) {\n\t\t\t/**\n\t\t\t * Similar to action WordPress action `admin_footer`,\n\t\t\t * but only fired from pages with Simple History.\n\t\t\t *\n\t\t\t * @param Simple_History $instance This class.\n\t\t\t */\n\t\t\tdo_action( 'simple_history/admin_footer', $this );\n\t\t}\n\t}",
"public function footerAction() {$this->_helper->viewRenderer->setResponseSegment('footer');}",
"public function after() {\n $this->template->header = View::factory('manage/partial/header')\n ->set('user', Auth::instance()->get_user());\n $this->template->menu = View::factory('manage/partial/menu');\n parent::after();\n }",
"function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}",
"protected function footer()\n {\n\n }",
"function udesign_single_post_entry_after() {\r\n do_action('udesign_single_post_entry_after');\r\n}",
"public function footer() {\n\t}",
"public function do_footer_items()\n {\n }",
"public function do_footer_items()\n {\n }",
"function footer() {\n\t\trequire ('views/partial/footer.php');\n\t}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function tr_custom_admin_footer() {\n\t_e('<span id=\"footer-thankyou\">Developed by <a href=\"http://third-law.com\" target=\"_blank\">Kenny Scott (Third Law Web Design)</a></span>. Built using Tabula Rasa.', 'tabula_rasa');\n}",
"public function after_main_content() {\n\t?>\n\n\t\t\t</div><!-- #bbp-content -->\n\t\t</div><!-- #bbp-container -->\n\n\t<?php\n\t}"
]
| [
"0.7849621",
"0.77520007",
"0.74532896",
"0.737358",
"0.7333914",
"0.732307",
"0.72428817",
"0.7161421",
"0.7161421",
"0.7161421",
"0.7161421",
"0.7161421",
"0.71566147",
"0.71438915",
"0.71216035",
"0.7076594",
"0.7060886",
"0.7057326",
"0.7056256",
"0.70466727",
"0.7007244",
"0.700262",
"0.69344896",
"0.6895175",
"0.6878423",
"0.6878423",
"0.6876358",
"0.68696123",
"0.68514603",
"0.6831937"
]
| 0.9004031 | 0 |
Fire the 'udesign_footer_inside' action | function udesign_footer_inside() {
do_action('udesign_footer_inside');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_footer_before() {\r\n do_action('udesign_footer_before');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"public function footerAction() {$this->_helper->viewRenderer->setResponseSegment('footer');}",
"function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}",
"public function executeFooterPanel()\n {\n }",
"function display_portal_footer()\r\n {\r\n Display :: footer();\r\n }",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"function admin_footer()\n {\n }",
"protected function footer()\n {\n\n }",
"public function do_footer_items()\n {\n }",
"public function do_footer_items()\n {\n }",
"function udesign_inside_body_tag() {\r\n do_action('udesign_inside_body_tag');\r\n}",
"function footer()\r\n{\r\n}",
"function footer() {\n\t\trequire ('views/partial/footer.php');\n\t}",
"function display_footer()\r\n {\r\n if ($this->has_menu())\r\n {\r\n echo '<div class=\"clear\"> </div>';\r\n echo '</div>';\r\n }\r\n\r\n echo '<div class=\"clear\"> </div>';\r\n Display :: footer();\r\n }",
"function block_footer_area()\n {\n }",
"protected function after_filter()\n {\n $this->render('footer.php');\n }",
"public function renderDivisionFooter(): void;",
"abstract protected function footer();",
"abstract protected function footer();",
"function Footer(){\n\t}",
"function Footer()\r\n {\r\n }",
"public function footer() {\n\t}"
]
| [
"0.7364748",
"0.7115632",
"0.7088075",
"0.7058516",
"0.7019944",
"0.69651705",
"0.6857125",
"0.6856942",
"0.6808579",
"0.67870265",
"0.6780938",
"0.6780938",
"0.6780938",
"0.6780938",
"0.6780938",
"0.67451435",
"0.6727647",
"0.6727647",
"0.6724726",
"0.6709509",
"0.669939",
"0.6694622",
"0.6694362",
"0.66434026",
"0.6639864",
"0.6639383",
"0.6639383",
"0.6587862",
"0.6578449",
"0.6564984"
]
| 0.87243605 | 0 |
( hooks ) Fire the 'udesign_sidebar_top' action | function udesign_sidebar_top() {
do_action('udesign_sidebar_top');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_top_wrapper_top() {\r\n do_action('udesign_top_wrapper_top');\r\n}",
"function udesign_body_top() {\r\n do_action('udesign_body_top');\r\n}",
"function udesign_page_content_top() {\r\n do_action('udesign_page_content_top');\r\n}",
"function udesign_entry_top() {\r\n do_action('udesign_entry_top');\r\n}",
"function udesign_home_page_content_top() {\r\n do_action('udesign_home_page_content_top');\r\n}",
"function udesign_head_top() {\r\n do_action('udesign_head_top');\r\n}",
"function udesign_bottom_section_top() {\r\n do_action('udesign_bottom_section_top');\r\n}",
"function udesign_top_wrapper_before() {\r\n do_action('udesign_top_wrapper_before');\r\n}",
"function udesign_sidebar_bottom() {\r\n do_action('udesign_sidebar_bottom');\r\n}",
"function udesign_main_content_top( $is_front_page ) {\r\n do_action('udesign_main_content_top', $is_front_page);\r\n}",
"function udesign_blog_entry_top() {\r\n do_action('udesign_blog_entry_top');\r\n}",
"function udesign_blog_post_top_area_inside() {\r\n do_action('udesign_blog_post_top_area_inside');\r\n}",
"function ft_hook_sidebar() {}",
"function msdlab_hero(){\n if(is_active_sidebar('homepage-top')){\n print '<div id=\"hp-top\">';\n dynamic_sidebar('homepage-top');\n print '</div>';\n } \n}",
"public function hookTop(){\n $settings = unserialize( Configuration::get($this->name.'_settings') );\n \n $this->context->smarty->assign(array(\n 'user' => $settings['user'],\n 'widget_id' => $settings['widget_id'],\n 'tweets_limit' => $settings['tweets_limit'],\n 'follow_btn' => $settings['follow_btn']\n ));\n \n return $this->display(__FILE__, $this->name.'_scroll.tpl');\n }",
"function udesign_page_title_top() {\r\n do_action('udesign_page_title_top');\r\n}",
"function udesign_single_post_entry_top() {\r\n do_action('udesign_single_post_entry_top');\r\n}",
"public function quickSidebarAction();",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function sidebar() {\n\t\t}",
"function mpcth_display_top_area($id = 'mpcth_top_widget_area'){\r\n\techo '<div id=\"mpcth_top_widget_area\">';\r\n\t\techo '<ul class=\"mpcth-top-widget-hidden\">';\r\n\t\t\tdynamic_sidebar($id);\r\n\t\techo '</ul>';\r\n\t\techo '<div class=\"mpcth-clear-fix\"></div>';\r\n\t\techo '<div id=\"mpcth_top_widget_area_handle\"></div>';\r\n\techo '</div>';\r\n}",
"public function sidebarAction();",
"function udesign_single_portfolio_entry_top() {\r\n do_action('udesign_single_portfolio_entry_top');\r\n}",
"function udesign_top_elements_inside( $is_front_page ) {\r\n do_action('udesign_top_elements_inside', $is_front_page);\r\n}",
"function top() {\n\t\trequire ('views/partial/top.php');\n\t}",
"function launchpad_force_top_sidebar() {\n\treturn 'above';\n}",
"public function topAction();",
"function generate_top_bar() {\n\t\tif ( ! is_active_sidebar( 'top-bar' ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<div <?php generate_do_element_classes( 'top_bar' ); ?>>\n\t\t\t<div class=\"inside-top-bar<?php if ( 'contained' == generate_get_option( 'top_bar_inner_width' ) ) echo ' grid-container grid-parent'; ?>\">\n\t\t\t\t<?php dynamic_sidebar( 'top-bar' ); ?>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"function anva_content_before_default() {\n\t?>\n\t<div class=\"sidebar-layout\">\n\t<?php\n}",
"function udesign_top_wrapper_bottom( $is_front_page ) {\r\n do_action('udesign_top_wrapper_bottom', $is_front_page);\r\n}"
]
| [
"0.80772144",
"0.78985214",
"0.7856571",
"0.7613795",
"0.7608971",
"0.760415",
"0.7458171",
"0.7447504",
"0.73809195",
"0.7352353",
"0.7323553",
"0.7307341",
"0.7228115",
"0.72280616",
"0.710423",
"0.7027006",
"0.69553334",
"0.68753314",
"0.6850903",
"0.6783804",
"0.67711884",
"0.67490894",
"0.67345804",
"0.66895723",
"0.6666925",
"0.6665398",
"0.66113645",
"0.6607269",
"0.6539275",
"0.6514921"
]
| 0.89937717 | 0 |
Fire the 'udesign_sidebar_bottom' action. | function udesign_sidebar_bottom() {
do_action('udesign_sidebar_bottom');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function udesign_main_content_bottom() {\r\n do_action('udesign_main_content_bottom');\r\n}",
"function udesign_page_content_bottom() {\r\n do_action('udesign_page_content_bottom');\r\n}",
"function udesign_body_bottom() {\r\n do_action('udesign_body_bottom');\r\n}",
"function udesign_bottom_section_bottom() {\r\n do_action('udesign_bottom_section_bottom');\r\n}",
"function udesign_entry_bottom() {\r\n do_action('udesign_entry_bottom');\r\n}",
"function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}",
"function udesign_single_post_entry_bottom() {\r\n do_action('udesign_single_post_entry_bottom');\r\n}",
"function launchpad_force_bottom_sidebar() {\n\treturn 'below';\n}",
"function udesign_head_bottom() {\r\n do_action('udesign_head_bottom');\r\n}",
"function udesign_single_portfolio_entry_bottom() {\r\n do_action('udesign_single_portfolio_entry_bottom');\r\n}",
"function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}",
"function udesign_footer_after() {\r\n do_action('udesign_footer_after');\r\n}",
"function udesign_sidebar_top() {\r\n do_action('udesign_sidebar_top');\r\n}",
"function udesign_bottom_section_top() {\r\n do_action('udesign_bottom_section_top');\r\n}",
"function rovoko_page_sidebar_position(){\n return apply_filters('rovoko_page_sidebar_position','bottom');\n}",
"function bethel_do_footer_bottom() {\n\tgenesis_widget_area ('footer-bottom', array ('before' => '<div id=\"bethel-header-right-bottom\">', 'after' => '</div>'));\n}",
"function udesign_top_wrapper_bottom( $is_front_page ) {\r\n do_action('udesign_top_wrapper_bottom', $is_front_page);\r\n}",
"function rovoko_post_sidebar_position(){\n return apply_filters('rovoko_post_sidebar_position','bottom');\n}",
"function udesign_footer_inside() {\r\n do_action('udesign_footer_inside');\r\n}",
"function poco_after_content() {\n echo <<<HTML\n\t</main><!-- #main -->\n</div><!-- #primary -->\nHTML;\n\n do_action('poco_sidebar');\n }",
"function udesign_page_content_after() {\r\n do_action('udesign_page_content_after');\r\n}",
"function ft_hook_sidebar() {}",
"public static function show_box_bottom() {\n require Config::get('prefix') . '/templates/show_box_bottom.inc.php';\n }",
"function rovoko_portfolio_sidebar_position(){\n return apply_filters('rovoko_portfolio_sidebar_position','bottom');\n}",
"public function executeFooterPanel()\n {\n }",
"function adaline_bottom_bar() {\n\n\techo '<div class=\"bottom-bar\"><div class=\"wrap\">';\n\n\tgenesis_widget_area( 'bottom-bar-left', array(\n\t\t'before' => '<div class=\"bottom-bar-left\">',\n\t\t'after' => '</div>',\n\t) );\n\n\techo '</div></div>';\n \n}",
"public function on_admin_footer() {\n\t\tif ( $this->is_on_our_own_pages() ) {\n\t\t\t/**\n\t\t\t * Similar to action WordPress action `admin_footer`,\n\t\t\t * but only fired from pages with Simple History.\n\t\t\t *\n\t\t\t * @param Simple_History $instance This class.\n\t\t\t */\n\t\t\tdo_action( 'simple_history/admin_footer', $this );\n\t\t}\n\t}",
"function hybrid_get_utility_after_content() {\n\tget_sidebar( 'after-content' );\n}",
"function client_portal_move_yoast_to_bottom() {\n\t\treturn 'low';\n\t}",
"function anva_content_after_default() {\n\t?>\n\t</div><!-- .sidebar-layout (end) -->\n\t<?php\n}"
]
| [
"0.80990654",
"0.7962936",
"0.78630143",
"0.77415144",
"0.76175904",
"0.73878527",
"0.7115456",
"0.69780076",
"0.69517165",
"0.6911558",
"0.68659353",
"0.67205274",
"0.6623563",
"0.6616495",
"0.6612176",
"0.66018146",
"0.6585977",
"0.6512799",
"0.64219165",
"0.6304719",
"0.62731755",
"0.6233935",
"0.61943144",
"0.6111549",
"0.605312",
"0.6033534",
"0.60239744",
"0.6022505",
"0.6008168",
"0.6003988"
]
| 0.8995449 | 0 |
Left boundary of the background fill area | function _fillLeft()
{
return $this->_left + $this->_padding['left'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBackgroundPosition() {return $this->readBackgroundPosition();}",
"public function setRimsBackInteriorLeft($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 14 : // 10\n return 10;\n break;\n case 15 : // 20\n return 20;\n break;\n case 16 : // 30\n return 30;\n break;\n case 17 : // 40\n return 40;\n break;\n case 18 : // 50\n return 50;\n break;\n case 19 : // 60\n return 60;\n break;\n case 20 : // 70\n return 70;\n break;\n case 21 : // 80\n return 80;\n break;\n case 22 : // 90\n return 90;\n break;\n }\n }",
"public function getLeftPixels()\n {\n return $this->left_pixels;\n }",
"function ImageTrim(&$im, $bg, $pad=null){\n if (isset($pad)){\n $pp = explode(' ', $pad);\n if (isset($pp[3])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[3]);\n }else if (isset($pp[2])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[1]);\n }else if (isset($pp[1])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[0], (int) $pp[1]);\n }else{\n $p = array_fill(0, 4, (int) $pp[0]);\n }\n }else{\n $p = array_fill(0, 4, 0);\n }\n\n // Get the image width and height.\n $imw = imagesx($im);\n $imh = imagesy($im);\n\n // Set the X variables.\n $xmin = $imw;\n $xmax = 0;\n\n // Start scanning for the edges.\n for ($iy=0; $iy<$imh; $iy++){\n $first = true;\n for ($ix=0; $ix<$imw; $ix++){\n $ndx = imagecolorat($im, $ix, $iy);\n if ($ndx != $bg){\n if ($xmin > $ix){ $xmin = $ix; }\n if ($xmax < $ix){ $xmax = $ix; }\n if (!isset($ymin)){ $ymin = $iy; }\n $ymax = $iy;\n if ($first){ $ix = $xmax; $first = false; }\n }\n }\n }\n\n // The new width and height of the image. (not including padding)\n $imw = 1+$xmax-$xmin; // Image width in pixels\n $imh = 1+$ymax-$ymin; // Image height in pixels\n\n // Make another image to place the trimmed version in.\n $im2 = imagecreatetruecolor($imw+$p[1]+$p[3], $imh+$p[0]+$p[2]);\n\n // Make the background of the new image the same as the background of the old one.\n $bg2 = imagecolorallocate($im2, ($bg >> 16) & 0xFF, ($bg >> 8) & 0xFF, $bg & 0xFF);\n imagefill($im2, 0, 0, $bg2);\n\n // Copy it over to the new image.\n imagecopy($im2, $im, $p[3], $p[0], $xmin, $ymin, $imw, $imh);\n\n // To finish up, we replace the old image which is referenced.\n $im = $im2;\n }",
"public static function innerFill()\n {\n return self::INNER_FILL;\n }",
"public function getMinArea();",
"public function getWidth() { return 0; }",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"function readBackgroundPosition() {return $this->_backgroundposition;}",
"function fillRect($x,$y,$w,$h) {\n\n if ( $this->rotate != 0 )\n $this->rotateRect($x,$y,$w,$h);\n\n #echo \" x = $x; y = $y; w = $w; h = $h; <br>\";\n\n imagefilledrectangle( $this->img, $x, $y, $x+$w-1, $y+$h-1, $this->currentColor);\n}",
"public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }",
"private static function generateBoundary() {\n\t\treturn \"-----=\".md5(uniqid(mt_rand(), 1));\n\t}",
"function getLeft() ;",
"private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }",
"public function withoutClipRect();",
"public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }",
"function filledRectangle($x1,$y1,$width,$height)\n\t{\n\t\t$point = $this->rotateXY($x1, $y1);\n\t\t//$point = $this->rotateRadial($x1, $y1);\n\t\t$x1 = $point['x'];\n\t\t$y1 = $point['y'];\n\t\tif(rad2deg($this->rotation) == 90 || rad2deg($this->rotation) == -90)\n\t\t{\n\t\t\t$temp = $width;\n\t\t\t$width = $height;\n\t\t\t$height = $temp;\n\t\t\t//$x1 -= $width;\n\t\t\t$y1 -= $height;\n\t\t}\n\t\treturn parent::filledRectangle($x1,$y1,$width,$height);\n\t}",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"public function rotateLeft($bg_color = array(255, 255, 255)) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->rotate(90, $bg_color);\n\t}",
"protected function getBoundary() {\n\t\treturn $this->boundary;\n\t}",
"function part1() {\n $this->fabric = array_fill($this->minY, $this->spanY,\n array_fill($this->minX, $this->spanX, 0)\n );\n // Fill fabric with smaller areas:\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n\n while ($w > 0) {\n while ($h > 0) {\n// echo \"($x,$y)\\n\";\n // Place area id in empty cell:\n if ($this->fabric[$y][$x] === 0) {\n $this->fabric[$y][$x] = $id;\n }\n // Place '@' where areas overlap:\n else if ($this->fabric[$y][$x] !== '@' && $this->fabric[$y][$x] !== 0) {\n $this->fabric[$y][$x] = '@';\n }\n $y++;\n $h--;\n }\n $y = $a['y'];\n $h = $a['h'];\n $x++;\n $w--;\n }\n }\n //$this->printGrid($fabric);\n $charCounts = $this->charCounter('@', $this->fabric);\n echo \"Overlap: $charCounts\\n\";\n }",
"public function getStartTransparency()\r\n {\r\n return $this->start_transparency;\r\n }",
"public function getLeft() {}",
"function _fillBottom()\n {\n return $this->_bottom - $this->_padding['bottom'];\n }",
"private function cutFill($im, $line_numbers, $line_width, $start, $end, $direction, $step = 0) {\n if ($step) $this->step = $step;\n list($r1,$g1,$b1) = self::hex2rgb($start);\n list($r2,$g2,$b2) = self::hex2rgb($end);\n\n/*\n switch($direction) {\n case 'horizontal':\n $line_numbers = imagesx($im);\n $line_width = imagesy($im);\n break;\n case 'vertical':\n $line_numbers = imagesy($im);\n $line_width = imagesx($im);\n break;\n case 'ellipse':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'ellipse2':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle2':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'square':\n case 'rectangle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = max($width,$height)/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'diamond':\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n break;\n default:\n }\n*/\n\n $r = $g = $b = 255;\n $colors = [];\n $fill = '';\n for ( $i = 0; $i < $line_numbers; $i=$i+$this->step ) {\n // old values :\n $old_r=$r;\n $old_g=$g;\n $old_b=$b;\n // new values :\n $r = ( $r2 - $r1 != 0 ) ? intval( $r1 + ( $r2 - $r1 ) * ( $i / $line_numbers ) ): $r1;\n $g = ( $g2 - $g1 != 0 ) ? intval( $g1 + ( $g2 - $g1 ) * ( $i / $line_numbers ) ): $g1;\n $b = ( $b2 - $b1 != 0 ) ? intval( $b1 + ( $b2 - $b1 ) * ( $i / $line_numbers ) ): $b1;\n\n\n if ( \"$old_r,$old_g,$old_b\" != \"$r,$g,$b\")\n $fill = imagecolorallocate( $im, $r, $g, $b );\n $colors[] = $fill;\n }\n return $colors;\n }",
"private function create_blank_image() {\r\n\t\t$image = imagecreatetruecolor( $this->diameter,$this->diameter );\r\n\r\n\t\t/* we also need a transparent background ... */\r\n\t\timagesavealpha($image, true);\r\n\r\n\t\t/* create a transparent color ... */\r\n\t\t$color = imagecolorallocatealpha($image, 0, 0, 0, 127);\r\n\r\n\t\t/* ... then fill the image with it ... */\r\n\t\timagefill($image, 0, 0, $color);\r\n\r\n\t\t/* nothing to do then ... just save the new image ... */\r\n\t\t$this->cutted_image = $image;\r\n\r\n\t\t/* go back and see what should we do next ..? */\r\n\t\treturn;\r\n\r\n\t}",
"public function fillAndStroke() {}",
"function _fillRight()\n {\n return $this->_right - $this->_padding['right'];\n }"
]
| [
"0.5521262",
"0.55172056",
"0.5351764",
"0.5297258",
"0.52384055",
"0.51679784",
"0.51080436",
"0.50638175",
"0.50638175",
"0.5062451",
"0.4992685",
"0.49847004",
"0.4965128",
"0.49375847",
"0.49357322",
"0.49328983",
"0.49171588",
"0.4913568",
"0.49078807",
"0.48998618",
"0.48661017",
"0.48636398",
"0.48630843",
"0.48555905",
"0.48525703",
"0.48511454",
"0.48305652",
"0.48124683",
"0.47654027",
"0.47271135"
]
| 0.57643884 | 0 |
Top boundary of the background fill area | function _fillTop()
{
return $this->_top + $this->_padding['top'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _fillBottom()\n {\n return $this->_bottom - $this->_padding['bottom'];\n }",
"function getBackgroundPosition() {return $this->readBackgroundPosition();}",
"function klippe_mikado_get_top_bar_background_height() {\n\t\t$top_bar_height_meta = klippe_mikado_filter_px( klippe_mikado_options()->getOptionValue( 'top_bar_height' ) );\n\t\t$header_height_meta = klippe_mikado_filter_px( klippe_mikado_options()->getOptionValue( 'menu_area_height' ) );\n\t\t\n\t\t$top_bar_height = ! empty( $top_bar_height_meta ) ? $top_bar_height_meta : 37;\n\t\t$header_height = ! empty( $header_height_meta ) ? $header_height_meta : 82;\n\t\t\n\t\t$top_bar_background_height = round( $top_bar_height ) + round( $header_height / 2 );\n\t\t\n\t\treturn $top_bar_background_height;\n\t}",
"private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }",
"function ImageTrim(&$im, $bg, $pad=null){\n if (isset($pad)){\n $pp = explode(' ', $pad);\n if (isset($pp[3])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[3]);\n }else if (isset($pp[2])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[1]);\n }else if (isset($pp[1])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[0], (int) $pp[1]);\n }else{\n $p = array_fill(0, 4, (int) $pp[0]);\n }\n }else{\n $p = array_fill(0, 4, 0);\n }\n\n // Get the image width and height.\n $imw = imagesx($im);\n $imh = imagesy($im);\n\n // Set the X variables.\n $xmin = $imw;\n $xmax = 0;\n\n // Start scanning for the edges.\n for ($iy=0; $iy<$imh; $iy++){\n $first = true;\n for ($ix=0; $ix<$imw; $ix++){\n $ndx = imagecolorat($im, $ix, $iy);\n if ($ndx != $bg){\n if ($xmin > $ix){ $xmin = $ix; }\n if ($xmax < $ix){ $xmax = $ix; }\n if (!isset($ymin)){ $ymin = $iy; }\n $ymax = $iy;\n if ($first){ $ix = $xmax; $first = false; }\n }\n }\n }\n\n // The new width and height of the image. (not including padding)\n $imw = 1+$xmax-$xmin; // Image width in pixels\n $imh = 1+$ymax-$ymin; // Image height in pixels\n\n // Make another image to place the trimmed version in.\n $im2 = imagecreatetruecolor($imw+$p[1]+$p[3], $imh+$p[0]+$p[2]);\n\n // Make the background of the new image the same as the background of the old one.\n $bg2 = imagecolorallocate($im2, ($bg >> 16) & 0xFF, ($bg >> 8) & 0xFF, $bg & 0xFF);\n imagefill($im2, 0, 0, $bg2);\n\n // Copy it over to the new image.\n imagecopy($im2, $im, $p[3], $p[0], $xmin, $ymin, $imw, $imh);\n\n // To finish up, we replace the old image which is referenced.\n $im = $im2;\n }",
"function get_background_color()\n {\n }",
"public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }",
"public function withoutClipRect();",
"function readBackgroundPosition() {return $this->_backgroundposition;}",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"function getHeight();",
"public function getHeight() { return 0; }",
"function fillRect($x,$y,$w,$h) {\n\n if ( $this->rotate != 0 )\n $this->rotateRect($x,$y,$w,$h);\n\n #echo \" x = $x; y = $y; w = $w; h = $h; <br>\";\n\n imagefilledrectangle( $this->img, $x, $y, $x+$w-1, $y+$h-1, $this->currentColor);\n}",
"public static function innerFill()\n {\n return self::INNER_FILL;\n }",
"function mainTop(){\n\t\techo \"<table align='center' cellpadding='0' cellspacing='0' width='\".$this->width.\"'>\\n<tr>\\n<td width='\".$this->width.\"' class='main-bg'>\\n\";\n\t}",
"public function bottom();",
"public function getRect() {}",
"function background_color()\n {\n }",
"private function drawChartBackground($im, $ymin, $ymax, $yscale, $chart_bounds, $axis_size)\n {\n $chart_x1 = $chart_bounds[0] + $axis_size[0];\n $chart_y1 = $chart_bounds[1] + $axis_size[3];\n $chart_x2 = $chart_bounds[2] - $axis_size[2];\n $chart_y2 = $chart_bounds[3] - $axis_size[1];\n\n $chart_w = $chart_x2 - $chart_x1;\n $chart_h = $chart_y2 - $chart_y1;\n\n // Background\n\n imagefilledrectangle($im, $chart_x1, $chart_y1, $chart_x2, $chart_y2, 0x30FFFFFF);\n }",
"protected function _drawBorderAndBackground(\\SetaPDF_Core_Canvas $canvas, $x, $y) {}",
"function getBackground() {return $this->readBackground();}",
"public function getMaxContours() {}",
"function getHeight() {\n\t\t}",
"function _custom_background_cb()\n {\n }",
"public function fillAndStroke() {}",
"public function getMinArea();",
"private function create_blank_image() {\r\n\t\t$image = imagecreatetruecolor( $this->diameter,$this->diameter );\r\n\r\n\t\t/* we also need a transparent background ... */\r\n\t\timagesavealpha($image, true);\r\n\r\n\t\t/* create a transparent color ... */\r\n\t\t$color = imagecolorallocatealpha($image, 0, 0, 0, 127);\r\n\r\n\t\t/* ... then fill the image with it ... */\r\n\t\timagefill($image, 0, 0, $color);\r\n\r\n\t\t/* nothing to do then ... just save the new image ... */\r\n\t\t$this->cutted_image = $image;\r\n\r\n\t\t/* go back and see what should we do next ..? */\r\n\t\treturn;\r\n\r\n\t}"
]
| [
"0.5730748",
"0.57226485",
"0.5492256",
"0.52805614",
"0.5223241",
"0.5207642",
"0.5149079",
"0.514638",
"0.512437",
"0.5100578",
"0.5100578",
"0.5098976",
"0.50944847",
"0.5048387",
"0.50066936",
"0.49907666",
"0.4972345",
"0.49717635",
"0.49617302",
"0.49597067",
"0.4951335",
"0.49400946",
"0.49333635",
"0.48760173",
"0.48723757",
"0.4866276",
"0.48604774",
"0.48296982",
"0.48294428",
"0.48259884"
]
| 0.59511137 | 0 |
Right boundary of the background fill area | function _fillRight()
{
return $this->_right - $this->_padding['right'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function innerFill()\n {\n return self::INNER_FILL;\n }",
"public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }",
"public function closeFillAndStrokeEvenOdd() {}",
"function getBackgroundPosition() {return $this->readBackgroundPosition();}",
"function fillRect($x,$y,$w,$h) {\n\n if ( $this->rotate != 0 )\n $this->rotateRect($x,$y,$w,$h);\n\n #echo \" x = $x; y = $y; w = $w; h = $h; <br>\";\n\n imagefilledrectangle( $this->img, $x, $y, $x+$w-1, $y+$h-1, $this->currentColor);\n}",
"public function closeFillAndStroke() {}",
"function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }",
"private static function generateBoundary() {\n\t\treturn \"-----=\".md5(uniqid(mt_rand(), 1));\n\t}",
"public function getMapCropBottomRight(): XY\n {\n return $this->mapCropBottomRight;\n }",
"function filledRectangle($x1,$y1,$width,$height)\n\t{\n\t\t$point = $this->rotateXY($x1, $y1);\n\t\t//$point = $this->rotateRadial($x1, $y1);\n\t\t$x1 = $point['x'];\n\t\t$y1 = $point['y'];\n\t\tif(rad2deg($this->rotation) == 90 || rad2deg($this->rotation) == -90)\n\t\t{\n\t\t\t$temp = $width;\n\t\t\t$width = $height;\n\t\t\t$height = $temp;\n\t\t\t//$x1 -= $width;\n\t\t\t$y1 -= $height;\n\t\t}\n\t\treturn parent::filledRectangle($x1,$y1,$width,$height);\n\t}",
"public function fillAndStroke() {}",
"function ImageTrim(&$im, $bg, $pad=null){\n if (isset($pad)){\n $pp = explode(' ', $pad);\n if (isset($pp[3])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[3]);\n }else if (isset($pp[2])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[2], (int) $pp[1]);\n }else if (isset($pp[1])){\n $p = array((int) $pp[0], (int) $pp[1], (int) $pp[0], (int) $pp[1]);\n }else{\n $p = array_fill(0, 4, (int) $pp[0]);\n }\n }else{\n $p = array_fill(0, 4, 0);\n }\n\n // Get the image width and height.\n $imw = imagesx($im);\n $imh = imagesy($im);\n\n // Set the X variables.\n $xmin = $imw;\n $xmax = 0;\n\n // Start scanning for the edges.\n for ($iy=0; $iy<$imh; $iy++){\n $first = true;\n for ($ix=0; $ix<$imw; $ix++){\n $ndx = imagecolorat($im, $ix, $iy);\n if ($ndx != $bg){\n if ($xmin > $ix){ $xmin = $ix; }\n if ($xmax < $ix){ $xmax = $ix; }\n if (!isset($ymin)){ $ymin = $iy; }\n $ymax = $iy;\n if ($first){ $ix = $xmax; $first = false; }\n }\n }\n }\n\n // The new width and height of the image. (not including padding)\n $imw = 1+$xmax-$xmin; // Image width in pixels\n $imh = 1+$ymax-$ymin; // Image height in pixels\n\n // Make another image to place the trimmed version in.\n $im2 = imagecreatetruecolor($imw+$p[1]+$p[3], $imh+$p[0]+$p[2]);\n\n // Make the background of the new image the same as the background of the old one.\n $bg2 = imagecolorallocate($im2, ($bg >> 16) & 0xFF, ($bg >> 8) & 0xFF, $bg & 0xFF);\n imagefill($im2, 0, 0, $bg2);\n\n // Copy it over to the new image.\n imagecopy($im2, $im, $p[3], $p[0], $xmin, $ymin, $imw, $imh);\n\n // To finish up, we replace the old image which is referenced.\n $im = $im2;\n }",
"public function getTileBottomRight(): XY\n {\n return $this->tileBottomRight;\n }",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"public function getInteriorColor() {}",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"public function getRightPixels()\n {\n return $this->right_pixels;\n }",
"public function getRect() {}",
"public function fillAndStrokeEvenOdd() {}",
"function _fillBottom()\n {\n return $this->_bottom - $this->_padding['bottom'];\n }",
"public function setRimsBackInteriorRight($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 14 : // 10\n return 10;\n break;\n case 15 : // 20\n return 20;\n break;\n case 16 : // 30\n return 30;\n break;\n case 17 : // 40\n return 40;\n break;\n case 18 : // 50\n return 50;\n break;\n case 19 : // 60\n return 60;\n break;\n case 20 : // 70\n return 70;\n break;\n case 21 : // 80\n return 80;\n break;\n case 22 : // 90\n return 90;\n break;\n }\n }",
"protected function getBoundary() {\n\t\treturn $this->boundary;\n\t}",
"function drawRating($rating) {\n $image = imagecreate(102,10);\n $back = ImageColorAllocate($image,0,0,0);\n echo $back;\n $border = ImageColorAllocate($image,0,0,0);\n $red = ImageColorAllocate($image,255,60,75);\n $fill = ImageColorAllocate($image,44,81,150);\n ImageFilledRectangle($image,0,0,101,9,$back);\n// ImageFilledRectangle($image,1,1,$rating,9,$fill);\n// ImageRectangle($image,0,0,101,9,$border);\n imagePNG($image,\"aaa.png\");\n imagedestroy($image);\n}",
"public function getRectangle() {}",
"public function areaColor()\n {\n return $this->color[array_rand($this->color)];\n }",
"function area() { return ($this->max->x() - $this->min->x()) * ($this->max->y() - $this->min->y()); }",
"public function getMaxArea();",
"private function cutFill($im, $line_numbers, $line_width, $start, $end, $direction, $step = 0) {\n if ($step) $this->step = $step;\n list($r1,$g1,$b1) = self::hex2rgb($start);\n list($r2,$g2,$b2) = self::hex2rgb($end);\n\n/*\n switch($direction) {\n case 'horizontal':\n $line_numbers = imagesx($im);\n $line_width = imagesy($im);\n break;\n case 'vertical':\n $line_numbers = imagesy($im);\n $line_width = imagesx($im);\n break;\n case 'ellipse':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'ellipse2':\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = sqrt(pow($width,2)+pow($height,2));\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'circle2':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = min($width,$height);\n $center_x = $width/2;\n $center_y = $height/2;\n $rh = $rw = 1;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n imagefill($im, 0, 0, imagecolorallocate( $im, $r1, $g1, $b1 ));\n break;\n case 'square':\n case 'rectangle':\n $width = imagesx($im);\n $height = imagesy($im);\n $line_numbers = max($width,$height)/2;\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n break;\n case 'diamond':\n list($r1,$g1,$b1) = $this->hex2rgb($end);\n list($r2,$g2,$b2) = $this->hex2rgb($start);\n $width = imagesx($im);\n $height = imagesy($im);\n $rh=$height>$width?1:$width/$height;\n $rw=$width>$height?1:$height/$width;\n $line_numbers = min($width,$height);\n break;\n default:\n }\n*/\n\n $r = $g = $b = 255;\n $colors = [];\n $fill = '';\n for ( $i = 0; $i < $line_numbers; $i=$i+$this->step ) {\n // old values :\n $old_r=$r;\n $old_g=$g;\n $old_b=$b;\n // new values :\n $r = ( $r2 - $r1 != 0 ) ? intval( $r1 + ( $r2 - $r1 ) * ( $i / $line_numbers ) ): $r1;\n $g = ( $g2 - $g1 != 0 ) ? intval( $g1 + ( $g2 - $g1 ) * ( $i / $line_numbers ) ): $g1;\n $b = ( $b2 - $b1 != 0 ) ? intval( $b1 + ( $b2 - $b1 ) * ( $i / $line_numbers ) ): $b1;\n\n\n if ( \"$old_r,$old_g,$old_b\" != \"$r,$g,$b\")\n $fill = imagecolorallocate( $im, $r, $g, $b );\n $colors[] = $fill;\n }\n return $colors;\n }",
"function fillRect($x1, $y1, $x2, $y2)\r\n {\r\n $this->forceBrush();\r\n echo \"$this->_canvas.fillRect($x1, $y1, $x2 - $x1, $y2 - $y1);\\n\";\r\n }"
]
| [
"0.5730514",
"0.53344655",
"0.52206135",
"0.5206115",
"0.51312447",
"0.51230943",
"0.51213413",
"0.511804",
"0.5105116",
"0.50972617",
"0.5094289",
"0.50936776",
"0.5072492",
"0.5064896",
"0.5064896",
"0.506355",
"0.505257",
"0.50373",
"0.5033755",
"0.5027902",
"0.5025193",
"0.50030255",
"0.49491996",
"0.49211583",
"0.48896113",
"0.4887648",
"0.48758006",
"0.4874606",
"0.48725092",
"0.4871113"
]
| 0.5784297 | 0 |
Bottom boundary of the background fill area | function _fillBottom()
{
return $this->_bottom - $this->_padding['bottom'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function bottom();",
"function getHeight();",
"public function atBottom() {\n }",
"function boxBottom() {\n\t\treturn html_ac(html_ap() -1).'<!-- class=\"box-surround\" -->'.\"\\n\";\n\t}",
"function getHeight() {\n\t\t}",
"public function getBottomPixels()\n {\n return $this->bottom_pixels;\n }",
"public function getHeight();",
"public function getHeight();",
"public function getHeight();",
"public function getHeight();",
"public function getHeight();",
"function getBackgroundPosition() {return $this->readBackgroundPosition();}",
"public function getHeight() { return 0; }",
"public function createRectangle()\n {\n imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, imagecolorallocate($this->image, 255, 255, 255));\n }",
"public static function innerFill()\n {\n return self::INNER_FILL;\n }",
"private static function generateBoundary() {\n\t\treturn \"-----=\".md5(uniqid(mt_rand(), 1));\n\t}",
"public function getPaddingBottom() {}",
"private function drawChartBackground($im, $ymin, $ymax, $yscale, $chart_bounds, $axis_size)\n {\n $chart_x1 = $chart_bounds[0] + $axis_size[0];\n $chart_y1 = $chart_bounds[1] + $axis_size[3];\n $chart_x2 = $chart_bounds[2] - $axis_size[2];\n $chart_y2 = $chart_bounds[3] - $axis_size[1];\n\n $chart_w = $chart_x2 - $chart_x1;\n $chart_h = $chart_y2 - $chart_y1;\n\n // Background\n\n imagefilledrectangle($im, $chart_x1, $chart_y1, $chart_x2, $chart_y2, 0x30FFFFFF);\n }",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function getHeight() {}",
"public function closeFillAndStroke() {}",
"function swf_shapefillbitmapclip($bitmapid)\n{\n}",
"private function _addBlots() {\r\n\t\t$background = imagecolorallocate($this->_resource, $this->_bg_color['R'], $this->_bg_color['G'], $this->_bg_color['B']);\r\n\t\t$foreground = imagecolorallocate($this->_resource, $this->_fg_color['R'], $this->_fg_color['G'], $this->_fg_color['B']);\r\n\r\n\t\t// Get dimension of image\r\n\t\t$width = imagesx($this->_resource);\r\n\t\t$height = imagesy($this->_resource);\r\n\t\t\r\n\t\t// Add filled rectangle at a random position.\r\n\t\tfor ($i = 0; $i < abs($this->_blotsModifier); $i++) {\r\n\t\t\t$x1 = rand(0, $width);\r\n\t\t\t$y1 = rand(0, $height);\r\n\t\t\t$x2 = $x1 + rand(1, 5);\r\n\t\t\t$y2 = $y1 + rand(1, 5);\r\n\r\n\t\t\t($this->useRandomColorBlots) ? $foreground = $this->_setRandomColor() : null;\r\n\t\t\r\n\t\t\timagefilledrectangle($this->_resource, $x1, $y1, $x2, $y2, (rand(0, 1) ? $foreground: $background));\r\n\t\t}\r\n\t}",
"public function fillAndStroke() {}",
"function launchpad_force_bottom_sidebar() {\n\treturn 'below';\n}"
]
| [
"0.5750766",
"0.5566637",
"0.55184656",
"0.55154043",
"0.54752743",
"0.546661",
"0.5434822",
"0.5434822",
"0.5434822",
"0.5434822",
"0.5434822",
"0.53463644",
"0.5222627",
"0.5102224",
"0.50963026",
"0.5092373",
"0.509138",
"0.50879693",
"0.50490946",
"0.50482213",
"0.5047533",
"0.5047533",
"0.5047533",
"0.5047533",
"0.5047533",
"0.49977824",
"0.49934137",
"0.49896884",
"0.49791402",
"0.49763304"
]
| 0.6755454 | 0 |
Set the extrema of the axis | function _setExtrema(& $plot)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setYAxisMax($a_val)\n\t{\n\t\t$this->y_max = $a_val;\n\t}",
"public function setXAxisMaxToToday() {\n\t\t$this->Options['xaxis']['max'] = time().'000';\n\t}",
"function setYAxisMaximum($max = false)\n {\n if ($max !== false) {\n $max = 1.0 * $max;\n }\n $this->yaxis_max = $max;\n }",
"public function getXMaxExtent() {}",
"public function setXMax($xMax) {}",
"public function setXMaxExtent($xMaxExtent) {}",
"function getYAxisMax()\n\t{\n\t\treturn $this->y_max;\n\t}",
"private function adjust_graph_dimensions(){\n\t\t$this->axiswidth = ($this->startingmonth + 1.5) * $this->monthwidth;\n\t\tif($this->max_graph_height < $this->max_month_value){\n\t\t\t$this->yscale = $this->max_graph_height / $this->max_month_value;\n\t\t}\n\t\t$this->axisheight = $this->yscale * ($this->max_month_value + 20);\n\t\tif($this->max_graph_height < $this->axisheight){\n\t\t\t$this->yscale = $this->yscale * ($this->max_graph_height / $this->axisheight);\n\t\t\t$this->axisheight = $this->max_graph_height;\n\t\t}\n\t\t$this->graphheight = $this->axisheight + $this->graphmargintop + $this->graphmarginbottom;\n\t\t$this->graphwidth = $this->axiswidth + $this->graphmarginleft + $this->graphmarginright;\n\t\t\n\t\treturn;\n\t}",
"public function setYLimits($axis, $min, $max, $autoscale = false, $factor = 'auto') {\n\t\tif ($autoscale) {\n\t\t\t$diff = $max - $min;\n\t\t\tif ($factor == 'auto') {\n\t\t\t\t$factor = pow(10, round(log10($diff))-1);\n\n\t\t\t\tif ($factor > 10)\n\t\t\t\t\t$factor = 10;\n\t\t\t}\n\n\t\t\t$minScaled = $min > 0 ? max(0, $min/$factor - 0.02*$diff) : $min/$factor - 0.02*$diff;\n\t\t\t$min = floor($minScaled)*$factor;\n\t\t\t$max = ceil($max/$factor+0.02*$diff)*$factor;\n\n\t\t\t$this->setYTicks($axis, $factor);\n\t\t}\n\n\t\t$this->Options['yaxes'][$axis-1]['min'] = $min;\n\t\t$this->Options['yaxes'][$axis-1]['max'] = $max;\n\t}",
"public function setYAxisPaceReverse($axis) {\n\t\t$this->Options['yaxes'][$axis-1]['transform'] = 'function(v){return 1/(v);}';\n\t\t$this->Options['yaxes'][$axis-1]['inverseTransform'] = 'function(v){return 1/v;}';\n\t}",
"function setYAxisMinimum($min = false)\n {\n if ($min !== false) {\n $min = 1.0 * $min;\n }\n $this->yaxis_min = $min;\n }",
"public function setAxes($val)\n {\n $this->_propDict[\"axes\"] = $val;\n return $this;\n }",
"public function setYAxisReverse($axis) {\n\t\t$this->Options['yaxes'][$axis-1]['transform'] = 'function(v){return -v;}';\n\t\t$this->Options['yaxes'][$axis-1]['inverseTransform'] = 'function(v){return -v;}';\n\t}",
"public function setXAxisLimitedTo($Year) {\n\t\t$this->Options['xaxis']['min'] = mktime(1,0,0,1,1,$Year).'000';\n\t\t$this->Options['xaxis']['max'] = mktime(1,0,0,1,0,$Year+1).'000';\n\t}",
"public function setYMax($yMax) {}",
"function setBottomAxis($axis)\n {\n return $this->setAxis(1, $axis);\n }",
"public function undo() {\r\n $this->chart->restoreAxisScales();\r\n $this->setZoomed(false);\r\n }",
"private function drawAxis() : void\n\t{\n\t\timageline($this->im, 0 , $this->shiftY , $this->sizeX , $this->shiftY, $this->colorAxisX);\n\t\timageline($this->im, $this->shiftX , 0 , $this->shiftX, $this->sizeY , $this->colorAxisX);\n\t}",
"function get_y_max()\n\t{\n\t\treturn count($this->_config[self::VALUES]) -1;\n\t}",
"protected function AdjustAxes(&$x_len, &$y_len)\n {\n return array(0, 0);\n }",
"public function setLogarithmic($value) /*throws ChartException*/ {\r\n if ($this->chart != null) { //CDI for custom axes at designtime this $value is\r\n //sometimes null.\r\n if (($value) && ($this->isDateTime())) {\r\n throw new ChartException(Language::getString(\"AxisLogDateTime\"));\r\n }\r\n\r\n if ($value) {\r\n $this->adjustMaxMin();\r\n if (($this->iMinimum < 0) || ($this->iMaximum < 0)) {\r\n throw new ChartException(Language::getString(\"AxisLogNotPositive\"));\r\n }\r\n }\r\n }\r\n\r\n $this->logarithmic = $this->setBooleanProperty($this->logarithmic, $value);\r\n }",
"function resize_axis( $size = 0, $axis = 'x' )\n\t{\n\t\tif( $size == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t$old_size = $this->size();\n\t\t\n\t\t//Y Axis\n\t\tif( !strcasecmp( $axis, 'Y' ) )\n\t\t{\n\t\t\t$new_w = $old_size->w * ( $size / $old_size->h );\n\t\t\t$new_h = $size;\n\t\t}\n\t\telse //X axis\n\t\t{\n\t\t\t$new_w = $size;\n\t\t\t$new_h = $old_size->h * ( $size / $old_size->w );\t\t\n\t\t}\n\n\t\t//resize the image\n\t\t$this->resize( $new_w, $new_h );\n\t}",
"private function setChartScale(Dataset $dataset): void\n {\n $this->start = 0;\n $this->unit = 1;\n $boundaries = $dataset->boundaries();\n if (null !== $boundaries) {\n $this->start = $boundaries->getStartDate()->getTimestamp();\n $this->unit = $this->config->width() / $boundaries->getTimestampInterval();\n }\n }",
"private function scaleX() : void\n\t{\n\t\t$this->domain = abs($this->rangeXLow) + abs($this->rangeXHigh);\n\n\t\t$this->scaleX = ((float)$this->sizeX / $this->domain);\n\t\t$this->originX = $this->sizeX >> 1;\n\t\t\n\t}",
"public function getLogarithmicBase() {\r\n return $this->logarithmicBase;\r\n }",
"public function getMaxXValue() {\r\n return $this->chart->getMaxXValue($this);\r\n }",
"public function setMaxExtent($extent = array())\n {\n $extent = explode(',', $extent);\n $this->max_extent = $extent;\n return $this;\n }",
"public function getXMax() {}",
"public function getXMax() {}",
"protected function GetAxisEnds()\n {\n // check guides\n if(is_null($this->guidelines))\n $this->CalcGuidelines();\n\n $v_max = $v_min = $k_max = $k_min = array();\n $y_axis_count = $this->YAxisCount();\n $x_axis_count = $this->XAxisCount();\n if($this->flip_axes) {\n $x_min_fixed = $this->axis_min_v;\n $x_max_fixed = $this->axis_max_v;\n $y_min_fixed = $this->axis_min_h;\n $y_max_fixed = $this->axis_max_h;\n } else {\n $y_min_fixed = $this->axis_min_v;\n $y_max_fixed = $this->axis_max_v;\n $x_min_fixed = $this->axis_min_h;\n $x_max_fixed = $this->axis_max_h;\n }\n\n for($i = 0; $i < $y_axis_count; ++$i) {\n $fixed_max = $this->ArrayOption($y_max_fixed, $i);\n $fixed_min = $this->ArrayOption($y_min_fixed, $i);\n\n // validate\n if(is_numeric($fixed_min) && is_numeric($fixed_max) &&\n $fixed_max < $fixed_min)\n throw new Exception(\"Invalid Y axis options: min > max ({$fixed_min} > {$fixed_max})\");\n\n if(is_numeric($fixed_min)) {\n $v_min[] = $fixed_min;\n } else {\n $minv_list = array($this->GetAxisMinValue($i));\n if(!is_null($this->min_guide['y']))\n $minv_list[] = (float)$this->min_guide['y'];\n\n // if not a log axis, start at 0\n if(!$this->ArrayOption($this->log_axis_y, $i))\n $minv_list[] = 0;\n $v_min[] = min($minv_list);\n }\n\n if(is_numeric($fixed_max)) {\n $v_max[] = $fixed_max;\n } else {\n $maxv_list = array($this->GetAxisMaxValue($i));\n if(!is_null($this->max_guide['y']))\n $maxv_list[] = (float)$this->max_guide['y'];\n\n // if not a log axis, start at 0\n if(!$this->ArrayOption($this->log_axis_y, $i))\n $maxv_list[] = 0;\n $v_max[] = max($maxv_list);\n }\n if($v_max[$i] < $v_min[$i])\n throw new Exception(\"Invalid Y axis: min > max ({$v_min[$i]} > {$v_max[$i]})\");\n }\n\n for($i = 0; $i < $x_axis_count; ++$i) {\n $fixed_max = $this->ArrayOption($x_max_fixed, $i);\n $fixed_min = $this->ArrayOption($x_min_fixed, $i);\n\n if($this->datetime_keys) {\n // 0 is 1970-01-01, not a useful minimum\n if(empty($fixed_max)) {\n $k_max[] = $this->GetAxisMaxKey($i);\n } else {\n $d = SVGGraphDateConvert($fixed_max);\n // subtract a se\n if(!is_null($d))\n $k_max[] = $d - 1;\n else\n throw new Exception(\"Could not convert [{$fixed_max}] to datetime\");\n }\n if(empty($fixed_min)) {\n $k_min[] = $this->GetAxisMinKey($i);\n } else {\n $d = SVGGraphDateConvert($fixed_min);\n if(!is_null($d))\n $k_min[] = $d;\n else\n throw new Exception(\"Could not convert [{$fixed_min}] to datetime\");\n }\n } else {\n // validate\n if(is_numeric($fixed_min) && is_numeric($fixed_max) &&\n $fixed_max < $fixed_min)\n throw new Exception(\"Invalid X axis options: min > max ({$fixed_min} > {$fixed_max})\");\n\n if(is_numeric($fixed_max))\n $k_max[] = $fixed_max;\n else\n $k_max[] = max(0, $this->GetAxisMaxKey($i), (float)$this->max_guide['x']);\n if(is_numeric($fixed_min))\n $k_min[] = $fixed_min;\n else\n $k_min[] = min(0, $this->GetAxisMinKey($i), (float)$this->min_guide['x']);\n }\n if($k_max[$i] < $k_min[$i])\n throw new Exception(\"Invalid X axis: min > max ({$k_min[$i]} > {$k_max[$i]})\");\n }\n return compact('v_max', 'v_min', 'k_max', 'k_min');\n }"
]
| [
"0.60079676",
"0.59782815",
"0.5939233",
"0.59210986",
"0.5746603",
"0.5703005",
"0.5592999",
"0.54902095",
"0.5392896",
"0.53879017",
"0.5347611",
"0.53452665",
"0.52878416",
"0.5209808",
"0.5150446",
"0.51238567",
"0.5089042",
"0.5062619",
"0.50612265",
"0.5051169",
"0.50494486",
"0.50480986",
"0.49663308",
"0.49593925",
"0.49099922",
"0.49083182",
"0.4903601",
"0.48855028",
"0.48855028",
"0.48475444"
]
| 0.7924519 | 0 |
Get the X pixel position represented by a value | function _pointX($value)
{
$country = $value['X'];
return $this->_plotLeft+$this->_mapPoints[$country]['X']*$this->_scale;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function calcXPosValue($value) {\r\n if ($this->isDepthAxis) {\r\n return $this->internalCalcDepthPosValue($value);\r\n } else\r\n if ($this->logarithmic) {\r\n return $this->internalCalcLogPosValue(true, $value);\r\n } else\r\n if ($this->iRangezero) {\r\n return $this->iCenterPos;\r\n } else {\r\n $tmp = ($value - $this->iMinimum) * $this->iAxisSizeRange;\r\n $tmp = $this->inverted ? $this->iEndPos - $tmp : $this->iStartPos + $tmp;\r\n if ($tmp > self::$MAXPIXELPOS) {\r\n $tmp = self::$MAXPIXELPOS;\r\n } else\r\n if ($tmp < -self::$MAXPIXELPOS) {\r\n $tmp = -self::$MAXPIXELPOS;\r\n }\r\n return $tmp;\r\n }\r\n }",
"public function calcPosValue($value) {\r\n return $this->horizontal ? $this->calcXPosValue($value) : $this->calcYPosValue($value);\r\n }",
"public function getValX() {\n return $this->valX;\n }",
"function getX() {\n $pt = $this->getFirstPoint();\n if ( empty($pt) ) return FALSE;\n \n $poslist = $pt->getPosList();\n $cs = explode(' ',$poslist);\n return $cs[1];\n }",
"public function x() {\n return $this->coords[0];\n }",
"private function getXposition()\n {\n return $this->getPositionInstance()->getXposition();\n }",
"public function getX()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_h($this->x);\n }",
"public function getX()\r\n {\r\n //retourne la valeur saisie x\r\n return $this->x;\r\n }",
"public function getX()\n {\n return $this->x;\n }",
"public function offsetX($value) {\n return $this->setProperty('offsetX', $value);\n }",
"public function offsetX($value) {\n return $this->setProperty('offsetX', $value);\n }",
"public function calcPosPoint($value) {\r\n\r\n if ($this->logarithmic) {\r\n if ($value == $this->iStartPos) {\r\n return $this->internalCalcPos($this->iMaximum, $this->iMinimum);\r\n } else if ($value == iEndPos) {\r\n return $this->internalCalcPos($this->iMinimum, $this->iMaximum);\r\n } else {\r\n $tmp = $this->iRangelog;\r\n if ($tmp == 0) {\r\n return $this->iMinimum;\r\n } else {\r\n if ($this->inverted) {\r\n $tmp = (($this->iEndPos - $value) * $tmp / $this->iAxisSize);\r\n } else {\r\n $tmp = (($value - $this->iStartPos) * $tmp / $this->iAxisSize);\r\n }\r\n\r\n return MathUtils::exp($this->horizontal ? $this->iLogMin + $tmp :\r\n $this->iLogMax - $tmp);\r\n }\r\n }\r\n } else\r\n if ($this->iAxisSize > 0) {\r\n\r\n $tmp = $this->inverted ? $this->iEndPos - $value : $value - $this->iStartPos;\r\n $tmp *= $this->iRange / $this->iAxisSize;\r\n return $this->horizontal ? $this->iMinimum + $tmp : $this->iMaximum - $tmp;\r\n\r\n } else {\r\n return 0;\r\n }\r\n }",
"public function getPosX($c)\n {\n $x = $this->getWidthOfBorder();\n\n # Beim 1. Feld brauchen wir sonst keinen Abstand\n if($c == 1)\n {\n $x += 0;\n }\n if($c >= 2)\n {\n $x += $this->getFieldsWidthBrutto() * ($c-1);\n }\n if($c >= 3)\n {\n $x += 12;\n }\n if($c >= 5)\n {\n $x += 12;\n }\n\n # Offset left zu x dazu\n $x += $this->getFieldsOffsetLeft();\n\n # Richtiger X Wert wird zurückgegeben\n return $x;\n }",
"public function getX()\n\t{\n\t\treturn $this->x;\n\t}",
"public function getX()\n\t{\n\t\treturn $this->x;\n\t}",
"public function getPosX();",
"public function getLocationX()\n {\n return $this->locationX;\n }",
"function getX() {\n return $this->x;\n }",
"public function getX() {\n\t\t\treturn $this->_x;\n\t\t}",
"public function getXCoordinate()\n {\n return $this->getValueOfN() * cos(\\deg2rad($this->latitude)) * cos(deg2rad($this->longitude));\n }",
"public function getX() { return $this->_x; }",
"public function getXPosition($unit = null);",
"public function getXp()\n {\n return $this->xp;\n }",
"public function getCursorX()\n {\n return $this->moveToLocal_h($this->pdf->GetCursorX());\n }",
"public function getX();",
"public function getMinXValue() {\r\n return $this->chart->getMinXValue($this);\r\n }",
"public function getPositionXL()\n {\n // Scrutinizer thinks the following could return string. It is wrong.\n return array_search($this->position, self::POSITION_XLREF);\n }",
"public function getOffset($value);",
"public function x($value) {\n return $this->setProperty('x', $value);\n }",
"public function getTileTopLeft(): XY\n {\n return $this->tileTopLeft;\n }"
]
| [
"0.73933333",
"0.6862006",
"0.67047447",
"0.65379083",
"0.6532078",
"0.6504409",
"0.64713615",
"0.6408094",
"0.6356789",
"0.631676",
"0.631676",
"0.6309705",
"0.6303576",
"0.62817353",
"0.62817353",
"0.62714374",
"0.6227571",
"0.6193499",
"0.61524737",
"0.6107381",
"0.6081343",
"0.60803163",
"0.6028251",
"0.5992853",
"0.59268814",
"0.59054995",
"0.59053797",
"0.587857",
"0.5873711",
"0.5871708"
]
| 0.72163194 | 1 |
Get the Y pixel position represented by a value | function _pointY($value)
{
$country = $value['X'];
return $this->_plotTop+$this->_mapPoints[$country]['Y']*$this->_scale;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function calcYPosvalue($value) {\r\n if ($this->isDepthAxis) {\r\n return $this->internalCalcDepthPosValue($value);\r\n } else\r\n if ($this->logarithmic) {\r\n return $this->internalCalcLogPosValue(false, $value);\r\n } else\r\n if ($this->iRangezero) {\r\n return $this->iCenterPos;\r\n } else {\r\n\r\n // compile with //#define CHECKOVER\r\n // if you wish to afunction axis coordinates overflow when zooming,\r\n // specially in Windows 95, 98 or Me.\r\n\r\n//#if CHECKOVER\r\n $tmp = ($value - $this->iMinimum) * $this->iAxisSizeRange;\r\n $tmp = $this->inverted ? $this->iStartPos + $tmp : $this->iEndPos - $tmp;\r\n if ($tmp > self::$MAXPIXELPOS) {\r\n $tmp = self::$MAXPIXELPOS;\r\n } else\r\n if ($tmp < -self::$MAXPIXELPOS) {\r\n $tmp = -self::$MAXPIXELPOS;\r\n }\r\n return (int) $tmp;\r\n\r\n//#else // faster version (no checking)...\r\n\r\n// $tmp = (int) (($value - iMinimum) * iAxisSizeRange);\r\n// return inverted ? IStartPos + tmp : IEndPos - tmp;\r\n\r\n//#endif\r\n }\r\n }",
"public function getValY() {\n return $this->valY;\n }",
"public function y() {\n return $this->coords[1];\n }",
"public function getY()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->y);\n }",
"public function getY(): int;",
"public function getY();",
"public function getY()\n {\n return $this->y;\n }",
"public function getY()\n\t{\n\t\treturn $this->y;\n\t}",
"public function getY()\n\t{\n\t\treturn $this->y;\n\t}",
"public function calcPosValue($value) {\r\n return $this->horizontal ? $this->calcXPosValue($value) : $this->calcYPosValue($value);\r\n }",
"private function getYposition()\n {\n return $this->getPositionInstance()->getYposition();\n }",
"public function getY() {\n\t\t\treturn $this->_y;\n\t\t}",
"public function getY() {}",
"public function getY() {}",
"public function getY(){\r\r\n\t\treturn $this->y_Atual;\r\r\n\t}",
"public function getPosY();",
"public function y($value) {\n return $this->setProperty('y', $value);\n }",
"function getY() {\n $pt = $this->getFirstPoint();\n if ( empty($pt) ) return FALSE;\n \n $poslist = $pt->getPosList();\n $cs = explode(' ',$poslist);\n return $cs[0];\n }",
"public function getLocationY()\n {\n return $this->locationY;\n }",
"function _getPointY($x)\n {\n $function = $this->_dataFunction;\n return $function ($x);\n }",
"public function getCursorY()\n {\n return $this->moveToLocal_v($this->pdf->GetCursorY());\n }",
"public function getYCoordinate()\n {\n return $this->getValueOfN() * cos(\\deg2rad($this->latitude)) * sin(deg2rad($this->longitude));\n }",
"public function getYPosition($unit = null);",
"protected function _getLastAbsoluteY()\n {\n for ($k=count($this->table)-1; $k>=0; $k--) {\n if ($this->table[$k]['y'] && $this->table[$k]['position']) return $this->table[$k]['y'];\n }\n return $this->_pdf->gettMargin();\n }",
"public function offsetY($value) {\n return $this->setProperty('offsetY', $value);\n }",
"public function offsetY($value) {\n return $this->setProperty('offsetY', $value);\n }",
"public function getOffset($value);",
"function get_y_min()\n\t{\n\t\treturn 0;\n\t}",
"public function getValue(int $indexX, int $indexY): int;",
"private function getYLabel() {\n\t\treturn $this->yLabel;\n\t}"
]
| [
"0.7245574",
"0.7130746",
"0.6846955",
"0.67050934",
"0.6634549",
"0.65458554",
"0.65350324",
"0.6478817",
"0.6478817",
"0.6465535",
"0.63301396",
"0.626685",
"0.62638795",
"0.62638795",
"0.62488",
"0.6248586",
"0.6207889",
"0.6191813",
"0.5978768",
"0.5965826",
"0.59604967",
"0.5955092",
"0.5953304",
"0.59407544",
"0.5935602",
"0.5935602",
"0.5882784",
"0.58500135",
"0.58039546",
"0.5766211"
]
| 0.73050207 | 0 |
Add a point to the maps | function addPoint($x, $y, $name)
{
$this->_mapPoints[$name] = array('X' => $x, 'Y' => $y);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPoint()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $db;\r\n\t// The 1st alias\r\n\t$name = GET_INC('name');\r\n\t// City? Lng? Lat?\r\n\t$city = GET_INC('city');\r\n\t$lng = GET_INC('lng');\r\n\t$lat = GET_INC('lat');\r\n\t// We need user ID\r\n\t$uid = GET_INC('uid');\r\n\t// Query?\r\n\t// Looks simple...\r\n\t$db->connDB();\r\n\t// insert into db\r\n\t$db->insert('bus_station', \"NULL,{$city},{$lng},{$lat}\");\r\n\t// get ID\r\n\t$db->query('SELECT MAX(id) FROM bus_station;');\r\n\t$res = $db->fetch_array();\r\n\t// insert 1st alias\r\n\t$db->insert('bus_sname', \"{$res[0]},{$name}\");\r\n\t// close db\r\n\t$db->closeDB();\r\n}",
"function addMappoint($latitude, $longitude, $name)\n {\n $x = (($longitude + 180) * ($this->_mapSize['X'] / 360));\n $y = ((($latitude * -1) + 90) * ($this->_mapSize['Y'] / 180));\n $this->_mapPoints[$name] = array('X' => $x, 'Y' => $y);\n }",
"function addPoint($x, $y = false, $ID = false)\n {\n }",
"function add_mappoint() {\n\tif(isset($_POST['addpoint'])){\n\t\tglobal $wpdb;\n\t\t$data_top = $_POST['data-top'];\n\t\t$data_left = $_POST['data-left'];\n\t\t$point_tile = $_POST['map_point_title'];\n\t\t$point_content = $_POST['mappoint_content'];\n\n\n\t\t$post_id = wp_insert_post(array (\n\t\t\t'post_type' => 'map-point',\n\t\t\t'post_title' => $point_tile,\n\t\t\t'post_content' => $point_content,\n\t\t\t'post_status' => 'publish',\n\t\t\t'comment_status' => 'closed', // if you prefer\n\t\t\t'ping_status' => 'closed', // if you prefer\n\t\t));\n\n\t\tif ($post_id) {\n\t\t\t// insert post meta\n\t\t\tadd_post_meta($post_id, '_data-top', $data_top);\n\t\t\tadd_post_meta($post_id, '_data-left', $data_left);\n\n\t\t}\n\n\t}\n}",
"public function add_point($x,$y,$size=50) {\n\n\t\tarray_push($this->data[\"x\"],$x);\n\t\tarray_push($this->data[\"y\"],$y);\n\t\tarray_push($this->data[\"size\"],$size);\n\t\t\n\t}",
"public function addPoint($newPoint)\n {\n if (is_null($this->elements)) {\n $this->elements = array();\n $distance = 0;\n } else {\n $lastElement = end($this->elements);\n\n reset($this->elements);\n\n $lastDistance = $lastElement->distance;\n $lastPoint = $lastElement->point;\n\n $distance = $lastDistance + $lastPoint->distanceToPoint($newPoint);\n }\n\n $this->addRawElement(new SpineElement($newPoint, $distance));\n }",
"public function addPoint(ShapePoint $point) {\n $this->_points[] = $point;\n $this->_needsSort = true;\n return $this;\n }",
"public function addPoint($point) {\n $this->sessionData[\"points\"][] = $point;\n // Ensure that we don't exceed the maximum number of points stored in\n // memcached.\n while (count($this->sessionData[\"points\"]) > getConfig(\"max_cached_pts\")) {\n array_shift($this->sessionData[\"points\"]);\n }\n return $this;\n }",
"public function addTrackPoint(TrackPoint $point){\n $this->trackPoints[] = $point; \n return $point;\n }",
"public function add(Point $point)\n {\n $this->list[]=$point;\n return $this;\n }",
"public function addPoint(int $point): M_member\n\t{\n\n\t\t$this->db->set($this->pointField(), $this->point + $point);\n\t\t$this->db->where($this->idField(), $this->id);\n\t\t$this->db->update($this->tableName());\n\n\t\treturn $this->getData();\n\t}",
"public function add(\\SetaPDF_Core_Geometry_Vector $vector) {}",
"public function addPoints($teamId, $points)\n {\n $this->_teamData[$teamId]['points'] = $this->_teamData[$teamId]['points'] + $points;\n }",
"public static function point();",
"public function addGeopoint($str_name)\n {\n return $this->addField($str_name, self::FIELD_GEOPOINT);\n }",
"private function registerPoint($point, &$destination)\n {\n // Вызовы хука для некоторой точки в коде\n if ($point) {\n $key = array_search($point, $destination['points']);\n if ($key === false) {\n $destination['points'][] = $point;\n end($destination['points']);\n $key = key($destination['points']);\n $destination['points_count'][$key] = [\n 'count' => 0,\n 'time' => 0\n ];\n }\n $destination['points_count'][$key]['count']++;\n }\n }",
"abstract public function addCoord(array $coord);",
"protected function addLocation($remote_id, $item)\n {\n if(!empty($item['latitude']) && !empty($item['longitude']) && !empty($item['address']))\n {\n $pointObj = new Point($item['latitude'], $item['longitude']);\n $point = [\n 'location' => DB::raw(sprintf(\"ST_GeogFromText('%s')\", $pointObj->toWKT())),\n 'address' => $item['address'],\n ];\n $this->locations[$remote_id] = $point;\n }\n }",
"public function addLocation(string $location);",
"public function add($point)\n {\n if( $this->inf )\n return $point;\n\n // P + O = P\n if( $point->inf )\n return $this;\n\n // P + P = 2P\n if( $this->eq($point) )\n return $this->dbl();\n\n // P + (-P) = O\n if( $this->neg()->eq($point) )\n return $this->curve->point(null, null);\n\n // P + Q = O\n if( $this->x->cmp($point->x) === 0 )\n return $this->curve->point(null, null);\n\n $c = $this->y->redSub($point->y);\n if( ! $c->isZero() )\n $c = $c->redMul($this->x->redSub($point->x)->redInvm());\n $nx = $c->redSqr()->redISub($this->x)->redISub($point->x);\n $ny = $c->redMul($this->x->redSub($nx))->redISub($this->y);\n\n return $this->curve->point($nx, $ny);\n }",
"public function addCoordinates()\n {\n $this->bad_points = array();\n if (isset($this->coords) && $this->coords) {\n //do this in reverse order because the legend will otherwise be presented in reverse order\n for ($j=count($this->coords)-1; $j>=0; $j--) {\n\n //clear out previous loop's selection\n $size = \"\";\n $shape = \"\";\n $color = array();\n\n $title = ($this->coords[$j]['title']) ? stripslashes($this->coords[$j]['title']) : \"\";\n $size = ($this->coords[$j]['size']) ? $this->coords[$j]['size'] : 8;\n if ($this->_isResize() && $this->_download_factor > 1) {\n $size = $this->_download_factor*$size;\n }\n $shape = ($this->coords[$j]['shape']) ? $this->coords[$j]['shape'] : 'circle';\n if ($this->coords[$j]['color']) {\n $color = explode(\" \", $this->coords[$j]['color']);\n if (count($color) != 3) {\n $color = array();\n }\n }\n\n $data = trim($this->coords[$j]['data']);\n\n if ($data) {\n $this->_legend_required = true;\n $layer = ms_newLayerObj($this->map_obj);\n $layer->set(\"name\", \"layer_\".$j);\n $layer->set(\"status\", MS_ON);\n $layer->set(\"type\", MS_LAYER_POINT);\n $layer->set(\"tolerance\", 5);\n $layer->set(\"toleranceunits\", 6);\n $layer->setProjection(self::getProjection($this->default_projection));\n\n $class = ms_newClassObj($layer);\n if ($title != \"\") {\n $class->set(\"name\", $title);\n }\n\n $style = ms_newStyleObj($class);\n $style->set(\"symbolname\", $shape);\n $style->set(\"size\", $size);\n\n if (!empty($color)) {\n if (substr($shape, 0, 4) == 'open') {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n } else {\n $style->color->setRGB($color[0], $color[1], $color[2]);\n $style->outlinecolor->setRGB(85, 85, 85);\n }\n } else {\n $style->outlinecolor->setRGB(0, 0, 0);\n }\n\n $style->set(\"width\", $this->_determineWidth());\n\n $new_shape = ms_newShapeObj(MS_SHAPE_POINT);\n $new_line = ms_newLineObj();\n\n $rows = explode(\"\\n\", self::removeEmptyLines($data)); //split the lines that have data\n $points = array(); //create an array to hold unique locations\n\n foreach ($rows as $row) {\n $coord_array = self::makeCoordinates($row);\n $coord = new \\stdClass();\n $coord->x = ($coord_array[1]) ? self::cleanCoord($coord_array[1]) : null;\n $coord->y = ($coord_array[0]) ? self::cleanCoord($coord_array[0]) : null;\n //only add point when data are good & a title\n if (self::checkOnEarth($coord) && !empty($title)) {\n if (!array_key_exists($coord->x.$coord->y, $points)) { //unique locations\n $new_point = ms_newPointObj();\n $new_point->setXY($coord->x, $coord->y);\n $new_line->add($new_point);\n $points[$coord->x.$coord->y] = array();\n }\n } else {\n $this->bad_points[] = stripslashes($this->coords[$j]['title'] . ' : ' . $row);\n }\n unset($coord);\n }\n\n unset($points);\n $new_shape->add($new_line);\n $layer->addFeature($new_shape);\n }\n }\n }\n }",
"function addLayer($map, $layerID) {\n\t\tforeach (yieldXY(0, 0, 4, 4, true) as $x => $y) {\n\t\t\t$map[$layerID][$y][$x] = '.';\n\t\t}\n\t\t$map[$layerID][2][2] = '?';\n\t\treturn $map;\n\t}",
"public function AddTotalPoints($points){\r\n\t\t$this -> totalPoints += $points; \r\n\t }",
"protected function addPointSection(ArrayNodeDefinition $node)\n {\n $node\n ->children()\n ->arrayNode('point')->addDefaultsIfNotSet()\n ->children()\n ->scalarNode('class')->end()\n ->scalarNode('helper_class')->end()\n ->scalarNode('prefix_javascript_variable')->end()\n ->scalarNode('x')->end()\n ->scalarNode('y')->end()\n ->end()\n ->end()\n ->end();\n }",
"function add_point($data)\n {\n // $this->db->insert('kegiatan',$params);\n // return $this->db->insert_id();\n return $this->db->insert('point', $data);\n }",
"function autocreate_map ($post_id, $lat, $lon, $add) {\r\n\t\t$opts = get_option('agm_google_maps');\r\n\t\t$do_associate = @$opts['custom_fields_options']['associate_map'];\r\n\r\n\t\tif (!$lat || !$lon) {\r\n\t\t\t$geo = $this->_address_to_marker($add);\r\n\t\t} else {\r\n\t\t\t$geo = $this->_position_to_marker($lat, $lon);\r\n\t\t}\r\n\r\n\t\tif (!$geo) return false; // Geolocation failed\r\n\r\n\t\t$map = $this->get_map_defaults();\r\n\t\t$map['title'] = $geo['title'];\r\n\t\t$map['show_map'] = 1;\r\n\t\t$map['show_markers'] = 1;\r\n\t\t$map['markers'] = array($geo);\r\n\t\tif ($do_associate) $map['post_ids'] = array($post_id);\r\n\r\n\t\t$map_id = $this->save_map($map);\r\n\r\n\t\tif (!$map_id) return false;\r\n\t\tupdate_post_meta($post_id, 'agm_map_created', $map_id);\r\n\t\treturn $map_id;\r\n\t}",
"public function add()\n\t{\n\t\tEvent::add('ushahidi_filter.map_base_layers', array($this, '_add_layer'));\n\t\tif (Router::$controller != 'settings')\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.map_layers_js', array($this, '_add_map_layers_js'));\n\t\t}\n\t}",
"public function addCoordinate()\n {\n $args = func_get_args();\n \n if(isset($args[0]) && is_int($args[0]) && isset($args[1]) && is_int($args[1]))\n {\n if(isset($args[2]) && is_bool($args[2]))\n $this->coordinates[] = new Coordinate($args[0], $args[1], $args[2]);\n else\n $this->coordinates[] = new Coordinate($args[0], $args[1]);\n }\n else if(isset($args[0]) && ($args[0] instanceof Coordinate))\n $this->coordinates[] = $args[0];\n else\n throw new \\InvalidArgumentException();\n }",
"public function addGeoPoint($key, $latitude, $longitude)\n {\n $value = ['lat' => $latitude, 'lon' => $longitude];\n\n $this->set($key, $value);\n\n return $this;\n }",
"public function setPointCoordinates($latA, $lonA, $latB, $lonB);"
]
| [
"0.6597291",
"0.6504601",
"0.6498256",
"0.6449595",
"0.6419158",
"0.62881726",
"0.6171068",
"0.6039446",
"0.5991125",
"0.5918437",
"0.58640486",
"0.5860891",
"0.5809947",
"0.58063096",
"0.5775438",
"0.56542087",
"0.5601768",
"0.5510584",
"0.5504715",
"0.5484121",
"0.5464758",
"0.5463301",
"0.5450582",
"0.54358697",
"0.5416692",
"0.5396829",
"0.53624165",
"0.5317246",
"0.5315408",
"0.5269614"
]
| 0.76698023 | 0 |
Wait element and return it, or throw an exception | function getElement(WebDriver $driver, WebDriverBy $locator): WebDriverElement
{
return $driver->wait(10, 500)
->until(WebDriverExpectedCondition::presenceOfElementLocated($locator),
'element not found');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testWaitReturnValue(): void\n {\n $this->getSession()->visit($this->pathTo('/js_test.html'));\n\n $found = $this->getSession()->wait(5000, '$(\"#draggable\").length === 1');\n $this->assertTrue($found);\n }",
"public function testWaitReturnValue()\n {\n $this->getSession()->visit($this->pathTo('/js_test.php'));\n\n $found = $this->getSession()->wait(5000, '$(\"#draggable\").length == 1');\n $this->assertTrue($found);\n }",
"public function execute()\n {\n $locator = $this->element->getLocator();\n if (null === $this->callback) {\n throw new WebDriver_Exception(\"Wait callback is undefined for element '{$locator}''\");\n }\n for ($i = 0; $i < $this->timeout; $i++) {\n if (call_user_func($this->callback, $this->element())) {\n return $this;\n }\n sleep(1);\n }\n $message = \"Provided state of element '{$locator}' is not reached after timeout\";\n $message = ($this->errorMessage == null) ? $message : \"{$message} with error: {$this->errorMessage}\";\n throw new WebDriver_Exception($message);\n }",
"public function iWaitForElement($text){\n $this->spin(function(FeatureContext $context) use ($text){\n try {\n $context->assertPageContainsText($text);\n return true;\n }\n catch(\\Behat\\Mink\\Exception\\ResponseTextException $e){\n print_r(\"AAAAA \" +$e);\n\n }\n return false;\n }\n );\n }",
"public function iWaitForElement($element): void\n {\n $this->iWaitSecondsForElement($this->timeout, $element);\n }",
"protected function waitFormToLoad()\n {\n $browser = $this->browser;\n $selector = $this->formSelector;\n $browser->waitUntil(\n function () use ($browser, $selector) {\n $element = $browser->find($selector);\n return $element->isVisible() ? true : null;\n }\n );\n }",
"private function waitFormLoading()\n {\n $this->_rootElement->click();\n $this->browser->waitUntil(\n function () {\n return $this->browser->find($this->waitElement)->isVisible() ? null : true;\n }\n );\n }",
"public function elementIsVisible($arg) {\n $el = $this->getSession()->getPage()->find('css', $arg);\n if($el) {\n if(!$el->isVisible()){\n throw new Exception('Element is not visible');\n }\n } else {\n throw new Exception('Element not found');\n }\n }",
"public function iWaitUntilISeeInTheElement($text, $element): void\n {\n $this->iWaitSecondsUntilISeeInTheElement($this->timeout, $text, $element);\n }",
"abstract function getAsElem($dom);",
"public function find($xpath) {\n\t\treturn $this->retry(__METHOD__, func_get_args(), true);\n\t}",
"public function wait(): void;",
"function getElemOrAttrVal(&$element, $name){\n\t\t$value;\n\t\t$parts = explode(\".\", $name);\n\t\t\t\n\t\tswitch(count($parts)){\n\t\t\tcase 1:\n\t\t\t\t$value = $element->xpath(\".//\". $parts[0] .\"[1]\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif($parts[1] == \"\"){\n\t\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\t\texit(EWQUERY);\n\t\t\t\t}\n\t\t\t\tif($parts[0] == \"\")\n\t\t\t\t\t$parts[0] = \"*\";\n\t\t\t\t\n\n\t\t\t\tif($parts[0] == $element->getName() || $parts[0] == \"*\"){\n\t\t\t\t\tif($element->attributes()->$parts[1] != false){\n\t\t\t\t\t\t$value = $element;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$value = $element->xpath(\".//\". $parts[0] .\"[@\" . $parts[1] . \"][1]\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t}\n\n\t\tif(count($value) != 0)\n\t\t\t$value = $value[0];\n\t\telse return false;\n\n\t\tif(count($parts) == 1){\n\t\t\tif($value->count() != 0){\n\t\t\t\tfprintf(STDERR, \"ERROR! Input is in an an illegal format!\\n\");\n\t\t\t\texit(EINPUTF);\n\t\t\t}\n\t\t\telse return $value[0];\n\t\t}\n\t\telse return $value->attributes()->$parts[1];\n\t}",
"function wait($timeout=10, $propagate=TRUE, $interval=0.5)\n\t{\n\t\treturn $this->get($timeout, $propagate, $interval);\n\t}",
"private function waitSuccessInstall()\n {\n $root = $this->_rootElement;\n $successInstallText = $this->successInstallText;\n $launchAdmin = $this->launchAdmin;\n\n $root->waitUntil(\n function () use ($root, $successInstallText, $launchAdmin) {\n $isInstallText = $root->find($successInstallText, Locator::SELECTOR_XPATH)->isVisible();\n $isLaunchAdmin = $root->find($launchAdmin, Locator::SELECTOR_CSS)->isVisible();\n return $isInstallText == true || $isLaunchAdmin == true ? true : null;\n }\n );\n }",
"public function get($element);",
"public static function stalenessOf(WebDriverElement $element)\n {\n return new static(\n function () use ($element) {\n try {\n $element->isEnabled();\n\n return false;\n } catch (StaleElementReferenceException $e) {\n return true;\n }\n }\n );\n }",
"public function iWaitSecondsUntilISeeInTheElement($count, $text, $element): void\n {\n $startTime = time();\n $this->iWaitSecondsForElement($count, $element);\n\n $expected = str_replace('\\\\\"', '\"', $text);\n $message = \"The text '$expected' was not found after a $count seconds timeout\";\n\n $found = false;\n do {\n try {\n \\usleep(1000);\n $node = $this->getSession()->getPage()->find('css', $element);\n $this->assertContains($expected, $node->getText(), $message);\n\n return;\n } catch (ExpectationException) {\n /* Intentionally leave blank */\n } catch (StaleElementReference) {\n // assume page reloaded whilst we were still waiting\n }\n } while (!$found && (\\time() - $startTime < $count));\n\n // final assertion...\n $node = $this->getSession()->getPage()->find('css', $element);\n $this->assertContains($expected, $node->getText(), $message);\n }",
"public function iWaitSecondsForElement($count, $element): void\n {\n $found = false;\n $startTime = \\time();\n $e = null;\n\n do {\n try {\n \\usleep(1000);\n $node = $this->getSession()->getPage()->findAll('css', $element);\n $this->assertCount(1, $node);\n $found = true;\n } catch (ExpectationException $e) {\n /* Intentionally leave blank */\n }\n } while (!$found && (\\time() - $startTime < $count));\n\n if ($found === false) {\n $message = \"The element '$element' was not found after a $count seconds timeout\";\n throw new ResponseTextException($message, $this->getSession()->getDriver(), $e);\n }\n }",
"private function readNextElement()\n {\n $xr = $this->xmlReader;\n \n if ($this->emptyXml)\n return NULL;\n \n while ($xr->read())\n {\n // Read: /meta\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'meta')\n {\n return $this->readMeta();\n }\n \n // Read: /messages/msg\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'msg')\n {\n $type = $xr->getAttribute('type');\n \n // Read: /messages/msg/[TEXT]\n if (!$xr->read())\n break;\n assert ($xr->nodeType == XMLReader::TEXT);\n $text = $xr->value;\n \n return new Splunk_ResultsMessage($type, $text);\n }\n \n // Read: /result\n if ($xr->nodeType == XMLReader::ELEMENT &&\n $xr->name === 'result')\n {\n return $this->readResult();\n }\n }\n return NULL;\n }",
"public function wait($wait = -1) {}",
"public function waitUntil($callback);",
"public function isOk($element, $msg = \"Excepción generada desde isOK\"){\n if(!$element):\n throw new \\Exception($msg);\n endif;\n }",
"public function getElement();",
"public function getElement();",
"function waitfor($file)\r\n\t{\r\n\t\treturn parent::waitFor($file);\r\n\t}",
"abstract protected function get_root_element();",
"public function waitRequest(): ?Request;",
"abstract protected function getUnexistingRequiredElement(string $requiredName): ?DependencyCollectonElement;",
"private function waitPrompt(){\r\n\t\treturn $this->readTo($this->prompt);\r\n\t}"
]
| [
"0.6234309",
"0.6146004",
"0.61190695",
"0.5688982",
"0.5665031",
"0.56494427",
"0.5280061",
"0.5269174",
"0.5183494",
"0.51647574",
"0.51545763",
"0.50972545",
"0.50621134",
"0.5012635",
"0.49955705",
"0.4986008",
"0.49726668",
"0.49611107",
"0.49592355",
"0.49503213",
"0.49495223",
"0.49339435",
"0.49099535",
"0.4906982",
"0.4906982",
"0.4893799",
"0.4892617",
"0.48708522",
"0.48679358",
"0.48472187"
]
| 0.64989495 | 0 |
Suma dias a una fecha dada Guido | function sumar_dias_a_una_fecha($dia,$mes,$anio,$numdias){
if (!checkdate($mes,$dia,$anio)) die("error en sumar_dias_a_una_fecha() - Se le ha mandado a la función una fecha incorrecta");
$fecha=mktime ( 0,0,0, $mes,$dia+$numdias,$anio);
return date( "Y-m-d", $fecha);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function valorCreditosDia($parametro)\n{\n conectar::conexiones();\n $sql=\"SELECT debe, estado, liquidado FROM pedidos WHERE fechaPedido BETWEEN \".fechaActualFija.\" AND \".(fechaActualFija+86400).\" AND liquidado =1 AND estado=2\";\n $query=mysql_query($sql);\n $sum=0;\n while ($rs=mysql_fetch_array($query)) {\n # code...\n $sum=$sum+($rs[\"debe\"]);\n }\n\n return $sum;\n conectar::desconectar();\n}",
"function qtdDiasUteis($hoje, $vencto) {\r\n $proxDia = proximoDiaUtil($vencto);\r\n $proxDia = retornaData($proxDia, 2);\r\n //$inicio = new DateTime($vencto);\r\n $inicio = new DateTime($proxDia);\r\n $fim = new DateTime($hoje);\r\n $fim->modify('+1 day');\r\n $diasUt = 0;\r\n\r\n $interval = new DateInterval('P1D');\r\n $periodo = new DatePeriod($inicio, $interval, $fim);\r\n\r\n foreach ($periodo as $data) {\r\n $tdy = strtotime($data->format(\"d-m-Y\"));\r\n //if (date('N', $tdy) <= 5) {\r\n $diasUt++;\r\n //}\r\n }\r\n return $diasUt;\r\n }",
"function sumDateTimes($fecha1, $fecha2)\n{\n $aux = new DateTime();\n $aux->setTimestamp($fecha1->getTimestamp() + $fecha2->getTimestamp());\n return $aux;\n}",
"function sumDayToDate($date,$days){\n\t$date = date_create($date);\n\tdate_add($date, date_interval_create_from_date_string($days));\n\t\n\treturn date_format($date, 'Y-m-d H:i:s');\n}",
"public static function totalDayByPeriod($dataInicio, $dataFim, $tipoDia = 1, $format = 'Y-m-d H:i:s') {\r\n\r\n if (!self::checkFormatDate($format, $dataInicio)) {\r\n throw new \\Exception('Start date invalid:' . $dataInicio);\r\n }\r\n if (!self::checkFormatDate($format, $dataFim)) {\r\n throw new \\Exception('End date invalid:' . $dataFim);\r\n }\r\n\r\n if (!HelperDate::dateCompare($dataInicio, $dataFim, '<=')) {\r\n return 0;\r\n }\r\n\r\n $objDataInicio = \\DateTime::createFromFormat($format, $dataInicio);\r\n $objDataFim = \\DateTime::createFromFormat($format, $dataFim);\r\n\r\n\r\n $diaIni = $objDataInicio->format('d');\r\n $mesIni = $objDataInicio->format('m');\r\n $anoIni = $objDataInicio->format('Y');\r\n\r\n $diaFim = $objDataFim->format('d');\r\n $mesFim = $objDataFim->format('m');\r\n $anoFim = $objDataFim->format('Y');\r\n $totalDia = 0;\r\n\r\n //Todos os dias\r\n if ($tipoDia == 1) {\r\n return self::diffDay($dataInicio, $dataFim, $format);\r\n }\r\n\r\n //Percorre todos os anos do periodo informado\r\n for ($ano = $anoIni; $anoFim >= $ano; $ano++) {\r\n\r\n //Percorre todos os meses do ano\r\n for ($mes = $mesIni; $mes <= 12; $mes++) {\r\n\r\n //Recupera a quantidade de dias do mes\r\n $dias_no_mes = cal_days_in_month(CAL_GREGORIAN, $mes, $ano);\r\n\r\n $continuaMesAno = !($mesFim == $mes && $ano == $anoFim);\r\n\r\n //Percorre todos os dias do mes\r\n for ($dia = $diaIni; $dia <= $dias_no_mes; $dia++) {\r\n\r\n $timestamp = mktime(0, 0, 0, $mes, $dia, $ano);\r\n $semana = date(\"N\", $timestamp);\r\n\r\n //Verifica o dia NAO util (sabado/domingo)\r\n $paramSemana = ($tipoDia == 2) ? 7 : 6;\r\n if ($semana < $paramSemana) {\r\n $totalDia++;\r\n }\r\n\r\n //Limita o dia da ultima data informada\r\n if (($diaFim == $dia && !$continuaMesAno)) {\r\n break;\r\n }\r\n }\r\n //Limita o mes da ultima data informada\r\n if (!$continuaMesAno) {\r\n break;\r\n }\r\n }\r\n }\r\n return $totalDia;\r\n }",
"function restar_dias_a_una_fecha($dia,$mes,$anio,$numdias){\r\nif (!checkdate($mes,$dia,$anio)) die(\"error en restar_dias_a_una_fecha() - Se le ha mandado a la función una fecha incorrecta\");\r\n$fecha=mktime ( 0,0,0, $mes,$dia-$numdias,$anio);\r\nreturn date( \"Y-m-d\", $fecha);\r\n}",
"function getTotalDays();",
"public function fechaVigencia() // funcion que suma fecha usada para años biciestos\n\t{\n\n\t\t$fecha = $_GET['fecha'];\n\t\t$nuevafecha = strtotime('+365 day', strtotime($fecha));\n\t\t$nuevafecha = date('Y-m-d', $nuevafecha);\n\t\treturn $nuevafecha;\n\t}",
"public function totalInasistencias($fecha1, $fecha2, $dni_alumno) {\n $con = ConexionBD::getConexion();\n $result = $con->recuperarAsociativo(\"select sum(valor) as valor from asistencia where alumnoxcurso_alumno_dni='\" . $dni_alumno . \"' and fecha between '\".$fecha1.\"' and '\".$fecha2.\"'\");\n return $result;\n }",
"public function findSumByYear(\\DateTime $date);",
"public function getAcopioByDay($day)\n {\n\n\n $acopios = Acopio::where('feha','=',$day)->get();\n\n $suma = 0;\n\n foreach($acopios as $acopio){\n $suma+=$acopio->cantidad_total;\n\n }\n return $suma;\n\n\n }",
"function somarDatas($data,$dias){\n\t$data_final = date('Y-m-d', strtotime(\"$dias days\",strtotime($data)));\t\n\treturn $data_final;\n\t\n}",
"function sum_creante_moth_group_emp($id)\n{\n $query = \"SELECT count(sum_creanta) AS creante, sum(sum_creanta) AS suma, DATE_FORMAT(data, '%m') AS data\n FROM cozagro_db.creante WHERE deleted = 0 AND id_angajat= $id\n GROUP BY MONTH(data)\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n die(\"Nu s-a reusit conexiunea la DB selectarea salariilor platite\" . Database::getInstance()->getConnection()->error);\n }\n $creante_luna = [];\n while ($x = $result->fetch_assoc()) {\n $creante_luna[$x['data']] = array(\"nr\" => $x['creante'], \"cre\" => $x['suma']);\n }\n $result->free_result();\n return $creante_luna;\n}",
"public function SumarEgresos() \n{\n\tself::SetNames();\n\t$sql = \"select sum(montomovimientocaja) as totalegresos from movimientoscajas where tipomovimientocaja = 'EGRESO' AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"public function totalDia(){\n //$conexao = $c->conexao();\n\n $sql = \" SELECT ifnull(sum(c.valor),0) as total, ifnull(sum(c.troco),0) as troco from tbpedido_pagamento c WHERE DAY(c.data_pagamento) = DAY(now()) and c.status = 'F';\";\n $rstotal = $this->conexao->query($sql);\n $result = $rstotal->fetch_array();\n $totalvendas = $result['total'];\n $totaltroco = $result['troco'];\n\n $total = array(\n 'totalvendas' => '',\n 'totaltroco' => '',\n );\n\n $total['totalvendas'] = $totalvendas;\n $total['totaltroco'] = $totaltroco;\n\n //print_r($total);\n return $total;\n\n }",
"function getTotalSetps(){\n $sum = 0;\n $mysqli = $GLOBALS['mysqli'];\n $result = $mysqli->query(\"SELECT DATE(time) AS time, MAX(steps) AS steps FROM steps GROUP BY DAY(time)\");\n while($row = $result->fetch_assoc()) {\n $sum = $sum + $row['steps'];\n }\n return $sum;\n}",
"function suma_godzin() {\n \n $db_connect = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n \n if( !$db_connect->connect_errno ) {\n \n $query = \"SELECT * FROM czas\";\n \n if( $result = $db_connect->query($query) ) {\n $suma_dnia_int = 0;\n $suma_dnia_mod = 0;\n while( $row_table = $result->fetch_assoc() ) {\n \n $suma_dnia_int = $suma_dnia_int + $row_table['int_sum']++;\n $suma_dnia_mod = $suma_dnia_mod + $row_table['modulo']++;\n \n }\n \n $suma_dnia_mod_mod = $suma_dnia_mod % 60;\n $suma_dnia_mod_mod = czas_pracy_modulo($suma_dnia_mod_mod);\n $suma_dnia_mod_int = $suma_dnia_mod / 60;\n $suma_dnia_mod_int = (int)$suma_dnia_mod_int;\n \n $suma_dnia_int = $suma_dnia_int + $suma_dnia_mod_int;\n $suma_dnia_int = $suma_dnia_int . \".\" . $suma_dnia_mod_mod;\n \n \n return $suma_dnia_int . '<br>'; \n \n \n }\n \n } else {\n \n echo 'Wystąpił błąd podczas połączenia z serwerem.';\n \n }\n \n $db_connect->close();\n \n}",
"function sum_plati_moth_group_emp($id)\n{\n $query = \"SELECT count(platit) AS plati, sum(platit) AS suma, DATE_FORMAT(data, '%m') AS data, comment\n FROM cozagro_db.lichidare WHERE deleted = 0 AND id_angajat= $id\n GROUP BY MONTH(data)\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n die(\"Nu s-a reusit conexiunea la DB selectarea salariilor platite\" . Database::getInstance()->getConnection()->error);\n }\n $lichidare_luna = [];\n while ($x = $result->fetch_assoc()) {\n $lichidare_luna[$x['data']] = array(\"nr\" => $x['plati'], \"pla\" => $x['suma'], \"com\" => $x['comment']);\n }\n $result->free_result();\n return $lichidare_luna;\n}",
"public function SumarIngresos() \n{\n\tself::SetNames();\n\t$sql = \"select sum(montomovimientocaja) as totalingresos from movimientoscajas where tipomovimientocaja = 'INGRESO' AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') >= ? AND DATE_FORMAT(fechamovimientocaja,'%Y-%m-%d') <= ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"function diasUteisNovo($vencto, $atual) {\r\n $data_inicio = strtotime($vencto);\r\n $data_fim = strtotime($atual);\r\n $dias = 0;\r\n $fimSem = 0;\r\n // Resgata diferença entre as datas\r\n if ($data_fim > $data_inicio) {\r\n $inicio = $data_inicio;\r\n $fim = $data_fim;\r\n while ($inicio <= $fim) {\r\n $diaSem = date(\"N\", $inicio);\r\n if ($diaSem > 5) {\r\n $fimSem++;\r\n }\r\n $inicio += 86400;\r\n $dias++;\r\n }\r\n /* $dateInterval = $data_inicio->diff($data_fim);\r\n $dias = $dateInterval->days; */\r\n $dias = $dias - $fimSem;\r\n if ($dias < 0) {\r\n $dias = 0;\r\n }\r\n } else {\r\n $dias = 0;\r\n }\r\n return $dias;\r\n }",
"public function sum_daily($feedid, $time_now, $value)\n {\n \n $feedname = \"feed_\" . trim($feedid) . \"\";\n $feedtime = mktime(0, 0, 0, date(\"m\",$time_now), date(\"d\",$time_now), date(\"Y\",$time_now));\n\n $result = $this->mysqli->query(\"SELECT * FROM $feedname WHERE time = '$feedtime'\");\n if (!$result) return $value;\n $row = $result->fetch_array();\n\n $sum = $row['data'];\n \n $new_sum = ($sum + $value);\n \n if ($row)\n {\n $this->mysqli->query(\"UPDATE $feedname SET data = '$new_sum' WHERE time = '$feedtime'\");\n\t$daily_sum = $new_sum;\n }\n else\n {\n $this->mysqli->query(\"INSERT INTO $feedname (`time`,`data`) VALUES ('$feedtime','$value')\");\n\t$daily_sum = $value;\n }\n\n $this->feed->set_update_value_redis($feedid, $daily_sum, $time_now);\n \n return $daily_sum;\n }",
"private function getTotalDia($data)\n\t{\n\t\t$arrData = explode('/',$data);\n\t\t$condicoes['year(Lote.created)']\t= $arrData[2];\n\t\t$condicoes['month(Lote.created)']\t= $arrData[1];\n\t\t$condicoes['day(Lote.created)']\t\t= $arrData[0];\n\t\t$total = $this->find('count',array('conditions'=>$condicoes));\n\t\treturn $total;\n\t}",
"public function total_reservas_sala_mes($fecha) // reservas sin eliminar // //PDF\n {\n\n $q_string = \"select sala, count(sala) as cant from reservas where month(fecha) = month('\".$fecha.\"') and eliminada ='0' and estado ='1' group by sala\";\n //select sala, count(sala) as cant\n //from reservas where month(fecha) ='6' and eliminada ='0' and estado ='1'\n //group by sala\n\t \t $data = $this->db->query($q_string);\n\t\t return $data;\n\t}",
"function dias_transcurridos($fecha_i,$fecha_f)\n{\n\t$dias\t= (strtotime($fecha_i)-strtotime($fecha_f))/86400;\n\t$dias \t= abs($dias); $dias = floor($dias);\t\t\n\treturn $dias;\n}",
"public function additionDate()\n {\n global $dbh;\n $sql = $dbh->prepare\n (\"INSERT INTO `daten` (`idu`, `kindd`, `idair`, `ida`, `idr`, `idc`, `idy`, `idcr`, `idv`, `idm`, `idx`, `idi`, `idmark`, `ido`, `idn`, `idserv`, `idp`, `ids`)\n VALUES \n ('$this->idu', '$this->kindd', '$this->idair', '$this->ida', '$this->idr', '$this->idc', '$this->idy',\n '$this->idcr', '$this->idv', '$this->idm', '$this->idx', '$this->idi', '$this->idmark', '$this->ido', '$this->idn', '$this->idserv', '$this->idp', '$this->ids');\");\n $result = $sql->execute();\n return $result;\n }",
"function sum_salarii_moth_group_emp($id)\n{\n $query = \"SELECT count(platit) AS plati, sum(platit) AS suma, DATE_FORMAT(data, '%m') AS data, sum(motiv) AS motivat\n FROM cozagro_db.salarii WHERE deleted = 0 AND id_angajat= $id\n GROUP BY MONTH(data)\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result) {\n die(\"Nu s-a reusit conexiunea la DB selectarea salariilor platite\" . Database::getInstance()->getConnection()->error);\n }\n $creante_luna = [];\n while ($x = $result->fetch_assoc()) {\n $creante_luna[$x['data']] = array(\"nr\" => $x['plati'], \"sum\" => $x['suma'], \"mot\" => $x['motivat']);\n }\n $result->free_result();\n return $creante_luna;\n}",
"public static function sumarVisitaReceta($id_receta){\n $cantidad = Receta::select('visitas')->where('id', $id_receta)->first();\n $cantidad_actual = $cantidad->visitas;\n $cantidad_mod = $cantidad_actual + 1;\n\n $receta_mod = Receta::find($id_receta);\n $receta_mod->visitas = $cantidad_mod;\n $receta_mod->save();\n }",
"public function consumo_medio_diario($codart){\n\n $hoy=date('Y-m-d');\n $fecha_inicio = date('Y-m-d', strtotime(\"-$this->meses month\", strtotime( $hoy ) ));\n $consumo = 0;\n\n $query1 = Planilla_entrega_renglones::find();\n $query1->joinWith(['remito']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n \n $query1->andFilterWhere(['>=','PE_FECHA', $fecha_inicio]);\n\n $consumo += $query1->sum('PR_CANTID');\n\n \n $query1 = Devolucion_salas_renglones::find();\n\n $query1->joinWith(['devolucion_encabezado']);\n $query1->andFilterWhere([\n 'PR_DEPOSITO' => $this->deposito,\n 'PR_CODART' => $codart,\n ]);\n\n $query1->andFilterWhere(['>=','DE_FECHA', $fecha_inicio]);\n\n $consumo -= $query1->sum('PR_CANTID');\n \n $segundos=strtotime('now') - strtotime($fecha_inicio);\n \n $dias=intval($segundos/60/60/24);\n return $consumo/$dias;\n\n }",
"function MESES_ANTIGUEDAD($_ARGS) {\r\n\t$fingreso = FECHA_INGRESO($_ARGS);\r\n\t$periodo_actual = $_ARGS['HASTA'];\r\n\tlist($anios, $meses, $dias) = TIEMPO_DE_SERVICIO(formatFechaDMA($fingreso), formatFechaDMA($periodo_actual));\r\n\t$cantidad = $meses + ($anios * 12);\r\n\treturn $cantidad;\r\n}",
"public function getDiasPanti($id, $ano, $mes)\n { \n if ($mes > 0 )\n {\n $mes = $mes + ( $ano * 12 ); // Pasar los años a meses \n $result=$this->adapter->query(\"select b.id, b.idEmp ,0 as dias,c.idCcos, \n c.fecing , DATE_ADD( c.fecing , interval \".$mes.\" month) , c.CedEmp , c.nombre , c.idTemp, case when e.id > 0 then 1 else 0 end as pg, \n case when (day( d.fecha) >= day(a.fechaI)) and (day( d.fecha) <= day(a.fechaF)) then 1 else 0 end as diaI \n from n_nomina a\n inner join n_nomina_e b on b.idNom = a.id\n inner join a_empleados c on c.id = b.idEmp \n inner join n_tipemp_p d on d.idEmp = b.idEmp and d.idTemp = 1 # mientras 1 es para los convencionados \n left join n_pg_primas_ant e on e.idEmp = b.idEmp and year(e.fechaI) = year(a.fechaI) and month( e.fechaI ) and month( a.fechaI )\n where c.activo=0 and c.estado = 0 \n and ( ( year( DATE_ADD( d.fecha , interval \".$mes.\" month) ) = year( a.fechaI ) )\n and ( month( DATE_ADD( d.fecha , interval \".$mes.\" month) ) = month( a.fechaI ) ) ) \n and a.id = \".$id.\" \n order by c.fecing desc\",Adapter::QUERY_MODE_EXECUTE);\t\t \n }else{\n $result=$this->adapter->query(\"select b.id, b.idEmp ,0 as dias,c.idCcos, \n c.fecing , day( d.fecha ) as diaI, DATE_ADD( c.fecing , interval \".$ano.\" year) , c.CedEmp , c.nombre , c.idTemp, case when e.id > 0 then 1 else 0 end as pg,\n case when (day( d.fecha) >= day(a.fechaI)) and (day( d.fecha) <= day(a.fechaF)) then 1 else 0 end as diaI \n from n_nomina a\n inner join n_nomina_e b on b.idNom = a.id\n inner join a_empleados c on c.id = b.idEmp \n inner join n_tipemp_p d on d.idEmp = b.idEmp and d.idTemp = 1 # mientras 1 es para los convencionados\n left join n_pg_primas_ant e on e.idEmp = b.idEmp and year(e.fechaI) = year(a.fechaI) and month( e.fechaI ) and month( a.fechaI ) \n where c.activo=0 and c.estado = 0 \n and ( ( year( DATE_ADD( d.fecha , interval \".$ano.\" year) ) = year( a.fechaI ) )\n and ( month( DATE_ADD( d.fecha , interval \".$ano.\" year) ) = month( a.fechaI ) ) ) \n and a.id = \".$id.\" \n order by c.fecing desc \",Adapter::QUERY_MODE_EXECUTE);\t\t \n }\t\t \n $datos=$result->toArray();\n return $datos; \n }"
]
| [
"0.6595051",
"0.6445438",
"0.6272093",
"0.62113625",
"0.6183581",
"0.6116968",
"0.6108242",
"0.60854834",
"0.6001188",
"0.5981953",
"0.5931621",
"0.5931407",
"0.5926683",
"0.5889275",
"0.5821554",
"0.5803877",
"0.577782",
"0.57045776",
"0.5693352",
"0.5691016",
"0.56885254",
"0.5685203",
"0.5683102",
"0.5662636",
"0.5662506",
"0.5656921",
"0.56513846",
"0.5640492",
"0.56338847",
"0.5630821"
]
| 0.75635254 | 0 |
Resta dias a una fecha dada Mariano | function restar_dias_a_una_fecha($dia,$mes,$anio,$numdias){
if (!checkdate($mes,$dia,$anio)) die("error en restar_dias_a_una_fecha() - Se le ha mandado a la función una fecha incorrecta");
$fecha=mktime ( 0,0,0, $mes,$dia-$numdias,$anio);
return date( "Y-m-d", $fecha);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dias_del_mes(){\n \n $fecha= date('Y-m-d');\n return; date('t',strtotime($fecha));\n \n}",
"public function fecha();",
"function leerlafecha($fechaentrada, $idioma) {\n\t\t//devuelve variables en el idioma dado por la variable $idioma que puede valer 'cas' o 'cat'\n\t\t//Así podremos leer la fecha en formato humanoide.\n\t\t\n\t\tdate_default_timezone_set('Europe/Madrid');\t//Esta definicion de la zona horaria me la pide el php del hosting en freehostia.com para dejarme usar strtotime en el script\n\t\t\n\t\t//Dependiendo del idioma definimos los nombres de los meses del año y los dias de la semana\n\t\tif ($idioma == 'cat' or empty($idioma)) {$anno = array (\"gener\", \"febrer\", \"març\", \"abril\", \"maig\", \"juny\", \"juliol\", \"agost\", \"setembre\", \"octubre\", \"novembre\", \" desembre \"); $dias = array ('', 'Dilluns', 'Dimarts', 'Dimecres', 'Jueves', 'Divendres', 'Dissabte', 'Diumenge');}\n\t\telse if ($idioma == 'cas') {$anno = array(\"enero\", \"febrero\", \"marzo\", \"abril\",\"mayo\",\"junio\",\"julio\",\"agosto\",\"septiembre\",\"octubre\",\"noviembre\",\"diciembre\"); $dias = array('','Lunes','Martes','Miercoles','Jueves','Viernes','Sabado','Domingo');}\n\t\t\n\t\tif (empty($fechaentrada)==false){\n\t\t\t$dia = substr ($fechaentrada, 8 , 2 ); //número del dia\n\t\t\t$mesnumerico = substr($fechaentrada,5,2); //número del mes\n\t\t\t$ano = substr ($fechaentrada,0,4); //número del año\n\t\t\t$indicemes = intval($mesnumerico) - 1;\n\t\t\t$nombremes = $anno[$indicemes]; //nombre del mes en el idioma escojido\n\t\t\t$nombredia = $dias[date('N', strtotime($fechaentrada))]; //nombre del dia en el idioma elejido\n\t\t}\n\t\t\n\t\t return array ($dia,$mesnumerico,$ano,$nombremes,$nombredia);\n\t\t\n\t}",
"function fecha($cadena){\n\t\treturn date($cadena);\n\t}",
"function moisAnPasse()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t$annee--;\n\t$moisActuel = $annee . $mois;\n\treturn $moisActuel;\n}",
"function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}",
"function primer_dia_periodo() {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n \n }",
"function bank_date_fin_mois($annee, $mois){\n\t$date_fin = mktime(0, 0, 0, $mois, 01, $annee);\n\t$date_fin = strtotime(\"+1 month\", $date_fin);\n\treturn date('Y-m-d H:i:s', $date_fin);\n}",
"function sumar_dias_a_una_fecha($dia,$mes,$anio,$numdias){\r\nif (!checkdate($mes,$dia,$anio)) die(\"error en sumar_dias_a_una_fecha() - Se le ha mandado a la función una fecha incorrecta\");\r\n$fecha=mktime ( 0,0,0, $mes,$dia+$numdias,$anio);\r\nreturn date( \"Y-m-d\", $fecha);\r\n}",
"function ultimoDiaMes($x_fecha_f){\r\n\techo \"entra a ultimo dia mes con fecha \".$x_fecha_f.\"<br>\";\r\n\t\t\t\t\t$temptime_f = strtotime($x_fecha_f);\t\r\n\t\t\t\t\t$x_numero_dia_f = strftime('%d', $temptime_f);\r\n\t\t\t\t\t$x_numero_mes_f = strftime('%m', $temptime_f);\r\n\t\t\t\t\techo \"numero mes\".$x_numero_mes_f.\"<br>\";\r\n\t\t\t\t\t$x_numero_anio_f = strftime('%Y', $temptime_f);\r\n\t\t\t\t\t$x_ultimo_dia_mes_f = strftime(\"%d\", mktime(0, 0, 0, $x_numero_mes_f+2, 0, $x_numero_anio_f));\r\n\techo \"el ultimo dia de mes es\".\t$x_ultimo_dia_mes_f .\"<br>\";\t\t\t\r\n\treturn $x_ultimo_dia_mes_f;\r\n}",
"function moisActuel()\n{\n\t$dateActuelle = date(\"d/m/Y\");\n\t@list($jour, $mois, $annee) = explode('/', $dateActuelle);\n\t//$annee--;\n\t$moisActuel = $mois;\n\treturn $annee . $moisActuel;\n}",
"private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"public function mes(){\n\n\t\t$date = $this->dia;\n $date = DateTime::createFromFormat('Y-m-d', $date);\n \t \n\t\treturn $date->format('m') - 1;\n\t}",
"public function premierdelasemaine(): DateTime{\n // Obtenir le premier jour de la premiere semaine de l'année en cours\n $begin = new DateTime(\"{$this->year}-01-01\");\n \n if ($begin->format('w')!=1) $begin->modify(\"next monday\");\n \n return $begin->modify(\"+\".($this->week-1).\" weeks\");\n }",
"public function getDateDebut();",
"public function retosSemana(){\n\n\n //$s = explode(\"-\",$fecha);\n\n\t\t//$actualDate = Carbon::create(intval($s[2]),intval($s[1]),intval($s[0]));\n\t\t\n\t\t$actualDate= Carbon::now();\n\n \n\n $date1 = Carbon::now();\n $date2 = Carbon::now();\n $date3 = Carbon::now();\n $date4 = Carbon::now();\n $date5 = Carbon::now();\n $date6 = Carbon::now();\n $date7 = Carbon::now();\n\n \n \n \n $nD = $date1->dayOfWeekIso;\n\n \n if($nD==1){\n //Lunes\n\n $monday = $date1;\n $tuesday = $date2->addDay();\n $wednesday = $date3->addDays(2);\n $thursday= $date4->addDays(3);\n $friday= $date5->addDays(4);\n $saturday= $date6->addDays(5);\n $sunday= $date7->addDays(6);\n\n }elseif(intval($nD==2)){\n //Martes\n $monday = $date1->subDay();\n $tuesday = $date2;\n $wednesday = $date3->addDay();\n $thursday= $date4->addDays(2);\n $friday= $date5->addDays(3);\n $saturday= $date6->addDays(4);\n $sunday= $date7->addDays(5);\n\n }\n elseif(intval($nD==3)){\n //Miercoles\n \n $monday = $date1->subDays(2);\n $tuesday = $date2->subDay();\n $wednesday = $date3;\n $thursday= $date4->addDay();\n $friday= $date5->addDays(2);\n $saturday= $date6->addDays(3);\n $sunday= $date7->addDays(4);\n\n \n\n }elseif($nD==4){\n //Jueves\n $monday = $date1->subDays(3);\n $tuesday = $date2->subDays(2);\n $wednesday = $date3->subDay();\n $thursday= $date4;\n $friday= $date5->addDay();\n $saturday= $date6->addDays(2);\n $sunday= $date7->addDays(3);\n }elseif($nD==5){\n //Viernes\n $monday = $date1->subDays(4);\n $tuesday = $date2->subDays(3);\n $wednesday = $date3->subDays(2);\n $thursday= $date4->subDay();\n $friday= $date5;\n $saturday= $date6->addDay();\n $sunday= $date7->addDays(2);\n }elseif($nD==6){\n //Sabado\n $monday = $date1->subDays(5);\n $tuesday = $date2->subDays(4);\n $wednesday = $date3->subDays(3);\n $thursday= $date4->subDays(2);\n $friday= $date5->subDay();\n $saturday= $date6;\n $sunday= $date7->addDay();\n }else{\n //Domingo\n $monday = $date1->subDays(6);\n $tuesday = $date2->subDays(5);\n $wednesday = $date3->subDays(4);\n $thursday= $date4->subDays(3);\n $friday= $date5->subDays(2);\n $saturday= $date6->subDay();\n $sunday= $date7;\n\t\t}\n\n\n\t\t$company_id = auth()->user()->company_id;\n\t\t\n\n\t\t$sumaLunes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$monday->toDateString())->get());\n\t\t$sumaMartes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$tuesday->toDateString())->get());\n\t\t$sumaMiercoles = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$wednesday->toDateString())->get());\n\t\t$sumaJueves = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$thursday->toDateString())->get());\n\t\t$sumaViernes = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$friday->toDateString())->get());\n\t\t$sumaSabado = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$saturday->toDateString())->get());\n\t\t$sumaDomingo = count(DB::table('innovations')->where(function ($query) {\n\t\t\t$query->where('innovations.type', '=', 'solucion')\n\t\t\t\t->orWhere('innovations.type', '=', 'idea');\n\n\t\t})->where('company_id',$company_id)->whereDate('created_at',$sunday->toDateString())->get());\n\n\t\t\n\n\n\n\t\t$sumaSemanal = array(\n\n\t\t\t'Lunes ' =>$sumaLunes,\n\t\t\t'Martes'=>$sumaMartes,\n\t\t\t'Miércoles'=>$sumaMiercoles,\n\t\t\t'Jueves'=>$sumaJueves,\n\t\t\t'Viernes'=>$sumaViernes,\n\t\t\t'Sábado'=>$sumaSabado,\n\t\t\t'Domingo ' =>$sumaDomingo,\n\t\t);\n\n\t\treturn $sumaSemanal;\n\t}",
"function Fecha_mes_n2($Ingresomes_c){\t\n$mes_mes_c = new DateTime($Ingresomes_c);\n$mes = $mes_mes_c->format('m');\nreturn $mes;\n}",
"function ultimo_dia_periodo() { \n\n $sql=\"select fecha_fin from mocovi_periodo_presupuestario where actual=true\";\n $resul=toba::db('designa')->consultar($sql); \n return $resul[0]['fecha_fin'];\n }",
"function ritorna_data_attuale() {\n\t$tz = 'Europe/Rome';\n\t$format='d/m/Y H:i:s'; // Formato Italiano\n $retData='';\n//\n// DO NOT EDIT ANYTHING BELOW THIS LINE!\n//\n\tdate_default_timezone_set($tz);\n\t$retData = date($format);\n\treturn($retData);\n}",
"function getFecha(){\n\t\t$anio = date(\"Y\");\n\t\t$dia = date(\"j\");\n\t\t$mes = date(\"m\");\n\t\t$fechactual = $anio.\"-\".$mes.\"-\".$dia;\n\t\treturn $fechactual;\n\t}",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"function agenda_moisdecal($date, $decalage, $format = 'Y-m-d H:i:s') {\n\tinclude_spip('inc/filtres');\n\t$date_array = recup_date($date);\n\tif ($date_array) {\n\t\tlist($annee, $mois, $jour) = $date_array;\n\t}\n\tif (!$jour) {\n\t\t$jour = 1;\n\t}\n\tif (!$mois) {\n\t\t$mois = 1;\n\t}\n\t$mois2 = $mois + $decalage;\n\t$date2 = mktime(1, 1, 1, $mois2, $jour, $annee);\n\t// mois normalement attendu\n\t$mois3 = date('m', mktime(1, 1, 1, $mois2, 1, $annee));\n\t// et si le mois de la nouvelle date a moins de jours...\n\t$mois2 = date('m', $date2);\n\tif ($mois2 - $mois3) {\n\t\t$date2 = mktime(1, 1, 1, $mois2, 0, $annee);\n\t}\n\treturn date($format, $date2);\n}",
"function agenda_date_debut_liste($date, $affichage_debut = 'date_jour') {\n\tswitch ($affichage_debut) {\n\t\tcase 'date_jour':\n\t\t\tbreak;\n\t\tcase 'date_veille':\n\t\t\t$date = agenda_jourdecal($date, -1);\n\t\t\tbreak;\n\t\tcase 'debut_semaine':\n\t\t\t$t = strtotime($date);\n\t\t\t$date = agenda_jourdecal($date, -(date('N', $t)-1));\n\t\t\tbreak;\n\t\tcase 'debut_semaine_prec':\n\t\t\t$t = strtotime($date);\n\t\t\t$date = agenda_jourdecal($date, -(date('N', $t)-1+7));\n\t\t\tbreak;\n\t\tcase 'debut_mois':\n\t\t\t$t = strtotime($date);\n\t\t\t$date = agenda_jourdecal($date, -(date('j', $t)-1));\n\t\t\tbreak;\n\t\tcase 'debut_mois_prec':\n\t\t\t$t = strtotime($date);\n\t\t\t$date = agenda_jourdecal($date, -(date('j', $t)-1)); // debut de mois\n\t\t\t$date = agenda_moisdecal($date, -1); // precedent\n\t\t\tbreak;\n\t\tcase 'debut_mois_1':\n\t\tcase 'debut_mois_2':\n\t\tcase 'debut_mois_3':\n\t\tcase 'debut_mois_4':\n\t\tcase 'debut_mois_5':\n\t\tcase 'debut_mois_6':\n\t\tcase 'debut_mois_7':\n\t\tcase 'debut_mois_8':\n\t\tcase 'debut_mois_9':\n\t\tcase 'debut_mois_10':\n\t\tcase 'debut_mois_11':\n\t\tcase 'debut_mois_12':\n\t\t\t$t = strtotime($date);\n\t\t\t$mdebut = intval(substr($affichage_debut, strlen('debut_mois_')));\n\t\t\t$mcourant = date('n', $t);\n\t\t\t$offset = ($mcourant-$mdebut+12)%12;\n\t\t\t$date = agenda_jourdecal($date, -(date('j', $t)-1)); // debut de mois\n\t\t\t$date = agenda_moisdecal($date, -$offset);\n\t\t\tbreak;\n\t}\n\treturn $date;\n}",
"function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}",
"function calcula_numero_dia_semana($dia,$mes,$ano){\r\n\t$nrodiasemana = date('w', mktime(0,0,0,$mes,$dia,$ano));\r\n\treturn $nrodiasemana;\r\n}",
"function convertdateanglais($date){\n\t$ladate=explode('-',$date);\n\t$jour=$ladate[2];\n\t$moi=$ladate[1];\n\t$anne=$ladate[0];\n\t$madate=date(\"d/m/Y\", mktime(0, 0, 0, $moi, $jour, $anne));\n\treturn $madate;\n}",
"function primer_dia_periodo_anio($anio) {\n\n $sql=\"select fecha_inicio from mocovi_periodo_presupuestario where anio=\".$anio;\n $resul=toba::db('designa')->consultar($sql);\n return $resul[0]['fecha_inicio'];\n }",
"public function setDateDuJour()\n{\n$this->setDateSysteme(date(\"Y-m-d\"));\n$this->setDateUtilisateur(date(\"d/m/Y\"));\n}",
"function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}",
"function Fecha_mes($Ingresomes){\t\n$mes_mes = new DateTime($Ingresomes);\n$me = $mes_mes->format('m');\n$mes='';\nif($me=='01') $mes='Enero';\nif($me=='02') $mes='Febrero';\nif($me=='03') $mes='Marzo';\nif($me=='04') $mes='Abril';\nif($me=='05') $mes='Mayo';\nif($me=='06') $mes='Junio';\nif($me=='07') $mes='Julio';\nif($me=='08') $mes='Agosto';\nif($me=='09') $mes='Septiembre';\nif($me=='10') $mes='Octubre';\nif($me=='11') $mes='Noviembre';\nif($me=='12') $mes='Diciembre';\n$cadena = (\"$mes\");\nreturn $cadena;\n}"
]
| [
"0.7024813",
"0.68948615",
"0.6827427",
"0.6756596",
"0.6617817",
"0.6603044",
"0.6599686",
"0.65797853",
"0.6578685",
"0.6578598",
"0.6566086",
"0.65316087",
"0.65295315",
"0.6451526",
"0.64415747",
"0.6372603",
"0.6368027",
"0.6356797",
"0.63481915",
"0.6340455",
"0.6277745",
"0.62744933",
"0.6252324",
"0.62342536",
"0.62342536",
"0.6231662",
"0.6219832",
"0.62062657",
"0.61992973",
"0.61675954"
]
| 0.72166556 | 0 |
Makes errorsData by getting errors from model. Also resolves for owned related models such as Email. Prior to having this method, things such as currencyValue, emailAddress, and street1 for example were not properly showing validation errors on failure. This method properly handles Address, Email, and CurrencyValue which are three special related models where there are multiple attributes that are all shown as if they are the attributes on the base model. Custom fields don't follow this because they only have 'value' to show so are ok without special manipulation. | public static function makeErrorsDataAndResolveForOwnedModelAttributes($model)
{
assert('$model instanceof RedBeanModel || $model instanceof CModel');
$errorData = array();
foreach ($model->getErrors() as $attribute => $errors)
{
if ($model::isRelation($attribute) && $model::isOwnedRelation($attribute) &&
in_array($model::getRelationModelClassName($attribute), array('Address', 'Email', 'CurrencyValue')))
{
foreach ($errors as $relatedAttribute => $relatedErrors)
{
$errorData[ZurmoHtml::activeId($model, $attribute . '[' . $relatedAttribute . ']')] = $relatedErrors;
}
}
else
{
$errorData[ZurmoHtml::activeId($model, $attribute)] = $errors;
}
}
return $errorData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}",
"private function collectValidateErrors()\n {\n // collect errors from current model\n $this->addModelErrors();\n }",
"function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}",
"private function internalValidateAndGetErrors($data,$owner)\n\t{\n\t\tif($owner===null)\n\t\t\t$owner=$this->getOwner();\n\n\t\tif($data===null)\n\t\t{\n\t\t\t$attributes=null;\n\t\t\t$newData=array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// retrieve real class attributes that was specified in the class declaration\n\t\t\t$classAttributes=get_class_vars(get_class($owner));\n\t\t\tunset($classAttributes['db']); // has nothing in common with the application logic\n\t\t\t$classAttributes=array_keys($classAttributes);\n\n\t\t\t// mixing virtual attributes that represents database table columns with real class attributes\n\t\t\t$attributeNames=array_merge($classAttributes,$owner->attributeNames());\n\t\t\t// array_intersect must not be used here because when error_reporting is -1 notice will happen\n\t\t\t// since $data array contains not just scalar string values\n\t\t\t$attributes=array_uintersect($data,$attributeNames,\n\t\t\t\tcreate_function('$x,$y','return !is_string($x) || !is_string($y) ? -1 : strcmp($x,$y);'));\n\n\t\t\tif($attributes===array())\n\t\t\t\t$attributes=null;\n\n\t\t\t// array_udiff must not be used here because when error_reporting is -1 notice will happen\n\t\t\t// since $data array contains not just scalar string values\n\t\t\t$newData=array_udiff($data,$attributeNames,\n\t\t\t\tcreate_function('$x,$y','return !is_string($x) || !is_string($y) ? -1 : strcmp($x,$y);'));\n\n\t\t\tforeach($newData as $key=>$value)\n\t\t\t\tif (is_string($value))\n\t\t\t\t{\n\t\t\t\t\tunset($newData[$key]);\n\t\t\t\t\t$newData[$value]=array();\n\t\t\t\t}\n\t\t}\n\n\t\t$owner->validate($attributes,false);\n\t\t$errors=$owner->errors;\n\t\tforeach($newData as $name=>$data)\n\t\t{\n\t\t\tif(!is_array($data))\n\t\t\t\t$name=$data;\n\n\t\t\tif(!$owner->hasRelated($name))\n\t\t\t\tcontinue;\n\n\t\t\t/** @var CActiveRecord|CActiveRecord[]|null $related */\n\t\t\t$related=$owner->getRelated($name);\n\n\t\t\tif(null===$related)\n\t\t\t\tcontinue;\n\t\t\telseif(is_array($related))\n\t\t\t{\n\t\t\t\tforeach ($related as $key => $model)\n\t\t\t\t\tif ($relationErrors=$this->getRelationErrors($data,$model))\n\t\t\t\t\t\t$errors[$name][$key]=$relationErrors;\n\t\t\t}\n\t\t\telse\n\t\t\t\tif($relationErrors=$this->getRelationErrors($data,$related))\n\t\t\t\t\t$errors[$name]=$relationErrors;\n\t\t}\n\n\t\treturn $errors;\n\t}",
"protected function getErrorData()\n {\n $error = [\n 'message' => $this->getErrorMessage(),\n ];\n\n if ($this->debug && \\is_object($this->error)) {\n $error['exception'] = \\get_class($this->error);\n $error['file'] = $this->error->getFile();\n $error['line'] = $this->error->getLine();\n $error['trace'] = \\collect($this->error->getTrace())->map(function ($trace) {\n return Arr::except($trace, ['args']);\n })->all();\n }\n\n if ($this->error instanceof ValidationException && $this->error->validator) {\n if ($this->error->validator) {\n $error['errors'] = $this->error->validator->errors();\n } else {\n $error['errors'] = [];\n }\n } elseif ($this->error instanceof MessageBag) {\n $error['errors'] = $this->error->getMessages();\n }\n\n return $error;\n }",
"private function internalClearErrors($data,$owner)\n\t{\n\t\tif($owner===null)\n\t\t\t$owner=$this->getOwner();\n\n\t\tif($data===null)\n\t\t{\n\t\t\t$attributes=null;\n\t\t\t$newData=array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// retrieve real class attributes that was specified in the class declaration\n\t\t\t$classAttributes=get_class_vars(get_class($owner));\n\t\t\tunset($classAttributes['db']); // has nothing in common with the application logic\n\t\t\t$classAttributes=array_keys($classAttributes);\n\n\t\t\t// mixing virtual attributes that represents database table columns with real class attributes\n\t\t\t$attributeNames=array_merge($classAttributes,$owner->attributeNames());\n\t\t\t// array_intersect must not be used here because when error_reporting is -1 notice will happen\n\t\t\t// since $data array contains not just scalar string values\n\t\t\t$attributes=array_uintersect($data,$attributeNames,\n\t\t\t\tcreate_function('$x,$y','return !is_string($x) || !is_string($y) ? -1 : strcmp($x,$y);'));\n\n\t\t\tif($attributes===array())\n\t\t\t\t$attributes=null;\n\n\t\t\t// array_udiff must not be used here because when error_reporting is -1 notice will happen\n\t\t\t// since $data array contains not just scalar string values\n\t\t\t$newData=array_udiff($data,$attributeNames,\n\t\t\t\tcreate_function('$x,$y','return !is_string($x) || !is_string($y) ? -1 : strcmp($x,$y);'));\n\t\t}\n\n\t\t$owner->clearErrors();\n\n\t\tforeach($newData as $name=>$data)\n\t\t{\n\t\t\tif(!is_array($data))\n\t\t\t{\n\t\t\t\t$name=$data;\n\t\t\t\t$data=array($name);\n\t\t\t}\n\n\t\t\tif(!$owner->hasRelated($name))\n\t\t\t\tcontinue;\n\n\t\t\t/** @var CActiveRecord|CActiveRecord[]|null $related */\n\t\t\t$related=$owner->getRelated($name);\n\n\t\t\tif(null===$related)\n\t\t\t\tcontinue;\n\t\t\telseif(is_array($related))\n\t\t\t\tforeach ($related as $key => $model)\n\t\t\t\t\t$this->internalClearErrors($data,$model);\n\t\t\telse\n\t\t\t\t$this->internalClearErrors($data,$related);\n\t\t}\n\t}",
"protected function _readErrors (&$model, $queryData = array(), $options=array()) {\r\n\t\t\r\n\t\textract($queryData);\r\n\t\textract(array_merge(\r\n\t\t\tarray(\r\n\t\t\t\t'is_count' => $this->_isCount($fields)\r\n\t\t\t),\r\n\t\t\t$options\r\n\t\t));\r\n\t\t\r\n\t\tif (!empty($conditions) && !is_array($conditions)) {\r\n\t\t\t$this->showError(__('Conditions must be in array format', true));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($order) && !is_array($order)) {\r\n\t\t\t$this->showError(__('Order must be in array format', true));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (count($order) > 1) {\r\n\t\t\t$this->showError('Only 1 level of ordering is supported', true);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($joins)) {\r\n\t\t\t$this->showError(__('Joins are not supported', true));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif (!empty($group)) {\r\n\t\t\t$this->showError(__('Group is not supported', true));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t\t\r\n\t}",
"private function addValidationError()\n {\n $validationError = new ValidationError();\n $validationError->setValidationCode($this->validation->getValidationCode());\n if ($this->eachFieldName && $this->eachIndex) {\n $eachField = $this->formDataHandler->getFormValue($this->eachFieldName);\n $eachFieldValue = $eachField[$this->eachIndex][$this->formFieldName];\n $validationError->setFormValue($eachFieldValue);\n $validationError->setFormField($this->eachFieldName);\n $validationError->setEachFieldName($this->formFieldName);\n $validationError->setEachIndex($this->eachIndex);\n } else {\n $validationError->setFormValue($this->formDataHandler->getFormValue($this->formFieldName));\n $validationError->setFormField($this->formFieldName);\n }\n if ($this->errorText) {\n $validationError->setCustomErrorText($this->errorText);\n }\n $this->validationErrorHandler->addValidationError($validationError);\n }",
"public function _getValidationErrors(): array\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getYear())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_YEAR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getMonth())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MONTH] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDay())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DAY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSeason())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SEASON] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATE])) {\n $v = $this->getDate();\n foreach($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE])) {\n $errs[self::FIELD_DATE] = [];\n }\n $errs[self::FIELD_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_YEAR])) {\n $v = $this->getYear();\n foreach($validationRules[self::FIELD_YEAR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_YEAR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_YEAR])) {\n $errs[self::FIELD_YEAR] = [];\n }\n $errs[self::FIELD_YEAR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MONTH])) {\n $v = $this->getMonth();\n foreach($validationRules[self::FIELD_MONTH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_MONTH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MONTH])) {\n $errs[self::FIELD_MONTH] = [];\n }\n $errs[self::FIELD_MONTH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DAY])) {\n $v = $this->getDay();\n foreach($validationRules[self::FIELD_DAY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DAY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DAY])) {\n $errs[self::FIELD_DAY] = [];\n }\n $errs[self::FIELD_DAY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SEASON])) {\n $v = $this->getSeason();\n foreach($validationRules[self::FIELD_SEASON] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_SEASON, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SEASON])) {\n $errs[self::FIELD_SEASON] = [];\n }\n $errs[self::FIELD_SEASON][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_BACKBONE_ELEMENT, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"public static function validation_errors($input, $fields_to_validate)\n\t\t\t\t{\n\t\t\t\t\t$input = (array)$input;\n\t\t\t\t\t$fields_to_validate = (array)$fields_to_validate;\n\n\t\t\t\t\t$errors = array(); // Initialize the array of errors.\n\t\t\t\t\t$force_personal_emails = isset($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_force_personal_emails'][0]) ? TRUE : FALSE;\n\t\t\t\t\t$non_personal_email_users = '/^(?:'.implode('|', preg_split('/[\\s;,]+/', preg_quote($GLOBALS['WS_PLUGIN__']['s2member']['o']['custom_reg_force_personal_emails'], '/'))).')@/i';\n\n\t\t\t\t\tforeach($fields_to_validate as $_field)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(empty($_field['id'])) continue; // Not applicable.\n\t\t\t\t\t\t$_field_type = !empty($_field['type']) ? $_field['type'] : '';\n\t\t\t\t\t\t$_field_var = preg_replace('/[^a-z0-9]/i', '_', strtolower($_field['id']));\n\t\t\t\t\t\t$_field_id_class = preg_replace('/_/', '-', $_field_var);\n\n\t\t\t\t\t\t$_field_required = !empty($_field['required']) && $_field['required'] === 'yes';\n\t\t\t\t\t\t$_field_expects = !empty($_field['expected']) ? $_field['expected'] : '';\n\t\t\t\t\t\t$_field_label = !empty($_field['label']) ? $_field['label'] : ucwords(str_replace('_', ' ', $_field_var));\n\n\t\t\t\t\t\tswitch($_field_type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\tcase 'pre_checkbox':\n\t\t\t\t\t\t\tcase 'radios':\n\t\t\t\t\t\t\tcase 'select':\n\t\t\t\t\t\t\t\tif(isset($input[$_field_var]) && !is_string($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Invalid data type. Expecting a string.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'checkboxes':\n\t\t\t\t\t\t\tcase 'selects':\n\t\t\t\t\t\t\t\tif(isset($input[$_field_var]) && !is_array($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Invalid data type. Expecting an array.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault: // Default case handler for best security.\n\t\t\t\t\t\t\t\tif(isset($input[$_field_var]) && !is_string($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Invalid data type. Expecting a string.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(empty($errors[$_field_var]) && $_field_required) switch($_field_type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_string($input[$_field_var]) || !isset($input[$_field_var][0]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('This is a required field, please try again.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'checkbox':\n\t\t\t\t\t\t\tcase 'pre_checkbox':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_string($input[$_field_var]) || !isset($input[$_field_var][0]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Required. This box must be checked.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'checkboxes':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_array($input[$_field_var]) || empty($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please check at least one of the boxes.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'radios':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_string($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please select one of the options.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'select':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_string($input[$_field_var]) || !isset($input[$_field_var][0]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please select one of the options.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'selects':\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_array($input[$_field_var]) || empty($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please select at least one of the options.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault: // Default case handler for best security.\n\t\t\t\t\t\t\t\tif(!isset($input[$_field_var]) || !is_string($input[$_field_var]) || !isset($input[$_field_var][0]))\n\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('This is a required field, please try again.', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(empty($errors[$_field_var]) && $_field_expects) switch($_field_type)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\t\t\tif(isset($input[$_field_var]) && is_string($input[$_field_var]) && isset($input[$_field_var][0])) switch($_field_expects)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'numeric-wp-commas':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9][0-9\\.,]*$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be numeric (with or without decimals, commas allowed).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'numeric':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9][0-9\\.]*$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be numeric (with or without decimals, no commas).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'integer':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9]+$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be an integer (a whole number, without any decimals).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'integer-gt-0':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9]+$/', $input[$_field_var]) || $input[$_field_var] <= 0)\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be an integer > 0 (whole number, no decimals, greater than 0).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'float':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9\\.]+$/', $input[$_field_var]) || !preg_match('/[0-9]/', $input[$_field_var]) || !preg_match('/\\./', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a float (floating point number, decimals required).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'float-gt-0':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9\\.]+$/', $input[$_field_var]) || !preg_match('/[0-9]/', $input[$_field_var]) || !preg_match('/\\./', $input[$_field_var]) || $input[$_field_var] <= 0)\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a float > 0 (floating point number, decimals required, greater than 0).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a date (required date format: dd/mm/yyyy).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'email':\n\t\t\t\t\t\t\t\t\t\tif(!is_email($input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a valid email address.', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if($force_personal_emails && $non_personal_email_users && preg_match($non_personal_email_users, $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'.sprintf(_x('Please use a personal email address. Addresses like <%s@> are problematic.', 's2member-front', 's2member'), substr($input[$_field_var], 0, strpos($input[$_field_var], '@'))).'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'url':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^https?\\:\\/\\/.+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a full URL (starting with http or https).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'domain':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[a-zA-Z0-9]+(?:\\-*[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+(?:\\-*[a-zA-Z0-9]+)*)*(?:\\.[a-zA-Z][a-zA-Z0-9]+)?$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a domain name (domain name only, without http).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'phone':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9 ()\\-]+$/', $input[$_field_var]) || strlen(preg_replace('/[^0-9]+/', '', $input[$_field_var])) !== 10)\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a phone # (10 digits w/possible hyphens, spaces, brackets).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'uszip':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9]{5}(?:\\-[0-9]{4})?$/', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a US zipcode (5-9 digits w/ possible hyphen).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'cazip':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9A-Z]{3} ?[0-9A-Z]{3}$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a Canadian zipcode (6 alpha-numerics w/ possible space).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 'uczip':\n\t\t\t\t\t\t\t\t\t\tif(!preg_match('/^[0-9]{5}(?:\\-[0-9]{4})?$/', $input[$_field_var]) && !preg_match('/^[0-9A-Z]{3} ?[0-9A-Z]{3}$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Must be a zipcode (either a US or Canadian zipcode).', 's2member-front', 's2member').'</em>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tdefault: // Handle others dynamically here.\n\n\t\t\t\t\t\t\t\t\t\tif(preg_match('/^alphanumerics\\-spaces\\-punctuation\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[a-z 0-9\\/\\\\\\\\,.?:;\"\\'{}[\\]\\^|+=_()*&%$#@!`~\\-]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use alphanumerics, spaces & punctuation only.', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^alphanumerics\\-spaces\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[a-z 0-9]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use alphanumerics & spaces only.', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^alphanumerics\\-punctuation\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[a-z0-9\\/\\\\\\\\,.?:;\"\\'{}[\\]\\^|+=_()*&%$#@!`~\\-]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use alphanumerics & punctuation only (no spaces).', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^alphanumerics\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[a-z0-9]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use alphanumerics only (no spaces/punctuation).', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^alphabetics\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[a-z]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use alphabetics only (no digits/spaces/punctuation).', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^numerics\\-[0-9]+(?:\\-e)?$/', $_field_expects) && !preg_match('/^[0-9]+$/i', $input[$_field_var]))\n\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'._x('Please use numeric digits only.', 's2member-front', 's2member').'</em>';\n\n\t\t\t\t\t\t\t\t\t\telse if(preg_match('/^(?:any|alphanumerics\\-spaces\\-punctuation|alphanumerics\\-spaces|alphanumerics\\-punctuation|alphanumerics|alphabetics|numerics)\\-[0-9]+(?:\\-e)?$/', $_field_expects))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$_field_expects_split = explode('-', $_field_expects);\n\t\t\t\t\t\t\t\t\t\t\t$_field_expects_length = (integer)$_field_expects_split[1];\n\t\t\t\t\t\t\t\t\t\t\t$_field_expects_exact_length = !empty($_field_expects_split[2]) && $_field_expects_split[2] === 'e';\n\n\t\t\t\t\t\t\t\t\t\t\tif($_field_expects_exact_length && strlen($input[$_field_var]) !== $_field_expects_length)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif($_field_expects_split[0] === 'numerics')\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($_field_expects_length === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_field_expects_digits_chars = _x('digit', 's2member-front', 's2member');\n\t\t\t\t\t\t\t\t\t\t\t\t\telse $_field_expects_digits_chars = _x('digits', 's2member-front', 's2member');\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\telse if($_field_expects_length === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$_field_expects_digits_chars = _x('character', 's2member-front', 's2member');\n\t\t\t\t\t\t\t\t\t\t\t\telse $_field_expects_digits_chars = _x('characters', 's2member-front', 's2member');\n\n\t\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'.sprintf(_x('Must be exactly %s %s.', 's2member-front', 's2member'), $_field_expects_length, $_field_expects_digits_chars).'</em>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if(strlen($input[$_field_var]) < $_field_expects_length)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif($_field_expects_split[0] === 'numerics')\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($_field_expects_length === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_field_expects_digits_chars = _x('digit', 's2member-front', 's2member');\n\t\t\t\t\t\t\t\t\t\t\t\t\telse $_field_expects_digits_chars = _x('digits', 's2member-front', 's2member');\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\telse if($_field_expects_length === 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$_field_expects_digits_chars = _x('character', 's2member-front', 's2member');\n\t\t\t\t\t\t\t\t\t\t\t\telse $_field_expects_digits_chars = _x('characters', 's2member-front', 's2member');\n\n\t\t\t\t\t\t\t\t\t\t\t\t$errors[$_field_var] = '<strong>'.$_field_label.'</strong><br /> <em>'.sprintf(_x('Must be at least %s %s.', 's2member-front', 's2member'), $_field_expects_length, $_field_expects_digits_chars).'</em>';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tunset($_field, $_field_type, $_field_var, $_field_id_class, $_field_required, $_field_label, $_field_expects, $_field_expects_split, $_field_expects_length, $_field_expects_exact_length, $_field_expects_digits_chars);\n\n\t\t\t\t\treturn apply_filters('c_ws_plugin__s2member_custom_reg_field_validation_errors', $errors, get_defined_vars());\n\t\t\t\t}",
"public function getErrors() {\n /** @var Table $this */\n $errors = $this->entity->getErrors();\n\n $getThis = function ($association, $path, &$current, &$previous) {\n $key = array_pop($path);\n\n foreach ($current as $k => $v) {\n\n if ($association == 'embedded') {\n\n if (is_scalar($v)) {\n return;\n }\n $k = \"$key.$k\";\n }\n $previous[$k] = $v;\n }\n unset($previous[$key]);\n };\n\n $this->walkWithAssociated($errors, $getThis);\n $result = [];\n\n foreach ($errors as $field => $error) {\n $alias = $this->getAliasByField($field);\n\n foreach ($error as $key => $value) {\n // hasMany\n if (is_numeric($key)) {\n $result[$alias . \"[$key].\" . key($value)] = array_values(array_values($value)[0])[0];\n }\n else {\n $result[$alias] = $value;\n break;\n }\n }\n }\n\n return $result;\n }",
"public function validationErrors() {\n\t\t$return = array();\n\n\t\t$models = ClassRegistry::keys();\n\t\tforeach ($models as $currentModel) {\n\t\t\t$currentObject = ClassRegistry::getObject($currentModel);\n\t\t\tif ($currentObject instanceof Model) {\n\t\t\t\t$return[$currentObject->alias] = $currentObject->validationErrors;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}",
"protected function getFlattenedValidationErrorMessage() {}",
"public function cleanFields(Model $Model, $data = array(), $options = array()) {\n\t\textract(Hash::merge($this->settings[$Model->alias], $options));\n\t\tforeach($fields as $field) {\n\t\t\tif (isset($data[$Model->alias][$field])) {\n\t\t\t\t$data[$Model->alias][$field] = $this->purifyHtml($Model, $data[$Model->alias][$field], $purifierConfig);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * If source and target institute id is available in input decode it and merge with input\n\t\t */\n\t\tif ( $this->has('source_institute_id') ) {\n\t\t\t$input['source_institute_id'] = GeneralHelpers::decode($this->input('source_institute_id'));\n\t\t}\n\n\t\tif ( $this->has('target_institute_id') ) {\n\t\t\t$input['target_institute_id'] = GeneralHelpers::decode($this->input('target_institute_id'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData();\n\t}",
"public function validate()\n {\n\t# checking default value\n\tif ( $this->default &&\n\t !$this->isValidValue($this->default))\n\t{\n\t $this->_addError(\"invalid datatype of default value '$this->default'\");\n\t}\n\telseif ($this->default)\n\t{\n\t $this->default= $this->retype($this->default);\n\t}\n\n\tforeach($this->errors as $key => $error)\n\t{\n\t $this->errors[$key] = str_replace('%s', $this->getModel()->getName(). '::'.$this->name, $error);\n\t}\n\treturn $this->errors;\n }",
"public function getValidationErrors();",
"public function getValidationErrors();",
"protected function prepareForValidation()\n {\n if($this->name != null) {\n $this->merge([\n 'name' => filter_var($this->name, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->email != null) {\n $this->merge([\n 'email' => filter_var(trim($this->email), FILTER_SANITIZE_EMAIL),\n ]);\n }\n\n if($this->leader != null) {\n $this->merge([\n 'leader' => filter_var($this->leader, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->gruplac != null) {\n $this->merge([\n 'gruplac' => filter_var(trim($this->gruplac), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->minciencias_code != null) {\n $this->merge([\n 'minciencias_code' => filter_var(trim($this->minciencias_code), FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->minciencias_category != null) {\n $this->merge([\n 'minciencias_category' => filter_var($this->minciencias_category, FILTER_SANITIZE_STRING),\n ]);\n }\n\n if($this->website != null) {\n $this->merge([\n 'website' => filter_var(trim($this->website), FILTER_SANITIZE_URL),\n ]);\n }\n\n if($this->educational_institution_id != null) {\n $this->merge([\n 'educational_institution_id' => (integer) filter_var($this->educational_institution_id, FILTER_SANITIZE_NUMBER_INT),\n ]);\n }\n }",
"public function validationData()\n {\n $all = parent::validationData();\n $all['bank-info'] = Purifier::clean($all['bank-info']);\n $all['delivery'] = Purifier::clean($all['delivery']);\n return $all;\n }",
"private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }",
"public function errors(array $data = array(), array $errors = array())\n {\n //prepare\n $data = $this->prepare($data);\n \n //the uniqueness of a profile is from their id or email\n //if they change their email, they must provide a profile id\n //because there is no way to reference what to update\n //Simply put,\n //if profile id, we simply update it\n //if no profile id and email, $search for the email\n // and if found, update it\n // otherwise, insert it\n if (!is_numeric($data['profile_id'])\n && !$this('validation', $data['profile_email'])->isType('email', true)) {\n $errors['profile_id'] = self::INVALID_REFERENCE;\n $errors['profile_email'] = self::INVALID_REFERENCE;\n }\n \n //if we do have a number, just update it\n if (isset($data['profile_id'])\n && is_numeric($data['profile_id'])) {\n return eve()->model('profile')->update()->errors($data, $errors);\n }\n \n //at this point we should have an email at least\n //we don't know if we should test for create or update\n //best to just return what we got\n return $errors;\n }",
"protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}",
"public function rules()\n {\n return [\n 'name'=>'required|regex:/^[a-zA-Z\\s]+$/u|max:50',\n 'email'=>'required|email',\n 'phone'=>'required|regex:/^(09)([0-9\\s\\-\\+\\(\\)]*)$/|min:9|max:11',\n 'nrc'=>'required|regex:/^[0-9]{1,2}[/][a-zA-Z]+[(]+[N]+[)]+[0-9]+$/',\n 'gender'=>'required',\n 'race'=>'required|regex:/^[a-zA-Z\\s]+$/u|max:10',\n 'religious'=>'required|regex:/^[a-zA-Z\\s]+$/u|max:20',\n 'native_town'=>'required|regex:/^[a-zA-Z\\s]+$/u|max:50',\n 'date_of_birth'=>'required',\n 'weight'=>'required|numeric',\n 'feet'=>'required|numeric|max:9',\n 'inches'=>'required|numeric|min:1|max:11',\n 'marital_status'=>'required',\n 'health'=>'required|regex:/^[a-zA-Z\\s]+$/u|max:10',\n 'address'=>'required',\n 'emergency_contact_name'=>'required',\n 'emergency_phone'=>'required|regex:/^(09)([0-9\\s\\-\\+\\(\\)]*)$/|min:9|max:11',\n 'relation_with_econtact'=>'required', \n ];\n }",
"public function getErrors();",
"public function getErrors();"
]
| [
"0.6651823",
"0.662161",
"0.6611336",
"0.63729906",
"0.62853235",
"0.6100249",
"0.59507096",
"0.59176654",
"0.56476474",
"0.5622813",
"0.55876666",
"0.55408025",
"0.5455059",
"0.5404778",
"0.54031676",
"0.5398237",
"0.5384505",
"0.53822374",
"0.53405887",
"0.53318954",
"0.53239185",
"0.53239185",
"0.5317237",
"0.53169465",
"0.52993125",
"0.5291022",
"0.52508897",
"0.5230186",
"0.5178944",
"0.5178944"
]
| 0.66972834 | 0 |
Prepares a single doc output for response. | public function prepare_item_for_response($doc, $request) {
$data = [
'id' => $doc->ID,
'date' => mysql_to_rfc3339($doc->post_date),
'date_gmt' => mysql_to_rfc3339($doc->post_date_gmt),
'modified' => mysql_to_rfc3339($doc->post_modified),
'modified_gmt' => mysql_to_rfc3339($doc->post_modified_gmt),
'slug' => $doc->post_name,
'permalink' => get_permalink($doc),
'title' => [
'rendered' => get_the_title($doc->ID)
],
'content' => [
'rendered' => post_password_required($doc) ? '' : apply_filters('the_content', $doc->post_content),
],
'parent' => $doc->post_parent,
'order' => $doc->menu_order,
];
if ($request['context'] == 'edit') {
$data['title']['raw'] = $doc->post_title;
$data['content']['raw'] = $doc->post_content;
}
$response = rest_ensure_response($data);
$links = $this->prepare_links($doc);
$response->add_links($links);
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prepareResponse();",
"function post_process() {\n $this->_format_doc_comment();\n }",
"protected function _afterPrepareDocumentData()\n {\n }",
"function xh_createDocument()\r\n\t{\r\n\t}",
"protected function initDocumentTemplate() {}",
"protected function initDocumentTemplate() {}",
"protected function initDocumentTemplate() {}",
"protected function initDocumentTemplate() {}",
"public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }",
"public function finishDocument();",
"protected function header()\n {\n $data = date(\"Y-m-d\");\n $filename = $data . \"-\" . str_replace(\" \", \"-\", $this->title) . \".doc\";\n header(\"Content-type: application/vnd.ms-word\");\n header(\"Content-Disposition: attachment;Filename=$filename\");\n }",
"public function fn_get_print_doc($location, $params = array())\n {\n $tmp = QdSetupOther::GET();\n if ($tmp != null) {\n $tpl = $tmp->pbhanh_tpl;\n if (trim($tpl) === '') {\n $this->pushValidateError('', 'Please setup pbhanh_tpl in SetupOther first', 'error');\n } else {\n //mapping field\n $tpl = str_replace('{id}', $this->id, $tpl);\n $tpl = str_replace('{cust_fullname}', $this->cust_name, $tpl);\n $tpl = str_replace('{cust_address}', $this->cust_addr, $tpl);\n $tpl = str_replace('{cust_phone}', $this->cust_phone, $tpl);\n $tpl = str_replace('{cust_email}', $this->cust_email, $tpl);\n $tpl = str_replace('{product_name}', $this->product_name, $tpl);\n $tpl = str_replace('{product_model}', $this->model, $tpl);\n $tpl = str_replace('{product_no}', $this->product_no, $tpl);\n $tpl = str_replace('{warranty_policy}', $this->free_days_exchange, $tpl);\n $tpl = str_replace('{warranty_time_span}', $this->days_of_warranty, $tpl);\n\n\n if ($this->purchase_date) {\n $tpl = str_replace('{date_of_purchase}', date_format($this->purchase_date, \"d/m/Y\"), $tpl);\n } else {\n $tpl = str_replace('{date_of_purchase}', '', $tpl);\n }\n\n if ($this->date_created) {\n $tpl = str_replace('{date_created}', date_format($this->purchase_date, \"d/m/Y\"), $tpl);\n } else {\n $tpl = str_replace('{date_created}', '', $tpl);\n }\n\n if ($this->guarantee_exp_date) {\n $tpl = str_replace('{guarantee_exp}', date_format($this->guarantee_exp_date, \"d/m/Y\"), $tpl);\n } else {\n $tpl = str_replace('{guarantee_exp}', '', $tpl);\n }\n\n $tpl = str_replace('{shop_name}', $this->dealer_name, $tpl);\n $tpl = str_replace('{shop_address}', $this->dealer_addr, $tpl);\n $tpl = str_replace('{guarantee_address}', $this->guarantee_address, $tpl);\n\n if ($this->status === static::$STATUS_OPEN) {\n $this->status = static::$STATUS_PRINTED;\n if ($this->save())\n return $tpl;\n else {\n $this->pushValidateError('', 'Could not Save!', 'error');\n }\n }\n return $tpl;\n }\n } else {\n $this->pushValidateError('', 'Could not get QdSetupOther!', 'error');\n }\n }",
"public function displayDoc()\n {\n include __DIR__ . '/templates/doc.php';\n }",
"public function prepare_response_for_collection($response)\n {\n }",
"abstract public static function getDoc();",
"protected function _prepareDocument()\n\t{\n\t\t$app = JFactory::getApplication();\t\t\n $document = JFactory::getDocument();\n\t\t$menus = $app->getMenu();\n\t\t$title = null;\n\t\t\n\t\t$params \t= JComponentHelper::getParams( 'com_formularios' );\n\t\t$captcha = $params->get('reCaptcha', 0);\n\t\t$sitekey = $params->get('reCaptcha_sitekey');\n\t\t\n\t\tif($captcha == 1) {\n\t\t\t$document->addScript('https://www.google.com/recaptcha/api.js?render='.$sitekey);\n\t\t}\n\n\t\t// Because the application sets a default page title,\n\t\t// we need to get it from the menu item itself\n\t\t$menu = $menus->getActive();\n\t\tif($menu)\n\t\t{\n\t\t\t$title = $menu->title;\n\t\t} else {\n\t\t\t$title = JText::_('COM_BOTIGA_DEFAULT_PAGE_TITLE');\n\t\t}\n\n\t\t$this->document->setTitle($title);\n\t}",
"public function generateDocblock();",
"public function docHeaderContent() {}",
"private function _preprocessDocument()\n {\n $xml = $this->getDocument();\n $xml = preg_replace('/<w:bookmarkStart w:id=\"[0-9]\" w:name=\"([0-9 A-Z _]*)\"/',\n self::$_templateSymbol . '${1}' . self::$_templateSymbol, $xml);\n return $xml;\n }",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"function ax_create_document() {\n\t$root = ax_indirect_dictionary('Root');\n\t$root['Pages'] = ax_indirect_dictionary('Pages');\n\t$info = ax_indirect_dictionary();\n\t$info['Creator'] = AX_ACROSTIX_CREATOR_STRING;\n\t$info['CreationDate'] = ax_date(time());\n\t$trailer = array();\n\t$trailer['Root'] =& $root;\n\t$trailer['Info'] =& $info;\t\n\t\n\t$doc_obj = new AxDocument;\n\t$doc_obj->pages = array();\n\t$doc_obj->info =& $info;\n\t$doc_obj->PDFStructure = $trailer;\t\n\treturn $doc_obj;\n}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"protected function getDocumentTemplate() {}",
"function __processDocument() {\n\t\t$document = new Apache_Solr_Document;\n\t\tif ($this->settings[$this->model->alias]['boost']) {\n\t\t\t$document->setBoost($this->settings[$this->model->alias]['boost']);\n\t\t}\n\t\tforeach ($this->model->data as $alias => $data) {\n\t\t\tif ($alias === $this->model->alias) {\n\t\t\t\t$document = $this->__processDocumentFieldArray($document, $data);\n\t\t\t} elseif (in_array($alias, $this->settings[$this->model->alias]['include'])) {\n\t\t\t\t$field = $alias . $this->__fieldTypeMappingTable['relations'];\n\t\t\t\t$document = $this->__processDocumentRelationalFieldArray($document, $field, $data);\n\t\t\t}\n\t\t}\n\t\t$document->setField($this->__fieldModelAlias, $this->model->alias);\n\t\t$document->setField('id', $this->__createDocId());\n\t\treturn $document;\n\t}"
]
| [
"0.55953413",
"0.54254264",
"0.5422041",
"0.5411608",
"0.53206235",
"0.53206235",
"0.53206235",
"0.53206235",
"0.5313019",
"0.5303763",
"0.5275304",
"0.5265279",
"0.52053994",
"0.5171768",
"0.51227736",
"0.50891733",
"0.50834775",
"0.50826144",
"0.50722545",
"0.50297433",
"0.50297433",
"0.5028539",
"0.5028539",
"0.5028521",
"0.50277585",
"0.5027442",
"0.5027442",
"0.5027442",
"0.5027442",
"0.5016195"
]
| 0.62331617 | 0 |
Add trait to class at a given path. | public function addTrait($name, $path) {
$source = $this->files->get($path);
$pos = strpos($source, '{') + 1;
$newSource = substr_replace($source, "\n use \Baum\NodeTrait;\n", $pos, 0);
$this->files->put($path, $newSource);
return $path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTrait(PhpTrait $trait);",
"public function addPath($path);",
"public function addPath($path);",
"public function register_class($class_name, $path)\n\t{\n\t\t$class_name = strtolower($class_name);\n\t\tif ($path[0]!=DIRECTORY_SEPARATOR) $path = $this->get_modules_dir().DIRECTORY_SEPARATOR.$path;\n\t\t$this->classes[$class_name] = $path;\n\t}",
"public function setClassPath($class, $path)\n {\n $class = strtolower($class);\n\n $this->overriden[$class] = $path;\n\n $this->classes[$class] = $path;\n }",
"public function setClassPath($class, $path)\n {\n $class = strtolower($class);\n\n $this->overriden[$class] = $path;\n\n $this->classes[$class] = $path;\n }",
"function addTrait($trait)\n {\n if (is_string($trait)) {\n $this->traits[] = $this->normalizeTrait($trait);\n } else if (is_array($trait)) {\n foreach ($trait as $item) {\n if(!is_string($item)){\n $this->throwTraitException();\n }\n $this->addTrait($item);\n }\n } else {\n $this->throwTraitException();\n }\n return $this;\n }",
"public function addClassPath( &$path ) {\n\t\n\t\tif ( in_array( $path, self::$paths ))\n\t\t\treturn $this;\n\t\t\t\n\t\tself::$paths[] = $path;\n\t\t\n\t\treturn $this;\n\t}",
"public static function addPath($path) {\n if (!isset(self::$lookup_path)) {\n self::register();\n }\n self::$lookup_path[] = $path;\n }",
"public function addClassPath($path) {\n\t\t// trim any trailing slash\n\t\t$path = rtrim($path, '/');\n\t\tif (is_dir($path)) {\n\t\t\tif (!in_array($path, $this->classPaths)) {\n\t\t\t\t$this->classPaths[] = $path;\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public static function add(&$path) {\n $path = preg_replace('/((?:^|\\\\/)[^\\\\/\\\\.]+?)$/isD', '$1/', $path);\n }",
"static public function registerPath($path)\r\n {\r\n self::$paths[] = $path;\r\n }",
"public static function addClassPath($path) {\n $includes = explode(PATH_SEPARATOR, get_include_path());\n if (!is_array($path)) {\n $path = array($path);\n }\n foreach ($path as $p) {\n if (!in_array($p, $includes)) {\n array_unshift($includes, $p);\n }\n }\n @set_include_path(implode(PATH_SEPARATOR, $includes));\n }",
"public function addUsedClass(string $path): self\n {\n $this->usedClasses[] = $path;\n\n return $this;\n }",
"public function addClass($classname, $path)\n {\n $this->_map[$classname] = $path;\n\n return $this;\n }",
"public function add(string $path, string $namespace): self;",
"public static function addSpecialClass($class_name, $path) {\n self::definePathConstants();\n self::$special_classes[$class_name] = EFC_WEBAPP_PATH.$path;\n require_once(EFC_WEBAPP_PATH.$path);\n }",
"function cache_classes_Add($classname, $path)\n{\n cache_classes_Initialize();\n\n $filecontents = file_get_contents($path);\n $cache = core_cache_Get(CACHE_CLASSES_KEY);\n $cache[$classname] = $filecontents;\n core_cache_Set(CACHE_CLASSES_KEY, $cache, CACHE_CLASSES_TTL);\n}",
"public function addPath($path)\n {\n if (!in_array($path, $this->paths)) {\n $this->paths[] = $path;\n }\n }",
"public function withPath($path)\n {\n // TODO: Implement withPath() method.\n }",
"public function withPath($path)\n {\n // TODO: Implement withPath() method.\n }",
"public static function addPath( $path )\n\t{\n\t\t$path = rtrim($path, '/');\n\t\t$path = rtrim($path, '\\\\');\n\t\t$path .= DIRECTORY_SEPARATOR;\n\n\t\tif ( @!is_dir($path) ) {\n\t\t\trequire_once 'Mapper/Exception.php';\n\t\t\tthrow new Orm_Mapper_Exception(\"The path '$path' does not exist'\");\n\t\t}\n\n\t\tself::$_paths[$path] = $path;\n\t}",
"public static function register($name, $path) {\n static::$paths[$name] = rtrim($path, '/');\n }",
"public function addPath($path)\n {\n if (!in_array($path, $this->_paths)) {\n $this->_paths[] = rtrim($path, '/\\\\');\n }\n }",
"public function addPath($path)\n {\n $incpath = explode(PATH_SEPARATOR, get_include_path());\n if (!in_array($path, $incpath) && file_exists($path)) {\n set_include_path(get_include_path() . PATH_SEPARATOR . $path);\n }\n return self::$_instance;\n }",
"public function appendPath(string $path) : EngineInterface;",
"public function generateOtpAuthTrait($path, $nameInput)\n {\n list($path, $name, $otpAuthClass) = $this->qualifyTrait($path, $nameInput);\n $this->files->put($path, $this->sortImports($this->buildTrait($name, $otpAuthClass)));\n }",
"public function addFile($path)\n {\n $this->files[] = $path;\n }",
"public function setClassFilePath( & $path )\n {\n $this->classPath = & $path;\n }",
"public function withPath($path)\n {\n }"
]
| [
"0.68859726",
"0.64900076",
"0.64900076",
"0.6131301",
"0.60465026",
"0.60465026",
"0.5938348",
"0.592489",
"0.5919521",
"0.58455306",
"0.584397",
"0.57643235",
"0.5666531",
"0.5662838",
"0.5629982",
"0.5618941",
"0.5612188",
"0.5598552",
"0.55746365",
"0.5532502",
"0.5532502",
"0.5522618",
"0.55113506",
"0.54315406",
"0.5377525",
"0.5331301",
"0.52751255",
"0.52682155",
"0.52592486",
"0.5243392"
]
| 0.7753511 | 0 |
Static function to create a new Response DTO from array | public static function createFromArray(array $params): self {
/**
* @var ResponseDTO $dto
*/
$dto = pluginApp(ResponseDTO::class);
$dto->setId($params['id'] ?? null);
$dto->setEventDate($params['eventDate'] ?? null);
$dto->setPickupDate($params['pickupDate'] ?? null);
$dto->setPoNumber($params['poNumber'] ?? null);
$dto->setBillOfLading($params['billOfLading'] ?? null);
$dto->setConsolidatedShippingLabel($params['consolidatedShippingLabel'] ?? null);
$dto->setGeneratedShippingLabels($params['generatedShippingLabels'] ?? null);
$dto->setPurchaseOrder($params['purchaseOrder'] ?? null);
return $dto;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function mapResponse(array $data = [])\n {\n return array_map(function ($item) {\n return [\n 'id' => $item['orderId'],\n 'symbol' => $item['symbol'],\n 'side' => strtolower($item['side']),\n 'type' => strtolower($item['type']),\n 'status' => strtolower($item['status']),\n 'price' => $item['price'],\n 'amount' => $item['origQty'],\n 'timestamp' => $item['time'],\n ];\n }, $data);\n }",
"function makeResponse($response)\n {\n $result = current(Util::toArray($response));\n\n $response = new Response([\n 'raw_body' => $result,\n\n ## get response message as array\n 'default_expected' => function($rawBody) use ($result) {\n return $result;\n }\n ]);\n // TODO handle exceptions\n\n /** @var iResponse $response */\n $response = $this->exceptionHandler($response);\n \n\n return $response;\n }",
"protected function _createResponse($name, $data = array())\n\t{\n\t\treturn new ArrayResponse($name, $data);\n\t}",
"protected static function dataToResponse(array $data)\n {\n return new InvoiceResponse($data);\n }",
"public function canTransformArrayToResponse()\n {\n $resourceTransformer = new DummyResourceTransformer();\n\n $dummyArray = [\n [\n 'id' => 'test'\n ],\n [\n 'id' => 'super'\n ]\n ];\n\n $transformed = $resourceTransformer->transformToResponse($dummyArray);\n\n $decoded = json_decode($transformed->getContent());\n\n $this->assertEquals(2, count($decoded->data));\n }",
"function makeNewResponseArray($response, $oldResponse){\n\t\t$newResponse = $oldResponse;\n\t\tforeach($response as $responseAttribute => $value){\n\t\t\tif($value != null){\n\t\t\t\t$newResponse[$responseAttribute] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $newResponse;\n\t}",
"protected function prepareBinDto(array $responseArray): BinDto\n {\n $binCountry = (new BinCountry())\n ->setAlpha2($responseArray['country']['alpha2'] ?? '');\n\n return (new BinDto())\n ->setCountry($binCountry);\n }",
"public function getTransformedCollection( ) {\n $response[\"data\"] = [];\n foreach ( (new static)->get() as $industry_object) {\n $response['data'][] = $industry_object->getBeforeStandard();\n }//foreach ( (new static)->get() as $industry_object)\n return $response;\n }",
"public function createResponse()\n {\n return new Response;\n }",
"function api_create_response($payload, $status, $message) {\n if (is_numeric($payload)) {\n\n if ($payload == 1)\n $payload = array();\n elseif ($payload == 2)\n $payload = new \\stdClass();\n }\n\n $response_array = array('payload' => $payload, 'status' => $status, 'message' => $message);\n return $response_array;\n}",
"public function toResponse()\n\t{\n\t\treturn $this->toArray();\n\t}",
"public function convertResponse($values)\n {\n\t}",
"public function convertResponse($values)\n {\n\n\t}",
"public function toEntity($array);",
"public function toEntity($array);",
"public function composeResponse($chanel,$movies) {\n if(!is_array($movies)) {\n $movies=array($movies);\n }\n\n $chanel=(array)$chanel;\n\n $chanel['movies']=array();\n\n foreach ($movies as $movie) {\n $chanel['movies'][]=Movie::getInstance()->composeResponse($movie);\n }\n $chanel= (object)$chanel;\n\n $chanel->id=intval($chanel->id);\n $chanel->created_at=intval(strtotime($chanel->created_at));\n $chanel->updated_at=intval(strtotime($chanel->updated_at));\n $chanel->order=intval($chanel->order);\n\n return $chanel;\n }",
"public static function mapFromResult(array $data)\n {\n $formData['fields'] = $data;\n\n if (!isset($formData['fields']['witnesses'])) {\n $formData['fields']['witnesses'] = 0;\n }\n\n foreach ($formData['fields'] as $key => $value) {\n if (isset($value['id'])) {\n $formData['fields'][$key] = $value['id'];\n }\n }\n\n return $formData;\n }",
"public function createResponse()\n {\n return new GuzzleResponse();\n }",
"public function createFromResponse(): Article\n {\n return new Article((array) $this);\n }",
"public function arrayToObject($array): static;",
"public function createFromResponse(): ContactClient\n {\n return new ContactClient((array) $this);\n }",
"public function create(): array\n {\n $url = sprintf(\n '%s%s/sobjects/%s/',\n static::getApiPrefix(),\n config('salesforce.api_version'),\n static::$objectApiName\n );\n $record = $this->encode($this->raw());\n $response = self::guzzleRequest('post', $url, [\n 'json' => $record,\n ]);\n if ($response['success']) {\n $this->Id = $response['id'];\n }\n return $response;\n }",
"abstract public function createResponse(AbstractRequestClient $request);",
"public static function mapFromResult(array $data)\n {\n $formData = [];\n\n if (isset($data['id'])) {\n $formData = [\n 'exception-details' => [\n 'id' => $data['id'],\n 'version' => $data['version'],\n 'teamOrUser' => isset($data['user']['id']) ? 'user' : 'team',\n 'team' => isset($data['team']['id']) ? $data['team']['id'] :\n (isset($data['team']) ? $data['team'] : null)\n ],\n 'team-printer' => [\n 'printer' => $data['printer']['id'],\n 'subCategoryTeam' => $data['subCategory']['id'],\n 'categoryTeam' => $data['subCategory']['category']['id']\n ],\n 'user-printer' => [\n 'printer' => $data['printer']['id'],\n 'subCategoryUser' => $data['subCategory']['id'],\n 'categoryUser' => $data['subCategory']['category']['id'],\n 'user' => isset($data['user']['id']) ? $data['user']['id'] : null\n ],\n ];\n }\n if (isset($data['team']) && !is_array($data['team'])) {\n $formData['exception-details']['team'] = $data['team'];\n }\n\n return $formData;\n }",
"protected function buildJsonApiObject(array $arr, string $dtoClass): array\n {\n $reflection = new ReflectionClass($dtoClass);\n $exposedProperties = $this->entityMetadata->extractExposedProperties($reflection);\n $attributes = [];\n foreach ($exposedProperties as $property) {\n if (array_key_exists($property->name, $arr)) {\n $attributes[$property->name] = $arr[$property->name];\n }\n }\n\n $relatedProperties = $this->entityMetadata->extractRelated($reflection);\n $type = $this->entityMetadata->extractType($reflection);\n $idProperty = $this->entityMetadata->extractId($reflection);\n $id = $attributes[$idProperty];\n\n $relationships = [];\n foreach ($relatedProperties as $attributeName => $relationshipType) {\n if (array_key_exists($attributeName, $attributes)) {\n $value = $attributes[$attributeName];\n if (is_array($value)) {\n $relationships[$attributeName]['data'] = [];\n foreach ($value as $relId) {\n $relationships[$attributeName]['data'][] = [\n 'type' => $relationshipType,\n 'id' => $relId,\n ];\n }\n } elseif (is_null($value)) {\n $relationships[$attributeName]['data'] = null;\n } else {\n $relationships[$attributeName]['data'] = [\n 'type' => $relationshipType,\n 'id' => $value,\n ];\n }\n }\n\n unset($attributes[$attributeName]);\n }\n unset($attributes[$idProperty]);\n\n return [\n 'id' => $id,\n 'type' => $type,\n 'attributes' => $attributes,\n 'relationships' => $relationships\n ];\n }",
"private function serviceFieldsToObject(array $fields) {\n $data = new stdClass();\n foreach ($fields as $field) {\n if (is_array($field))\n $data->{$field['key']} = $field['value'];\n else\n $data->{$field->key} = $field->value;\n }\n\n return $data;\n }",
"public function getDto()\r\n {\r\n $data = $this->toArray();\r\n\r\n $dto = new Pandamp_Modules_Misc_Poll_Dto();\r\n foreach ($data as $key => $value) {\r\n if (property_exists($dto, $key)) {\r\n $dto->$key = $value;\r\n }\r\n }\r\n\r\n return $dto;\r\n }",
"public function createResponse(): ResponseInterface {\n return $this->responseFactory->createResponse()->withHeader('Content-Type', 'application/json');\n }",
"public function jsonSerialize(): array\n {\n Response::jsonField('name', $this->getName());\n Response::jsonField('in', $this->getIn());\n Response::jsonField('description', $this->getDescription());\n Response::jsonField('required', $this->isRequired());\n Response::jsonField('type', $this->getType());\n Response::jsonField('format', $this->getFormat());\n Response::jsonField('allowEmptyValue', $this->isAllowEmptyValue());\n Response::jsonField('collectionFormat', $this->getCollectionFormat());\n Response::jsonField('items', $this->getItems());\n Response::jsonField('schema', $this->getSchema());\n\n return Response::jsonSerialize($this);\n }",
"protected function build_response($res, $options = []){\n\n if(!$res) {\n return [];\n }\n\n $details = [];\n if(in_array('detail', $options)) {\n $details = [\n 'content' => $res->content,\n 'status' => $res->status\n ];\n }\n\n if(in_array('public_status', $options)) {\n\n if(isset($res->started_at) && $res->started_at > business_date('Y-m-d H:i:s')) {\n $details['public_status'] = 'before_published';\n }\n\n if($res->started_at <= business_date('Y-m-d H:i:s') && (business_date('Y-m-d H:i:s') <= $res->ended_at || $res->ended_at == null)) {\n $details['public_status'] = 'available';\n }\n\n if(isset($res->ended_at) && business_date('Y-m-d H:i:s') > $res->ended_at) {\n $details['public_status'] = 'expired';\n }\n }\n\n return array_merge([\n 'id' => isset($res->id) ? (int) $res->id : NULL,\n 'title' => $res->title,\n 'created_at' => $res->created_at,\n 'started_at' => $res->started_at,\n 'ended_at' => $res->ended_at\n ], $details);\n }"
]
| [
"0.58898544",
"0.57818747",
"0.5767748",
"0.5729738",
"0.5700261",
"0.5634757",
"0.55661684",
"0.55462927",
"0.55409086",
"0.549438",
"0.54880685",
"0.54862446",
"0.5483196",
"0.5471167",
"0.5471167",
"0.54579663",
"0.5430098",
"0.5423167",
"0.5412949",
"0.5386757",
"0.5382562",
"0.5369986",
"0.53656226",
"0.535395",
"0.5349412",
"0.53407395",
"0.5322581",
"0.5310717",
"0.5307221",
"0.52807224"
]
| 0.6964682 | 0 |
Lists all Goods models. | public function actionIndex()
{
$searchModel = new GoodsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $goods = $em->getRepository('DeepSpaceOneGameBundle:Good')->findAll();\n\n return array(\n 'goods' => $goods,\n );\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"public function actionIndex()\n {\n $searchModel = new GoodsCategorySearchModel();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $model = new GoodsCategoryModel();\n $show = $model::$_show;\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'show' => $show,\n 'hot' => $model::$_hot,\n ]);\n }",
"public function actionIndex() {\n $this->breadcrumbs = array($this->page_name . '管理');\n $criteria = new CDbCriteria();\n $model = GoodsCategory::model()->findAll($criteria);\n $list = Utils::getUnLimitClass(Utils::object2array($model), 0, '---');\n $this->render('index', array('model' => $list));\n }",
"public function index()\n {\n return $this->model->getAll();\n }",
"public function index()\n {\n return $this->model->all();\n }",
"public function index()\n {\n //\n $data= Goods::all();\n return view('admin.goods.index',compact('data'));\n }",
"public function actionIndex()\n {\n $searchModel = new BrandSpecGoodsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function index(){\n return $this->model->all();\n }",
"public function getGoods()\n {\n $goods = Good::with('catalog')\n ->orderBy('price')\n ->get();\n return response()->json([\n 'goods' => $goods,\n 'success' => true\n ], $this->successStatus);\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function allBooks ()\n {\n $books = $this->book->findAll();\n $this->show('admin/allbooks', ['books' => $books]);\n }",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}",
"public function index()\n {\n //\n $goods = new Goods;\n $goods_info = $goods->get();\n $supplier = new Supplier;\n $supplier_info = $supplier->get();\n return view('goods.index',compact('goods_info','supplier_info'));\n \n }",
"public function index()\n {\n return Entity::all();\n }",
"private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }",
"public function index()\n {\n $ingredients = Ingredient::all();\n\n return $this->showAll($ingredients);\n }",
"public function index()\n {\n return Model::all();\n }",
"public function getModels();",
"public function getModels();",
"static public function getGoodsAll($modelId, $goodId)\n {\n $params = [\n 'model_id' => $modelId,\n 'goods_name_id' => $goodId\n ];\n\n try {\n $res = json_decode(self::get('/goods/by_model', $params), true);\n Log::info('getGoodsAll=' . print_r($res, 1));\n\n return $res;\n } catch (\\Exception $e) {\n Log::error($e);\n throw new HttpException(404, 'Model with id None not found');\n }\n }",
"public function index()\n {\n return $this->itemRepo->findAll();\n }",
"public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }",
"public function index()\n {\n $booket=Booket::all();\n\n return $this->showAll($booket);\n\n }"
]
| [
"0.6778327",
"0.6519662",
"0.63298243",
"0.62952715",
"0.6273727",
"0.6255434",
"0.62513036",
"0.6249907",
"0.6216159",
"0.6216159",
"0.6216159",
"0.6204096",
"0.6188839",
"0.61826336",
"0.6179654",
"0.61572033",
"0.61558926",
"0.6149059",
"0.6115133",
"0.6096071",
"0.60919183",
"0.6084012",
"0.6060694",
"0.60556227",
"0.60543853",
"0.60543853",
"0.6050236",
"0.60278136",
"0.6021173",
"0.5994982"
]
| 0.7001598 | 0 |
Creates a new Goods model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new Goods([
'created_by' => Yii::$app->user->id,
'updated_by' => Yii::$app->user->id,
]);
$model->loadDefaultValues();
$model->goods_sn = date('YmdHis', time()) . rand(1000, 9999);
$goodsDetail = new GoodsDetail();
// var_dump(Yii::$app->request->post());exit;
if ($model->load(Yii::$app->request->post()) && $goodsDetail->load(Yii::$app->request->post())) {
$tran = Yii::$app->db->beginTransaction();
if ($model->save()) {
//新建商品详情数据
$goodsDetail->goods_id = $model->id;
$goodsDetail->save();
//新建标签
$tags = Tags::saveTags($model->tags);
//添加引用
GoodsTagRef::saveGoodsTagRef($model->id, $tags);
$tran->commit();
return $this->redirect(['view', 'id' => $model->id]);
} else {
$tran->rollBack();
}
}
return $this->render('create', [
'model' => $model,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new ProductGoods();\n $post = Yii::$app->request->post();\n\n if ($model->load($post) && $model->validate()) {\n\n if($model->addressRadioButton == 'my') {\n $model->address = '';\n } else {\n $model->address = $post['ProductGoods']['address'];\n }\n $model->status = ProductGoods::STATUS_NEW;\n $model->user_id = Yii::$app->user->id;\n $model->save();\n\n return $this->redirect(['update', 'id' => $model->id]);\n// return $this->redirect(['/profile/products']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n\t\t//添加货品权限\n\t\tif (Gate::denies('create-goods')) {\n return back();\n\t\t}\n return view('admin/good/create',array('sid'=>$this->sid));\n }",
"public function create()\n {\n $goods['id'] = md5(microtime());\n $currency = Currency::get();\n $program = Program::get();\n $manufacturer = Manufacturer::get();\n $merchant = Merchant::get();\n\n return view('goods-create', compact('goods', 'currency', 'program', 'manufacturer', 'merchant'));\n }",
"public function actionCreate()\n {\n $model = new Ddiet();\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 // 全部分类\n $cate = self::getCates();\n // 全部品牌\n $brand = Brand::get();\n // dd($brand);\n //加载分类添加页面\n return view('Admin.Goods.goodsAdd',['type'=>$cate,'brand'=>$brand]);\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 actionCreate()\n {\n $model = new Produksi();\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 PricefallsProducts();\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($goods_id)\n {\n $goodsModel = Goods::findOne(['id' => $goods_id]);\n $model = new GoodsMaterial(['goods_id' => $goods_id]);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'goods_id' => $goods_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'goodsModel' => $goodsModel,\n ]);\n }",
"public function actionCreate()\n {\n $model = new DrugTuri();\n\n if ($model->load(Uni::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_DrugTuri]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n // 后台商品添加\n $cate = CateController::getCates(); // 调用分类控制器中的获取分类方法\n return view('Admin.Goods.add',['cate'=>$cate]);\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 create()\n {\n //添加\n //用来遍历下拉框\n $data = new shopGoods;\n $type_data = $data->getType();\n return view('admin.goods.create',['title'=>'添加商品','top'=>'添加商品','type_data'=>$type_data]); \n }",
"public function actionCreate() {\n $model = new Stakeholder();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->datecreated = Date('Y-m-d h:i:sa');\n\n if ($model->save()) {\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 $model = new GestionStock;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionStock'])) {\n $model->attributes = $_POST['GestionStock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n {\n $model = new Oadode();\n $modelDescription = new DescriptionOfGoods();\n $posts = Yii::$app->request->post();\n if (!empty(Yii::$app->request->post())) {\n $posts['DescriptionOfGoods']['application_id'] = $posts['Oadode']['application_id'];\n $posts['DescriptionOfGoods']['customer_id'] = $posts['Oadode']['customer_id'];\n $posts['DescriptionOfGoods']['user_id'] = $posts['Oadode']['user_id'];\n }\n \n if ($model->load($posts) && $model->save()) {\n if ($modelDescription->load($posts) && $modelDescription->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'modelDescription' =>$modelDescription\n ]);\n }",
"public function actionCreate()\n {\n $model = new Book();\n $modelPicture = new PictureForm();\n\n if(!empty(Yii::$app->session['bookPicture'])) {\n $model->picture = Yii::$app->session['bookPicture'];\n }\n\n if(!empty(Yii::$app->session['bookPicture'])) {\n $model->picture = Yii::$app->session['bookPicture'];\n unset(Yii::$app->session['bookPicture']);\n }\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 'modelPicture' => $modelPicture,\n ]);\n }",
"public function create()\n {\n //\n check_admin_purview('4');\n $user = DB::table('users')->get();\n $cate = CateModel::all();\n $meal = DB::table('goods_meals')->select('id','goods_meals_detail')->get();\n\n return view('Admin.Goods.add',['user'=>$user,'cate'=>$cate,'meal'=>$meal]);\n }",
"public function actionCreate()\n {\n $model = new Lab();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($model->status == $model::STATUS_DEFAULT) {\n return $this->redirect(['create-goods', 'id' => $model->labid]);\n }\n else {\n return $this->redirect(['view', 'id' => $model->labid]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new GoodsCategoryModel();\n\n if ($model->load(Yii::$app->request->post())) {\n\t $categoryId = Yii::$app->request->post('GoodsCategoryModel')['top_category'];\n\t //如果存在顶级分类,并且没有上级分类,把顶级分类设置为上级分类\n\t if($categoryId > 0 && $model->parent_id <= 0) {\n\t\t $model->parent_id = $categoryId;\n\t }\n\t \n\t //如果不是顶级分类,查找上级分类\n\t if($model->parent_id > 0) {\n\t\t $parent = GoodsCategoryModel::findOne($model->parent_id);\n\t\t $model->parent_id_path = $parent->parent_id_path ? $parent->parent_id_path.'_'.$parent->id : $parent->id;\n\t\t $model->level = $parent->level + 1;\n\t } else {\n\t \t$model->parent_id = 0;\n\t }\n\t \n\t \n\t if($model->save()){\n\t\t \n\t\t return $this->redirect(['index']);\n\t }\n } else {\n \t$model->is_show = $model::SHOW_Y;\n \t$model->is_hot = $model::HOT_N;\n $model->sort = 10;\n $model->level = 1;\n $model->parent_id = 0;\n \t$top_category = $model->getSons(0, 'id,name');\n \t$categorys = [];\n \t\n \t$group = CategoryGroupModel::find()\n\t\t ->where(['category_id' => null])\n\t\t ->all();\n return $this->render('create', [\n 'model' => $model,\n\t 'top_category' => $top_category,\n\t 'categorys' => $categorys,\n\t 'group' => $group,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Products();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Stock();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_stock]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new ShopErasureData();\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\t$model = new ServiceDrug;\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['ServiceDrug'])) {\n\t\t\t$model->attributes = $_POST['ServiceDrug'];\n\t\t\tif ($model->save()) {\n\t\t\t\t$this->redirect(array('view', 'id' => $model->id));\n\t\t\t}\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 {\n $model = new Peticiones();\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 $model = new TimeBooks();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\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 $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }"
]
| [
"0.7454306",
"0.74196845",
"0.6987868",
"0.69800586",
"0.6946474",
"0.6945114",
"0.69300234",
"0.6909809",
"0.69065356",
"0.68984115",
"0.6876613",
"0.6855188",
"0.685154",
"0.68436015",
"0.68109447",
"0.6808141",
"0.6788905",
"0.6787601",
"0.67736727",
"0.6772823",
"0.6771948",
"0.67523223",
"0.674404",
"0.67288405",
"0.6696504",
"0.6687539",
"0.6686484",
"0.6680229",
"0.6670896",
"0.666564"
]
| 0.8303446 | 0 |
In view and edit mode, we always show status. | function action_view()
{
$this->addStatusFields();
return parent::action_view();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatus() \n {\n if ($this->status) \n {\n \techo 'user status : присутствует<br><br><br>';\n }\n else\n {\n \techo 'user status : отсутствует<br><br><br>';\t\n }\n }",
"public function statusAction()\n {\n // enforce permissions.\n $this->acl->check('content', 'manage');\n\n // set context\n $this->contextSwitch->initContext('json');\n\n $processId = $this->getRequest()->getParam('processId');\n $statusFile = sys_get_temp_dir() . '/' . static::STATUS_FILE . $processId;\n\n if (!file_exists($statusFile) ) {\n $status = array(\n 'label' => 'no status',\n 'message' => 'No current status file.',\n 'done' => true\n );\n $this->view->status = $status;\n return;\n }\n\n $this->view->status = $this->_readStatusFile($processId);\n }",
"function view() {\n $status_update = StatusUpdates::findById($this->request->get('status_update_id'));\n \n if (!instance_of($status_update, 'StatusUpdate')) {\n $this->httpError(HTTP_ERR_NOT_FOUND);\n } // if\n \n $this->redirectToUrl($status_update->getRealViewUrl($this->status_updates_per_page));\n die();\n }",
"public function status();",
"public function status();",
"public function statusAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $ctrlRow->set('enabled', $ctrlRow->get('enabled') == 1 ? 0 : 1);\n $this->dbCtrl->update($ctrlRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n\n // disabled all actions too, they are relevant in the ACL\n IF($ctrlRow->get('enabled') === 0) {\n $actionRow = new Admin_Model_DbRow_Action(array(\n 'enabled' => 0\n ));\n $actionDbModel = new Admin_Model_DbTable_Acl_Action;\n $actionDbModel->updateWithControllerId($actionRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n }\n\n $this->_redirect('admin/controller/index');\n \n }",
"public function actionChangeStatus() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$content = Content::model()->findByPk(\\Yii::app()->getRequest()->getParam('contentId', 0));\n\t\t\t$mode = \\Yii::app()->getRequest()->getParam('mode', 'draft');\n\t\t\tif($content !== null) {\n\t\t\t\t$content->contentStatus = $mode;\n\t\t\t\t$content->save();\n\t\t\t}\n\t\t\t$this->renderPartial('_contentHeader', array('content' => $content));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function status()\n {\n if (auth::check()) {\n if (auth::user()->auth == 1) {\n $status = status::all();\n return view('backend.pengaturan.status', compact('status'));\n }\n }\n }",
"public function update_status();",
"function _showStatus() {\r\n $okMessage = implode('<br />', $this->_okMessage);\r\n $errMessage = implode('<br />', $this->_errMessage);\r\n\r\n if (!empty($errMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_ERROR_MESSAGE', $errMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('errormsg');\r\n }\r\n\r\n if (!empty($okMessage)) {\r\n $this->_objTpl->setVariable('FILEBROWSER_OK_MESSAGE', $okMessage);\r\n } else {\r\n $this->_objTpl->hideBlock('okmsg');\r\n }\r\n }",
"public function status () {\n\n //GETS CURRENT NOTEPADID FROM REQUEST AND STORES IN VARIABLE\n $NotepadID = request('NotepadID');\n \n //FINDS TASK RECORD WITH ID REQUEST AND STORES IN OBJECT\n $data=Tasks::find(request('id'));\n \n //IF TASK STATUS EQUALS TRUE, THEN SET FALSE AND IF TASK STATUS\n //EQUALS FALSE THEN SET TRUE\n if ($data->status) {\n $data->status=0;\n } \n else {\n $data->status=1;\n }\n\n //SAVE DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }",
"protected function status()\n {\n }",
"public function getorderStatus()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Status (Linnworks API)');\n\n\t\t}",
"public function getStatusAdmin()\n {\n switch ($this->status) {\n case 0:\n return '<span class=\"label label-danger\">Open</span>';\n case 1:\n return '<span class=\"label label-success\">Closed</span>';\n }\n }",
"public function get_status()\n {\n }",
"public function get_status()\n {\n }",
"function status(){\n return ($this -> is_approved())?\"Approved\":\"Unapproved\";\n }",
"public function status()\t{\n\t\t\t$this->veiculo->update($this->input->post('id'), array('veiculo_status' => $this->input->post('status')));\n\t\t}",
"public function show(Status $status)\n {\n //\n }",
"public function show(Status $status)\n {\n //\n }",
"public function show(Status $status)\n {\n //\n }",
"public function ctlStatus() \n {\n if($this->getStatus() < $this->_statusOkDel) : \n $this->setIdDel(true);\n else:\n $this->setIdDel(false);\n endif;\n \n if($this->getStatus() < $this->_statusOkMaj) : \n $this->setIdMaj(true);\n else:\n $this->setIdMaj(false);\n endif;\n $this->setOnlinedat();\n }",
"public function edit(Status $status)\n {\n //\n }",
"public function status()\r\n {\r\n if($this->twitter->check_login() == False)\r\n {\r\n url::redirect($this->docroot.'ktwitter/demo');\r\n }\r\n \r\n $response = False;\r\n // now if we are \"POSTING\" then we need to update status first\r\n if($_POST)\r\n {\r\n // setStatus does what it says on the tin (no input sanitized!!!!!)\r\n $response = $this->twitter->setStatus($this->input->post('status'));\r\n \r\n // manipulating the response object\r\n $response = $response->text;\r\n\r\n }\r\n \r\n // get the timeline\r\n $timeline = $this->twitter->getStatus();\r\n \r\n // show the page\r\n $this->page->content = new View('ktwitter/demo/status',array('response'=>$response,'timeline'=>$timeline));\r\n $this->page->render(True);\r\n \r\n }",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function actionCaseStatus()\n {\n\n if (Yii::$app->request->post('hasNew')) {\n $model = new CaseStatus();\n $model->load(Yii::$app->request->post());\n\n $model->created_by = Yii::$app->user->identity->id;\n $hasError = true;\n if($model->save()) {\n $hasError = false;\n }\n echo Json::encode(['hasError'=>$hasError]);\n return;\n }\n\n if (Yii::$app->request->post('hasEditable')) {\n\n $id = Yii::$app->request->post('editableKey');\n $model = CaseStatus::findOne($id);\n\t\t\t$model->updated_by = Yii::$app->user->identity->id;\n\n $message = '';\n\n $post = [];\n $posted = current($_POST['CaseStatus']);\n $post['CaseStatus'] = $posted;\n\n if ($model->load($post)) {\n if(!$model->save())\n $message = ' ';\n }\n echo Json::encode(['output'=>'', 'message'=>$message]);\n return;\n }\n\n if (Yii::$app->request->get('hasToggle')) {\n $state = Yii::$app->request->get('state');\n $id = Yii::$app->request->get('id');\n $saved = false;\n if(isset($state) && isset($id)) {\n $model = CaseStatus::findOne($id);\n $model->deleted = ($state == 'true')?0:1;\n if($model->save()){\n $saved = true;\n }\n }\n echo Json::encode(['saved'=>$saved]);\n return;\n }\n\n $dataProvider = new ActiveDataProvider([\n 'pagination' => array('pageSize' => 5),\n 'query' => CaseStatus::find()->orderby('name ASC'),\n 'sort' => false\n ]);\n\n $model = new CaseStatus();\n\n\n return $this->render('case_status', [\n 'dataProvider' => $dataProvider,\n 'model' => $model\n ]);\n }",
"public function statusAction()\n {\n $actionRow = new Admin_Model_DbRow_Action($this->dbAction->find($this->checkActionIdParam()));\n IF($actionRow->get('id')) {\n $actionRow->fromArray(array(\n 'enabled' => $actionRow->get('enabled') == 0 ? 1 : 0\n ));\n $this->dbAction->updateById($actionRow->toDbArray(array('enabled')), $actionRow->get('id'));\n } ELSE {\n // FIXME: Error Handling\n }\n\n $this->_redirect('admin/action/index/control/' . $actionRow->get('mcId'));\n }",
"public function changestatus() {\n\t\tif (!$this->session->userdata('logged_in')) {\n\t\t\tredirect('user/login');\n\t\t}\n\n\t\t$statusid = $this->input->post('statusid');\n\t\t$controllername = $this->input->post('controllername');\n//\t$displayid = $this->input->post('displayid');\n\n\t\tif($this->input->post('statusvalue')) {\n\t\t\t$statusVal = '0';\n\t\t\t$statusRow = '<span statusid='.$statusid.' statusvalue='.$statusVal.' controllername='.$controllername.' style=\"color: #ff0000; cursor: pointer;\" title=\"In Active\"><i class=\"fa fa-2x fa-ban\" aria-hidden=\"true\"></i></span>';\n\t\t} else {\n\t\t\t$statusVal = '1';\n\t\t\t$statusRow = '<span statusid='.$statusid.' statusvalue='.$statusVal.' controllername='.$controllername.' style=\"color: #00a65a; cursor: pointer;\" title=\"Active\"><i class=\"fa fa-2x fa-check\" aria-hidden=\"true\"></i></span>';\n\t\t}\n\n\t\t$changes = $this->Faq_model->changeStatus($statusid, $statusVal);\n\t\tif($changes) {\n\t\t\techo $statusRow;\n\t\t} else {\n\t\t\techo 'Server problem';\n\t\t}\n\t}",
"function getStatus() \n {\n return $this->instance->getStatus();\n }",
"private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }"
]
| [
"0.7014124",
"0.6953018",
"0.6715176",
"0.6697228",
"0.6697228",
"0.66804594",
"0.6632475",
"0.6627993",
"0.6623268",
"0.6612737",
"0.65424097",
"0.65377337",
"0.6533225",
"0.6509776",
"0.64708835",
"0.64708835",
"0.64602464",
"0.64468604",
"0.6429782",
"0.6429782",
"0.6429782",
"0.63938904",
"0.6381459",
"0.63523906",
"0.6346452",
"0.63409764",
"0.6306286",
"0.63020945",
"0.62966776",
"0.62721795"
]
| 0.7259063 | 0 |
Convert a zend config object into a WordPressSolid Config object | private static function _convertZendConfigToWordPressSolidConfig( ZendConfig $config ) {
return new Config( $config->toArray() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getConfigurationObject()\n {\n if(!is_object($this->confObj) && !($this->confObj instanceof Configuration)) {\n $this->confObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Service\\\\Configuration');\n }\n }",
"function tidy_get_config(tidy $object) {}",
"function config() {\n\t\t$reader = new \\Zend\\Config\\Reader\\Ini();\n\t\t$ar = $reader->fromString($this->config);\n\t\t\n\t\treturn new \\Zend\\Config\\Config($ar, true);\n\t}",
"function initConfig($config) {\r\n $configApp = new ZendExt_App_Config();\r\n $config = $configApp->configApp($config);\r\n Zend_Registry::getInstance()->config = $config;\r\n }",
"protected function _getConfig()\n {\n $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');\n $configArray = $bootstrap->getOptions();\n return $config = new Zend_Config($configArray);\n }",
"public function loadConfig() {\n return (object)$this->config;\n }",
"public static function config()\n {\n return new Config_ForClass(\"AntonyThorpe\\SilverShopUnleashed\\UnleashedAPI\");\n }",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', new Zend_Config($this->getOptions()));\n\t}",
"private function getRouteObjectConfig() {\n $r = new ReflectionObject($this->object);\n $prop = $r->getProperty('_config');\n $prop->setAccessible(true);\n return $prop->getValue($this->object);\n }",
"public function getConfigFromZk()\n {\n $content = '';\n $path = rtrim($this->options['path'], '/');\n if (strtolower($this->options['val_type']) == static::VALUE_TYPE_JSON) {\n $content = $this->getNodeValue($path);\n } else {\n $content = $this->getChildNodes($path);\n }\n return new Config($this->app, $content);\n }",
"public function config(): Config;",
"function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}",
"public function getConfig()\n\t{\n\t\t$config = new \\stdClass();\n\t\t$config->siteurl = $this->_config->siteurl;\n\t\t$config->host = $this->_config->host;\n\t\t$config->port = $this->_config->port;\n\t\t$config->dbname = $this->_config->dbname;\n\t\t$config->username = $this->_config->username;\n\t\t$config->password = $this->_config->password;\n\t\t$config->path = $this->_config->path;\n\t\t$config->options = $this->_config->options;\n\t\t$config->affiliateId = $this->_config->affiliateId;\n\n\t\treturn $config;\n\t}",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', $this->getOptions());\n\t}",
"abstract protected function getConfig();",
"protected function &getConfig(){\n \n if( is_null($this->config) ){\n $this->config = new \\stdClass();\n }\n \n return $this->config;\n \n }",
"public static function getConfig()\n {\n if(is_array(self::$config)){\n return new PhConfig(self::$config);\n }\n if(self::$config instanceof Config){\n return self::$config;\n }\n\n return new PhConfig();\n }",
"protected function _initConfig()\n {\n Zend_Registry::set('config', $this->getOptions());\n Zend_Registry::set('acl', new Application_Model_Acl());\n }",
"abstract public static function createConfig(): Config;",
"public function setConfig(Zend_Config $config)\n {\n return $this->setOptions($config->toArray());\n }",
"public function GetConfigClass ();",
"function process_config($config) {\n // Set to defaults if undefined\n if (!isset($config->wordpress_host)) {\n $config->wordpress_host = '';\n }\n if (!isset($config->client_key)) {\n $config->client_key = '';\n }\n if (!isset($config->client_secret)) {\n $config->client_secret = '';\n }\n set_config('wordpress_host', trim($config->wordpress_host), 'auth/wordpress');\n set_config('client_key', trim($config->client_key), 'auth/wordpress');\n set_config('client_secret', trim($config->client_secret), 'auth/wordpress');\n \n return true;\n }",
"abstract public function getConfig();",
"function mwznb_restore_sdk_config($oldConfig) {\r\n if (!empty($oldConfig) && $oldConfig instanceof MailWizzApi_Config) {\r\n MailWizzApi_Base::setConfig($oldConfig);\r\n }\r\n}",
"public static function fromFile( $filename, $returnConfigObject = false, $useIncludePath = false ) {\n\t\t$config = parent::fromFile( $filename, $returnConfigObject, $useIncludePath );\n\n\t\tif ( $returnConfigObject ) {\n\t\t\t$config = self::_convertZendConfigToWordPressSolidConfig( $config );\n\t\t}\n\n\t\treturn $config;\n\t}",
"public static function getConfig()\n {\n return new Config(self::$config);\n }",
"public static function config();",
"private static function initCfg() {\r\n\t\tif (!self::$cfg)\r\n\t\t\tself::$cfg = new config(factory::loadCfg(__CLASS__));\r\n\t}",
"public static function getConfigs(): ? stdClass\n {\n if (!is_null(self::$config)) {\n return self::$config;\n }\n\n // else we need to read from file\n $env = Foundation::getEnvironment(\"ENV\") ?? \"dev\";\n\n self::$config = require Foundation::getFilePath(\"config/env/\" . $env . \".php\");\n self::$config = json_decode(json_encode(self::$config, JSON_UNESCAPED_UNICODE));\n\n return self::$config;\n }",
"function getConfig() {\r\n\t\tstatic $config ;\r\n\t\tif (!$config) {\r\n\t\t\t$db = & JFactory::getDBO();\r\n\t\t\t$config = new stdClass ;\r\n\t\t\t$sql = 'SELECT * FROM #__osmembership_configs';\r\n\t\t\t$db->setQuery($sql);\r\n\t\t\t$rows = $db->loadObjectList();\r\n\t\t\tfor ($i = 0 , $n = count($rows); $i < $n; $i++) {\r\n\t\t\t\t$row = $rows[$i];\r\n\t\t\t\t$key = $row->config_key;\r\n\t\t\t\t$value = stripslashes($row->config_value);\t\t\t\t\r\n\t\t\t\t$config->$key = $value;\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn $config;\r\n\t}"
]
| [
"0.604752",
"0.5905813",
"0.57463276",
"0.5706799",
"0.5677867",
"0.5676467",
"0.5660112",
"0.5610405",
"0.56098324",
"0.560047",
"0.5486315",
"0.5395687",
"0.53803277",
"0.5377859",
"0.5363034",
"0.5354125",
"0.5324291",
"0.53209895",
"0.5318067",
"0.53119236",
"0.53007203",
"0.5270169",
"0.5258696",
"0.5253201",
"0.52437156",
"0.5241495",
"0.5228163",
"0.5226229",
"0.5193537",
"0.5182333"
]
| 0.7634837 | 0 |
check if Last two semesters are okay, i.e, less than allowed point, current semester and previous semester, | static public function checkLastTwoSemestersSGPAForAD($studentEnrollments, $sgpa, $cgpa, $year, $semester)
{
## If student's previous_chr AND previous_grade_points are 0, student is having first time enrollment,
$lastTwoSemestersMaxPoint = 1.00;
$pgpa = Statuses::getPreviousSGPA($studentEnrollments, $year, $semester);
if(!($year == 1 && $semester == 1))
{
if(is_null($sgpa) || is_null($pgpa))
return null;
if($sgpa < $lastTwoSemestersMaxPoint && $pgpa < $lastTwoSemestersMaxPoint)
return TRUE;
else
return FALSE;
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function check($semester = null)\n {\n $guru = Guru::where('staf', 0)->orWhere('staf', 2)->get()->count();\n if($guru < 1) { return -1; }\n $asosiasi = self::join('guru', 'guru.id', '=', 'mengajar.id_guru')\n ->where('mengajar.id_semester', $semester ? $semester : Semester::get_active_semester()->id)\n ->where(function($q) {\n $q->where('staf', 0)->orWhere('staf', 2);\n })\n ->groupBy('guru.id')\n ->get()->count();\n return $guru - $asosiasi;\n }",
"static public function checkIfWarning($studentEnrollments, $sgpa, $cgpa, $year, $semester)\n {\n $yOneSoneMax = 1.75;\n $yOneSoneMin = 1.25;\n $yOneAbove = 1.00; \n \n \n if($year == 1 && $semester == 1)\n {\n if($sgpa >= $yOneSoneMin && $sgpa < $yOneSoneMax )\n return TRUE;\n else\n return FALSE; \n }\n \n ## TODO\n # check if CGPA is pass, and SGPA falls below 1 for the first time.\n /*\n if($year >= 2 )\n {\n\n } \n * \n */ \n }",
"public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}",
"static public function checkIfPass($studentEnrollments, $sgpa, $cgpa, $year, $semester)\n {\n $yOneSoneMax = 1.75;\n $yOneStwoAndAbove = 2.00; \n \n \n if(is_null($cgpa) || is_null($sgpa))\n return null;\n \n if($year == 1 && $semester == 1)\n {\n if($sgpa >= $yOneSoneMax )\n return TRUE;\n else\n return FALSE; \n }\n \n if($year == 1 && $semester == 2)\n {\n if($cgpa >= $yOneStwoAndAbove )\n return TRUE;\n else\n return FALSE; \n } \n if($year >= 2)\n {\n if($cgpa >= $yOneStwoAndAbove )\n return TRUE;\n else\n return FALSE; \n } \n \n }",
"public function checkValidSeason()\n {\n if (!$this->season_helper->isValidSeason($this->selected_season)) {\n $this->selected_season = $this->season_helper->getSeasonId(date('r'));\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\n }",
"function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"public function get_semester()\n {\n $round = $this->get_round();\n $roundNumber = $round['numero'];\n /*Se obtiene la fecha final para sacar el mes*/\n $r = $round['fecha_final'];\n \n /*Se obtiene el mes de la ronda*/\n $m = $r[5].$r[6];\n /*Cómo la ronda no indica cual semestre es el actual la única forma de sacarlo es comparando las fecha actual, si es Junio o antes es el semestre 1, en caso contrario es semestre 2\n En julio se pueden empezar a pedir asistencias del segundo semestre?*/\n if ($m <= 6){\n $semestre = 1;\n } else {\n $semestre = 2;\n }\n \n return $semestre;\n }",
"public static function is_reservtion_possible(DateTime $date1, DateTime $date2, Room $room_for_check){\r\n if ($date1>$date2) return false;\r\n \r\n $unavailable_dates = (new self)->all_unavailable_dates($room_for_check);\r\n// var_dump($unavailable_dates); \r\n $unav_dates_between = array();\r\n foreach($unavailable_dates as $the_date){\r\n if (self::is_date_greater($the_date, $date1) && self::is_date_greater($date2, $the_date)){\r\n $unav_dates_between[] = $the_date;\r\n// var_dump($the_date);\r\n break;\r\n \r\n }\r\n }\r\n// var_dump($unav_dates_between);\r\n return empty($unav_dates_between);\r\n}",
"public function isSummerSemester()\n {\n if ($this->semesterNumber > 8) {\n return true;\n }\n\n return false;\n }",
"public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : false;\n }",
"public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }",
"private function check_for_excessive_dropped_users() {\n $is_validated = true;\n $invalid_courses = array(); // intentional local array\n $ratio = 0;\n $diff = 0;\n foreach($this->data as $course => $rows) {\n if (!validate::check_for_excessive_dropped_users($rows, $this->semester, $course, $diff, $ratio)) {\n $invalid_courses[] = array('course' => $course, 'diff' => $diff, 'ratio' => round(abs($ratio), 3));\n $is_validated = false;\n }\n }\n\n if (!empty($invalid_courses)) {\n usort($invalid_courses, function($a, $b) { return $a['course'] <=> $b['course']; });\n $msg = \"The following course(s) have an excessive ratio of dropped students.\\n Stats show mapped courses combined in base courses.\\n\";\n array_unshift($invalid_courses, array('course' => \"COURSE\", 'diff' => \"DIFF\", 'ratio' => \"RATIO\")); // Header\n foreach ($invalid_courses as $invalid_course) {\n $msg .= \" \" .\n str_pad($invalid_course['course'], 18, \" \", STR_PAD_RIGHT) .\n str_pad($invalid_course['diff'], 6, \" \", STR_PAD_LEFT) .\n str_pad($invalid_course['ratio'], 8, \" \", STR_PAD_LEFT) .\n PHP_EOL;\n }\n $msg .= \" No upsert performed on any/all courses in Submitty due to suspicious data sheet.\";\n\n $this->log_it($msg);\n return false;\n }\n\n return true;\n }",
"public function check_avail(){ \n\t\tif(!empty($this->data['HrPermission']['per_from']) && !empty($this->data['HrPermission']['per_to']) && !empty($this->data['HrPermission']['per_date'])){\n\t\t\t// get used leave\n\t\t\t$date_str = $this->get_search_date($this->data['HrPermission']['per_date']);\n\t\t\t$this->unBindModel(array('hasOne' => array('HrPerStatus', 'HrPerUser')));\t\t\t\n\t\t\t$data = $this->find('all', array('fields' => array(\"TIME_FORMAT(SEC_TO_TIME( SUM( TIME_TO_SEC(no_hrs))), '%k:%i') as count\", 'HrPermission.id'), \n\t\t\t'conditions' => array('HrPermission.app_users_id' => $this->data['HrPermission']['user_id'], 'HrPermission.is_deleted' => 'N', 'is_approve !=' => 'R', \n\t\t\t'per_date like' => $date_str.'%')));\t\t\t\n\t\t\t$used = $data[0][0]['count'];\n\t\t\t\n\t\t\tif(empty($used)){\t\n\t\t\t\t$total_hrs = $this->data['HrPermission']['no_hrs'];\n\t\t\t}else{\n\t\t\t\t$total_hrs = $this->add_time($used, $this->data['HrPermission']['no_hrs']);\t\n\t\t\t}\n\t\t\t// find total usable hours\t\t\t\t\t\n\t\t\t$total_hrs = explode(':', $total_hrs);\t\t\t\n\t\t\t$avail = 2;\t\t\t\t\n\t\t\tif(($total_hrs[0] >= $avail && $total_hrs[1] > 0) || ($total_hrs[0] > 2)){ \n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"function cmpSemester($a, $b) {\n \n global $semesters;\n\n // Assumption is being made on the comparison where a/b is:\n // YEAR SEMESTER_NAME DEPARTMENT COURSE_NUMBER SECTION_NUMBER\n list($a_year, $a_semester, $a_department, $a_course_number, $a_section_number) = explode(' ', $a);\n list($b_year, $b_semester, $b_department, $b_course_number, $b_section_number) = explode(' ', $b);\n\n if ($a_year != $b_year) {\n return strcmp($a_year, $b_year);\n } else if ($a_semester != $b_semester) {\n return strcmp($semesters[$a_semester], $semesters[$b_semester]);\n } else if ($a_department != $b_department) {\n return strcmp($a_department, $b_department);\n } else if ($a_course_number != $b_course_number) {\n return strcmp($a_course_number, $b_course_number);\n } else if ($a_section_number != $b_section_number) {\n return strcmp($a_section_number, $b_section_number);\n }\n\n return 0;\n}",
"function CHECK_valability($endDATE) {\n\n $TMSP_end = strtotime($endDATE);\n $TMSP_today = time();\n\n if($TMSP_end > $TMSP_today) return true;\n else return false;\n }",
"public function check_final_validation_evening($next_page){\n if($this->session->has_userdata('APPLICATION_ID')){\n $APPLICATION_ID = $this->session->userdata('APPLICATION_ID');\n $user = $this->session->userdata($this->SessionName);\n //prePrint($user);\n $user_fulldata = $this->User_model->getUserFullDetailWithChoiceById($user['USER_ID'],$APPLICATION_ID);\n// prePrint($user_fulldata);\n// exit();\n $data['user'] = $user_fulldata;\n $data['APPLICATION_ID'] = $APPLICATION_ID;\n $application = $this->Application_model->getApplicationByUserAndApplicationId($user['USER_ID'], $APPLICATION_ID);\n if($application['STATUS_ID']==FINAL_SUBMIT_STATUS_ID){\n redirect(base_url('form/application_form'));\n exit();\n }\n if ($application) {\n\n //prePrint($application);\n\n $error = $this->isValidProfileInformation($user_fulldata,$application);\n\n//\n// prePrint($error);\n// exit();\n if($error==\"\"){\n// prePrint($application);\n// exit();\n if(($application['PAID']=='N'||$application['PAID']=='Y')&&isValidData($application['CHALLAN_IMAGE'])){\n\n $min_choice = 0;\n $max_choice = 0;\n if($application['PROGRAM_TYPE_ID'] == 1){\n $max_choice = CHOICE_QUANTITY_FOR_BACHELOR_MAX;\n $min_choice = CHOICE_QUANTITY_FOR_BACHELOR_MIN;\n foreach ($user_fulldata['application_choices'] as $choice_list){\n if($choice_list['PROG_LIST_ID']==LLB_PROG_LIST_ID){\n $min_choice = 1;\n break;\n }\n }\n\n\n }else if($application['PROGRAM_TYPE_ID'] == 2){\n $max_choice = CHOICE_QUANTITY_FOR_MASTER_MAX;\n $min_choice = CHOICE_QUANTITY_FOR_MASTER_MIN;\n }\n\n\n if($min_choice>count($user_fulldata['application_choices_evening'])||$max_choice<count($user_fulldata['application_choices_evening'])){\n $error.=\"<div class='text-danger'>Please Must Select Minimum $min_choice And Maximum $max_choice</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url().\"form/select_program\");\n }\n if(count($user_fulldata['application_category'])<=0){\n\n $error.=\"<div class='text-danger'>Please Must Save Category</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url().\"form/select_category\");\n }\n //$next_page = \"final_lock\";\n $next_page1 = base64_encode($next_page);\n $next_page1 =urlencode($next_page1);\n if($next_page==\"final_lock_evening\"){\n redirect(base_url() . \"form/review/$next_page1\");\n }else{\n $error.=\"<div class='text-danger'>Something went wrong please contact technical team</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n\n redirect(base_url().\"form/dashboard\");\n }\n\n }else{\n $error.=\"<div class='text-danger'>Please select Bank Branch and must save it</div>\";\n $error.=\"<div class='text-danger'>Please upload Challan image and must save it</div>\";\n $alert = array('MSG'=>$error,'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url().\"form/upload_application_challan\");\n }\n\n\n }else{\n $alert = array('MSG'=>$error,'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url().\"form/upload_application_challan\");\n //prePrint($error);\n }\n\n\n }else{\n $alert = array('MSG'=>\"<div class='text-danger'>Application Not found </div>\",'TYPE'=>'ERROR');\n $this->session->set_flashdata('ALERT_MSG',$alert);\n redirect(base_url().\"form/announcement\");\n }\n }else {\n redirect(base_url() . \"login\");\n }\n }",
"private function check_meet_creation_limit()\n {\n $recent_shackmeet_count = count($this->load_recent_shackmeet_count());\n \n return $recent_shackmeet_count < 2;\n }",
"public function checkSeatSpace($startDate, $endDate, $examId)\n {\n\n //This part checks if there is too many people to fit the block, or too many of the same exam for\n //every other seat to be the same exam\n $pdo = DatabaseConnection::getInstance();\n $statement = $pdo->prepare(\"CALL spGetAvail(:start_date, :end_date, :exam_id)\");\n $data = array(\"start_date\"=>$startDate, \"end_date\"=>$endDate, \"exam_id\"=>$examId);\n\n $statement->execute($data);\n $examCount = 0;\n $totalCount = 0;\n while($row = $statement->fetch()){\n $examCount = $row['ExamCount'];\n $totalCount = $row['TotalCount'];\n }\n\n if($totalCount >= self::TEMP_MAX){\n http_response_code(Http\\StatusCodes::CONFLICT);\n exit(\"No Desks Available\");\n }\n if($examCount >= self::TEMP_MAX/2){\n http_response_code(Http\\StatusCodes::CONFLICT);\n exit(\"Too many with the same exam\");\n }\n\n }",
"function _isValidEndDate()\r\n {\r\n if (strtotime($this->data[$this->name]['end_date']) > strtotime(date('Y-m-d H:i:s'))) {\r\n return true;\r\n }\r\n return false;\r\n }",
"function recommends_req_wizard_schools_info_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n $date_due_month = $form_state['values']['schname'][$i]['r_date_due']['month'];\n $date_due_day = $form_state['values']['schname'][$i]['r_date_due']['day'];\n $date_due_year = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \n $d2=mktime(0,0,0,$date_due_month,$date_due_day,$date_due_year);\n $d1=time();\n $days_diff = floor(($d2-$d1)/86400);\n if ($days_diff < 30 ) {\n form_set_error(\"schname][$i][r_date_due\", 'The due date must be at least 30 days from today. Please contact the professor to discuss exceptions.');\n }\n\n }\n}",
"function _Fchecktimestchrgrpcnstr($_Mteacher1,$_Mgroup1,$_Mcourse1,&$_Mpossibletimes)\n{\n\t$_Mdayslots=$GLOBALS['_Mdayslots'];$_Mtotslots=$GLOBALS['_Mtotslots'];\n\t$_Mcourseunits=$_Mcourse1->getcourseunits();\n\t$_Mcoursepartunits=$_Mcourse1->getcoursepartunits();\n\t//if($_Mcourseunits==3) $_Mcourseunits++;//3 units needs 4 free slot\n\t$_Mteachertime=$_Mteacher1->getteachertimes();\n\t$_Mgroupstatus=$_Mgroup1->getgroupstatus();\n\t$_Mfreetimecount=0;\n\tfor($i=0 ; $i<$_Mtotslots ; $i++)\n\t{\n\t\t//checkconstraint4course();\n\t\t$_Mttime=$_Mteachertime[$i];$_Mgtime=$_Mgroupstatus[$i];\n\t\t//will correct ; p is assumed f\n\t\tif($_Mttime=='p') $_Mttime='f';\n\t\t//*********************\n\t\t\n\t\tif(($_Mttime=='f')&($_Mgroupstatus[$i]=='f'))\n\t\t $_Mfreetimecount++;\n\t\tif((($_Mttime=='e')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='o'))||\n\t\t (($_Mttime=='f')&($_Mgtime=='e'))||\n\t\t (($_Mttime=='o')&($_Mgtime=='f'))||\n\t\t (($_Mttime=='e')&($_Mgtime=='f'))//||\n\t\t //(($_Mttime=='p')&($_Mgtime!='s'))//will check other statuses\n\t\t )\n\t\t\t $_Mfreetimecount+=.5;\n\t \t$_Mpossibletimes[$i]=_Fsmaller($_Mttime,$_Mgtime);\n\t\t\n\t}\n\t$_Mcourseremainedtimes=$_Mcourse1->getcourseremainedunits();\n\tif(($_Mfreetimecount>0)&($_Mfreetimecount<$_Mcourseremainedtimes))//if teacher has free slot but not >= courseunits,act according to a total constraint parameter\n\t{\n\t\tglobal $_Mpartialteacherschedule;\n\t\tif($_Mpartialteacherschedule)\n\t\t{ \n\t\t\tarray_push($GLOBALS['_Mteachershavenocmpletefreeslots'],array($GLOBALS['_Mgroup1']->getgroupid(),$_Mcourse1->getcourseid(),$_Mcourse1->getcoursecaption(),$_Mteacher1->teacherid,$_Mteacher1->teacherfamily));\n\t\t\tif(($_Mfreetimecount>=$_Mcoursepartunits)&(($_Mcourse1->getcoursepart()=='c1')||($_Mcourse1->getcoursepart()=='a1')))return true;\n\t\t\telse if(($_Mfreetimecount>=$_Mcoursepartunits)&($_Mcourse1->getotherparttid()==$_Mteacher1->getteacherid()))return true;\n\t\t\telse return false;\n\t\t}\n\t\telse return false;\n\t}\n\n\telse if (($_Mfreetimecount>=$_Mcourseremainedtimes)&&($_Mfreetimecount>0))\n\t return true;\n\telse return false;\n}",
"function isUserAllowedToAcess2ndLoginForm() {\n\t\t\t\tglobal $loginAttempts;\n\t\t\t\tglobal $loginForm;\n\t\t\t\t$loginAttempts = array_slice($loginAttempts, -5);\n\t\t\t\tif (count($loginAttempts) > 4) {\n\t\t\t\t\tif ($loginAttempts[0][0] === 'fail' && $loginAttempts[1][0] === 'fail' && $loginAttempts[2][0] === 'fail'&& $loginAttempts[3][0] === 'fail'&& $loginAttempts[4][0] === 'fail') {\n\n\t\t\t\t\t\t$failedLoginTime = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$failedLoginTime->modify(\"+12 hours\");\n\n\t\t\t\t\t\t//https://stackoverflow.com/questions/5906686/php-time-remaining-until-specific-time-from-current-time-of-page-load\n\t\t\t\t\t\t$now = new DateTime();\n\t\t\t\t\t\t$future_date = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$interval = $failedLoginTime->diff($now);\n\t\t\t\t\t\t$remainingTime = $interval->format(\"%h hours %i minutes %s seconds\");\n\n\n\t\t\t\t\t\t$failedDateTime = new DateTime($loginAttempts[4][1]);\n\t\t\t\t\t\t$failedDateTime->modify(\"+12 hours\");\n\t\t\t\t\t\t$failedDateTimePlus12Hours = $failedDateTime->format(\"Y-m-d H:i:s\");\n\n\t\t\t\t\t\tif (date(\"Y-m-d H:i:s\") < $failedDateTimePlus12Hours) {\n\t\t\t\t\t\t\techo \"You've had too many failed attempts to log in. You have <strong>\" . $remainingTime . \"</strong> till you can try again.\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $loginForm;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo $loginForm;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $loginForm;\n\t\t\t\t}\n\t\t\t}",
"public function semesterregi(){\n\t\t$suid=$this->session->userdata('id_user');\n\t\t//print_r($suid);\n\t\t$Stuid=$this->commodel->get_listspfic1(\"student_master\",\"sm_id\",\"sm_userid\",$suid)->sm_id;\n\t\t//print_r($Stuid);\n \t//get current academic year\n \t//$acadyear = $this->user_model->getcurrentAcadYear();\n\t\t$this->appno = $this->commodel->get_listspfic1('student_entry_exit','senex_entexamapplicationno','senex_smid',$Stuid)->senex_entexamapplicationno;\n\t\t$stud_prg_rec = $this->commodel->get_listrow('student_program','sp_smid',$Stuid);\n \t$degree_id = $stud_prg_rec->row()->sp_programid;\n \t$noofsemester = sizeof($stud_prg_rec->result());\n\t\t\n\t\t$cacadyer = $this->user_model->getcurrentAcadYear();\n\t\t//print_r($cacadyer);\n \t$semestertype = $this->user_model->getcurrentSemester();\n \t//print_r($semestertype);\n \t$semesterrec = $this->stumodel->get_semester_no($Stuid,$cacadyer);\n \t$semsize = sizeof($semesterrec);\n\t\t$this->curresem = $semsize;\n\t\t//print_r($semsize);\n\t\t\n \t\n\t\t\n\t\t//student personnel detail\n\t\t$this->name=$this->commodel->get_listspfic1(\"student_master\",\"sm_fname\",\"sm_userid\",$suid)->sm_fname;\n\t\t$this->sturollno = $this->commodel->get_listspfic1('student_entry_exit','senex_rollno','senex_smid',$Stuid)->senex_rollno;\n\t\t$this->mobile=$this->commodel->get_listspfic1('student_master','sm_mobile','sm_id',$Stuid)->sm_mobile;\n\t\t$this->email=$this->commodel->get_listspfic1('student_master','sm_email','sm_id',$Stuid)->sm_email;\n\t\t$this->dob=$this->commodel->get_listspfic1('student_master','sm_dob','sm_id',$Stuid)->sm_dob;\n\t\t$this->uid=$this->commodel->get_listspfic1('student_master','sm_uid','sm_id',$Stuid)->sm_uid;\n\t\t$this->bgroup=$this->commodel->get_listspfic1('student_master','sm_bloodgroup','sm_id',$Stuid)->sm_bloodgroup;\n\t\t$this->gender=$this->commodel->get_listspfic1('student_master','sm_gender','sm_id',$Stuid)->sm_gender;\n\t\t$this->religname=$this->commodel->get_listspfic1('student_master','sm_religion','sm_id',$Stuid)->sm_religion;\n\n\t\t//student parent and course detail\n\t\t$this->mname = $this->commodel->get_listspfic1('student_parent','spar_mothername','spar_smid',$Stuid)->spar_mothername;\t\t\n\t\t$this->fathname=$this->commodel->get_listspfic1('student_parent','spar_fathername','spar_smid',$Stuid)->spar_fathername;\n\t\t\n\t\t$this->sem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_smid',$Stuid)->sp_semester;\n\t\t\n\t\t$this->ncid = $this->commodel->get_listspfic1('student_program','sp_programid','sp_smid',$Stuid)->sp_programid;\n\t\t//get programe name\n\t\t$this->pname = $this->commodel->get_listspfic1('program','prg_name','prg_id',$this->ncid)->prg_name;\n\t\t$this->progid = $this->commodel->get_listspfic1('program','prg_id','prg_name',$this->pname)->prg_id;\n\t\t\n\t\t//get program category name\n\t\t$this->pcatid = $this->commodel->get_listspfic1('student_program','sp_pcategory','sp_smid',$Stuid)->sp_pcategory;\n\t\t$this->pcatname = $this->commodel->get_listspfic1('programcategory','prgcat_name','prgcat_id',$this->pcatid)->prgcat_name;\n\n\t\t//postal address detail\n\t\t$this->padd=$this->commodel->get_listspfic1('student_parent','spar_caddress','spar_smid',$Stuid)->spar_caddress;\n\t\t$this->pcity=$this->commodel->get_listspfic1('student_parent','spar_ccity','spar_smid',$Stuid)->spar_ccity;\n\t\t$this->ppost=$this->commodel->get_listspfic1('student_parent','spar_cpostoffice','spar_smid',$Stuid)->spar_cpostoffice;\n\t\t$this->pdist=$this->commodel->get_listspfic1('student_parent','spar_cdistrict','spar_smid',$Stuid)->spar_cdistrict;\n\t\t$this->pstat=$this->commodel->get_listspfic1('student_parent','spar_cstate','spar_smid',$Stuid)->spar_cstate;\n\t\t$this->ppin=$this->commodel->get_listspfic1('student_parent','spar_cpincode','spar_smid',$Stuid)->spar_cpincode;\n\t\t$this->pcounname=$this->commodel->get_listspfic1('student_parent','spar_ccountry','spar_smid',$Stuid)->spar_ccountry;\n\t\t\n\t\t//get student category\n\t\t$this->cateid=$this->commodel->get_listspfic1('student_master','sm_category','sm_id',$Stuid)->sm_category;\n\t\t$this->catename=$this->commodel->get_listspfic1('category','cat_name','cat_id',$this->cateid)->cat_name;\n\n\t\t//get study center\n\t\t$this->sccode=$this->commodel->get_listspfic1('student_master','sm_sccode','sm_id',$Stuid)->sm_sccode;\n\t\t$this->scname=$this->commodel->get_listspfic1('study_center','sc_name','sc_code',$this->sccode)->sc_name;\n\t\t//get branch name\n\t\t$this->brid=$this->commodel->get_listspfic1('student_program','sp_branch','sp_smid',$Stuid)->sp_branch;\n\t\t$this->brname=$this->commodel->get_listspfic1('program','prg_branch','prg_id',$this->brid)->prg_branch;\n\t\t//get department name\n\t\t$this->depid=$this->commodel->get_listspfic1('student_program','sp_deptid','sp_smid',$Stuid)->sp_deptid;\n\t\t$this->depname=$this->commodel->get_listspfic1('Department','dept_name','dept_id',$this->depid)->dept_name;\n\n\t\t//$sprogid = $this->commodel->get_listspfic1('student_program','sp_id','sp_smid',$Stuid)->sp_id;\n\t\t//print_r($sprogid);\n\n\t\t//$this->db->select('sp_id')->from('student_program')->where('sp_smid',$Stuid)->where('sp_semester',$semsize);\n\t\t//$spstid = $this->db->get()->row();\n\t\t$getspid = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t$spstid = $this->commodel->get_listspficemore('student_program','sp_id',$getspid);\n\t\t\n\t\t//print_r($spstid);\n\t\tforeach($spstid as $stspid){\n\t\t\t$this->cusem = $this->commodel->get_listspfic1('student_program','sp_semester','sp_id',$stspid->sp_id)->sp_semester;\n\t\t\t//print_r($this->cusem);\n\t\t}\n\t\t\t$datawh = array('sp_smid' => $Stuid, 'sp_semester' => $semsize);\n\t \t\t$diffdate = $this->commodel->get_listspficemore('student_program','sp_programid,sp_semregdate',$datawh);\n\t\t\t//print_r($diffdate);\n\t\t\tforeach($diffdate as $spdate):\n\t\t\t\t$semdiffdate = $this->datmodel->diffdays($spdate->sp_semregdate);\n\t\t\t\t$spprgid = $spdate->sp_programid;\n\t\t\tendforeach;\t\n\t\t\t//print_r($semdiffdate);\n\t\t\t$prgpattern=$this->commodel->get_listspfic1('program','prg_pattern','prg_id',$spprgid)->prg_pattern;\n\t\t\t$tmonth = $semdiffdate/30;\n\t\t\t//print_r($this->tdate);\n\t\t\t\n\t\t\t\n\t\t\tif((($tmonth > 5) && ($prgpattern == 'Semester')) || (($tmonth > 11) && ($prgpattern == 'Yearly')))\n\t\t\t{\n\t\n\t\t\t\tif(isset($_POST['register']))\n\t\t\t\t{\t\n\t\t\t\t\t$this->form_validation->set_rules('Ssem','Semseter','trim|xss_clean|required');\n\t\t\t\t\t//Re-populate field\n\t\t\t\t\tif($_POST)\n\t\t\t\t\t{\n\t\t\t\t\t\t//$this->data['Stmobile']=$this->input->get_post('Stmobile');\n\t\t\t\t\t\t$this->data['Ssem']=$this->input->get_post('Ssem');\n\t\t\t\t\t}//re populate if close\t\n\t\t\t\t\t\tif ($this->form_validation->run() == FALSE) {\t\n\t\t\t\t\t\t\t//$message = '<h3>Your some detail is incorrect .</h3>';\n\t \t\t\t\t\t\t//$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\t//redirect('request/registartionsemester');\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\telse{\n\t\t\t\t\t//update in student_master\n \t \t\t\t\t$this->db->trans_begin();\n\n\t\t\t\t\t\t$cdate = date(\"Y-m-d h:i:sa\");\t\t\t\t\t \t\n\t\t\t \t\t\tif($_POST['Ssem'] != $semsize){\t\t\t\t\n\t\t\t\t\t\t\t//insert program data in student_program\n\t\t\t\t\t\t\t$progdata = array (\n\t\t\t\t\t\t\t\t'sp_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t\t'sp_programid'\t=>\t$this->ncid,\n\t\t\t\t\t\t\t\t'sp_deptid'\t=>\t$this->depid,\t\t\n\t\t\t\t\t\t\t\t'sp_sccode'\t=>\t$this->sccode,\n\t\t\t\t\t\t\t\t'sp_pcategory'\t=>\t$this->pcatid,\n\t\t\t\t\t\t\t\t'sp_branch'\t=>\t$this->brid,\n\t\t\t\t\t\t\t\t'sp_acadyear'\t=>\t$cacadyer,\n\t\t\t\t\t\t\t\t'sp_semregdate' =>\t$cdate,\n\t\t\t\t\t\t\t\t'sp_semester'\t=> $_POST['Ssem']\n\t\t\t\t\t\t\t\t); \n\t\t\t \t\t\t\t$this->db->insert('student_program',$progdata);\n\t\t\t \t\t\t\t$sprogramid = $this->db->insert_id();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$message1 = $semsize;\n\t\t\t\t\t\t\t$message = '<h3>You are already register in'.\" \". $semsize .\" \". $prgpattern.'</h3>';\n\t \t\t\t\t\t\t$this->session->set_flashdata('msg',$message);\n\t\t\t\t\t\t\tredirect('request/semesterregi');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//insert smid and spid in student fees\n\t\t\t\t\t\t$feesdata = array (\n\t\t\t\t\t\t\t'sfee_smid'\t=>\t$Stuid,\n\t\t\t\t\t\t\t'sfee_spid'\t=>\t$sprogramid\n\t\t\t\t \t\t\t); \n\t\t\t\t\t\t\t$this->db->insert('student_fees',$feesdata);\n\n\t\t\t\t//make transaction complete\n \t\t\t$this->db->trans_complete();\n\t\t\t\n\t \t\t\t\t//check if transaction status TRUE or FALSE\n \t\t\t\tif ($this->db->trans_status() === FALSE) {\n\t\t\t\n \t\t\t\t//if something went wrong, rollback everything\n \t\t\t\t\t$this->db->trans_rollback();\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration not update record in student_master table.\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration not update record in student_master table.\");\n\t\t\t\t\t\t$this->load->view('request/registartionsemester');\n\t\t\t\t\t\t//redirect('request/stufeesdetail');\n \t\t\t\t\t//return FALSE;\n \t\t\t\t\t } else {\t\n \t\t\t\t\t//if everything went right, commit the data to the database\n \t\t\t\t\t$this->db->trans_commit();\n\t\t\t \t\t\t$message = '<h3>Your registration successfully done.</h3>';\n\t \t\t\t\t\t$this->session->set_flashdata('msg',$message);\t\t\t\n\t\t\t\t\t\t$this->logger->write_logmessage(\"update\", \"Student registration successfull update record in student_master table\");\n \t\t\t\t$this->logger->write_dblogmessage(\"update\", \"Student registration successfull update record in student_master table\" );\n\t\t\t\t\t\tredirect('request/stufeesdetail');\n \t\t \t\t\t//return TRUE;\n \t\t\t \t\t}\n\t\t\t}//close first else\t\n\t\t\t}//if post close\n\t\t}//close semster difference if\n\t\telse{\n\t\t\t$message = '<h3>You can not register for next semester registration because you can not complete minimum duration.</h3>';\n \t\t\t$this->session->set_flashdata('err_message',$message);\n\t\t\tredirect('studenthome');\n\t\t }\t\n\t\t\n\t$this->load->view('request/registartionsemester');\n\t}",
"private function Check_File_Semester($semester,$year,$file_name)\n {\n $file_name = substr($file_name, 0, -4);\n $file_name = explode(\"_\",$file_name);\n $prefix = count($file_name);\n if($file_name[$prefix -1 ] == $year && $file_name[$prefix - 2 ] == $semester )\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"private function CheckStartFinishDate()\n\t{\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t\n\t\tif($start_date > $finish_date){\n\t\t\t$this->error = _START_FINISH_DATE_ERROR;\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\t\t\n\t}",
"function warranty_validation ($conn, $data) {\n\n\t$get_date1= $data[\"replaced_date\"];\n\t$start = strtotime(\"$get_date1\");\n\n\t$get_date2 = $data[\"warranty_period\"];\n\t$end = strtotime(\"$get_date2\");\n\n\tif ($end > $start) {\n\t\treturn \"YES\";\n\t}else{\n\t\treturn \"NO\" ;\n\t}\n\n\tdie();\n\n}",
"private function checkBounds()\n {\n $this->page = max($this->page, 0);\n $this->page = min($this->page, $this->lastPage());\n }",
"function recommends_req_crstut_9_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n $course_year = $form_state['values']['crsname'][$i]['courseyear'];\n \n if ($course_year && ($course_year < 2010 || $course_year > 2011)) {\n form_set_error(\"coursenum][$i][courseyear\", 'Enter a valid year.');\n }\n \n }\n}",
"function has_supergroup_standings() {\n return last_aggregate_roundid() !== 0;\n}",
"public function testTwoDisciplinesDiffAmtCourses()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $course3 = new Course();\n $course3->set(\"department\",\"CPSC\");\n $course3->set(\"courseTitle\",\"CPSC\");\n $student->set(\"courses\",$course3);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 2 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }"
]
| [
"0.5787835",
"0.5776148",
"0.568227",
"0.56719494",
"0.56492084",
"0.5435109",
"0.54132086",
"0.53986317",
"0.537575",
"0.5366288",
"0.53096175",
"0.5301165",
"0.52755636",
"0.5254343",
"0.5229511",
"0.51853603",
"0.51734716",
"0.51712376",
"0.5169972",
"0.51496744",
"0.513082",
"0.50956947",
"0.50811154",
"0.50791466",
"0.50688183",
"0.5060776",
"0.5037949",
"0.50273496",
"0.49945897",
"0.49924532"
]
| 0.66393423 | 0 |
Get the value of id_movieTheater | public function getId_movieTheater()
{
return $this->id_movieTheater;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdMovie()\n {\n return $this->idMovie;\n }",
"public function getMovieId() {\n\t\treturn ($this->movieId);\n\t}",
"function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}",
"function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}",
"public function getId(){\n return (string) $this->film['id'];\n }",
"protected function get_movie_id() {\n\n\t\tglobal $wpdb;\n\n\t\tif ( is_null( $this->attributes['title'] ) ) {\n\t\t\treturn $this->attributes['id'];\n\t\t}\n\n\t\t$like = $wpdb->esc_like( $this->attributes['title'] );\n\t\t$like = '%' . $like . '%';\n\n\t\t$post_id = $wpdb->get_var(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT ID FROM {$wpdb->posts} WHERE post_title LIKE %s\",\n\t\t\t\t$like\n\t\t\t)\n\t\t);\n\n\t\t$this->attributes['id'] = $post_id;\n\n\t\treturn $post_id;\n\t}",
"function get_movie_id($title){\r\n\t\tglobal $connection;\r\n\t\t$query = 'SELECT * FROM movies WHERE Title=\"' . $title . '\" LIMIT 1';\r\n\t\t$result = mysqli_query($connection, $query);\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row['Id'];\r\n\t}",
"public function setId_movieTheater($id_movieTheater)\n {\n $this->id_movieTheater = $id_movieTheater;\n\n return $this;\n }",
"public function getIdmov()\n {\n return $this->idmov;\n }",
"function getMoviesById($param){\n $c = new MoviesModel($param);\n if($c->getId() != 'null' || $c->getId() != 'NaN'){\n $check = $this->db->Check_if_id_exists($this->table_name, $c->getId());\n return $this->checkIsWasGood($check);\n }else{\n return $c->getId();\n }\n\n }",
"function get_movie($id)\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"SELECT DateTime, video, user.name as author,\n\t\t\t\t\t\tmovie.name as title, text\n\t\t\t\t\t\tFROM movie, movie_category, user\n\t\t\t\t\t\tWHERE movie.userID = user.userID \n\t\t\t\t\t\tAND movie.movieID = :id\");\n\t$stmt->execute(array(':id' => $id));\n\t$movie = $stmt->fetchAll(PDO::FETCH_ASSOC);\n close_database_connection($db);\n return $movie[0];\n}",
"public function getMovieTable() {\n return $this->param['tblMovie'];\n }",
"public function selectMovie($id) {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->movieSelectById($id);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\n\t}",
"public function getIdVit(){\n\t\treturn ($this->id);\n\t}",
"public function getIdVideo(){\n\t\treturn $this->idVideo;\t\n\t}",
"public function getPoster(){\n return $this->film['poster'];\n }",
"public static function getTmdbId($catId, $title) {\n\n\t\tif(empty($catId) || empty($title)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://api.themoviedb.org/3/search/movie?api_key=\" . urlencode(TMDB_API_KEY) . \"&query=\" . urlencode($title));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$json = curl_exec($ch);\n\t\t$error = curl_error($ch);\n\t\tcurl_close($ch);\n\n\t\tif(!empty($error)) {\n\t\t\tUtil::fatal(\"Cannot get tmdbId: \" . $error);\n\t\t}\n\t\t\n\t\t$db = new DB();\n\t\t$checkedTmdbIds = $db->selectCheckedTmdbIds($catId);\n\n\t\t$data = json_decode($json);\n\t\t\n\t\tforeach($data->results as $result) {\n\t\t\t$tmdbId = $result->id;\n\t\t\t\n\t\t\tif(!in_array($tmdbId, $checkedTmdbIds) && !$result->adult) {\n\t\t\t\treturn $tmdbId;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function getSeasonIdAttribute()\n {\n $videoIds = $this->id;\n $seasonName = Season::whereHas('videoSeason', function ($query) use ($videoIds) {\n $query->where('video_id', $videoIds);\n })->select('id')->where('is_active', 1)->first();\n\n return !empty($seasonName) ? $seasonName->id : '';\n }",
"private function getMovieDataWWM($movie_id){\n\t\t\n\t\t// gather movie data\n\t\t$movie_data = json_decode(json_encode((array) simplexml_load_string($this->get_data('http://webservice.cinema-source.com/3.8/?apikey=THBMB&query=movie&stars=yes&photos=all&movie_id='.trim($movie_id)))), 1);\n\n\t\treturn $movie_data['movie'];\n\t}",
"public function get_reserva_id(){\n\n\treturn $this->reserva_id;\n}",
"function getReviewerId() {\n\t\treturn $this->getData('reviewerId');\n\t}",
"public function getIdrestaurant(): int \n {\n return $this->id_restaurant;\n }",
"public function getMediotecaId()\n {\n return $this->getValue('nb_medioteca_id');\n }",
"function get_genre_id($genre){\r\n\t\tglobal $connection;\r\n\t\t$query = 'SELECT * FROM genres WHERE Name=\"' . $genre . '\" LIMIT 1';\r\n\t\t$result = mysqli_query($connection, $query);\r\n\t\t$row = mysqli_fetch_assoc($result);\r\n\t\treturn $row['Id'];\r\n\t}",
"public function getRating(){\n return $this->film['rating'];\n }",
"public function get_teachers_role_id()\n\t{\n\t\t$this->db->select('roles_id');\n\t\t$this->db->from('cms_roles');\n\t\t$this->db->where('roles_name','Teachers');\n\t\t$query = $this->db->get();\n\t\treturn $query->row();\n\t}",
"public function getVarighet()\n {\n return $this->getTid();\n }",
"public function getFilm()\n {\n return $this->hasOne(Film::className(), ['id' => 'film_id']);\n }",
"function infoOneMovie ($movieId){\n global $pdo;\n\n $oneMovieInfoSelect = '\n SELECT *\n FROM movie\n INNER JOIN categories ON categories.cat_id = movie.categories_cat_id\n INNER JOIN support ON support.sup_id = movie.support_sup_id\n ';\n\n\n if (!empty($movieId)) {\n $oneMovieInfoSelect .= ' WHERE mov_id = :movieId';\n }\n\n $request = $pdo->prepare($oneMovieInfoSelect);\n\n if (!empty($movieId)) {\n $request->bindValue(':movieId', $movieId, PDO::PARAM_INT);\n }\n\n if ($request->execute() === false ) {\n print_r( $request->errorInfo() );\n } else {\n $oneMovieInfo = $request->fetch(PDO::FETCH_ASSOC);\n return $oneMovieInfo;\n }\n\n return false;\n}",
"private function getKnightId(){\n $knightId = $this->getRequest()->getPost(\"id\") //POST?\n ?? $this->params(\"id\") //GET?\n ?? null; //no way\n return $knightId;\n }"
]
| [
"0.77149063",
"0.75280255",
"0.7396782",
"0.7396782",
"0.7033474",
"0.6742625",
"0.6333175",
"0.6289443",
"0.6138535",
"0.6094337",
"0.60904586",
"0.5989943",
"0.59749085",
"0.5927469",
"0.5867953",
"0.58467066",
"0.56791735",
"0.56505233",
"0.5634591",
"0.5628242",
"0.56273675",
"0.5620568",
"0.55850035",
"0.55784667",
"0.55760384",
"0.55651695",
"0.5564726",
"0.5543147",
"0.5542575",
"0.5541886"
]
| 0.817955 | 0 |
Set the value of id_movieTheater | public function setId_movieTheater($id_movieTheater)
{
$this->id_movieTheater = $id_movieTheater;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getId_movieTheater()\n {\n return $this->id_movieTheater;\n }",
"public function setIdMovie($idMovie)\n {\n $this->idMovie = $idMovie;\n\n return $this;\n }",
"public function setRegisteredMovieId(string $movieId): void;",
"public function setMovieId($newMovieId) {\n\t\tif($newMovieId === null) {\n\t\t\t$this->movieId = null;\n\t\t\treturn;\n\t\t}\n\t\t//verify the movie id is valid\n\t\t$newMovieId = filter_var($newMovieId, FILTER_VALIDATE_INT);\n\t\tif($newMovieId === false) {\n\t\t\tthrow(new UnexpectedValueException(\"movie id is not a valid integer\"));\n\t\t}\n\t\tif($newMovieId <= 0) {\n\t\t\tthrow(new RangeException(\"movie id is not positive\"));\n\t\t}\n\t\t//convert and store the movie id\n\t\t$this->movieId = intval($newMovieId);\n\t}",
"function setMovieID($inMovieID) {\n\t\tif ( $inMovieID !== $this->_MovieID ) {\n\t\t\t$this->_MovieID = $inMovieID;\n\t\t}\n\t\treturn $this;\n\t}",
"public function getIdMovie()\n {\n return $this->idMovie;\n }",
"public function setTmdbId($id){$this->tmdbId=$id;}",
"public function setPlayerMovieIdAttribute($input)\n {\n $this->attributes['player_movie_id'] = $input ? $input : null;\n }",
"function setMovieID($inMovieID) {\n\t\tif ( $inMovieID !== $this->_MovieID ) {\n\t\t\t$this->_MovieID = $inMovieID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"function setMovieID($inMovieID) {\n\t\tif ( $inMovieID !== $this->_MovieID ) {\n\t\t\t$this->_MovieID = $inMovieID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setIdVit($id){\n\t\t$this->id = $id;\n\t}",
"function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}",
"function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}",
"function setDirectorID( $director_id )\n {\n $this->setValueByFieldName( 'director_id', $director_id );\n }",
"public function setFilm(array $film): void\n {\n $this->film = $film;\n }",
"public function getMovieId() {\n\t\treturn ($this->movieId);\n\t}",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"function SetId($value) { $this->id=$value; }",
"public function edit(movie $movie)\n {\n //\n }",
"public function edit(movie $movie)\n {\n //\n }",
"public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function setVideoId()\n {\n $this->video_id = (int) substr(parse_url($this->url, PHP_URL_PATH), 1);\n }",
"public function setID($id){\n $this->id=$id;\n }",
"function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}",
"public function setID($id){\n $this->ID = $id;\n }",
"public function setRelaterId($value)\n {\n return $this->set(self::RELATER_ID, $value);\n }",
"public function setID($id){\n $this->id = $id;\n }",
"public function setID($id) {\n $this->id = $id; \n }"
]
| [
"0.7257469",
"0.6601107",
"0.6389628",
"0.62679344",
"0.6229987",
"0.6190964",
"0.6100877",
"0.5877095",
"0.58608156",
"0.58608156",
"0.58486843",
"0.5780211",
"0.5780211",
"0.5758636",
"0.5695314",
"0.5680686",
"0.56010413",
"0.5600956",
"0.55919456",
"0.5590543",
"0.5590543",
"0.5575043",
"0.5558401",
"0.5513465",
"0.5511108",
"0.5499612",
"0.54990613",
"0.54975927",
"0.5489813",
"0.54762286"
]
| 0.78557336 | 0 |
Get the value of total_tickets | public function getTotal_tickets()
{
return $this->total_tickets;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTotalTickets() {\n\n $select = $this->select()\n ->from($this, array(\"Totaltickets\" => \"COUNT(*)\"));\n\n $result = $this->getAdapter()->fetchRow($select);\n if ($result) {\n return $result['Totaltickets'];\n } else {\n return false;\n }\n }",
"protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }",
"function get_total_ticket_of_user_helpdesk($id)\n\t{\n\t\t$counts = Ticket::where('user_id', Auth::id())->get();\n\t\treturn count($counts);\n\t}",
"public function getTotal()\n {\n return $this->total;\n }",
"public function getTotal()\n {\n return $this->total;\n }",
"public function getTotal()\n {\n return $this->total;\n }",
"public function getTotal()\n {\n return $this->total;\n }",
"public function getTotal()\n {\n return $this->total;\n }",
"public function getTotal()\n {\n return $this->total;\n }",
"public function gettotal()\r\n {\r\n return $this->total;\r\n }",
"public function get_total() { \n\n\t// Get total\n\t$this->total = DB::queryFirstField(\"SELECT count(*) FROM notifications\");\n\tif ($this->total == '') { $this->total = 0; }\n\n\t// Return\n\treturn $this->total;\n\n}",
"public function getTotal() {\n return $this->get(self::TOTAL);\n }",
"public function total(){\n\t\treturn $this->total;\n\t}",
"public function getTotal() {\n\t\treturn $this->total;\n\t}",
"public function total()\n {\n return $this->total;\n }",
"public function total()\n {\n return $this->total;\n }",
"function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}",
"public function getTotal(){\n\t\treturn $this->_total;\n\t}",
"public function getTotal()\n\t{\n\t\treturn $this->total;\n\t}",
"public function getAmountOfTicketsLabel()\n {\n return Ticket::find()->creator($this->id)->count();\n }",
"public function getTotal()\n\t{\n\t\treturn $this->getKeyValue('total'); \n\n\t}",
"public function total()\n\t{\n\t\treturn $this->total;\n\t}",
"public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}",
"function getTotal()\n\t{\n\t\treturn $this->_total;\n\t}",
"public function getTicket_price()\n {\n return $this->ticket_price;\n }",
"public function getTotal() : int\n {\n return $this->total;\n }",
"public function getTickets_sold()\n {\n return $this->tickets_sold;\n }",
"public function total()\n {\n return $this->calculateTotal();\n }",
"public static function getTotalTicket($params) {\n\t\tif (!is_array($params)) return false;\n\t\treturn self::_getDao()->getTotalTicket($params);\n\t}",
"public function get_total()\n {\n }"
]
| [
"0.75269073",
"0.6733117",
"0.67266935",
"0.67080426",
"0.67080426",
"0.67080426",
"0.67080426",
"0.67080426",
"0.67080426",
"0.66717327",
"0.6649025",
"0.6646281",
"0.6636721",
"0.6629512",
"0.66247225",
"0.66247225",
"0.6615177",
"0.65996397",
"0.65986824",
"0.65821946",
"0.6540329",
"0.6528188",
"0.64805156",
"0.6478903",
"0.64729005",
"0.6466109",
"0.6458894",
"0.6458213",
"0.6419493",
"0.6398837"
]
| 0.8608803 | 0 |
Set the value of total_tickets | public function setTotal_tickets($total_tickets)
{
$this->total_tickets = $total_tickets;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTotal_tickets()\n {\n return $this->total_tickets;\n }",
"private function setTotalFromData()\n {\n if ($this->dataHasTotal()) {\n $this->collection->items[$this->cart_hash]->total = $this->data['total'];\n $this->collection->increaseTotal($this->data['total']);\n }\n }",
"public function setTotalUsers(?int $value): void {\n $this->getBackingStore()->set('totalUsers', $value);\n }",
"protected function _setTotal($total = 0){\n\t\t$this->_total = $total;\n\t}",
"public function setTotalCount($value)\n {\n $this->_totalCount = $value;\n }",
"public function setTotalCount($value)\n {\n $this->_totalCount = $value;\n }",
"public function setTotal($total) {\n $this->total = intval($total);\n }",
"public function setTotal($total)\n {\n $this->total = $total;\n }",
"public function setTotalCount($totalCount);",
"public function setTicket($ticket)\n {\n $this->ticket = $ticket;\n }",
"public function setTotalTasks(?int $value): void {\n $this->getBackingStore()->set('totalTasks', $value);\n }",
"public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }",
"public function setTotal($table){\n $sql = \"SELECT count(*) from $table\";\n $statement = $this->con->getConnection()->prepare($sql);\n $statement->execute();\n \n $result = $statement->fetch();\n \n $this->total = $result[0];\n }",
"public function setTotal($value) {\n return $this->set(self::TOTAL, $value);\n }",
"public function getTotalTickets() {\n\n $select = $this->select()\n ->from($this, array(\"Totaltickets\" => \"COUNT(*)\"));\n\n $result = $this->getAdapter()->fetchRow($select);\n if ($result) {\n return $result['Totaltickets'];\n } else {\n return false;\n }\n }",
"protected function setRefundTotal()\n {\n $organiserTaxRate = $this->organiserTaxRate;\n $currency = $this->currency;\n /**\n * Subtotal = (Ticket price + Organiser Fee)\n * Tax Amount = Subtotal * Tax rate\n * Refund Amount = Subtotal + Tax Amount\n */\n $this->refundAmount = new Money($this->attendees->map(function (Attendee $attendee) use (\n $organiserTaxRate,\n $currency\n ) {\n $ticketPrice = new Money($attendee->ticket->price, $currency);\n $organiserFee = new Money($attendee->event->getOrganiserFee($ticketPrice), $currency);\n $subTotal = $ticketPrice->add($organiserFee);\n Log::debug(sprintf(\"Ticket Price: %s\", $ticketPrice->display()));\n Log::debug(sprintf(\"Ticket Organiser Fee: %s\", $organiserFee->display()));\n Log::debug(sprintf(\"Ticket Tax: %s\", $subTotal->multiply($organiserTaxRate)->display()));\n return $subTotal->add($subTotal->multiply($organiserTaxRate));\n })->reduce(function ($carry, $singleTicketWithTax) use ($currency) {\n $refundTotal = (new Money($carry, $currency));\n return $refundTotal->add($singleTicketWithTax)->format();\n }), $currency);\n Log::debug(sprintf(\"Requested Refund should include Tax: %s\", $this->refundAmount->display()));\n }",
"public function setPriceTotal($value)\n {\n $this->priceTotal = $value;\n }",
"function update($units, $total){}",
"public function setTicketNumber(?string $value): void {\n $this->getBackingStore()->set('ticketNumber', $value);\n }",
"public function introduceTicket($valor){\n if ($valor>=0){\n $this->tickets[]=$valor;\n }\n }",
"public function setTotalDue($totalDue);",
"function setTotalRecords($total)\n\t{\n\t\t$this->total_records = 0+$total;\n\t}",
"public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }",
"protected function set_total( $key = 'total', $total ) {\n\t\t$this->totals[ $key ] = $total;\n\t}",
"public function setTickets(DataList $tickets)\n {\n $this->tickets = $tickets;\n }",
"private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }",
"public function setTicketPrice($value) {\n return $this->set(self::TICKETPRICE, $value);\n }",
"public function setTotalCalories($val){\n $this->totalCalories = $val;\n return $this;\n }",
"private function updateUnitCount(){\n $units = $this->currentUnits + $this->requestedUnits;\n error_log(\"Updated Unit Count: \" . $units);\n try {\n $stmt = $this->dbh->prepare(\"UPDATE `Locations`\n SET AccUnits = :units\n WHERE P_Id = :id\");\n $stmt->bindParam(\":units\", $units);\n $stmt->bindParam(\":id\",$this->accId);\n $stmt->execute();\n } catch (Exception $e) {\n error_log(\"Error: \" . $e->getMessage());\n }\n }",
"public function setTickets($tickets)\n {\n //Argument 1 must be int\n Argument::i()->test(1, 'string', 'array');\n\n if (is_array($tickets)) {\n $tickets = implode(',', $tickets);\n }\n\n $this->query['tickets'] = $tickets;\n\n return $this;\n }"
]
| [
"0.7034797",
"0.6267803",
"0.6076995",
"0.60440195",
"0.592663",
"0.592663",
"0.5882511",
"0.58190346",
"0.5756538",
"0.57545567",
"0.5736683",
"0.5689654",
"0.5663278",
"0.5658592",
"0.563641",
"0.56214315",
"0.5609515",
"0.55987996",
"0.5562388",
"0.55600065",
"0.5551538",
"0.5549593",
"0.54887736",
"0.54812866",
"0.5465608",
"0.5460127",
"0.54372305",
"0.54061085",
"0.53299826",
"0.531682"
]
| 0.7155272 | 0 |
Get the value of tickets_sold | public function getTickets_sold()
{
return $this->tickets_sold;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSold()\n {\n return $this->sold;\n }",
"public function getQuantitySold()\n {\n return $this->quantitySold;\n }",
"public function getPurchaseQuantitySold() {\n return $this->purchaseQuantitySold;\n }",
"public function getSoldPrice() {\r\n\t\treturn $this->soldPrice;\r\n\t}",
"function get_sold($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_sold',array('id' => $id));\n\treturn $result_array['total'];\n}",
"public function getTotalSoldCount()\n {\n return $this->totalSoldCount;\n }",
"public function total_sold()\n\t{\n\t\t$sold = self::$_ci->cart_item_m->count_by(array('status' => 'pg-success'));\n\t\t\n\t\treturn (int) $sold;\n\t\t\n\t}",
"public function getTotalSoldValue()\n {\n return $this->totalSoldValue;\n }",
"private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }",
"public function getTotal_tickets()\n {\n return $this->total_tickets;\n }",
"public function hasSoldCount(){\n return $this->_has(10);\n }",
"public function setTickets_sold($tickets_sold)\n {\n $this->tickets_sold = $tickets_sold;\n\n return $this;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->Stock;\n }",
"public function getSoldItems() {\n //$filter = 'LastHour';\n $filter = 'Last45Days';\n //$filter = 'SaleCompleted';\n $response = $this->trademe->get('MyTradeMe/SoldItems/'.$filter);\n\n if ($response->is_ok()) {\n return $response->List->SoldItem;\n }\n // error\n $this->tragentoLog(array(),$response->error_message(),'get_sold_items_error');\n return false;\n }",
"protected function sold()\n\t{\n\t\tforeach ($this->config->data()['sold'] as $key => $value) {\n\t\t\tif ($this->store['sold'] >= $key) {\n\t\t\t\t$this->score += $value;\n\t\t\t}\n\t\t}\n\t}",
"public function getStock(): int\n {\n return $this->stock;\n }",
"function get_stocked($obj, $id){\n\t$result_array = $obj->Query_reader->get_row_as_array('get_stocked',array('id' => $id));\n\treturn $result_array['total'];\n}",
"public function sold($deal = null)\n\t{\n\t\t$sold = 0;\n\t\t\n\t\t// Find deal by ID\n\t\tif (is_numeric($deal))\n\t\t{\n\t\t\t$deal = $this->get($deal);\n\t\t}\n\t\t\n\t\t\n\t\t// Find number of sold coupons\n\t\tif ($deal and isset($deal->sold_number))\n\t\t{\n\t\t\t$sold = (int) $deal->sold_number;\n\t\t}\n\t\telseif ($deal)\n\t\t{\n\t\t\t// Get number of sold items\n\t\t\t$sold = (int) $this->cart_item_m->count_by(array\n\t\t\t(\n\t\t\t\t'entry_id' => $deal->id,\n\t\t\t\t'status' => 'pg-success',\n\t\t\t));\n\t\t}\n\t\t\n\t\t\n\t\t// There's the possibility to fake the number of sold coupons so we set that here\n\t\tif (isset($deal->f_fake_coupons) and (int) $deal->f_fake_coupons)\n\t\t{\n\t\t\t$deal->sold_number += (int) $deal->f_fake_coupons;\n\t\t}\n\t\t\n\t\treturn $sold;\n\t\t\n\t}",
"public function getStock();",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getStock()\n {\n return $this->stock;\n }",
"public function getTotalAuctionSellingValue()\n {\n return $this->totalAuctionSellingValue;\n }",
"public function getTicket_price()\n {\n return $this->ticket_price;\n }",
"public function QtyForSale() {\n\treturn $this->Value('QtyForSale');\n }",
"public function getQtyInvoiced() {\n return $this->item->getQtyInvoiced();\n }"
]
| [
"0.75174934",
"0.71104175",
"0.65966487",
"0.65666896",
"0.64731556",
"0.6337639",
"0.6235218",
"0.6216535",
"0.61831546",
"0.6154472",
"0.6013062",
"0.6000645",
"0.5919346",
"0.5919346",
"0.5919346",
"0.5919346",
"0.5919346",
"0.59190464",
"0.59128743",
"0.5901866",
"0.58952653",
"0.5891545",
"0.588494",
"0.58306575",
"0.58061856",
"0.58061856",
"0.57001895",
"0.5668988",
"0.5633854",
"0.5624349"
]
| 0.8085592 | 0 |
Set the value of tickets_sold | public function setTickets_sold($tickets_sold)
{
$this->tickets_sold = $tickets_sold;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSold($sold)\n {\n $this->sold = $sold;\n }",
"public function getTickets_sold()\n {\n return $this->tickets_sold;\n }",
"protected function sold()\n\t{\n\t\tforeach ($this->config->data()['sold'] as $key => $value) {\n\t\t\tif ($this->store['sold'] >= $key) {\n\t\t\t\t$this->score += $value;\n\t\t\t}\n\t\t}\n\t}",
"private function setSoldIndividually() {\n $this->product->set_sold_individually($this->wcData->isSoldIndividually());\n }",
"public function getSold()\n {\n return $this->sold;\n }",
"public function getQuantitySold()\n {\n return $this->quantitySold;\n }",
"public function setSpent($value)\n\t{\n\t\t$this->spent = $value;\n\t}",
"public function setStocks($stocks)\n {\n $this->stocks = (array) $stocks;\n }",
"public function UpdateBookingQty($qty = 0)\n\t{\n\t\t$sql = 'UPDATE coursetickets SET tbooked=tbooked ' . ($qty >= 0 ? '+ ' : '- ') . abs($qty) . ' WHERE tid='. (int)$this->id;\t\n\t\t\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\n\t\t\tif ($this->db->AffectedRows())\n\t\t\t{\n\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\tif (!$this->IsBookable())\n\t\t\t\t{\t$this->UpdateStatus('sold_out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setTickets(DataList $tickets)\n {\n $this->tickets = $tickets;\n }",
"public function sold($deal = null)\n\t{\n\t\t$sold = 0;\n\t\t\n\t\t// Find deal by ID\n\t\tif (is_numeric($deal))\n\t\t{\n\t\t\t$deal = $this->get($deal);\n\t\t}\n\t\t\n\t\t\n\t\t// Find number of sold coupons\n\t\tif ($deal and isset($deal->sold_number))\n\t\t{\n\t\t\t$sold = (int) $deal->sold_number;\n\t\t}\n\t\telseif ($deal)\n\t\t{\n\t\t\t// Get number of sold items\n\t\t\t$sold = (int) $this->cart_item_m->count_by(array\n\t\t\t(\n\t\t\t\t'entry_id' => $deal->id,\n\t\t\t\t'status' => 'pg-success',\n\t\t\t));\n\t\t}\n\t\t\n\t\t\n\t\t// There's the possibility to fake the number of sold coupons so we set that here\n\t\tif (isset($deal->f_fake_coupons) and (int) $deal->f_fake_coupons)\n\t\t{\n\t\t\t$deal->sold_number += (int) $deal->f_fake_coupons;\n\t\t}\n\t\t\n\t\treturn $sold;\n\t\t\n\t}",
"protected function doActionSetSalePrice()\n {\n $form = new \\XLite\\Module\\CDev\\Sale\\View\\Form\\SaleSelectedDialog();\n $form->getRequestData();\n\n if ($form->getValidationMessage()) {\n \\XLite\\Core\\TopMessage::addError($form->getValidationMessage());\n } elseif (!$this->getSelected() && $ids = $this->getActionProductsIds()) {\n $qb = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Product')->createQueryBuilder();\n $alias = $qb->getMainAlias();\n $qb->update('\\XLite\\Model\\Product', $alias)\n ->andWhere($qb->expr()->in(\"{$alias}.product_id\", $ids));\n\n foreach ($this->getUpdateInfoElement() as $key => $value) {\n $qb->set(\"{$alias}.{$key}\", \":{$key}\")\n ->setParameter($key, $value);\n }\n\n $qb->execute();\n\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n } else {\n \\XLite\\Core\\Database::getRepo('\\XLite\\Model\\Product')->updateInBatchById($this->getUpdateInfo());\n \\XLite\\Core\\TopMessage::addInfo('Products information has been successfully updated');\n }\n\n $this->setReturnURL($this->buildURL('product_list', '', ['mode' => 'search']));\n }",
"public function getPurchaseQuantitySold() {\n return $this->purchaseQuantitySold;\n }",
"public function setStock($stock);",
"public function setQuantitySold($quantitySold)\n {\n $this->quantitySold = $quantitySold;\n return $this;\n }",
"public function UpdateStatusFromBookings()\n\t{\tif ($this->id)\n\t\t{\t$this->UpdateStatus(count($this->GetBookings()) >= $this->details['tqty'] ? 'sold_out' : 'in_stock');\n\t\t}\n\t}",
"public function setSeats(SelectTickets $request, Event $event)\n {\n $validated = $request->validated();\n\n if ($event->seatMap->layout !== null) {\n // handle seat ids\n session(['seats' => $validated['selected-seats']]);\n }\n\n session(['tickets' => $validated['tickets']]);\n session(['event' => $event]);\n\n\n return redirect()->route('ts.customerData');\n }",
"function soldStock($product_id, $count=1) {\n\t\t\t$product=$this->findById($product_id);\n\t\t\t\n\t\t\tif ($product['Product']['stock']) {\n\t\t\t\t$product['Product']['stock_number']--;\n\t\t\t\t\n\t\t\t\t$this->Save($product);\n\t\t\t}\n\t\t}",
"public function incrementSales() {\n $this->sales = ($this->getSales() + 1);\n }",
"public function UpdateQty($qty = 0)\n\t{\n\t\t$sql = 'UPDATE coursetickets SET tqty = tqty ' . ($qty >= 0 ? '+ ' : '- ') . abs($qty) . ' WHERE tid = '. (int)$this->id;\t\n\t\t\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\n\t\t\tif ($this->db->AffectedRows())\n\t\t\t{\n\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\tif ($this->details['tqty'] <= 0)\n\t\t\t\t{\t$this->UpdateStatus('sold_out');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function hasSoldCount(){\n return $this->_has(10);\n }",
"public function getTotalSoldCount()\n {\n return $this->totalSoldCount;\n }",
"public function updateSellIn() {\n $this->sellIn -= 1;\n }",
"public function updateSellIn() {\n $this->sellIn -= 1;\n }",
"public function updateSellIn(): void\n {\n $this->getItem()->sell_in--;\n }",
"function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}",
"public function setTicketId($newTicketId) {\n\t\t// zeroth, set allow the ticket id to be null if a new object\n\t\tif($newTicketId === null) {\n\t\t\t$this->ticketId = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// first, ensure the ticket id is an integer\n\t\tif(filter_var($newTicketId, FILTER_VALIDATE_INT) === false) {\n\t\t\tthrow(new UnexpectedValueException(\"ticket id $newTicketId is not numeric\"));\n\t\t}\n\n\t\t// second, convert the ticket id to an integer and enforce it's positive\n\t\t$newTicketId = intval($newTicketId);\n\t\tif($newTicketId <= 0) {\n\t\t\tthrow(new RangeException(\"ticket id $newTicketId is not positive\"));\n\t\t}\n\n\t\t// finally, take the ticket id out of quarantine and assign it\n\t\t$this->ticketId = $newTicketId;\n\t}",
"function setSyncItemsPriceAction()\n {\n }",
"public function set_stock_reduced( $order, $set ) {\n\t\t$order_id = WC_Order_Factory::get_order_id( $order );\n\n\t\tupdate_post_meta( $order_id, '_order_stock_reduced', wc_bool_to_string( $set ) );\n\t}",
"public function updateprices()\n {\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"updateval\");\n if (is_array($aParams)) {\n foreach ($aParams as $soxId => $aStockParams) {\n $this->addprice($soxId, $aStockParams);\n }\n }\n }"
]
| [
"0.75498986",
"0.67002106",
"0.6543002",
"0.5925858",
"0.5648656",
"0.556776",
"0.54708827",
"0.5419295",
"0.5396122",
"0.5387916",
"0.5372952",
"0.5345302",
"0.53032357",
"0.51850915",
"0.51821834",
"0.51498324",
"0.5098451",
"0.5044932",
"0.5008274",
"0.5006375",
"0.49961343",
"0.4979685",
"0.49794084",
"0.49794084",
"0.49793074",
"0.49779657",
"0.49650377",
"0.49483815",
"0.49394783",
"0.4933428"
]
| 0.71602994 | 1 |
Get the value of ticket_price | public function getTicket_price()
{
return $this->ticket_price;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTicketPrice() {\n return $this->get(self::TICKETPRICE);\n }",
"public function get_price(){\n\t\treturn $this->price;\n\t}",
"public function getPrice(){\n return $this->price;\n }",
"public function getPrice(){\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\n {\n return $this->price;\n }",
"public function getPrice()\r\n {\r\n return $this->price;\r\n }",
"public function getPrice() {\n\t\treturn($this->price);\n\t}",
"public function getPrice()\n {\n return $this->get(self::_PRICE);\n }",
"public function getPrice(){\n return $this->price;\n }",
"public function getPrice()\n\t{\n\t\treturn $this->price;\n\t}",
"public function getPrice()\n {\n\n return $this->price;\n }"
]
| [
"0.80733174",
"0.7518855",
"0.7156379",
"0.7156379",
"0.7150448",
"0.7150448",
"0.7113135",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.7095386",
"0.70443624",
"0.70399165",
"0.7035258",
"0.70011336",
"0.69976103",
"0.6938059"
]
| 0.8325525 | 0 |
Creates a Google calendar service. Required clients access token. | public function createCalendarService($accessToken)
{
$client = $this->createClient();
$client->setAccessToken($accessToken);
return new \Google_Service_Calendar($client);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createClient()\n {\n $scopes = implode(' ', [\\Google_Service_Calendar::CALENDAR]);\n\n $client = new \\Google_Client();\n $client->setApplicationName('P4 LMS');\n $client->setScopes($scopes);\n $client->setClientId(env('GOOGLE_API_ID'));\n $client->setClientSecret(env('GOOGLE_API_SECRET'));\n $client->setAccessType('offline');\n\n return $client;\n }",
"private function createGoogleConnection()\n {\n $clientid = \\JComponentHelper::getParams('com_pbbooking')->get('clientid');\n $clientsecret = \\JComponentHelper::getParams('com_pbbooking')->get('clientsecret');\n\n if (!$clientid || !$clientsecret || $clientid == '' || $clientsecret == '')\n {\n throw new \\Exception('clientid or clientsecret is blank or missing',0);\n }\n\n $token = $GLOBALS['com_pbbooking_data']['config']->token;\n\n if (!$token || $token == '')\n {\n throw new \\Exception('token is missing. Ensure calendar is linked correctly',0);\n }\n\n // All settings appear to be available so let's create the client.\n $client = new \\Google_Client();\n\n $client->setClientId($clientid);\n $client->setClientSecret($clientsecret);\n $client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob');\n $client->addScope('https://www.googleapis.com/auth/calendar');\n $client->setAccessType('offline');\n\n $client->setAccessToken($token);\n\n return $client;\n }",
"public function getServiceCalendar()\n {\n $scopes = array('https://www.googleapis.com/auth/calendar');\n $credential = new Google_Auth_AssertionCredentials($this->auth_email, $scopes, $this->p12_key);\n\n $client = new Google_Client();\n $client->setAssertionCredentials($credential);\n if ($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($credential);\n }\n\n return new Google_Service_Calendar($client);\n }",
"function __construct() {\n $this->client = new \\Google_Client();\n $this->client->setApplicationName(\"AIQ-CRM\");\n $this->client->setClientId(Config::get('google.calendar.client_id'));\n $this->client->setClientSecret(Config::get('google.calendar.client_secret'));\n $this->client->setRedirectUri(Config::get('google.calendar.redirect_uri'));\n $this->client->setAccessType('offline');\n $this->client->addScope(\"https://www.googleapis.com/auth/calendar\");\n //\n //\n $this->service = new \\Google_Service_Calendar($this->client);\n }",
"protected static function createClient()\n {\n $log = new Logger('debug');\n $client = new Google_Client();\n $client->setApplicationName(self::APPLICATION_NAME);\n $client->useApplicationDefaultCredentials();\n $client->addScope('https://www.googleapis.com/auth/drive');\n $client->setLogger($log);\n return $client;\n }",
"function createClient()\r\n {\r\n $client = new Google_Client();\r\n $client->setAuthConfigFile('../client_secret.json');\r\n $client->setAccessType(\"offline\");\r\n $client->setIncludeGrantedScopes(true);\r\n $client->addScope(Google_Service_Drive::DRIVE);\r\n return $client;\r\n }",
"function getClient()\n{\n $gClient = new Google_Client();\n $gClient->setApplicationName('ALGuru');\n $gClient->setScopes(Google_Service_Calendar::CALENDAR);\n $gClient->setAuthConfig('client_secret.json');\n $gClient->setAccessType('offline');\n $gClient->setPrompt('select_account consent');\n\n // Load previously authorized token from a file, if it exists.\n // The file token.json stores the user's access and refresh tokens, and is\n // created automatically when the authorization flow completes for the first\n // time.\n $userTokenPath = 'token.json';\n if (file_exists($userTokenPath)) {\n $appToken = json_decode(file_get_contents($userTokenPath), true);\n $gClient->setAccessToken($appToken);\n }\n\n // If there is no previous token or it's expired.\n if ($gClient->isAccessTokenExpired()) {\n // Refresh the token if possible, else fetch a new one.\n if ($gClient->getRefreshToken()) {\n $gClient->fetchAccessTokenWithRefreshToken($gClient->getRefreshToken());\n } else {\n // Request authorization from the user.\n if(!browserCredentials()) {\n $authUrl = $gClient->createAuthUrl();\n return \"<p>Sign to use this service!</p><a href='$authUrl'><button class='button' style='vertical-align:middle'><i class='fa fa-google' style='padding:0px 20px 5px 5px'></i><span> Sign In </span></button></a>\";\n }\n $authCode = $_GET['code'];\n \n // Exchange authorization code for an access token.\n $appToken = $gClient->fetchAccessTokenWithAuthCode($authCode);\n $gClient->setAccessToken($appToken);\n \n // Check to see if there was an error.\n if (array_key_exists('error', $appToken)) {\n throw new Exception(join(', ', $appToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($userTokenPath))) {\n mkdir(dirname($userTokenPath), 0700, true);\n }\n file_put_contents($userTokenPath, json_encode($gClient->getAccessToken()));\n }\n return $gClient;\n}",
"function getClient()\n \t\t {\n \t\t $client = new Google_Client();\n \t\t $client->setApplicationName('Google Calendar API PHP Quickstart');\n \t\t $client->setScopes(Google_Service_Calendar::CALENDAR_READONLY);\n \t\t $client->setAuthConfig(__DIR__ .'/credentials.json');\n \t\t $client->setAccessType('offline');\n \t\t $client->setPrompt('select_account consent');\n\n \t\t // Load previously authorized token from a file, if it exists.\n \t\t // The file token.json stores the user's access and refresh tokens, and is\n \t\t // created automatically when the authorization flow completes for the first\n \t\t // time.\n \t\t $tokenPath = 'token.json';\n \t\t if (file_exists($tokenPath)) {\n \t\t $accessToken = json_decode(file_get_contents($tokenPath), true);\n \t\t $client->setAccessToken($accessToken);\n \t\t }\n\n \t\t // If there is no previous token or it's expired.\n \t\t if ($client->isAccessTokenExpired()) {\n \t\t // Refresh the token if possible, else fetch a new one.\n \t\t if ($client->getRefreshToken()) {\n \t\t $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n \t\t } else {\n \t\t // Request authorization from the user.\n \t\t $authUrl = $client->createAuthUrl();\n \t\t printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n \t\t print 'Enter verification code: ';\n \t\t $authCode = trim(fgets(STDIN));\n\n \t\t // Exchange authorization code for an access token.\n \t\t $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);\n \t\t $client->setAccessToken($accessToken);\n\n \t\t // Check to see if there was an error.\n \t\t if (array_key_exists('error', $accessToken)) {\n \t\t throw new Exception(join(', ', $accessToken));\n \t\t }\n \t\t }\n \t\t // Save the token to a file.\n \t\t if (!file_exists(dirname($tokenPath))) {\n \t\t mkdir(dirname($tokenPath), 0700, true);\n \t\t }\n \t\t file_put_contents($tokenPath, json_encode($client->getAccessToken()));\n \t\t }\n \t\t return $client;\n \t\t }",
"public function createEvent($gClient, $google_calendar_id){\n if(empty($this->google_calendar_id))\n $this->google_calendar_id = $google_calendar_id;\n $service = new Google_Service_Calendar($gClient);\n \n $event = new Google_Service_Calendar_Event();\n $event->setSummary( $this->title );\n $event->setLocation( $this->location );\n $event->setDescription( $this->description );\n\n $start = new Google_Service_Calendar_EventDateTime();\n $start->setDateTime( date('c', strtotime($this->start)) ); //$start->setDateTime('2011-06-03T10:00:00.000-07:00');\n $start->setTimeZone( 'America/Los_Angeles' );\n $event->setStart($start);\n\n $end = new Google_Service_Calendar_EventDateTime();\n if (!empty($this->end))\n $end->setDateTime( date('c', strtotime($this->end)) ); //$end->setDateTime('2011-06-03T10:25:00.000-07:00');\n else\n $end->setDateTime( date('c', strtotime($this->start)+24*3600) );\n $end->setTimeZone( 'America/Los_Angeles' );\n $event->setEnd( $end );\n\n //$attendee1 = new Google_Service_Calendar_EventAttendee();\n //$attendee1->setEmail('attendeeEmail');\n // ...\n // $attendees = array($attendee1,\n // ...\n // );\n //$event->attendees = $attendees;\n\n $createdEvent = $service->events->insert($this->google_calendar_id, $event);\n if($id = $createdEvent->getId()){\n $this->google_calendar_event_id = $id;\n if($this->save())\n return $id;\n }\n return false;\n }",
"private function setupServicedAccountClient($developerKey, $serviceAccountName, $privateKey) {\n $this->client = new Google_Client();\n $this->client->setApplicationName(self::APPLICATION_NAME);\n $this->client->setDeveloperKey($developerKey);\n if (!empty($_SESSION[self::ACCESS_TOKEN])) {\n $currentAccessToken = $_SESSION[self::ACCESS_TOKEN];\n $this->client->setAccessToken($currentAccessToken);\n }\n\n // Saves information required for authentication later.\n $this->serviceAccountName = $serviceAccountName;\n $this->privateKey = $privateKey;\n $this->googleAssertionCredentials = new Google_Auth_AssertionCredentials($this->serviceAccountName,\n Google_Service_Tasks::TASKS, $this->privateKey);\n $this->client->setAssertionCredentials($this->googleAssertionCredentials);\n }",
"protected function getAuth_Provider_Oauth_Service_GoogleService()\n {\n return $this->services['auth.provider.oauth.service.google'] = new \\phpbb\\auth\\provider\\oauth\\service\\google(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }",
"function buildClient(){\n\t\n\t$client = new Google_Client();\n\t$client->setAccessType(\"offline\"); // offline access. Will result in a refresh token\n\t$client->setIncludeGrantedScopes(true); // incremental auth\n\t$client->setAuthConfig(__DIR__ . '/client_secrets.json');\n\t$client->addScope([YOUR SCOPES HERE]);\n\t$client->setRedirectUri(getRedirectUri());\t\n\treturn $client;\n}",
"static private function getSpreadSheetService()\n {\n $client = self::getClient();\n if (!($client instanceof Google_Client)) {\n echo json_encode([\n 'success' => false,\n 'error' => '<br>認証情報が不正です。<br>client_secret.jsonは配置されていますか?<br>配置されているなら「認証情報の作成」ボタンを押してください。'\n ]);\n die();\n }\n\n /**\n * @var $client Google_Client\n */\n return new Google_Service_Sheets($client);\n }",
"public function getconfig()\r\n\t{\r\n\t\t// define('SCOPES', implode(' ', array(\r\n\t\t// Google_Service_Calendar::CALENDAR,'https://www.googleapis.com/auth/userinfo.email')\r\n\t\t// ));\r\n\t\t$hostName = $_SERVER['HTTP_HOST'];\r\n $protocol = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';\r\n \t$server = $protocol.$hostName;\r\n\t\t\r\n\t\t$google_client = new Google_Client();\r\n\t\t$google_client->setApplicationName('Medicloud');\r\n\t\t$google_client->setRedirectUri($server.'/app/gcal/getClientToken');\r\n\t\t// $google_client->setRedirectUri('http://localhost/medicloud_v003/public/app/gcal/getClientToken');\r\n\t\t// $google_client->setRedirectUri('http://ec2-54-255-185-218.ap-southeast-1.compute.amazonaws.com/nuclei_mc_r1/public/app/gcal/getClientToken');\r\n\t\t// $google_client->setClientId('435398632542-oe70nsqe1mtpd5j1gteeb4anp4v5p315.apps.googleusercontent.com');\r\n\t\t// $google_client->setClientSecret('KZFY_DK7i21cBJuVyiGf8Of9');\r\n\t\t$google_client->setClientId('186173794919-hm0ejste4uocpnsg9p8hjd5ea3201ss8.apps.googleusercontent.com');\r\n\t\t$google_client->setClientSecret('FBBhPQ9SeHdEwUPTLKAuyn-5');\r\n\t\t// $google_client->setScopes(SCOPES);\r\n\t\t\r\n\r\n\t\treturn $google_client;\r\n\t}",
"protected function newGoogleClient(array $options = [])\n {\n $client = new \\Google_Client();\n $client->setClientId((isset($options['client_id']) ? $options['client_id'] : ''));\n $client->setClientSecret((isset($options['client_secret']) ? $options['client_secret'] : ''));\n $client->setRedirectUri($this->getGoogleLoginUrl());\n $client->setScopes('https://www.googleapis.com/auth/userinfo.profile');\n $client->addScope('email');\n $client->setApprovalPrompt('force');// always allow user to switch user or accept everytime.\n \n // done.\n $options = [];\n return $client;\n }",
"function openDriveService($config)\n{\n// load Zend Gdata libraries\nrequire_once 'Zend/Loader.php';\nZend_Loader::loadClass('Zend_Gdata_Spreadsheets');\nZend_Loader::loadClass('Zend_Gdata_ClientLogin');\n\n// set credentials for ClientLogin authentication\n$user = $config['drive_user'];\n$pass = $config['drive_pass'];\n\ntry {\n\t// connect to API\n\t$service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME;\n\t$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);\n\t$service = new Zend_Gdata_Spreadsheets($client);\n\t}\n\tcatch (Exception $e) {\n\t\tdie('ERROR: ' . $e->getMessage());\n\t}\n\treturn $service;\n}",
"public function __construct()\n {\n\n $client = new Google_Client();\n $client->setAuthConfig('client_secret.json');\n $client->setAccessType(\"offline\"); // offline access\n $client->setIncludeGrantedScopes(true); // incremental auth\n $client->addScope(Google_Service_Calendar::CALENDAR);\n $client->setRedirectUri(url('oauth2callback'));\n\n $guzzleClient = new \\GuzzleHttp\\Client(array('curl' => array(CURLOPT_SSL_VERIFYPEER => false)));\n $client->setHttpClient($guzzleClient);\n\n $this->client = $client;\n }",
"function getClient() {\n $client = new Google_Client();\n $client->setAuthConfig('credentials.json');\n $client->setApplicationName('theName');\n $client->setAccessType('offline');\n // $client->setScopes([\\Google_Service_Sheets::SPREADSHEETS]);\n $client->setScopes(\n ['https://www.googleapis.com/auth/spreadsheets',\n 'https://www.googleapis.com/auth/drive']);\n\n\n return $client;\n}",
"function getService()\n\t{\n\n\t // Load the Google API PHP Client Library.\n\t // require_once 'google-api-php-client/src/Google/autoload.php';\n\t require_once APPPATH.'third_party/Google_api/src/Google/autoload.php';\n\n\t $client = new Google_Client();\n\t $client->setApplicationName(\"[email protected]\");\n\t $client->setDeveloperKey(\"AIzaSyBX98zkxCCkQcxS_-qfKftDKgAgYPgS078\");\n\n\t \n\n\t // Create and configure a new client object.\n\t $client = new Google_Client();\n\t $client->setApplicationName(\"HelloAnalytics\");\n\t $analytics = new Google_Service_Analytics($client);\n\n\t // // Read the generated client_secrets.p12 key.\n\t // $key = file_get_contents($key_file_location);\n\t // $cred = new Google_Auth_AssertionCredentials(\n\t // $service_account_email,\n\t // array(Google_Service_Analytics::ANALYTICS_READONLY),\n\t // $key\n\t // );\n\t // $client->setAssertionCredentials($cred);\n\t // if($client->getAuth()->isAccessTokenExpired()) {\n\t // $client->getAuth()->refreshTokenWithAssertion($cred);\n\t // }\n\n\t return $analytics;\n\t}",
"public function create_service(array $credential=[]){\n \n if(!$credential) {\n $credential = \\Drupal::service('ml_engine.project')->get_credential();\n }\n $client = new \\Google_Client();\n $client->setAuthConfig($credential);\n $client->addScope(\\Google_Service_CloudMachineLearningEngine::CLOUD_PLATFORM);\n $service = new \\Google_Service_CloudMachineLearningEngine($client);\n return $service;\n }",
"function getGoogleClient() {\n\t$client = getOauth2Client();\n\n\t// Refresh the token if it's expired.\n\tif ($client->isAccessTokenExpired()) {\n\t\t$client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n\t\tfile_put_contents($credentialsPath, json_encode($client->getAccessToken()));\n\t}\nreturn $client;\n}",
"public function setUp()\n {\n /*\n * Create a new credentials object for authorization\n */\n $credentials = new \\Google_Auth_AssertionCredentials(\n $this->serviceAccountName,\n $this->scopes,\n $this->key,\n 'notasecret'\n );\n\n /*\n * Create a new client object\n */\n $this->client = new \\Google_Client();\n\n /*\n * Set app name, client ID, and service credentials\n */\n $this->client->setApplicationName($this->applicationName);\n $this->client->setClientId($this->clientId);\n $this->client->setAssertionCredentials($credentials);\n\n /*\n * Create google calendar service and assign to class property\n */\n $this->service = new \\Google_Service_Calendar($this->client);\n }",
"public function createClient(): Client {\n $client = new Client();\n $client->setApplicationName($this->configuration['application_name']);\n $client->setScopes($this->configuration['scopes']);\n $client->setAccessType('offline');\n $client->setAuthConfig($this->configuration['credentials_file']);\n $client->setPrompt('select_account consent');\n\n $tokenPath = $this->configuration['token_file'];\n if (file_exists($tokenPath)) {\n $accessToken = json_decode(file_get_contents($tokenPath), true);\n $client->setAccessToken($accessToken);\n }\n \n // If there is no previous token or it's expired.\n if ($client->isAccessTokenExpired()) {\n // Refresh the token if possible, else fetch a new one.\n if ($client->getRefreshToken()) {\n $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n }\n }\n\n return $client;\n }",
"private function getClient()\n {\n log_message('info', 'creating client START');\n $client = new Google_Client();\n $client->setAuthConfig($_SERVER['DOCUMENT_ROOT'].'/assets/client_secret.json');\n $client->addScope(Google_Service_Drive::DRIVE);\n $client->setAccessType('offline');\n $client->setPrompt('select_account consent');\n\n // Load previously authorized token from a file, if it exists.\n // The file token.json stores the user's access and refresh tokens, and is\n // created automatically when the authorization flow completes for the first\n // time.\n $tokenPath = 'token.json';\n if (file_exists($tokenPath)) {\n $accessToken = json_decode(file_get_contents($tokenPath), true);\n $client->setAccessToken($accessToken);\n }\n\n // If there is no previous token or it's expired.\n if ($client->isAccessTokenExpired()) {\n log_message('info', 'Access Token Expired');\n // Refresh the token if possible, else fetch a new one.\n if ($client->getRefreshToken()) {\n log_message('info', 'Refresh the token');\n $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken());\n } else {\n log_message('info', 'ERROR: Need to Request authorization from the user');\n // // Request authorization from the user.\n // $authUrl = $client->createAuthUrl();\n // printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n // print 'Enter verification code: ';\n // $authCode = trim(fgets(STDIN));\n\n // // Exchange authorization code for an access token.\n // $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);\n // $client->setAccessToken($accessToken);\n\n // // Check to see if there was an error.\n // if (array_key_exists('error', $accessToken)) {\n // throw new Exception(join(', ', $accessToken));\n // }\n return null;\n }\n // Save the token to a file.\n if (!file_exists(dirname($tokenPath))) {\n mkdir(dirname($tokenPath), 0700, true);\n }\n file_put_contents($tokenPath, json_encode($client->getAccessToken()));\n }\n log_message('info', 'creating client DONE');\n return $client;\n }",
"public function __construct()\n {\n parent::__construct();\n $client = new Google_Client();\n $client->addScope(Google_Service_Calendar::CALENDAR);\n $guzzleClient = new \\GuzzleHttp\\Client(array('curl' => array(CURLOPT_SSL_VERIFYPEER => false)));\n $client->setHttpClient($guzzleClient);\n $client->setApplicationName(\"Google Calendar Of DG\");\n $apiKey = 'AIzaSyCzmINkqTeDAhuA3Y-ZhCVYp6FSziQplcg';\n $client->setDeveloperKey($apiKey);\n $this->client = $client;\n }",
"public function setClient($clientObject) {\n\t\t$this->service = new Google_Service_Calendar($clientObject); \n\t}",
"public function create($serviceManager);",
"public function __construct($google_service_account_json = \"\")\n {\n if ($google_service_account_json == \"\") $google_service_account_json = __ROOT__ . '/google-service-account.json';\n $serviceAccount = ServiceAccount::fromJsonFile($google_service_account_json);\n\n $this->firebase = (new Factory)\n ->withServiceAccount($serviceAccount)\n ->create();\n\n $this->database = $this->firebase->getDatabase();\n }",
"static function getClient() {\n $credentials = new \\Google_Auth_AssertionCredentials(\n \\etc\\Config::API_ACCOUNT,\n array(\\Google_Service_Drive::DRIVE_FILE),\n file_get_contents(\\etc\\Config::AUTH_FILE)\n );\n\n $client = new \\Google_Client();\n $client->setAssertionCredentials($credentials);\n if ($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion();\n }\n\n return $client;\n }",
"public function testFactory()\n {\n $factory = new GoogleClientFactory('google_client_id');\n\n Assert::assertInstanceOf(\\Google_Client::class, $factory->getGoogleClient());\n }"
]
| [
"0.73315316",
"0.66591406",
"0.6440379",
"0.6366124",
"0.63013357",
"0.61448824",
"0.60743356",
"0.5943366",
"0.58582425",
"0.5838722",
"0.5783039",
"0.57535803",
"0.5650395",
"0.56285757",
"0.5581099",
"0.5566946",
"0.5533229",
"0.551545",
"0.5483197",
"0.5469842",
"0.54616094",
"0.5372386",
"0.53439325",
"0.5329779",
"0.53079903",
"0.52887326",
"0.5274841",
"0.5265299",
"0.5142884",
"0.5132626"
]
| 0.70348454 | 1 |
=========================================// Update Global Settings for the Website =========================================// | function updateGlobalSetting($data)
{
/***************** Site Information *****************/
$sql = "UPDATE global_config SET field_value = '".$data['global_site_name']."' WHERE field_key='global_site_name' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_meta_title']."' WHERE field_key='global_meta_title' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_meta_keywords']."' WHERE field_key='global_meta_keywords' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_meta_description']."' WHERE field_key='global_meta_description' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_phone_number']."' WHERE field_key='global_phone_number' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_web_admin_headquarters_address']."' WHERE field_key='global_web_admin_headquarters_address' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_web_admin_secondary_address']."' WHERE field_key='global_web_admin_secondary_address' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_paypal_business_email']."' WHERE field_key='global_paypal_business_email' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_paypal_mode']."' WHERE field_key='global_paypal_mode' ";
$recordSet = $this->db->query($sql);
/***************** Social Site Link *****************/
$sql = "UPDATE global_config SET field_value = '".$data['global_facebook_url']."' WHERE field_key='global_facebook_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_twitter_url']."' WHERE field_key='global_twitter_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_youtube_url']."' WHERE field_key='global_youtube_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_googleplus_url']."' WHERE field_key='global_googleplus_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_instagram_url']."' WHERE field_key='global_instagram_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_playstore_url']."' WHERE field_key='global_playstore_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_appstore_url']."' WHERE field_key='global_appstore_url' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_linkdin_url']."' WHERE field_key='global_linkdin_url' ";
$recordSet = $this->db->query($sql);
/***************** Email Information *****************/
$sql = "UPDATE global_config SET field_value = '".$data['global_web_admin_name']."' WHERE field_key='global_web_admin_name' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_webadmin_email']."' WHERE field_key='global_webadmin_email' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".addslashes($data['global_email_signature'])."' WHERE field_key='global_email_signature' ";
$recordSet = $this->db->query($sql);
$sql = "UPDATE global_config SET field_value = '".$data['global_contact_email']."' WHERE field_key='global_contact_email' ";
$recordSet = $this->db->query($sql);
/***************** List Settings *****************/
$sql = "UPDATE global_config SET field_value = '".$data['global_product_page_count']."' WHERE field_key='global_product_page_count' ";
$recordSet = $this->db->query($sql);
/***************** Extra Settings *****************/
$sql = "UPDATE global_config SET field_value = '".$data['global_credit_price']."' WHERE field_key='global_credit_price' ";
$recordSet = $this->db->query($sql);
/************** Map **************/
$sql = "UPDATE global_config SET field_value = '".$data['global_map_url']."' WHERE field_key='global_map_url' ";
$recordSet = $this->db->query($sql);
/*************Address******/
$sql = "UPDATE global_config SET field_value = '".$data['global_address']."' WHERE field_key='global_address' ";
$recordSet = $this->db->query($sql);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _globalSettings(){\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n foreach ($_POST as $name => $value) {\r\n $config = HTMLPurifier_Config::createDefault();\r\n $purifier = new HTMLPurifier($config);\r\n $clean_html = $purifier->purify($value);\r\n }\r\n\r\n $settings = new stdClass();\r\n $settings->website_name = isset($_POST['mrzpn-menu-website-name'])?$_POST['mrzpn-menu-website-name']:'';\r\n $settings->global_script = isset($_POST['mrzpn-menu-global-script'])?$_POST['mrzpn-menu-global-script']:'';\r\n\r\n if(file_put_contents(ROOT.DS.'site'.DS.'content'.DS.'global_settings.json', json_encode($settings))){\r\n $response = 200;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }",
"private function _loadGlobalSettings(){\r\n\r\n $settings = ROOT.DS.'site'.DS.'content'.DS.'global_settings.json';\r\n\r\n if(file_exists($settings)){\r\n $this->globalSettings = json_decode(file_get_contents($settings));\r\n } else {\r\n $globalSettings = new stdClass();\r\n $globalSettings->website_name = '';\r\n $globalSettings->global_script = '';\r\n file_put_contents($settings, json_encode($globalSettings));\r\n }\r\n\r\n }",
"function updateSettingsVersion() {\n\t\t$this->_settings->set('settingsversion', SPOTWEB_SETTINGS_VERSION);\n\t}",
"public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$this->load->model('settings_model', 'sm');\n\t\t\t\n\t\t\tif(count($_POST) > 0)\n\t\t\t{\n\t\t\t\tforeach($_POST as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$settings_data['value'] = $value;\n\t\t\t\t\t$this->sm->update($key, $settings_data);\n\t\t\t\t}\n\t\t\t\t$data['form_submit_message'] = '<div style=\"font-weight:bold;color:#0000FF;\">'.lang('msg_settings_saved') .'</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$settings_raw_data = $this->sm->get_all();\n\t\t\t$settings_data = array();\n\t\t\tforeach($settings_raw_data as $raw_settings)\n\t\t\t\t$settings_data[$raw_settings->name] = $raw_settings->value;\n\t\t\t$data['settings'] = $settings_data;\n\t\t\t$this->load->view('settings-admin', $data);\n\t\t}",
"function update_website_settings()\n\t{\n\t\tif ($this->input->post('system_name'))\n\t\t{\n\t\t\t$data1['content']\t\t\t=\t$this->input->post('system_name');\n\n\t\t\t$this->db->where('name', 'system_name');\n\t\t\t$this->db->update('setting', $data1);\n\t\t}\n\n\t\tif ($this->input->post('currency'))\n\t\t{\n\t\t\t$data2['content']\t\t\t=\t$this->input->post('currency');\n\n\t\t\t$this->db->where('name', 'currency');\n\t\t\t$this->db->update('setting', $data2);\n\t\t}\n\n\t\tif ($this->input->post('tagline'))\n\t\t{\n\t\t\t$data3['content']\t\t\t=\t$this->input->post('tagline');\n\n\t\t\t$this->db->where('name', 'tagline');\n\t\t\t$this->db->update('setting', $data3);\n\t\t}\n\n\t\tif ($this->input->post('timezone'))\n\t\t{\n\t\t\t$data4['content']\t\t\t=\t$this->input->post('timezone');\n\n\t\t\t$this->db->where('name', 'timezone');\n\t\t\t$this->db->update('setting', $data4);\n\t\t}\n\n\t\tif ($this->input->post('address_line_1') && $this->input->post('address_line_2'))\n\t\t{\n\t\t\t$data6['content']\t\t\t=\t$this->input->post('address_line_1') . '<br>' . $this->input->post('address_line_2');\n\n\t\t\t$this->db->where('name', 'address');\n\t\t\t$this->db->update('setting', $data6);\n\t\t}\n\n\t\t$this->session->set_flashdata('success', 'Website settings has been updated successfully.');\n\n\t\tredirect(base_url() . 'website_settings', 'refresh');\n\t}",
"function core_auto_updates_settings()\n {\n }",
"protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }",
"private static function initSettings()\n\t{\n\t\tif (!is_admin()) return;\n\t\tif (get_option('foomo_addthis_config', '') == '') update_option('foomo_addthis_config', '{\"data_track_clickback\":true}');\n\t}",
"private function load_site_settings() {\n\t\t\n\t\t$this->helper->load_editor_settings();\n\t\t$this->settings = array_merge($this->settings,$this->EE->session->cache['eeck']['eeck_settings']);\n\t}",
"function refreshSettings() {\n\tglobal $settings;\n\n\t$settings = json_decode(file_get_contents('settings.json'), true);\n}",
"static function update_site_settings($fields)\n {\n global $dbhost, $dbuser, $dbpass, $dbname, $title, $googleTrackingID, \n $copyright;\n \n \n // check the fields\n $numFields = 0;\n if (isset($fields['host'])) {\n $numFields++;\n $newDBHost = $fields['host'];\n } else {\n $newDBHost = $dbhost;\n }\n if (isset($fields['db'])) {\n $numFields++;\n $newDBName = $fields['db'];\n } else {\n $newDBName = $dbname;\n }\n if (isset($fields['dbuser'])) {\n $numFields++;\n $newDBUser = $fields['dbuser'];\n } else {\n $newDBUser = $dbuser;\n }\n if (isset($fields['password'])) {\n $numFields++;\n $newDBPass = $fields['password'];\n } else {\n $newDBPass = $dbpass;\n }\n if (isset($fields['site-name'])) {\n $numFields++;\n $newTitle = $fields['site-name'];\n } else {\n $newTitle = $title;\n }\n if (isset($fields['google'])) {\n $numFields++;\n $newGoogle = $fields['google'];\n } else {\n $newGoogle = $googleTrackingID;\n }\n if (isset($fields['copyright'])) {\n $numFields++;\n $newCopyright= $fields['copyright'];\n } else {\n $newCopyright = $copyright;\n }\n \n // check to see if there were too many fields\n if ($numFields !== count($fields)) {\n return 'ERROR: Too many fields given.';\n } else if ($numFields === 0) {\n // nothing to update\n return null;\n }\n \n // cleanup the old file\n if (file_exists(dirname(__FILE__).'/../../inc/config.inc.php')) {\n unlink(dirname(__FILE__).'/../../inc/config.inc.php');\n }\n // we can now run the update\n if ($error = config::create_config_inc(\n $newDBHost, $newDBUser, $newDBPass, $newDBName, $newTitle, \n $newGoogle, $newCopyright\n )) {\n return $error;\n } else {\n // no error\n return null;\n }\n }",
"public function universal()\n {\n if (!get_permission('global_settings', 'is_view')) {\n access_denied();\n }\n\n if ($_POST) {\n if (!get_permission('global_settings', 'is_edit')) {\n access_denied();\n }\n }\n\n $config = array();\n if ($this->input->post('submit') == 'setting') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n if (empty($config['reg_prefix'])) {\n $config['reg_prefix'] = false;\n }\n $this->db->where('id', 1);\n $this->db->update('global_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'theme') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n $this->db->where('id', 1);\n $this->db->update('theme_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 2);\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'logo') {\n move_uploaded_file($_FILES['logo_file']['tmp_name'], 'uploads/app_image/logo.png');\n move_uploaded_file($_FILES['text_logo']['tmp_name'], 'uploads/app_image/logo-small.png');\n move_uploaded_file($_FILES['print_file']['tmp_name'], 'uploads/app_image/printing-logo.png');\n move_uploaded_file($_FILES['report_card']['tmp_name'], 'uploads/app_image/report-card-logo.png');\n\n move_uploaded_file($_FILES['slider_1']['tmp_name'], 'uploads/login_image/slider_1.jpg');\n move_uploaded_file($_FILES['slider_2']['tmp_name'], 'uploads/login_image/slider_2.jpg');\n move_uploaded_file($_FILES['slider_3']['tmp_name'], 'uploads/login_image/slider_3.jpg');\n\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 3);\n redirect(current_url());\n }\n\n $this->data['title'] = translate('global_settings');\n $this->data['sub_page'] = 'settings/universal';\n $this->data['main_menu'] = 'settings';\n $this->data['headerelements'] = array(\n 'css' => array(\n 'vendor/dropify/css/dropify.min.css',\n ),\n 'js' => array(\n 'vendor/dropify/js/dropify.min.js',\n ),\n );\n $this->load->view('layout/index', $this->data);\n }",
"public function updateBasicSettings()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$this->initBasicSettingsForm();\n\n\t\tif ($this->form->checkInput())\n\t\t{\n\t\t\tif (ilUtil::isWindows())\n\t\t\t{\n\t\t\t\t$fs = array(\"datadir_path\", \"log_path\", \"convert_path\", \"zip_path\",\n\t\t\t\t\t\"unzip_path\", \"ghostscript_path\", \"java_path\", \"htmldoc_path\", \"ffmpeg_path\");\n\t\t\t\tforeach ($fs as $f)\n\t\t\t\t{\n\t\t\t\t\t$_POST[$f] = str_replace(\"\\\\\", \"/\", $_POST[$f]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$this->setup->checkLogSetup($_POST))\n\t\t\t{\n\t\t\t\t$i = $this->form->getItemByPostVar(\"log_path\");\n\t\t\t\t$i->setAlert($this->lng->txt($this->setup->getError()));\n\t\t\t\tilUtil::sendFailure($this->lng->txt(\"form_input_not_valid\"),true);\n\t\t\t}\n\t\t\telse if (!$this->setup->updateMasterSettings($_POST))\n\t\t\t{\n\t\t\t\tilUtil::sendFailure($this->lng->txt($this->setup->getError()),true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendSuccess($this->lng->txt(\"settings_saved\"),true);\n\t\t\t\tilUtil::redirect(\"setup.php?cmd=mastersettings\");\n\t\t\t}\n\t\t}\n\n\t\t$this->form->setValuesByPost();\n\t\t$this->changeMasterSettings(true);\n\t}",
"public static function general_settings() {\n\t\t$msg = '';\n\t\tif (!empty($_POST) && isset($_POST['save-settings'])) {\n\t\t\t$msg = self::save();\n\t\t}\n\t\t$page_id = get_option('dod_page_id');\n\t\t$args['page_id'] = $page_id;\n\t\t$query = new WP_Query($args);\n\t\t$page = $query->posts[0];\n\t\t$custom_css = array_shift(get_post_meta($page_id, 'dod_custom_css'));\n\t\t$selected_template = array_shift(get_post_meta($page_id, '_wp_page_template'));\n\t\t$templates = get_page_templates();\n\t\tinclude 'views/_geneal_settings.php';\n\t}",
"private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}",
"function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"function wp_settings_update_func($settings) {\r\n\r\n switch ( $settings['key'] ) {\r\n\r\n case 'general':\r\n update_option( 'wpc_graphic', $settings['graphic'] );\r\n update_option( 'wpc_create_client', $settings['create_client'] );\r\n\r\n $current_settings = get_option( 'wpc_settings' );\r\n if ( !is_array( $current_settings ) )\r\n $current_settings = array();\r\n\r\n $settings['wpc_settings'] = array_merge( $current_settings, $settings['wpc_settings'] );\r\n //update settings value\r\n update_option( 'wpc_settings', $settings['wpc_settings'] );\r\n\r\n break;\r\n\r\n case 'business_info':\r\n $current_settings = get_option( 'wpc_business_info' );\r\n if ( !is_array( $current_settings ) )\r\n $current_settings = array();\r\n\r\n $settings['wpc_business_info'] = array_merge( $current_settings, $settings['wpc_business_info'] );\r\n //update settings value\r\n update_option( 'wpc_business_info', $settings['wpc_business_info'] );\r\n\r\n break;\r\n\r\n case 'skins':\r\n if ( $settings['theme'] )\r\n update_option( 'wpclients_theme', $settings['theme'] );\r\n break;\r\n\r\n case 'login_alerts':\r\n //login alerts notifications\r\n if ( isset( $settings['login_alerts'] ) ) {\r\n if( !isset( $settings['login_alerts']['successful'] ) && '1' != $settings['login_alerts']['successful'] )\r\n $settings['login_alerts']['successful'] = 0;\r\n if( !isset( $settings['login_alerts']['failed'] ) && '1' != $settings['login_alerts']['failed'] )\r\n $settings['login_alerts']['failed'] = 0;\r\n\r\n update_option( 'wpc_login_alerts', $settings['login_alerts'] );\r\n }\r\n break;\r\n }\r\n }",
"private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }",
"public function settings_updated() {\n\t\tglobal $pagenow;\n\t\t$on_options_page = ($pagenow == 'options-general.php');\n\t\t$on_plugins_page = (isset($_GET['page']) && $_GET['page'] == $this->menu_page);\n\t\t$just_updated = (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true');\n\n\t\tif($on_options_page && $on_plugins_page && $just_updated) {\n\t\t\tdo_action('chaos-settings-updated');\n\t\t}\n\t}",
"function loadSettings() {\n\tsetupSiteURLs();\n}",
"public function action_general_settings()\n\t{\n\t\tglobal $context, $scripturl, $txt;\n\n\t\t$context['SPortal']['themes'] = sp_general_load_themes();\n\n\t\t// These are very likely to come in handy! (i.e. without them we're doomed!)\n\t\trequire_once(ADMINDIR . '/ManagePermissions.controller.php');\n\t\trequire_once(ADMINDIR . '/ManageServer.controller.php');\n\t\trequire_once(SUBSDIR . '/SettingsForm.class.php');\n\n\t\t// Initialize the form\n\t\t$this->_initGeneralSettingsForm();\n\n\t\tif (isset($_GET['save']))\n\t\t{\n\t\t\tcheckSession();\n\n\t\t\tif (!empty($_POST['sp_portal_mode']))\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'PortalMain_Controller'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupdateSettings(array('front_page' => 'MessageIndex_Controller'));\n\t\t\t}\n\n\t\t\t$this->_generalSettingsForm->setConfigValues($_POST);\n\t\t\t$this->_generalSettingsForm->save();\n\t\t\tredirectexit('action=admin;area=portalconfig;sa=generalsettings');\n\t\t}\n\n\t\t$context['post_url'] = $scripturl . '?action=admin;area=portalconfig;sa=generalsettings;save';\n\t\t$context['settings_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['page_title'] = $txt['sp-adminGeneralSettingsName'];\n\t\t$context['sub_template'] = 'show_settings';\n\n\t\t$this->_generalSettingsForm->prepare();\n\t}",
"function display_global_settings()\n {\n $settings = array_merge($this->settings, $_POST);\n \n $site_url = rtrim($this->EE->config->item('site_url'), '/');\n $third_party_path_array = explode('/', trim(PATH_THIRD, '/'));\n $uri_segments_array = array();\n $uri_segments_array = array_slice($third_party_path_array, -3);\n //print_r($uri_segments_array);\n $third_party_uri = implode('/', $uri_segments_array);\n // Styles\n $this->EE->cp->add_to_head('<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$site_url.'/'.$third_party_uri.'/page_type_switcher/styles/display_global_settings.css\" />');\n \n $this->EE->lang->loadfile('page_type_switcher');\n \n //print_r($this->settings);\n \n // Get custom field info \n $query_field_info = $this->_get_field_info();\n $query_field_info_num_rows = $query_field_info->num_rows();\n //echo '$query_field_info_num_rows: ['.$query_field_info_num_rows.']<br><br>'.PHP_EOL;\n $query_field_info_result = $query_field_info->result_array();\n //print_r($query_field_info_result);\n \n // Find page type switcher's ftype_id\n $sql_ftype_id = \"SELECT fieldtype_id \n FROM exp_fieldtypes \n WHERE name = 'page_type_switcher'\n LIMIT 1\";\n $query_ftype_id = $this->EE->db->query($sql_ftype_id);\n if ($query_ftype_id->num_rows() == 1)\n {\n $ftype_id = $query_ftype_id->row('fieldtype_id');\n //echo '$ftype_id: ['.$ftype_id.']<br><br>'.PHP_EOL;\n }\n \n // Create fieldtype's site settings form\n $r = '';\n $r .= '<table class=\"mainTable padTable\" cellspacing=\"0\" cellpaddind=\"0\" border=\"0\">'.PHP_EOL;\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= $this->EE->lang->line('page_types_max_num');\n $r .= '</td>'.PHP_EOL;\n $r .= '<td>'.PHP_EOL;\n $r .= '<input type=\"text\" name=\"page_types_max_num\" value=\"'.$this->settings['page_types_max_num'].'\" style=\"width: 90%;\" />';\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n \n if ($query_field_info_num_rows == 0)\n {\n $r .= '<script type=\"text/javascript\">alert(\"'.$this->EE->lang->line('no_page_type_switchers_in_field_groups_allert').'\");</script>'.PHP_EOL;\n }\n\n for ($i = 0; $i < $query_field_info_num_rows; $i++)\n {\n if ($i == 0 OR $query_field_info_result[$i]['group_id'] != $query_field_info_result[$i - 1]['group_id'])\n {\n $r .= '<tr class=\"header\">'.PHP_EOL;\n $r .= '<th colspan=\"2\">';\n $r .= $query_field_info_result[$i]['group_name'];\n $r .= '</th>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n \n for ($j = 1; $j <= $this->settings['page_types_max_num']; $j++)\n {\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= str_replace('{number}', $j, $this->EE->lang->line('page_type_number_name'));\n $r .= '</td>'.PHP_EOL;\n $r .= '<td>'.PHP_EOL;\n $value = '';\n if (isset($this->settings['field_group'][$query_field_info_result[$i]['group_id']]['page_type_'.$j.'_name']))\n {\n $value = $this->settings['field_group'][$query_field_info_result[$i]['group_id']]['page_type_'.$j.'_name'];\n }\n $r .= '<input type=\"text\" name=\"'.'field_group['.$query_field_info_result[$i]['group_id'].'][page_type_'.$j.'_name]'.'\" value=\"'.$value.'\" style=\"width: 90%;\">'; \n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n }\n \n // Display all fields except page type switcher\n if ($query_field_info_result[$i]['field_type'] != 'page_type_switcher')\n {\n $r .= '<tr>'.PHP_EOL;\n $r .= '<td width=\"30%\">'.PHP_EOL;\n $r .= $query_field_info_result[$i]['field_label'];\n $r .= '</td>'.PHP_EOL;\n $r .= '<td style=\"white-space: pre\">'.PHP_EOL;\n for ($j = 1; $j <= $this->settings['page_types_max_num']; $j++)\n {\n $checked = '';\n if (isset($this->settings['page_types_field_id'][$query_field_info_result[$i]['field_id']]['page_type_'.$j]) AND $this->settings['page_types_field_id'][$query_field_info_result[$i]['field_id']]['page_type_'.$j] == 'y')\n {\n $checked = 'checked=\"checked\"';\n }\n $r .= str_replace('{number}', $j, $this->EE->lang->line('page_type_number_checkbox')).NBS.NBS.'<input type=\"checkbox\" name=\"'.'page_types_field_id['.$query_field_info_result[$i]['field_id'].'][page_type_'.$j.']'.'\" value=\"y\" '.$checked.'>'.NBS.NBS.NBS.NBS;\n \n }\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n }\n $r .= '</table>'.PHP_EOL;\n\n return $r;\n \n }",
"public function reload_settings()\r\n\t{\r\n\t\t$this->clear_cache();\r\n\t\t$this->load_settings();\r\n\t}",
"function settings()\n\t{\n\t\tif($this->session->userdata('admin_login') != 1)redirect(base_url() , 'refresh');\n\t\t\n\t\tif($_POST)\n\t\t{\n\t\t\t$data['institute_name']\t\t=\t$this->input->post('institute_name');\n\t\t\t$data['address']\t\t\t=\t$this->input->post('address');\n\t\t\t$data['phone_number']\t\t=\t$this->input->post('phone_number');\n\t\t\t$data['page_title']\t\t\t=\t$this->input->post('page_title');\n\t\t\t$data['page_meta_tag']\t\t=\t$this->input->post('page_meta_tag');\n\t\t\t\n\t\t\t$this->db->update('settings' , $data);\n\t\t\tmove_uploaded_file($_FILES['userfile']['tmp_name'], 'uploads/logo.png');\n\t\t\t$this->session->set_flashdata('settings_message', 'Settings Updated');\n\t\t\tredirect(base_url().'index.php/admin/settings/' , 'refresh');\t\t\t\n\t\t}\n\t\t$page_data['page_info']\t=\t'System settings';\n\t\t$page_data['page_name']\t=\t'admin/settings';\n\t\t$page_data['page_title']=\t'Manage system settings';\n\t\t$this->load->view('index' , $page_data);\n\t}",
"public function update_settings($data) {\n\n\t\tif(function_exists('update_option')) { \n\t\t\t$data = array_merge($this->settings, (array)$data); \n\t\t\tupdate_option('wpu-settings', $data);\n\t\t\t$this->settings = $data;\n\t\t}\n\t}",
"public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }",
"public function reloadSettings () \n {\n \t// get the current settings from the database\n \t$this->settings = $this->qdb_object->getSettingsAll();\n \t// perform error checking\n \tif (isset ($this->settings['ERRORS']) && ($this->settings['ERRORS'] != ''))\n \t{\n \t\t// fatal error as we need these settings for everything else to work\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_SETTINGS, \"Error reloading settings \".$this->settings['ERRORS']);\n \t}\n \t\n }",
"public function refresh_plugin_settings() {\n self::$instance->plugin_settings = self::$instance->get_plugin_settings();\n }",
"function app_settings()\n\t{\n\t\t\t\t\n\t$this->data['message'] \t= ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message'));\n\t\tif ($this->input->post()) \n\t\t{\n\t\t\t$this->check_isdemo(URL_SITE_SETTINGS);\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'site_title', \n\t\t\t$this->phrases['site title'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'sitename', \n\t\t\t$this->phrases['site name'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'address', \n\t\t\t$this->phrases['address'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'city', \n\t\t\t$this->phrases['city'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'state', \n\t\t\t$this->phrases['state'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'country', \n\t\t\t$this->phrases['country'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'latitude', \n\t\t\t$this->phrases['latitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'longitude', \n\t\t\t$this->phrases['longitude'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'zip', \n\t\t\t$this->phrases['zip code'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'phone', \n\t\t\t$this->phrases['phone'], \n\t\t\t'required|min_length[10])|max_length[11]');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'portal_email', \n\t\t\t$this->phrases['contact email'], \n\t\t\t'required|valid_email');\n\t\t\t\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'language_id', \n\t\t\t$this->phrases['select language'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'design_by', \n\t\t\t$this->phrases['design by'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'rights_reserved_content', \n\t\t\t$this->phrases['rights reserved'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'ios_url', \n\t\t\t$this->phrases['ios url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'android_url', \n\t\t\t$this->phrases['android url'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'from_time', \n\t\t\t$this->phrases['from time'], \n\t\t\t'required');\n\t\t\t$this->form_validation->set_rules(\n\t\t\t'to_time', \n\t\t\t$this->phrases['to time'], \n\t\t\t'required');\n\t\t\t\n\t\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t\t\n\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t$ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);\n\t\t\t\t\n\t\t\t\tif (($ext != \"gif\") && ($ext != \"jpg\") && ($ext != \"png\") && ($ext != \"jpeg\")) {\n\t\t\t\t\t$msg = (isset($this->phrases['invalid file'])) ? $this->phrases['invalid file'] : \"Invalid File\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this->form_validation->run() \t== TRUE\t) {\n\t\t\t\t\n\t\t\t\t$inputdata['site_title'] \t\t= $this->input->post('site_title');\n\t\t\t\t$inputdata['site_name'] \t\t= $this->input->post('sitename');\n\t\t\t\t$inputdata['address'] \t\t\t= $this->input->post('address');\n\t\t\t\t$inputdata['city'] \t\t\t\t= $this->input->post('city');\n\t\t\t\t$inputdata['state'] \t\t\t= $this->input->post('state');\n\t\t\t\t$inputdata['country'] \t\t\t= $this->input->post('country');\n\t\t\t\t$inputdata['longitude'] \t\t= $this->input->post('longitude');\n\t\t\t\t$inputdata['latitude'] \t\t\t= $this->input->post('latitude');\n\t\t\t\t$inputdata['zip'] \t\t\t\t= $this->input->post('zip');\n\t\t\t\t$inputdata['phone'] \t\t\t= $this->input->post('phone');\n\t\t\t\t$inputdata['from_time'] \t\t= $this->input->post('from_time');\n\t\t\t\t$inputdata['to_time'] \t\t\t= $this->input->post('to_time');\n\t\t\t\t$inputdata['land_line'] \t\t= $this->input->post('land_line');\n\t\t\t\t$inputdata['fax'] \t\t\t\t= $this->input->post('fax');\n\t\t\t\t$inputdata['portal_email'] \t\t= $this->input->post('portal_email');\n\t\t\t\t$inputdata['language_id'] \t\t= $this->input->post('language_id');\n\t\t\t\t$inputdata['currency'] \t\t\t= $this->input->post('currency');\n\t\t\t\t$inputdata['currency_symbol'] \t= $this->input->post('currency_symbol');\n\t\t\t\t$inputdata['country_code'] \t\t= $this->input->post('country_code');\n\t\t\t\t$inputdata['ios_url'] \t\t\t= $this->input->post('ios_url');\n\t\t\t\t$inputdata['android_url'] \t\t= $this->input->post('android_url');\n\t\t\t\t$inputdata['design_by'] \t\t= $this->input->post('design_by');\n\t\t\t\t$inputdata['rights_reserved_content'] = $this->input->post(\n\t\t\t\t'rights_reserved_content');\n\t\t\t\t\t\t\t\n\t\t\t\t$inputdata['facebook_api'] \t\t= $this->input->post('facebook_api');\n\t\t\t\t$inputdata['google_api'] \t\t= $this->input->post('google_api');\n\t\t\t\t\n\t\t\t\t$sms_notifications = 'No';\n\t\t\t\tif($this->input->post('sms_notifications')=='on'){\n\t\t\t\t\t$sms_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['sms_notifications'] \t\t= $sms_notifications;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$push_notifications = 'No';\n\t\t\t\tif($this->input->post('fcm_push_notifications')=='on'){\n\t\t\t\t\t$push_notifications = 'Yes';\t\n\t\t\t\t}\n\t\t\t\t$inputdata['fcm_push_notifications'] \t\t= $push_notifications;\n\t\t\t\t\n\t\t\t\t$where['id'] \t\t\t\t\t= $this->input->post('update_record_id');\n\t\t\t\t\n\t\t\t\tif ($this->base_model->update_operation(\n\t\t\t\t$inputdata, TBL_SITE_SETTINGS, $where)) \n\t\t\t\t{\n\t\t\t\t\tif (!empty($_FILES['userfile']['name'])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$config['upload_path'] \t = IMG_SITE_LOGO;\n\t\t\t\t\t\t$config['allowed_types'] = ALLOWED_TYPES;\n\t\t\t\t\t\t$config['overwrite'] = TRUE;\n\t\t\t\t\t\t$config['file_name'] \t = 'site_logo.'. $ext;\n\t\t\t\t\t\t$this->load->library('upload', $config);\n\t\t\t\t\t\t$this->upload->initialize($config);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (!$this->upload->do_upload()) {\n\t\t\t\t\t\t\t$this->prepare_flashmessage(\n\t\t\t\t\t\t\t$this->upload->display_errors() , 1);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$input1['site_logo']= 'site_logo.'. $ext;\n\t\t\t\t\t\t\t$this->base_model->update_operation(\n\t\t\t\t\t\t\t$input1, TBL_SITE_SETTINGS, $where);\n\t\t\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg = (isset($this->phrases['updated successfully'])) ? $this->phrases['updated successfully'] : \"Updated Successfully\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 0);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$msg = (isset($this->phrases['unable to update'])) ? $this->phrases['unable to update'] : \"Unable to update\";\n\t\t\t\t\t$this->prepare_flashmessage($msg, 1);\n\t\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->prepare_flashmessage(validation_errors(),1);\n\t\t\t\tredirect(URL_SITE_SETTINGS,REFRESH);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$site_settings \t= $this->base_model->fetch_records_from(TBL_SITE_SETTINGS);\n\t\tif (count($site_settings) > 0) \n\t\t\t$this->data['site_settings'] \t\t= $site_settings[0];\n\t\telse \n\t\t\t$this->data['site_settings'] \t\t= array();\n\t\t\n\t\t// LANGUAGE OPTIONS\n\t\t$lang_options \t\t\t\t\t\t\t= array('' => $this->phrases['select language']);\n\t\t$languages \t\t\t\t\t\t\t\t= $this->base_model->fetch_records_from(TBL_LANGUAGES,array('status'=>'Active'));\n\t\tforeach($languages as $row):\n\t\t\t$lang_options[$row->id] \t\t\t= ucfirst($row->lang_name);\n\t\tendforeach;\n\t\t\n\t\t// CURRENCY OPTIONS\n\t\t\n\t\t$currency_options = array(''=>$this->phrases['select currency']);\n\t\t\n\t\t$currencies = $this->base_model->fetch_records_from(TBL_CURRENCY);\n\t\tforeach($currencies as $row):\n\t\t\t$currency_options[$row->currency_code_alpha] = ucfirst($row->currency_name);\n\t\tendforeach;\n\t\t\n\t\t//echo \"<pre>\";\n\t\t//print_r($this->data['site_settings']); die();\n\t\t$this->data['lang_options'] \t\t\t= $lang_options;\n\t\t$this->data['currency_options'] \t\t= $currency_options;\n\t\t$this->data['active_class'] \t\t\t= ACTIVE_MASTER_SETTINGS;\n\t\t$this->data['title'] \t\t\t\t\t= (isset($this->phrases['app settings'])) ? $this->phrases['app settings'] : \"App Settings\";\n\t\t$this->data['content'] \t\t\t\t\t= 'site_settings';\n\t\t$this->_render_page(TEMPLATE_ADMIN, $this->data);\n\t}"
]
| [
"0.6982467",
"0.6941399",
"0.6809662",
"0.67559063",
"0.675352",
"0.6729664",
"0.6728484",
"0.66959417",
"0.66457",
"0.65518856",
"0.6534953",
"0.65133804",
"0.648226",
"0.6457731",
"0.6423322",
"0.6412272",
"0.6384528",
"0.6384496",
"0.63705105",
"0.63597554",
"0.6358881",
"0.6343471",
"0.62790436",
"0.62745047",
"0.6251274",
"0.62461317",
"0.6234984",
"0.622231",
"0.62117875",
"0.62066424"
]
| 0.7335166 | 0 |
/ Gets procecesses from done array that are actually in calculation equasion | private function get_needed_done_processes( $data ){
$done = array();
$done_needed = $this->calc->get_total()['total_cost_equasion'];
foreach ($data as $key => $value) {
if (
array_key_exists( $value->total['name'], $done_needed )
|| ( $value->total['name'] == 'pa_multi_quantity' || $value->total['name'] == 'pa_master_multi_quantity' )
) {
$done[] = $value;
}
}
return $done;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_procs_array();",
"private function getProgressForDQCombinations()\n {\n /* Get basic progress statistics (no multiple assessments considered yet) */\n // different DQCombinations\n $total_assessments = $this->dq_repo->findTotalAssessments();\n // number of different DQCombinations\n $total_assessments = (float)$total_assessments[0]['total_assessments'];\n // DQCombinations with at least 1 assessment\n $finished_assessments = $this->dq_repo->findFinishedAssessments();\n // number of DQCombinations with at least 1 assessment\n $finished_assessments = (float)$finished_assessments[0]['finished_assessments'];\n // calculate proportion\n $total_assessments > 0\n ? $assessment_prop = round(($finished_assessments / $total_assessments) * 100, 1)\n : $assessment_prop = 0;\n\n return array('total' => $total_assessments, 'finished' => $finished_assessments, 'proportion' => $assessment_prop);\n }",
"public function process() : array\n {\n $results = [];\n\n foreach ($this->queue as [$task, $after, $context]) {\n $result = $task();\n\n if ($after) {\n $after($result, $context);\n }\n\n $results[] = $result;\n }\n\n $this->queue = [];\n\n return $results;\n }",
"public function getProcessedElements(): array;",
"protected function calculateExecutionTime(): array\n\t{\n\t\t$totalTime = microtime(true) - $this->application->getStartTime();\n\n\t\t$executionTime = ['total' => $totalTime, 'details' => []];\n\n\t\t$otherTime = 0;\n\n\t\tforeach($this->timers as $timer)\n\t\t{\n\t\t\t$otherTime += $timer instanceof Closure ? $timer() : $timer;\n\t\t}\n\n\t\t$detailedTime = $totalTime - $otherTime;\n\n\t\t$executionTime['details']['PHP'] = ['time' => $detailedTime, 'pct' => ($detailedTime / $totalTime * 100)];\n\n\t\tforeach($this->timers as $timer => $time)\n\t\t{\n\t\t\tif($time instanceof Closure)\n\t\t\t{\n\t\t\t\t$time = $time();\n\t\t\t}\n\n\t\t\t$executionTime['details'][$timer] = ['time' => $time, 'pct' => ($time / $totalTime * 100)];\n\t\t}\n\n\t\treturn $executionTime;\n\t}",
"public function get_procs_array(){\n return array();\n }",
"function poequation($pocount)\n{\n//\t\t $totalrmpoqty4, $totalrmpoqty5, $totalrmpoqty6, $totalrmpoqty7, \n//\t\t $totalrmpoqty8, $totalrmpoqty9, $totalrmpoqty10, $totalrmpoqty11,\n//\t $totalrmpoqty12, $reqfrompo;\n GLOBAL $poarray, $qtyreq, $fg, $grn, $reqfrompo, $totalrmpoqtycomp,$totalrmpoqtyeqn;\n\t$totalrmpoqtycomp = 0;\n\t$totalrmpoqtyeqn = \"\";\n\t$usedfrompo = 0;\n\tfor ($i = 0; $i < $pocount; $i++)\n\t{\n\t\t $index = $pocount -1;\n\t\t\t\n\t\t\tif ($poarray[$i] == '' || $poarray[$i] == 0)\n\t\t {\n\t\t\t\t$poarray[$i] = 0;\n\t\t }\n else\n\t\t\t{\n\t $totalrmpoqtycomp = $totalrmpoqtycomp + $poarray[$i];\n\t\t\t\t //echo \"<br>totalpo till now is $totalrmpoqtycomp\";\n\t\t\t\t $reqfrompo = $qtyreq-($fg+$grn)-$usedfrompo;\n\t\t\t\t //echo \"<br>reqfrom po for $i is $reqfrompo\";\n\t\t\t\t if ($reqfrompo > $poarray[$i])\n\t\t\t\t {\n\t\t\t \t $usedfrompo = $poarray[$i];\n\t\t\t\t\t $poarray[$i] = 0;\n\t\t\t\t\t $totalrmpoqtyeqn .= \"+ $usedfrompo\" . \"po{$i}\";\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t \t $usedfrompo = $reqfrompo;\n\t\t\t\t\t $poarray[$i] = $poarray[$i] - $reqfrompo;\n\t\t\t\t\t $totalrmpoqtyeqn .= \"+ $usedfrompo\" . \"po{$i}\";\n\t\t\t\t }\n\t\t\t \n\t\t\t\t //echo \"<br>reqfrom po for $i is $reqfrompo\";\n\t\t\t\t //echo \"<br>In function value of poarray for $i is $poarray[$i]\";\n\t\t\t\t //var_dump($poarray);\n\t }\n //$poarray[$index] = 0;\n\t}\n\t$reqfrompo = $qtyreq-($fg+$grn+$totalrmpoqtycomp);\n\t//echo \"<br>In function value of reqfrom po is $reqfrompo and pocount is $pocount\";\n\t//echo \"<br>In function value of poarray for $index is $poarray[$index]\";\n\n}",
"public function getTotalCanceled();",
"function interceptions() {\n\t\t$interceptions_calc = $this->_interceptions/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\t$interceptions_calc *= 25;\n\t\tif (2.375 - $interceptions_calc < 0) {\n\t\t\t$interceptions_calc = 0;\n\t\t} else {\n\t\t\t$interceptions_calc = 2.375 - $interceptions_calc;\n\t\t}\n\t\treturn $interceptions_calc;\n\t}",
"public function getAllFinished(): array;",
"public function compute()\n\t{\n\t\t$quotas = [];\n\t\t$lst = $this->getProxies();\n\t\t\n\n\t\t// create an associative array (name => quota%)\n\t\tforeach ( $lst as $l )\n\t\t\t$quotas[$l->name] = $l->computeQuota();\n\t\t\n\t\t\n\t\t// cleaning stuff (removing data before midnight today)\n\t\t$this->qi->clean(strtotime('today'));\n\t\t\n\t\treturn (object)$quotas;\n\t}",
"private function setResult() {\n $result = 0;\n foreach ($this->process AS $key => $value) {\n $total = $value['pivot'] * $value['adj']['result'];\n if($key == 0) {\n $result = $result + $total;\n }\n elseif($key == 1) {\n $result = $result - $total;\n }\n else {\n if($key % 2 == 0) {\n $result = $result + $total;\n }\n else {\n $result = $result - $total;\n }\n }\n }\n unset($key, $value, $total);\n return $result;\n }",
"public function processMeasurements()\n {\n $log = $this->logger();\n $c = $this->cache();\n $results = [\n 'success' => 0,\n 'errors' => 0\n ];\n $log->debug(\"Processesing Cached Measurements\");\n $done = false;\n do {\n\n $log->debug(\" ------------------- Next Cached Item --------------------\");\n $items = $c->llen($this->rkey);\n $log->debug(\"Items left on the \" . $this->rkey . \" list: \" . $items);\n if ($items == 0) {\n break;\n }\n\n $retval = $c->lpop($this->rkey);\n if ($retval) {\n $log->debug(\"Got measurement data: \" . $retval);\n $blockstr = $retval;\n $block = explode('|', $blockstr);\n $ok = $this->parseMeasurement($block);\n if (!$ok) {\n $log->error(\"Failed to parse: \" . $block); \n $results['errors']++;\n } else {\n $results['success']++;\n }\n } else {\n $done = true;\n }\n \n } while ( ! $done );\n return $results;\n }",
"private function parse_total(){\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$product_constructor_name = '\\gcalc\\db\\product\\\\' . str_replace( '-', '_', $this->get_slug() );\n\t\t$product_constructor_exists = class_exists( $product_constructor_name );\n\t\t$product_constructor_cost_equasion_exists = $product_constructor_exists ? method_exists( $product_constructor_name, 'get_calc_data' ) : false;\n\n\n\n\t\t/*\n\t\tEquasion can be stored in product constructor or formats array.\n\t\tFormats array is a temporary means to keep data so product constructor is a preferred way\n\t\t */\n\t\t$total_cost_equasion = \n\t\t\t$product_constructor_cost_equasion_exists ? \n\t\t\t\t$product_constructor_name::get_calc_data( )\n\t\t\t\t: $production_formats->get_total_cost_equasion( $this->get_product_id() );\n\n\t\t$total_cost_equasion_string = $total_cost_equasion['equasion'];\n\n\t\t$total_cost_equasion = $total_cost_equasion_string;\n\t\t$total_pcost_equasion = $total_cost_equasion_string;\n\n\t\t\n\t\t/**\n\t\t * Keeps selling prices of used processes\n\t\t * @var array\n\t\t */\n\t\t$total_cost_array = array();\n\t\t/**\n\t\t * Keeps production costs of used processes\n\t\t * @var array\n\t\t */\n\t\t$total_pcost_array = array();\n\t\t/**\n\t\t * Keeps markups of used proceses\n\t\t * @var array\n\t\t */\n\t\t$total_markup_array = array();\n\t\t/**\n\t\t * All used in calculation formats\n\t\t * @var array\n\t\t */\n\t\t$used_formats_array = array();\n\t\t/**\n\t\t * All used in calculation media\t\t \n\t\t * @var array\n\t\t */\n\t\t$used_media_array = array();\n\n\t\t//checking credentials for data filter\t\t\n\t\t$credetials = $this->login();\n\t\t$al = $credetials['access_level'];\n\n\t\tforeach ($this->done as $key => $value) {\t\n\t\t\tif ( preg_match( '/'.$value->total['name'].'/', $total_cost_equasion_string )) {\n\t\t\t\t$total_cost_equasion = str_replace($value->total['name'], $value->total['total_price'], $total_cost_equasion);\t\t\t\t\t\t\n\t\t\t\t$total_pcost_equasion = str_replace($value->total['name'], $value->total['production_cost'], $total_pcost_equasion);\t\t\n\n\t\t\t\t$total_cost_array[ $value->total['name'] ] = $value->total['total_price'];\n\t\t\t\t$total_pcost_array[ $value->total['name'] ] = $value->total['production_cost'];\n\t\t\t\t$total_markup_array[ $value->total['name'] ] = $value->total['markup'];\n\t\t\t}\t\n\n\t\t\t//used formats total\n\t\t\tif ( preg_match( '/_format/', $value->total['name'] )) {\n\t\t\t\t$production_format_pieces = $value->total['extended']['production_format']['pieces'];\n\t\t\t\t$common_format_name = $value->total['extended']['production_format']['common_format']['name'];\n\t\t\t\t$common_format_width = $value->total['extended']['production_format']['common_format']['width'];\n\t\t\t\t$common_format_height = $value->total['extended']['production_format']['common_format']['height'];\n\n\t\t\t\t$production_format_format = $value->total['extended']['production_format']['format'];\n\t\t\t\t$production_format_width = $value->total['extended']['production_format']['width'];\n\t\t\t\t$production_format_height = $value->total['extended']['production_format']['height'];\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t* Filtering data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\t\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t$format_str = $production_format_pieces .' '. __('slots', 'gcalc') .' '. $common_format_name .'('.$common_format_width.'x'.$common_format_height.')' \n\t\t\t\t\t\t\t.' @ '. $production_format_format.'('.$production_format_width.'x'.$production_format_height.')';\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t$format_str = '';\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$format_str = $common_format_width.'x'.$common_format_height;\n\n\t\t\t\t}\n\n\n\t\t\t\t$used_formats_array[ $value->total['name'] ] = $format_str;\n\t\t\t}\n\t\t\t\n\t\t\t//used papers total\n\t\t\tif ( preg_match( '/_paper/', $value->total['name'] )) {\n\t\t\t\t$sheet_cost = $value->total['extended']['sheet_cost'];\n\t\t\t\t$sheets_quantity = $value->total['extended']['sheets_quantity'];\n\t\t\t\t$paper_price_per_kg = $value->total['extended']['paper']['price_per_kg'];\n\t\t\t\t$paper_label = $value->total['extended']['paper']['label'];\t\t\t\t\n\t\t\t\t$paper_thickness = $value->total['extended']['paper']['thickness'];\n\n\t\t\t\t/*\n\t\t\t\t* Filtering data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t$media_str = $sheets_quantity .' x ' . $paper_label . ' (' . $paper_thickness . 'mm)'\n\t\t\t\t\t\t.' @ ' . $sheet_cost . ' PLN / '. __('sheet','gcalc') .' (' . $paper_price_per_kg . '/kg) ';\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t$media_str = '';\t\n\t\t\t\t\t}\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$media_str = $paper_label;\n\n\t\t\t\t}\n\n\t\t\t\t$used_media_array[ $value->total['name'] ] = $media_str;\n\n\t\t\t}\n\t\t}\n\t\teval('$total_cost_ = ' . $total_cost_equasion . ';');\n\t\teval('$total_pcost_ = ' . $total_pcost_equasion . ';');\n\n\t\t$average_markup = count($total_markup_array) > 0 ? array_sum( $total_markup_array ) / count($total_markup_array) : 1;\n\n\n\n\n\t\t$total_ = array(\n\t\t\t'equasion' => $total_cost_equasion_string,\t\t\t\n\t\t\t'used_formats' => $used_formats_array,\n\t\t\t'used_media' => $used_media_array,\n\n\t\t\t'total_markup' => $total_markup_array,\n\t\t\t'total_cost_equasion' => $total_cost_array,\n\t\t\t'total_pcost_equasion' => $total_pcost_array,\n\t\t\t\n\t\t\t'average_markup' => ( ( $total_cost_ - $total_pcost_ ) / $total_pcost_ ) + 1, \n\t\t\t'total_cost_' => $total_cost_,\n\t\t\t'total_pcost_' => $total_pcost_\n\t\t);\n\n\t\t\t\t/*\n\t\t\t\t* Filtering total data\n\t\t\t\t*/\n\t\t\t\tif ( $al > 0) {\n\t\t\t\t\tif ($al > 5) { // admin, master only\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t} else { // no data for account, inner\n\t\t\t\t\t\t\n\t\t\t\t\t\tunset($total_['used_formats']);\n\t\t\t\t\t\tunset($total_['used_media']);\n\t\t\t\t\t}\n\t\t\t\t} else { // 0 - anonymous\n\t\t\t\t\t$media_str = $paper_label;\n\n\t\t\t\t}\n\n\n\t\t$total_ = $this->merge_children_totals( $total_ );\n\t\t$this->total_ = $total_;\n\n\t}",
"public function getRetVals()\n {\n }",
"public function getProcessed()\n {\n return $this->processed;\n }",
"public function calculatedCommissionFee()\n {\n $output = [];\n try {\n if (!array_key_exists('error', $this->data)) {\n for ($i = 0; $i < count($this->data); ++$i) {\n //Assign value to array via keys\n if (count($this->data[$i]) === 6) {\n $userType =\n (string) $this->data[$i][2];\n $operationType =\n (string) $this->data[$i][3];\n $operationAmt =\n (float) $this->data[$i][4];\n $currency =\n (string) $this->data[$i][5];\n $convertedAmount =\n $this\n ->_setTotalAmt($currency, $operationAmt);\n\n //Get converted amount, operation type, user type and currency then get the final result.\n $output[] =\n $this\n ->_result($convertedAmount, $operationType, $userType, $currency);\n continue;\n }\n }\n }\n } catch (\\Exception $e) {\n $output =\n ['error' => [\n $e->getCode(), $e->getMessage(),\n ],\n ];\n }\n\n return $output;\n }",
"public function getTaskProcessingResults()\n {\n if (array_key_exists(\"taskProcessingResults\", $this->_propDict)) {\n return $this->_propDict[\"taskProcessingResults\"];\n } else {\n return null;\n }\n }",
"protected function computeIncompleteHandlingOrders(){\r\n\t \t$incompleteOrders = $this->_orderInstance->getIncompleteHandlingOrders();\r\n\t \t//divide incomplete orders into 4 divisions and amazon orders.\r\n\t \t\r\n\t \t$amazonOrders = array();\r\n\t \t$ommitedOrders = array();\r\n\t \t$arrangedOrders = array();\r\n\t \t//$stockLockedOrders = array();\r\n\t \t$needComputingOrders = array();\r\n\t \t$readyOrders = array();\r\n\t \t$stockLockedItems = array();\r\n\t\r\n\t \tforeach ($incompleteOrders as $k=>$v){\r\n\t \t\t$v->lack_qty = 0;\r\n\t \t\tif($v->status_handling == '3'){\r\n\t \t\t\t//amazon stock.\r\n\t \t\t\t$amazonOrders[$k] = $v;\r\n\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsDetailByOid($v->oid);\r\n\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t \t\t\t$v->items = $orderItems;\r\n\t \t\t}else if($v->status_handling == '-1'){\r\n\t \t\t\t//回收站\r\n\t \t\t\t$ommitedOrders[$k] = $v;\r\n\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t \t\t\t$v->items = $orderItems;\r\n\t \t\t}else if($v->status_handling == '2'){\r\n\t \t\t\t//缺货\r\n\t \t\t\tif($v->status_locking == '1'){\r\n\t \t\t\t\t//已锁定(已安排)\r\n\t\t \t\t\t//this order was locked. Need except from stock.\r\n\t\t \t\t\t//get order items.\r\n \t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n \t\t \t\t$v->items = $orderItems;\r\n \t\t \t\tforeach($orderItems as $k2=>$v2){\r\n \t\t \t\t\tif(key_exists($v2->p_sn, $stockLockedItems)){\r\n \t\t \t\t\t\tif(key_exists($v2->avid, $stockLockedItems[$v2->p_sn])){\r\n \t\t \t\t\t\t\t$curStockItemQty = $stockLockedItems[$v2->p_sn][$v2->avid];\r\n \t\t \t\t\t\t\tif($v2->stock_qty < $curStockItemQty){\r\n \t\t \t\t\t\t\t\t//recount the stock qty.\r\n \t\t \t\t\t\t\t\t$v2->current_qty = 0;\r\n \t\t \t\t\t\t\t\t//$make the stock locked items as the stock qty.\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}else if($v2->stock_qty < $curStockItemQty + $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty - $curStockItemQty;\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}else{\r\n \t\t \t\t\t\t\t\t//库存充足\r\n \t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] += intval($v2->current_qty);\r\n \t\t \t\t\t\t\t}\r\n \t\t \t\t\t\t}else{\r\n \t\t \t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n \t\t \t\t\t\t\t}\r\n \t\t \t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = intval($v2->current_qty);\r\n \t\t \t\t\t\t}\r\n \t\t \t\t\t}else{\r\n \t\t \t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n \t\t \t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n \t\t \t\t\t\t}\r\n \t\t \t\t\t\t$stockLockedItems[$v2->p_sn] = array($v2->avid=>intval($v2->current_qty));\r\n \t\t \t\t\t}\r\n \t\t \t\t\t$v->lack_qty += intval($v2->qty - $v2->current_qty);\r\n \t\t \t\t}\r\n\t \t\t\t \tif($v->export_decision == '0'){\r\n\t\t \t\t\t\t$arrangedOrders[$k] = $v;\r\n\t \t\t\t\t}else{\r\n\t \t\t\t\t\t$readyOrders[$k] = $v;\r\n\t \t\t\t\t}\r\n\t \t\t\t}else{\r\n\t \t\t\t\t//未锁定,等待安排。\r\n\t \t\t\t\t$needComputingOrders[$k] = $v;\r\n\t \t\t\t}\r\n\t \t\t}else if($v->status_handling == '1'){\r\n\t \t\t\t//不缺货\r\n\t \t\t\t//if($v->status_locking == '1'){\r\n\t \t\t\t\t//this item was locked. Need except from stock.\r\n\t\t \t\t\t$orderItems = $this->_orderInstance->getOrderItemsWithStockInfo($v->oid);\r\n\t\t \t\t\tif($orderItems == false) $orderItems = array();\r\n\t\t \t\t\t$v->items = $orderItems;\r\n\t\t \t\t\tforeach($orderItems as $k2=>$v2){\r\n\t\t \t\t\t\tif(key_exists($v2->p_sn, $stockLockedItems)){\r\n\r\n\t\t \t\t\t\t\tif(key_exists($v2->avid, $stockLockedItems[$v2->p_sn])){\r\n\t\t \t\t\t\t\t\t$curStockItemQty = $stockLockedItems[$v2->p_sn][$v2->avid];\r\n\t\t \t\t\t\t\t\tif($v2->stock_qty < $curStockItemQty){\r\n\t\t \t\t\t\t\t\t\t//recount the stock qty.\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = 0;\r\n\t\t \t\t\t\t\t\t\t//$make the stock locked items as the stock qty.\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}else if($v2->stock_qty < $curStockItemQty + $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty - $curStockItemQty;\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}else{\r\n\t\t \t\t\t\t\t\t\t//库存充足\r\n\t\t \t\t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] += intval($v2->current_qty);\r\n\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t}else{\r\n\t\t \t\t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n\t\t \t\t\t\t\t\t}\r\n\t\t \t\t\t\t\t\t$stockLockedItems[$v2->p_sn][$v2->avid] = intval($v2->current_qty);\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}else{\r\n\t\t \t\t\t\t\tif($v2->stock_qty < $v2->current_qty){\r\n\t\t \t\t\t\t\t\t\t$v2->current_qty = $v2->stock_qty;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t\t$stockLockedItems[$v2->p_sn] = array($v2->avid=>intval($v2->current_qty));\r\n\t\t \t\t\t\t}\r\n\t\t \t\t\t\t$v->lack_qty += intval($v2->qty - $v2->current_qty);\r\n\t\t \t\t\t}\r\n\t\t \t\t\t$readyOrders[$k] = $v;\r\n\t \t\t//}else{\r\n\t \t\t\t\t//$needComputingOrders[$k] = $v;\r\n\t \t\t\t//}\r\n\t \t\t}else{\r\n\t \t\t\t$needComputingOrders [$k] = $v;\r\n\t \t\t}\r\n\t \t\t//now we already get the 3 arrays\r\n\t \t}\r\n\t \t\r\n\t \t$this->_orderInstance->updateArrangedOrderItemsLackState($arrangedOrders, $readyOrders, $stockLockedItems);\r\n\t \t\r\n\t \t//now we need compute amazon store.\r\n\t \t//$this->computeAmazonOrders($amazonOrders, $needComputingOrders);\r\n\t \t\r\n\t \t//$this->view->assign('amazonOrders', $amazonOrders);\r\n\t \t\r\n\t \t$orders_pools = $this->_orderInstance->calculateOrderItemsLackState($needComputingOrders, $stockLockedItems);\r\n\t \t$this->sortArrangedOrders($arrangedOrders);\r\n\t \t$orders_pools['arrangedOrders'] = $arrangedOrders;\r\n\t \t$orders_pools['ommitedOrders'] = $ommitedOrders;\r\n\t \t\r\n\t \tforeach ($readyOrders as $oid=>$order){\r\n\t \t\t$orders_pools['readyExportOrders'][$oid] = $order;\r\n\t \t}\r\n\t \t\r\n\t \treturn array($orders_pools, $stockLockedItems);\r\n }",
"public function getPendingSteps();",
"public function returnResults()\n {\n $this->executionResult['final']['X'] = $this->currentXPosition;\n $this->executionResult['final']['Y'] = $this->currentYPosition;\n $this->executionResult['final']['facing'] = $this->currentDirection;\n $this->executionResult['battery'] = $this->battery;\n if (isset($this->executionResult['visited'])) {\n array_multisort($this->executionResult['visited'], SORT_ASC);\n }\n if (isset($this->executionResult['cleaned'])) {\n array_multisort($this->executionResult['cleaned'], SORT_ASC);\n }\n\n return $this->executionResult;\n }",
"public function get_processedentries() {\n return $this->_processedentries;\n }",
"function getPromo()\n {\n return 3.50;\n }",
"protected function preFinalResult()\n {\n if(!empty($this->recSize) && is_array($this->recSize)) { \n $arr=array_count_values($this->recSize); \n \n foreach($arr as $key=>$value)\n {\n // $very_tught_plus=(isset($result['data'][Evaluate::VERY_TIGHT_PLUS]))\n // ? array_key_exists($key, $result['data'][Evaluate::VERY_TIGHT_PLUS])\n // : false;\n // \n // $baggy_plus=(isset($result['data'][Evaluate::BAGGY_PLUS]))\n // ? array_key_exists($key, $result['data'][Evaluate::BAGGY_PLUS])\n // : false; \n \n $rangeListCount=count($this->useRangeList);\n $lesBy=$rangeListCount-$value;\n if($rangeListCount==$value)\n $this->fullyFittedSizeList[$key]=Evaluate::RECOMENDED;\n elseIf($lesBy==$this->entryNeededNotLessThan){\n $this->semiFittedSizeList[$key]=Evaluate::SEMI_RECOMENDED;\n } \n else\n $this->notFittedSizeList[$key]=Evaluate::NOT_FITTED; \n }\n }\n \n// if(!empty($this->fullyFittedSizeList)) {\n// } \n \n /**\n * Checks if there is a semi or fully recomended size within the finalResult[range]['recomended'] array for each range\n * and removes them from 'recomended' and puts into another key 'semirecomeded';\n */\n foreach($this->finalResult['evaluation'] as $rkey=>$result)\n {\n if(!empty($this->semiFittedSizeList)) {\n foreach($this->semiFittedSizeList as $key=>$fsize)\n {\n if(isset($result['data'][Evaluate::RECOMENDED]) && is_array($result['data'][Evaluate::RECOMENDED])){\n if(array_key_exists($key, $result['data'][Evaluate::RECOMENDED])) {\n $this->finalResult['evaluation'][$rkey]['data'][Evaluate::SEMI_RECOMENDED][$key]=$this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key];\n unset($this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key]);\n }\n } \n }\n } \n \n if(!empty($this->notFittedSizeList))\n {\n /**\n * Removed from recomended every size, that is in recomanded range only on one range formula\n * amongst 3 or more. That is if the difference between the quantity of range formulas and\n * the 'recomended' entries for a given size is more than set in $entryNeededNotLessThan=1, ot is removed\n * from 'recomended' and marked as 'not fitted'\n * \n */\n foreach($this->notFittedSizeList as $key=>$fsize)\n {\n if(isset($result['data'][Evaluate::RECOMENDED]) && is_array($result['data'][Evaluate::RECOMENDED])){\n if(array_key_exists($key, $result['data'][Evaluate::RECOMENDED])) {\n $this->finalResult['evaluation'][$rkey]['data'][Evaluate::NOT_FITTED][$key]=$this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key];\n unset($this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key]);\n }\n } \n } \n }\n }\n }",
"protected function cleanExecutionArrays() {}",
"public function qtdTotalChamadosAbertosAgenteProcesso() {\n $tickets = Yii::app()->dbFRAPORT->createCommand()\n ->select(\"COUNT(t.id) as qtd \")\n ->from(\"ticket AS t \")\n ->join(\"ticket_history AS th\", \"t.id = th.ticket_id \")\n ->where(\"t.create_time BETWEEN :dtIni and :dtFim AND history_type_id = 1 AND th.queue_id = 23 AND th.state_id = 4\"\n , array(':dtIni' => FksFormatter::StrToDate($this->dtInicio),\n ':dtFim' => FksFormatter::StrToDate($this->dtTermino),\n ))\n ->queryAll();\n return $tickets[0]['qtd'];\n }",
"function contabilizar($notas) {\r\n\t$total = 0;\r\n\t\r\n\tforeach ($notas as $valor => $quantidade) {\r\n\t\t$total += ($valor * $quantidade);\r\n\t}\r\n\r\n\treturn $total;\r\n}",
"function getprodproclist($bid)\r\n\t{\r\n\t\t$sql = \"select p.product_name as product,p.product_id,(pl.qty*o.quantity) as qty \r\nfrom proforma_invoices i \r\njoin king_orders o on o.id=i.order_id \r\njoin m_product_deal_link pl on pl.itemid=o.itemid \r\njoin m_product_info p on p.product_id=pl.product_id \r\njoin (select distinct p_invoice_no from shipment_batch_process_invoice_link where batch_id = ? and packed=0) as h on h.p_invoice_no = i.p_invoice_no\r\nwhere i.invoice_status=1 \r\norder by p.product_name asc \r\n\t\t\";\r\n\t\t$raw=$this->db->query($sql,$bid)->result_array();\r\n\t\t$prods=array();\r\n\t\t$pids=array();\r\n\t\tforeach($raw as $r)\r\n\t\t{\r\n\t\t\tif(!isset($prods[$r['product_id']]))\r\n\t\t\t\t$prods[$r['product_id']]=array(\"product_id\"=>$r['product_id'],\"product\"=>$r['product'],\"qty\"=>0,\"location\"=>\"\");\r\n\t\t\t$prods[$r['product_id']]['qty']+=$r['qty'];\r\n\t\t\t$pids[]=$r['product_id'];\r\n\t\t}\r\n\t\t$pids=array_unique($pids);\r\n\t\t$raw_locs=$this->db->query(\"select s.mrp,s.product_id,rb.rack_name,rb.bin_name from t_stock_info s join m_rack_bin_info rb on rb.id=s.rack_bin_id where s.product_id in ('\".implode(\"','\",$pids).\"') order by s.stock_id asc\")->result_array();\r\n\t\t$ret=array();\r\n\t\tforeach($prods as $i=>$p)\r\n\t\t{\r\n\t\t\t$q=$p['qty'];\r\n\t\t\t$locations=array();\r\n\t\t\t$mrps=array();\r\n\t\t\tforeach($raw_locs as $s)\r\n\t\t\t{\r\n\t\t\t\tif($s['product_id']!=$i)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t$q-=$s['available_qty'];\r\n\t\t\t\t$locations[]=$s['rack_name'].$s['bin_name'];\r\n\t\t\t\t$mrps[]=\"Rs \".$s['mrp'];\r\n\t\t\t\tif($q<=0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$prods[$i]['location']=$loc=implode(\", \",array_unique($locations));\r\n\t\t\t$prods[$i]['mrp']=implode(\", \",array_unique($mrps));\r\n\t\t\t$assoc_loc=$loc.substr($p['product'],0,10).rand(110,9999);\r\n\t\t\t$ret[$assoc_loc]=$prods[$i];\r\n\t\t}\r\n\t\tksort($ret);\r\n\t\treturn $ret;\r\n\t}",
"public function getRunAsArray()\n {\n return $this->_totalTime;\n }",
"public function calculate(array $data);"
]
| [
"0.53468287",
"0.52567184",
"0.52190834",
"0.5185053",
"0.51728994",
"0.5171384",
"0.51626074",
"0.5130981",
"0.5089309",
"0.5080588",
"0.50307685",
"0.5030725",
"0.5027564",
"0.5026614",
"0.49923083",
"0.4959371",
"0.4947738",
"0.49266735",
"0.48693287",
"0.4865229",
"0.48624963",
"0.4833854",
"0.48273042",
"0.48234364",
"0.48114455",
"0.4799651",
"0.47783267",
"0.4776368",
"0.4767455",
"0.47649065"
]
| 0.65435314 | 0 |
Get blog posts from the BookStack blog. | public function getBlogPosts()
{
$contents = file_get_contents('https://www.bookstackapp.com/blog/rss/');
$blogItems = [];
$rss = simplexml_load_string($contents);
if ($rss !== false) {
foreach ($rss->channel->{'item'} as $item) {
$blogItem = new stdClass;
$blogItem->link = (string) $item->link;
$blogItem->title = (string) $item->title;
$blogItem->description = (string) strip_tags($item->description);
$blogItems[] = $blogItem;
}
} else {
return [];
}
$blogItems = array_slice($blogItems, 0, 3);
return $blogItems;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allblogpostsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla posts i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"post\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allblogposts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }",
"public function getPosts();",
"public function getPosts();",
"public function getAllBlogContent() {\n\t \n\t // Get content\n\t $sql = \"SELECT * FROM {$this->tableName}\n\t\t\t\t\tWHERE type = 'post' AND published <= NOW()\n\t\t\t\t\tORDER BY updated DESC;\";\n\t\n\t\t$result = $this->db->ExecuteSelectQueryAndFetchAll($sql);\n\t\treturn $result;\n }",
"public function getPosts() {}",
"function getPosts()\r\n\t{\r\n\t\t$db = pg_connect( 'dbname=thedarkvortex user=thedarkvortex_web password=JXEC:hu=3=N9rTZkQ8T#H%xl?fR-Ww' );\r\n\t\t$r = pg_query( $db, 'SELECT * FROM website.blog_posts ORDER BY \"created\" DESC;' );\r\n\t\t\r\n\t\t$retVal = array();\r\n\t\twhile( $row = pg_fetch_assoc($r) ) {\r\n\t\t\t$retVal[] = $row;\r\n\t\t}\r\n\t\treturn $retVal;\r\n\t}",
"public function getBlogPostNav()\n {\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $BlogMapper = $dataMapper('BlogMapper');\n\n // Get posts\n $posts = $BlogMapper->getPosts();\n\n // Nest array by month\n $priorPosts = [];\n foreach ($posts as $post) {\n $priorPosts[(new \\DateTime($post->published_date))->format('Y-m')][] = $post;\n }\n\n return $priorPosts;\n }",
"public function getAllPosts()\n {\n $entityManager = $this->getEntityManager();\n $queryBuilder = $entityManager->createQueryBuilder();\n $queryBuilder\n ->select('bp')\n ->from('App:BlogPost', 'bp')\n ->orderBy('bp.id', 'DESC');\n\n return $queryBuilder->getQuery()->getResult();\n }",
"public function posts()\n\t{\n\t\t//To do : Blog Posts by Category, Author, tags\n\n\t\t$wheres = $this->checkInputData(array('category_id', 'id', 'author_id', 'tag'));\n\n\t\t$before_after = $this->checkInputData(array('after_id', 'before_id', 'since', 'until'));\n\n\t\t$limit = (Input::get('limit')) ?: 0;\n\n\t\t$offset = (Input::get('offset')) ?: 0;\n\n\t\tif (empty($wheres) and empty($before_after)) {\n\n\t\t\t$blog = Provider::allPublicPosts($limit, $offset);\n\n\t\t} else {\n\n\t\t\tif (!empty($wheres)) {\n\t\t\t\t$conditions['wheres'] = $wheres;\n\t\t\t}\n\n\t\t\tif (!empty($before_after)) {\n\t\t\t\t$conditions['before_after'] = $before_after;\n\t\t\t}\n\n\t\t\t$blog = Provider::getPostsBy($conditions, $limit, $offset);\n\n\t\t}\n\n\t\t$data = $this->transform($blog);\n\n\t\treturn Response::json(array(\n\t\t\t'total_items' => count($data),\n\t\t\t'type'\t\t => 'posts',\n\t\t\t'items'\t\t => $data\n\t\t));\n\n\t}",
"public function blogPosts()\n\t{\n\t\t$auth = $this->ensureAuthed();\n\t\t$output = Output::getInstance();\n\t\t$feeds = Feeds::getInstance();\n\n\t\t$urls = $feeds->getValidURLs();\n\n\t\t$posts = array();\n\t\tforeach ($urls as $url => $user)\n\t\t{\n\t\t\t$teams = $auth->getTeams($user);\n\t\t\tif (count($teams) > 0)\n\t\t\t{\n\t\t\t\t$author = $auth->displayNameForTeam($teams[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$author = $user;\n\t\t\t}\n\t\t\t$msgs = Feeds::getRecentPosts($url, 3, $author);\n\t\t\t$posts = array_merge($posts, $msgs);\n\t\t}\n\t\t$output->setOutput('posts', $posts);\n\t\treturn true;\n\t}",
"public function get_blog_articles()\n {\n unset($this->blogs);\n\n parent::con();\n\n $sql=\"select * from blogs\";\n\n $res=mysql_query($sql);\n \n while ($reg=mysql_fetch_assoc($res))\n {\n $this->blogs[]=$reg;\n }\n return $this->blogs; \n\n mysql_free_result($reg); \n }",
"public function getBlog() {}",
"public function recentBlogs()\n {\n try {\n $blog = Blog::orderBy('created_at', 'desc')->paginate(10);\n return $blog;\n } catch (\\Throwable $th) {\n throw $th;\n $errReport = new ErrorHandler;\n $errReport->LogError($th);\n }\n }",
"public function getPublishedPosts() {\r\n $sql = 'SELECT p.ID as ID, post_title, post_subtitle,\r\n username, name, word_count, b.status as bookmark_status,\r\n UNIX_TIMESTAMP(post_date) as post_date \r\n FROM posts p JOIN users u ON (post_author=u.id) \r\n LEFT JOIN bookmarks b ON (b.post_id=p.ID AND b.user_id=?)\r\n WHERE post_status = \"publish\" \r\n ORDER BY post_date DESC LIMIT 0, 10';\r\n $sth = $this->db->prepare($sql);\r\n $sth->execute(array($GLOBALS['user']['id']));\r\n\r\n $rows = array();\r\n while($row = $sth->fetch()) {\r\n $row['post_date_supertag'] = date('j<b\\r>M', $row['post_date']);\r\n $row['reading_time'] = ceil($row['word_count'] / WORDS_PER_MINUTE);\r\n\r\n $rows[] = $row;\r\n }\r\n\r\n return $rows;\r\n }",
"public function all(){\n\t\t$posts = $this->repository->all();\n SEOMeta::setTitle(\"Blog\");\n SEOMeta::setDescription(\"Blog público com as opiniões de diversos alunos e professores da plataforma\");\n\n\t\treturn view('posts.all', ['posts' => $posts]);\n }",
"public function getPosts($currentPage)\n {\n $nbPerPage = $this->getNbPerPage();\n $postPage = $this->PostPage($currentPage);\n $dbName = $this->dbConnect();\n $req = $dbName->prepare(\"SELECT id, title,chapo, content,status,user_id, DATE_FORMAT(dateLastModification, '%d/%m/%Y à %Hh%imin%ss')\n AS dateLastModification FROM blogpost WHERE status = 1 ORDER BY dateLastModification DESC LIMIT :postPage ,:nbPerPage\");\n $req->bindValue(\":postPage\", $postPage, PDO::PARAM_INT);\n $req->bindValue(\":nbPerPage\", $nbPerPage, PDO::PARAM_INT);\n $req->execute();\n\n $posts = [];\n while ($row = $req->fetch(PDO::FETCH_ASSOC)) {\n $post = new BlogPost();\n $post->setId($row['id']);\n $post->setTitle($row['title']);\n $post->setContent($row['content']);\n $post->setDate($row['dateLastModification']);\n $post->setStatus($row['status']);\n $post->setUserId($row['user_id']);\n $post->setChapo($row['chapo']);\n $posts[] = $post;\n }\n return $posts;\n }",
"public function getPosts(){\n \t$posts = Post::latest()->paginate(3);\n \treturn new PostCollection($posts);\n }",
"function getPosts() {\n $connection = websterUser();\n try {\n $sql = 'SELECT blog.blogTitle, blogName, blogDate, blogPost FROM blog ORDER BY blogTitle, blogDATE';\n $stmt = $connection->prepare($sql);\n $stmt->execute();\n $blogPosts = $stmt->fetchAll();\n $stmt->closeCursor();\n } catch (PDOException $ex) {\n return FALSE;\n }\n return $blogPosts;\n}",
"protected function getPostFeed()\n {\n\n $postFeed = array();\n \n $sql = \"SELECT p.ID, p.post_image, p.post_author,\n p.post_date, p.post_modified, p.post_title,\n p.post_slug, p.post_content, p.post_type,\n p.post_status, u.user_login\n \t\t FROM posts AS p\n \t\t INNER JOIN users AS u ON p.post_author = u.ID\n \t\t WHERE p.post_type = 'blog' AND p.post_status = 'publish'\n \t\t ORDER BY p.ID DESC LIMIT 10\";\n \n $stmt = $this->dbc->query($sql);\n \n foreach ($stmt -> fetchAll() as $results) {\n \n $postFeed[] = $results;\n \n }\n \n return $postFeed;\n \n }",
"public function allPosts()\n {\n $query = 'SELECT blog_post.*,\n authors.author_name as author\n FROM \n blog_post\n JOIN authors USING(author_id)\n WHERE deleted = 0';\n\n $stmt = static::$dbh->query($query);\n\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $result;\n }",
"public function getPosts(Request $request)\n {\n // Get featured post\n $featuredPost = BlogPost::where([\n ['status', '=', 'PUBLISHED'],\n ['featured', '=', '1'],\n ])->whereDate('published_date', '<=', Carbon::now())\n ->orderBy('created_at', 'desc')\n ->first();\n $featuredPostId = $featuredPost ? $featuredPost->id : 0;\n\n // Get all posts\n $posts = BlogPost::where([\n ['status', '=', 'PUBLISHED'],\n ['id', '!=', $featuredPostId],\n ])->whereDate('published_date', '<=', Carbon::now())\n ->orderBy('created_at', 'desc')\n ->paginate(12);\n return $this->makeResponse($request, \"{$this->viewPath}::modules/posts/posts\", [\n 'featuredPost' => $featuredPost,\n 'posts' => $posts,\n ], BlogPostResource::collection($posts->load('authorId'))->additional(['meta' => [\n 'featuredPost' => ($featuredPost) ? new BlogPostResource($featuredPost): [],\n ]]));\n }",
"public function findAllPublishedPosts()\n {\n $posts = [];\n $query = \"\"\n . \"SELECT post.*, user.name as author \"\n . \"FROM post \"\n . \"LEFT JOIN user ON post.id_user = user.id \"\n . \"WHERE status > 0 \"\n . \"ORDER BY post.date_created DESC\";\n $result = $this->db->query($query);\n if ($result) {\n // Cycle through results\n while ($row = $result->fetch_assoc()) {\n $posts[] = [\n 'id' => $row['id'],\n 'title' => $row['title'],\n 'content' => $row['content'],\n 'author' => $row['author'],\n 'id_user' => $row['id_user'],\n 'date_created' => $row['date_created'],\n 'tags' => '' //$row['firstname']\n ];\n }\n // Free result set\n $result->close();\n } else {\n echo($this->db->error);\n }\n return $posts;\n }",
"static public function getAll() {\n $db = Database::connect(); //Connect to database\n\n $blogs = array();\n $sql = $db->query(\"SELECT * FROM blog ORDER BY sn DESC\");\n while($row = $sql->fetch_object()) {\n array_push($blogs, $row);\n }\n return $blogs;\n }",
"public function index()\n {\n $posts = $this->postService->getAll();\n\n return $posts;\n }",
"public function getPosts()\n {\n return $this->posts;\n }",
"public function listBlogs(){\n\n $sql = \"SELECT * FROM blogs\";\n $pdostm = $this->dbcon->prepare($sql);\n $pdostm->execute();\n\n $blogs = $pdostm->fetchAll(PDO::FETCH_ASSOC);\n return $blogs;\n }",
"function fetchAllBlogPosts()\r\n{\r\n return showAllBlogPosts();\r\n}",
"public function blog()\n {\n $posts = Post::latest()->paginate(6);\n // $posts = Post::paginate(6);\n // $posts->deskripsi = \\Str::limit(30);\n $context = array(\n \"title\" => \"Blog\",\n \"title_body\" => \"All-Post\"\n );\n // dd($posts->judul);\n return view('blog.blog', compact('context', 'posts'));\n }",
"public function getAllBlogEntries(){\r\n $sql = \"SELECT blog_id, blog_title,\r\n SUBSTRING(blog_text, 1, 150) AS intro\r\n FROM blog_entry_table\";\r\n $data = null;\r\n $statement = $this->makeStatement( $sql, $data);\r\n // return a PDOStatement; thru which access to all blog entries are obtained at a time\r\n return $statement; \r\n }",
"function addBlogPosts() {\r\n $postManager = new ArticlesManager();\r\n $posts = $postManager->getBlogPosts();\r\n return $posts->fetchAll();\r\n}"
]
| [
"0.7944105",
"0.7558496",
"0.7558496",
"0.7535483",
"0.7489025",
"0.7396277",
"0.731916",
"0.72827774",
"0.72150123",
"0.72148466",
"0.71264523",
"0.7123012",
"0.69795924",
"0.6977731",
"0.697231",
"0.6947084",
"0.69240767",
"0.69051075",
"0.6874966",
"0.6874384",
"0.681671",
"0.68122363",
"0.6771226",
"0.6760771",
"0.6760009",
"0.675059",
"0.67499775",
"0.67493534",
"0.67442",
"0.67307013"
]
| 0.7600903 | 1 |
Rename administrator role if required | public static function renameAdministratorRole()
{
$administratorName = 'Digital Webmaster';
if (Utils::roleName('administrator') !== $administratorName) {
Utils::renameRole('administrator', $administratorName);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createRole()\n {\n add_action('init', __NAMESPACE__ . '\\DigitalWebmaster::renameAdministratorRole');\n }",
"protected function ensureAdminRoleIfRequested() {}",
"function egsr_change_roles_names() {\n global $wp_roles;\n \n if ( ! isset( $wp_roles ) )\n $wp_roles = new WP_Roles();\n \n $wp_site_roles = egsr_default_wp_site_roles();\n foreach ($wp_site_roles as $key => $value) {\n // Change role name\n $wp_roles->roles[$key]['name'] = $wp_roles->roles[$key]['name'] .' (Deprecated)';\n $wp_roles->role_names['contributor'] = $wp_roles->role_names[$key] .'$wp_roles->roles[$key]'; \n }\n}",
"public function makeAdministrator()\n {\n $this->setRole('administrator');\n }",
"public function setAsAdmin()\n {\n if (!in_array('admin', $this->roles)) {\n $this->roles[] = 'admin';\n }\n }",
"public function assignRole ($name);",
"function reset_role( $role ) {\n $default_roles = array(\n 'administrator' => array(\n 'switch_themes' => 1,\n 'edit_themes' => 1,\n 'activate_plugins' => 1,\n 'edit_plugins' => 1,\n 'edit_users' => 1,\n 'edit_files' => 1,\n 'manage_options' => 1,\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'import' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_10' => 1,\n 'level_9' => 1,\n 'level_8' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n 'delete_users' => 1,\n 'create_users' => 1,\n 'unfiltered_upload' => 1,\n 'edit_dashboard' => 1,\n 'update_plugins' => 1,\n 'delete_plugins' => 1,\n 'install_plugins' => 1,\n 'update_themes' => 1,\n 'install_themes' => 1,\n 'update_core' => 1,\n 'list_users' => 1,\n 'remove_users' => 1,\n 'add_users' => 1,\n 'promote_users' => 1,\n 'edit_theme_options' => 1,\n 'delete_themes' => 1,\n 'export' => 1,\n ),\n \n 'editor' => array(\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n ),\n \n 'author' => array(\n 'upload_files' => 1,\n 'edit_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'read' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n 'delete_published_posts' => 1,\n ),\n \n 'contributor' => array(\n 'edit_posts' => 1,\n 'read' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n ),\n \n 'subscriber' => array(\n 'read' => 1,\n 'level_0' => 1,\n ),\n \n 'display_name' => array(\n 'administrator' => 'Administrator',\n 'editor'\t=> 'Editor',\n 'author'\t=> 'Author',\n 'contributor' => 'Contributor',\n 'subscriber'\t=> 'Subscriber',\n ),\n \n );\n \n $role = strtolower( $role );\n \n remove_role( $role );\n \n return add_role( $role, $default_roles['display_name'][$role], $default_roles[$role] );\n}",
"public function testUpdateRole()\n {\n }",
"public function testUpdateRole()\n {\n }",
"function gdlr_lms_add_user_role(){\r\n\t\tadd_role('instructor', __('Instructor', 'gdlr-lms'), \r\n\t\t\tarray('instructor'=>true, 'read'=>true, 'edit_users'=>true, 'edit_dashboard'=>true, 'upload_files'=>true,\r\n\t\t\t\t 'edit_course'=>true, 'edit_courses'=>true, 'edit_published_courses'=>true, 'publish_courses'=>true, 'delete_course'=>true, 'delete_courses'=>true, 'delete_published_courses'=>true,\r\n\t\t\t\t 'edit_quiz'=>true, 'edit_quizzes'=>true, 'edit_published_quizzes'=>true,'publish_quizzes'=>true, 'delete_quiz'=>true, 'delete_quizzes'=>true, 'delete_published_quizzes'=>true,\r\n\t\t\t\t 'course_taxes'=>true )\r\n\t\t);\r\n\t\tadd_role('student', __('Student', 'gdlr-lms'));\r\n\t\t\r\n\t\t$administrator = get_role('administrator');\r\n\t\t\r\n\t\t$administrator->add_cap('course_taxes');\r\n\t\t$administrator->add_cap('course_taxes_edit');\r\n\t\t$administrator->add_cap('edit_course');\r\n\t\t$administrator->add_cap('read_course');\r\n\t\t$administrator->add_cap('delete_course');\r\n\t\t$administrator->add_cap('edit_courses');\r\n\t\t$administrator->add_cap('edit_others_courses');\r\n\t\t$administrator->add_cap('publish_courses');\r\n\t\t$administrator->add_cap('read_private_courses');\r\n $administrator->add_cap('delete_courses');\r\n $administrator->add_cap('delete_private_courses');\r\n $administrator->add_cap('delete_published_courses');\r\n $administrator->add_cap('delete_others_courses');\r\n $administrator->add_cap('edit_private_courses');\r\n $administrator->add_cap('edit_published_courses');\t\r\n\r\n\t\t$administrator->add_cap('edit_quiz');\r\n\t\t$administrator->add_cap('read_quiz');\r\n\t\t$administrator->add_cap('delete_quiz');\r\n\t\t$administrator->add_cap('edit_quizzes');\r\n\t\t$administrator->add_cap('edit_others_quizzes');\r\n\t\t$administrator->add_cap('publish_quizzes');\r\n\t\t$administrator->add_cap('read_private_quizzes');\r\n $administrator->add_cap('delete_quizzes');\r\n $administrator->add_cap('delete_private_quizzes');\r\n $administrator->add_cap('delete_published_quizzes');\r\n $administrator->add_cap('delete_others_quizzes');\r\n $administrator->add_cap('edit_private_quizzes');\r\n $administrator->add_cap('edit_published_quizzes');\t\t\r\n\t\t\r\n\t\t// 1.01 capability fix\r\n\t\t$instructor = get_role('instructor');\r\n\t\t$instructor->add_cap('edit_published_courses');\r\n\t\t$instructor->add_cap('edit_published_quizzes');\r\n\t}",
"public function promote()\n {\n return $this->changeRole('admin');\n }",
"public function testAdministratorRole() {\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/people/role-settings');\n\n // Verify that the administration role is none by default.\n $this->assertTrue($this->assertSession()->optionExists('edit-user-admin-role', '')->isSelected());\n\n $this->assertFalse(Role::load($this->rid)->isAdmin());\n\n // Set the user's role to be the administrator role.\n $edit = [];\n $edit['user_admin_role'] = $this->rid;\n $this->drupalGet('admin/people/role-settings');\n $this->submitForm($edit, 'Save configuration');\n\n \\Drupal::entityTypeManager()->getStorage('user_role')->resetCache();\n $this->assertTrue(Role::load($this->rid)->isAdmin());\n\n // Enable block module and ensure the 'administer news feeds'\n // permission is assigned by default.\n \\Drupal::service('module_installer')->install(['block']);\n\n $this->assertTrue($this->adminUser->hasPermission('administer blocks'), 'The permission was automatically assigned to the administrator role');\n\n // Ensure that selecting '- None -' removes the admin role.\n $edit = [];\n $edit['user_admin_role'] = '';\n $this->drupalGet('admin/people/role-settings');\n $this->submitForm($edit, 'Save configuration');\n\n \\Drupal::entityTypeManager()->getStorage('user_role')->resetCache();\n \\Drupal::configFactory()->reset();\n $this->assertFalse(Role::load($this->rid)->isAdmin());\n\n // Manually create two admin roles, in that case the single select should be\n // hidden.\n Role::create(['id' => 'admin_role_0', 'is_admin' => TRUE, 'label' => 'Admin role 0'])->save();\n Role::create(['id' => 'admin_role_1', 'is_admin' => TRUE, 'label' => 'Admin role 1'])->save();\n $this->drupalGet('admin/people/role-settings');\n $this->assertSession()->fieldNotExists('user_admin_role');\n }",
"function editable_roles( $roles ){\n if( isset( $roles['administrator'] ) && !current_user_can('administrator') ){\n unset( $roles['administrator']);\n }\n return $roles;\n }",
"public function setAdmin($admin)\n {\n if($admin && !$this->hasRole(\"ROLE_ADMIN\"))\n {\n $this->addRole(\"ROLE_ADMIN\");\n } else {\n $this->removeRole(\"ROLE_ADMIN\");\n }\n }",
"public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }",
"function add_splus_roles_and_caps() {\n $role = get_role('administrator');\n if (is_object($role) && !$role->has_cap('manage_slp')) {\n $role->add_cap('manage_slp');\n }\n }",
"public function getAdminRole()\n {\n return $this->adminRole;\n }",
"public function testAdminCanUpdateARole()\n {\n $existRole = Role::factory()->create();\n $permission = Permission::where('name', 'view_roles')->first();\n\n $params = [\n 'name' => $this->faker->name(),\n 'permissions' => [$permission->name],\n ];\n $response = $this\n ->actingAs($this->admin)\n ->put('/admin/roles/'. $existRole->id, $params);\n\n $updatedRole = Role::find($existRole->id);\n $this->assertEquals($params['name'], $updatedRole->name);\n $this->assertEquals($existRole->id, $updatedRole->id);\n\n $response->assertStatus(302);\n $response->assertSessionHasNoErrors();\n $response->assertRedirect('/admin/roles');\n $response->assertSessionHas('success', __('roles.success_updated_message', ['name' => $existRole->name]));\n }",
"public function testCreateAdminRole(): void\n {\n // using factory\n Role::findByName(config('appSection-authorization.admin_role'))->delete();\n\n $role = Role::factory()->admin()->create();\n\n $this->assertEquals(config('appSection-authorization.admin_role'), $role->name);\n }",
"function tb_string_swap_rolescheck() {\n\tif ( current_user_can( 'edit_theme_options' ) ) {\n\t\tadd_action( 'admin_init', 'tb_string_swap_init' );\n\t\tadd_action( 'admin_menu', 'tb_string_swap_add_page');\n\t}\n}",
"public function testRolesAreAppledToAdminAndEditor() {\n\t\tberry_activation();\n\t\t$admin = get_role( 'administrator' );\n\t\t$this->assertTrue( $admin->has_cap( 'berry_admin' ) );\n\n\t\t$editor = get_role( 'editor' );\n\t\t$this->assertTrue( $editor->has_cap( 'berry_user' ) );\n\n\t}",
"function pilau_editable_roles( $roles ) {\n\n\t// Only admins should be able to update_core, and only admins can edit admins\n\tif ( ! current_user_can( 'update_core' ) && array_key_exists( 'administrator', $roles ) ) {\n\t\tunset( $roles['administrator'] );\n\t}\n\n\treturn $roles;\n}",
"function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}",
"public function setName()\n {\n $this->_role->name = '奥巴马';\n }",
"function sf_upgrade_add_new_role($newaction, $perm, $limit_access=false, $mods_only=false)\n{\n\tglobal $wpdb;\n\n\t$roles = $wpdb->get_results(\"SELECT * FROM \".SFROLES.\" ORDER BY role_id\");\n\tif ($roles)\n\t{\n\t\tforeach ($roles as $role)\n\t\t{\n\t\t\tif ($limit_access)\n\t\t\t{\n\t\t\t\t$perm = 1;\n\t\t\t\tif ($role->role_name == 'No Access' || $role->role_name == 'Read Only Access')\n\t\t\t\t{\n\t\t\t\t\t$perm = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($mods_only)\n\t\t\t{\n\t\t\t\t$perm = 0;\n\t\t\t\tif ($role->role_name == 'Moderators')\n\t\t\t\t{\n\t\t\t\t\t$perm = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$actions = unserialize($role->role_actions);\n\t\t\t$actions[$newaction] = $perm;\n\t\t\t$actions = maybe_serialize($actions);\n\t\t\t$sql = \"UPDATE \".SFROLES.\" SET \";\n\t\t\t$sql.= 'role_name=\"'.$role->role_name.'\", ';\n\t\t\t$sql.= 'role_desc=\"'.$role->role_desc.'\", ';\n\t\t\t$sql.= 'role_actions=\"'.$wpdb->escape($actions).'\" ';\n\t\t\t$sql.= \"WHERE role_id=\".$role->role_id.\";\";\n\t\t\t$wpdb->query($sql);\n\t\t}\n\t}\n}",
"function ihc_switch_role_for_user($uid=0){\n\t$do_switch = get_option('ihc_automatically_switch_role');\n\tif ($do_switch && $uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0])){\n\t\t\t$role = get_option('ihc_automatically_new_role');\n\t\t\tif (empty($role)){\n\t\t\t\t$role = 'subscriber';\n\t\t\t}\n\t\t\t$arr['role'] = $role;\n\t\t\t$arr['ID'] = $uid;\n\t\t\twp_update_user($arr);\n\t\t}\n\t}\n}",
"function updateRoles() {\n try {\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n\n $project_roles_table = TABLE_PREFIX . 'project_roles';\n $roles_table = TABLE_PREFIX . 'roles';\n $project_users_table = TABLE_PREFIX . 'project_users';\n $config_options_table = TABLE_PREFIX . 'config_options';\n\n DB::beginWork('Updating roles @ ' . __CLASS__);\n\n DB::execute(\"CREATE TABLE $project_roles_table (\n id smallint(3) unsigned NOT NULL auto_increment,\n name varchar(50) NOT NULL default '',\n permissions text,\n is_default tinyint(1) unsigned default NULL,\n PRIMARY KEY (id),\n UNIQUE KEY name (name)\n ) ENGINE=$engine DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci\");\n\n $rows = DB::execute(\"SELECT * FROM $roles_table WHERE type = ?\", 'project');\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $project_roles_table (name, permissions) VALUES (?, ?)\", $row['name'], $row['permissions']);\n DB::execute(\"UPDATE $project_users_table SET role_id = ? WHERE role_id = ?\", DB::lastInsertId(), $row['id']);\n } // foreach\n\n DB::execute(\"UPDATE $project_roles_table SET is_default = '1' LIMIT 1\");\n DB::execute(\"DELETE FROM $roles_table WHERE type = ?\", 'project');\n } // if\n\n // Update roles table\n DB::execute(\"ALTER TABLE $roles_table DROP COLUMN type\");\n DB::execute(\"ALTER TABLE $roles_table MODIFY COLUMN permissions text DEFAULT NULL AFTER name\");\n DB::execute(\"ALTER TABLE $roles_table ADD is_default tinyint(1) UNSIGNED NULL DEFAULT NULL AFTER permissions\");\n\n // Update default role ID\n $default_role_id = (integer) DB::executeFirstCell('SELECT value FROM ' . TABLE_PREFIX . 'config_options WHERE name = ?', 'default_role');\n if($default_role_id) {\n DB::execute(\"UPDATE $roles_table SET is_default = ? WHERE id = ?\", true, (integer) unserialize($default_role_id));\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'config_options WHERE name = ?', 'default_role');\n } // if\n\n // Rename system permissions\n $rename_system_permissions = array(\n 'system_access' => 'has_system_access',\n 'admin_access' => 'has_admin_access',\n 'project_management' => 'can_manage_projects',\n 'people_management' => 'can_manage_people',\n 'add_project' => 'can_add_project',\n 'manage_company_details' => 'can_manage_company_details',\n 'manage_trash' => 'can_manage_trash',\n 'manage_assignment_filters' => 'can_manage_assignment_filters',\n );\n\n $rows = DB::execute(\"SELECT id, permissions FROM $roles_table\");\n foreach($rows as $row) {\n $permissions = $row['permissions'] ? unserialize($row['permissions']) : array();\n\n foreach($rename_system_permissions as $k => $v) {\n if(isset($permissions[$k])) {\n $permissions[$v] = $permissions[$k];\n unset($permissions[$k]);\n } // if\n } // foreach\n\n if(array_var($permissions, 'has_admin_access') || array_var($permissions, 'can_manage_projects') || array_var($permissions, 'can_manage_people')) {\n $permissions['can_use_api'] = true;\n $permissions['can_use_feeds'] = true;\n } // if\n\n DB::execute(\"UPDATE $roles_table SET permissions = ? WHERE id = ?\", serialize($permissions), $row['id']);\n } // foreach\n\n // ---------------------------------------------------\n // Set default role\n // ---------------------------------------------------\n\n $default_role_id = DB::executeFirstCell(\"SELECT value FROM $config_options_table WHERE name = 'default_role'\");\n if($default_role_id) {\n $default_role_id = unserialize($default_role_id);\n } // if\n\n if($default_role_id) {\n DB::execute(\"UPDATE $roles_table SET is_default = ? WHERE id = ?\", true, $default_role_id);\n } // if\n\n if(DB::executeFirstCell(\"SELECT COUNT(id) FROM $roles_table WHERE is_default = ?\", true) == 0) {\n DB::execute(\"UPDATE $roles_table SET is_default = ? LIMIT 1\", true);\n } // if\n\n DB::execute(\"DELETE FROM $config_options_table WHERE name = 'default_role'\");\n\n // ---------------------------------------------------\n // Update role names\n // ---------------------------------------------------\n\n DB::execute(\"UPDATE $roles_table SET name = 'Employee' WHERE name = 'Member'\");\n DB::execute(\"UPDATE $roles_table SET name = 'Client Company Employee' WHERE name = 'Client Company Member'\");\n\n DB::commit('Roles updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update roles @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n\n return true;\n }",
"function add_manager_role()\n{\n add_role('manager', __(\n 'Manager'),\n array(\n 'read' => true, // Allows a user to read\n 'create_posts' => true, // Allows user to create new posts\n 'edit_posts' => true, // Allows user to edit their own posts\n )\n );\n}",
"function update_role ($role_id, $role_name, $role_priv_array) {\r\n $conn = db_connect();\r\n\r\n //if (!check_admin()) return false;\r\n if (isset($role_id) && isset($role_name)) {\r\n // change the role_name\r\n $result = $conn->query(\"update roles set role_name = '\".trim($role_name).\"' where role_id = '\".$role_id.\"'\");\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the DB.\");\r\n }\r\n }\r\n\r\n if (isset($role_id) && is_array($role_priv_array)) {\r\n $result = $conn->query(\"select priv_id from role_priv where role_id = '\".$role_id.\"'\");\r\n \r\n while (list($id) = $result->fetch_row()) {\r\n $res_array[] = $id;\r\n }\r\n\r\n foreach ($role_priv_array as $key) {\r\n if (!in_array($key, $res_array)) {\r\n // not exsit, then insert\r\n $result = $conn->query(\"insert into role_priv values ('', '\".$role_id.\"', '\".$key.\"')\");\r\n //echo \"sdfjksd1<br />\";\r\n }\r\n }\r\n\r\n foreach ($res_array as $key) {\r\n if (!in_array($key, $role_priv_array)) {\r\n // not exsit, then delete\r\n $result = $conn->query(\"delete from role_priv where role_id = '\".$role_id.\"' and \r\n priv_id = '\".$key.\"'\");\r\n //echo \"sdfjksd2<br />\";\r\n }\r\n }\r\n } \r\n\r\n return true;\r\n }",
"function roleUpdate(Role $new, ?Role $old);"
]
| [
"0.7222371",
"0.6982851",
"0.69521725",
"0.6834939",
"0.6805729",
"0.64511716",
"0.6356238",
"0.6273639",
"0.6273639",
"0.6261143",
"0.6242418",
"0.61742353",
"0.61596006",
"0.6138364",
"0.6058582",
"0.60102814",
"0.59691125",
"0.593902",
"0.59069365",
"0.5897614",
"0.5897368",
"0.58788234",
"0.5836087",
"0.583106",
"0.58210766",
"0.5817336",
"0.5809489",
"0.5788779",
"0.5763797",
"0.574554"
]
| 0.8674001 | 0 |
Create the new DigitalWebmaster role In practice this just renames the default administrator role. | public static function createRole()
{
add_action('init', __NAMESPACE__ . '\DigitalWebmaster::renameAdministratorRole');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n $this->authorize('create', Role::class);\n }",
"public function makeAdministrator()\n {\n $this->setRole('administrator');\n }",
"function roleCreate(Role $role);",
"public function createRole() {\n\t\t$Permissions = discover_permissions();\n\n\t\treturn \\view( 'admin.roles.create', compact( 'Permissions' ) );\n\t}",
"public function actionCreate_role() { \n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('user_role')) {\n return $this->redirect(['site/index']);\n }\n $model = new DvUsersRole();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'New User Role Created Successfully');\n return $this->redirect(['dv-users/create_role']);\n } else {\n return $this->render('create_role', [ 'model' => $model]);\n }\n }",
"public static function renameAdministratorRole()\n {\n $administratorName = 'Digital Webmaster';\n if (Utils::roleName('administrator') !== $administratorName) {\n Utils::renameRole('administrator', $administratorName);\n }\n }",
"public function create()\n {\n abort_if(Gate::denies('roleCreate'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n $this->resetInputFields();\n\n $this->createModal = true;\n }",
"public function create()\n {\n $this->authorize('admin');\n\n return view('backend.roles.create');\n }",
"public function create()\n\t{\n\t\t// $roles = Role::get();\n\t}",
"public function create()\n {\n if(!$this->checkPermission())\n return redirect('home');\n\n return view('admin.role.role_create');\n }",
"public function create()\n {\n $this->repository->setPageTitle(\"Administrator Roles | Add New\");\n\n $model = new AdminRole();\n $record = $model;\n $model->allowedRoles = [];\n\n $formMode = \"add\";\n $formSubmitUrl = \"/\".request()->path();\n\n $urls = [];\n $urls[\"listUrl\"]=URL::to(\"/admin/admin_role\");\n\n $this->repository->setPageUrls($urls);\n\n $systems = AdminPermissionSystem::query()->where(\"system_status\", \"=\", \"1\")->get();\n\n $systemPermissions = [];\n if(count($systems)>0)\n {\n $adminPermSysRepo = new AdminPermissionSystemRepository();\n foreach ($systems as $key => $system)\n {\n $systemModules = $system->permissionModules()->get()->toArray();\n $systemModules = $adminPermSysRepo->getSystemPermissionModules($systemModules);\n\n $system[\"modules\"] = $systemModules;\n $system[\"curr_permissions\"] = [];\n\n $systems->$key = $system;\n }\n\n $systemPermissions = $systems->toArray();\n }\n\n return view('admin::admin_role.create', compact('formMode', 'formSubmitUrl', 'record', 'systemPermissions'));\n }",
"public function run()\n {\n Role::create([\"name\" => \"SuperAdmin\"],[\"name\" => \"SubAdmin\"],[\"name\" => \"Seller\"],[\"name\" => \"Customer\"]);\n }",
"public function create($roleName);",
"public function create()\n {\n //\n return view(\"admin.role.create\");\n }",
"public function actionCreateRole($role_name, $user_id_or_name){\n $user_id = $this->getUserId($user_id_or_name);\n\n $auth = Yii::$app->authManager;\n $role = $auth->createRole($role_name . '-user-id-' . $user_id);\n $auth->add($role);\n }",
"public function createAdmin()\n {\n if(Auth::user()->role()->first()['id'] != 1 ){\n return redirect('/unauthorised')->with('error', 'Error 403');\n }\n return view('users.admins.new');\n }",
"function create_role($name, $shortname, $description, $legacy='') {\n\n // check for duplicate role name\n\n if ($role = get_record('role','name', $name)) {\n error('there is already a role with this name!');\n }\n\n if ($role = get_record('role','shortname', $shortname)) {\n error('there is already a role with this shortname!');\n }\n\n $role = new object();\n $role->name = $name;\n $role->shortname = $shortname;\n $role->description = $description;\n\n //find free sortorder number\n $role->sortorder = count_records('role');\n while (get_record('role','sortorder', $role->sortorder)) {\n $role->sortorder += 1;\n }\n\n if (!$context = get_context_instance(CONTEXT_SYSTEM)) {\n return false;\n }\n\n if ($id = insert_record('role', $role)) {\n if ($legacy) {\n assign_capability($legacy, CAP_ALLOW, $id, $context->id);\n }\n\n /// By default, users with role:manage at site level\n /// should be able to assign users to this new role, and override this new role's capabilities\n\n // find all admin roles\n if ($adminroles = get_roles_with_capability('moodle/role:manage', CAP_ALLOW, $context)) {\n // foreach admin role\n foreach ($adminroles as $arole) {\n // write allow_assign and allow_overrid\n allow_assign($arole->id, $id);\n allow_override($arole->id, $id);\n }\n }\n\n return $id;\n } else {\n return false;\n }\n\n}",
"public function testCreateRole()\n {\n }",
"public function testCreateRole()\n {\n }",
"public function create()\n {\n if(Auth::user()->role !== 1){\n return redirect('/home');\n }\n return view('superadmin.administrator.create');\n }",
"public function create()\n {\n if (!(policy(new Role)->create()))\n {\n flash()->error(\"User '\" . \\Auth::user()->username . \"' does not have sufficient rights for the requested operation\")->important();\n return redirect()->back();\n }\n\n return view('role.addRole');\n }",
"public function create()\n {\n $data['permissions'] = $this->permissionRepo->all(['id', 'display_name']);\n\n $this->theme->breadcrumb()->add('Create', route('backend.role.create.get'));\n return $this->theme->scope('role.create', $data)->render();\n }",
"public function run()\n {\n AdminRole::creates(['name' => '超级管理员', 'description' => '拥有系统的全部权限']);\n AdminRole::creates(['name' => '内容管理员', 'description' => '拥有管理内容的权限']);\n }",
"static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }",
"public function testCreateAdminRole(): void\n {\n // using factory\n Role::findByName(config('appSection-authorization.admin_role'))->delete();\n\n $role = Role::factory()->admin()->create();\n\n $this->assertEquals(config('appSection-authorization.admin_role'), $role->name);\n }",
"public function run()\n {\n Role::create(array(\n 'role' => 'admin',\n 'role_name' => 'administrador',\n 'role_description' => 'administrador del sitio',\n 'role_permits' =>'1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33' \n \n ));\n }",
"public function create()\n {\n $this->authorize('create', Role::class);\n\n return view('laralum_roles::create');\n }",
"public function actionCreate()\n {\n $model = new RoleForm();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $role = new \\yii\\rbac\\Role();\n $role->description = $model->description;\n $role->type = $model->type;\n $role->ruleName = empty($model->rule_name) ? null : $model->rule_name;\n $role->data = $model->data;\n\n $this->authManager->add($role);\n if(is_array($model->child) && count($model->child)){\n foreach($model->child as $name){\n $this->authManager->addChild($role,$this->authManager->getPermission($name));\n }\n }\n return $this->redirect(['update', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'permissions' => $this->authManager->getPermissions()\n ]);\n }\n }",
"protected function addRole()\n\t{\n\t\tglobal $rbacadmin, $rbacreview, $rbacsystem,$ilErr,$ilCtrl;\n\n\t\t$form = $this->initRoleForm();\n\t\tif($form->checkInput())\n\t\t{\n\t\t\t$new_title = $form->getInput(\"title\");\n\t\t\t\n\t\t\tinclude_once './Services/AccessControl/classes/class.ilObjRole.php';\n\t\t\t$role = new ilObjRole();\n\t\t\t$role->setTitle($new_title);\n\t\t\t$role->setDescription($form->getInput('desc'));\n\t\t\t$role->create();\n\t\t\t\n\t\t\t$GLOBALS['rbacadmin']->assignRoleToFolder($role->getId(),$this->getCurrentObject()->getRefId());\n\t\t\t\n\t\t\t// protect\n\t\t\t$rbacadmin->setProtected(\n\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t$role->getId(),\n\t\t\t\t$form->getInput('pro') ? 'y' : 'n'\n\t\t\t);\n\n\t\t\t// copy rights \n\t\t\t$right_id_to_copy = $form->getInput(\"rights\");\n\t\t\tif($right_id_to_copy)\n\t\t\t{\n\t\t\t\t$parentRoles = $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId(),true);\n\t\t\t\t$rbacadmin->copyRoleTemplatePermissions(\n\t\t\t\t\t$right_id_to_copy,\n\t\t\t\t\t$parentRoles[$right_id_to_copy][\"parent\"],\n\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t$role->getId(),\n\t\t\t\t\tfalse);\n\n\t\t\t\tif($form->getInput('existing'))\n\t\t\t\t{\n\t\t\t\t\tif($form->getInput('pro'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_PROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\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// add to desktop items\n\t\t\tif($form->getInput(\"desktop\"))\n\t\t\t{\n\t\t\t\tinclude_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';\n\t\t\t\t$role_desk_item_obj = new ilRoleDesktopItem($role->getId());\n\t\t\t\t$role_desk_item_obj->add(\n\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\tilObject::_lookupType($this->getCurrentObject()->getRefId(),true));\n\t\t\t}\t\t\n\n\t\t\tilUtil::sendSuccess($this->lng->txt(\"role_added\"),true);\n\t\t\t$this->ctrl->redirect($this,'perm');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$this->tpl->setContent($form->getHTML());\n\t\t}\n\t}",
"public function create()\n {\n //\n return view('user_management/role/create');\n }"
]
| [
"0.6672559",
"0.66685784",
"0.6612902",
"0.658742",
"0.648535",
"0.6453441",
"0.6382864",
"0.6336527",
"0.6334574",
"0.63269734",
"0.6301535",
"0.62953955",
"0.62139374",
"0.61680967",
"0.6157458",
"0.6141995",
"0.611634",
"0.6094626",
"0.6094626",
"0.6087218",
"0.6076492",
"0.6056408",
"0.6051994",
"0.60501766",
"0.6044316",
"0.6022268",
"0.6021179",
"0.6004444",
"0.5993867",
"0.5976746"
]
| 0.7707682 | 0 |
Get all of the organization's users including its owner. | public function allUsers()
{
return $this->users->merge([$this->owner]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUsers()\n {\n $em = $this->container->get('doctrine')->getEntityManager();\n $builder = $em->getRepository('AppWebBundle:User')->createQueryBuilder('u');\n \n return $builder->getQuery()->getResult();\n }",
"public function allUsers(): Collection\n {\n return $this->users->merge([$this->owner]);\n }",
"public function all()\n {\n return $this->newQuery('getUsers', ['type' => 'AllUsers']);\n }",
"function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}",
"public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }",
"public function fetchAllUsers()\n {\n return UserAuthorityModel::leftjoin('users', 'user_authorities.users__id', '=', 'users._id')\n ->where('user_authorities.user_roles__id', '!=', 1)\n ->select(\n __nestedKeyValues([\n 'users' => [\n '_id',\n 'status',\n ],\n 'user_authorities' => [\n 'user_roles__id',\n ]\n ])\n )\n ->get();\n }",
"public function getOrgUsers(){\n $return_array = array();\n $current_campaign=Yii::app()->session->get('current_campaign');\n $campaign = Definition::model()->findByPk($current_campaign);\n if($campaign){\n $users = Users::model()->findAllByAttributes(array('fk_org_id'=>$campaign->fk_org_id));\n foreach($users as $user){\n $return_array[$user->id] = $user->username;\n }\n }\n \n return $return_array;\n }",
"public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }",
"public function getAllUsers() {\n\n $users = $this->repoProvider->Users()->findAll();\n return MapperHelper::getMapper()->getDTOs($users); // tomorrow first priority. \n }",
"public function getAllUsers()\n {\n $users = User::all();\n return $users;\n }",
"public function getAllUsers()\n\t{\n\t\t$users = $this->fetchAll();\n\t\t\n\t\treturn $users;\n\t}",
"public function findAllUsers()\n {\n return array_map(\n function (UserResponse $response) {\n return $response->getUser();\n },\n $this->apiClient->findAllUsers()\n );\n }",
"public function getAllUsers(): array\n {\n return $this->em->getRepository('AppBundle:User')->findAll();\n }",
"public function getUsers() {\n $userDAO = new UserDAO();\n return $userDAO->retrieveUsers();\n }",
"public function getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }",
"public function getUsers()\n {\n if (empty($this->users)) {\n $this->setUsers();\n }\n }",
"public function getUsers() {\n return $this->userHandler->getUsers();\n }",
"public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }",
"public function getAllUsersFull() {\n return $this->mapper->getAllUsersFull();\n }",
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function getAllUsers($withAdmin = false)\n {\n return $this->repository->getAllUsers($withAdmin);\n }",
"public function getUsers() {\n return $this->getRelation(\"users\");\n }",
"public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }",
"public function getUsers()\n {\n return $this->getRelation('users');\n }",
"public function getUsers() {\n\t\ttry {\n\t\t\treturn $this->getBounded1MInstance(\"XTUsersRecords\", $filter, $order, $limit, $whereAdd);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function getUsers() {\n \n // Call getAllUsers method in userDataService and set to variable\n $users = $this->getAllUsers();\n \n // Return array of users\n return $users;\n }",
"public function GetAllUsers()\n {\n $data = $this->db()->run(\"SELECT * FROM users\")->fetchall(PDO::FETCH_ASSOC);\n return $data;\n }",
"public function getAllUsers(): array\n {\n return $this->users;\n }",
"public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }",
"public function getAll(){\n $users = UserResource::collection($this->userRepo->getAll());\n return $users;\n }"
]
| [
"0.7456658",
"0.7358215",
"0.70937586",
"0.70937234",
"0.7082061",
"0.7069165",
"0.70450664",
"0.7036923",
"0.7021586",
"0.70115304",
"0.69902503",
"0.69791615",
"0.69777685",
"0.69569665",
"0.6928811",
"0.6922992",
"0.6918007",
"0.68926775",
"0.68814856",
"0.6858596",
"0.6842375",
"0.682985",
"0.6819161",
"0.6815308",
"0.68121356",
"0.67946434",
"0.6793642",
"0.6790838",
"0.67896765",
"0.67767656"
]
| 0.78459495 | 0 |
Determine if the given user has the given permission on the organization. | public function userHasPermission($user, $permission)
{
return $user->hasOrganizationPermission($this, $permission);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isGranted($userOrId, $permission);",
"function is_user_granted_permission($permission, $user_id = NULL) {\n\t$user_permissions_clause = format_sql_in_clause ( $permission );\n\t\n\tif (strlen ( $user_id ) == 0 && is_site_public_access ()) {\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission\n\t\t\tWHERE \trole_name = '\" . get_public_access_rolename () . \"' AND\n\t\t\t\t \tpermission_name IN ($user_permissions_clause)\";\n\t} else {\n\t\tif (strlen ( $user_id ) == 0)\n\t\t\t$user_id = get_opendb_session_var ( 'user_id' );\n\t\t\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission srp, \n\t\t\t\t \tuser u \n\t\t\tWHERE \tu.user_role = srp.role_name AND\n\t\t\t\t \tsrp.permission_name IN ($user_permissions_clause) AND\n\t\t\t\t \tu.user_id = '$user_id'\";\n\t}\n\t\n\t$result = db_query ( $query );\n\tif ($result && db_num_rows ( $result ) > 0) {\n\t\tdb_free_result ( $result );\n\t\treturn TRUE;\n\t}\n\t\n\t//else\n\treturn FALSE;\n}",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"public function has_permission($permission)\n {\n $drupal_user = user_load($this->uid);\n return user_access($permission, $drupal_user);\n }",
"public function userCan($permission)\n {\n // search own permission\n $strpos = strpos($permission,\"-own\");\n // if find check permission for user (not admin)\n if ($strpos !== false) {\n $parsPermission = str_replace(\"-own\",\"\",$permission);\n if (!$this->hasRole('user') && $this->can($permission) && !$this->can($parsPermission)) {\n return true;\n }\n return false;\n }\n return $this->can($permission);\n }",
"public function hasAccess($permission);",
"private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}",
"function is_user_allowed($user, $permission){\n\n \tif($permission == PERMISSION_LOGIN){\n \t\tif($user->is_surveyor == TRUE\n \t\t\t\t&& $user->is_supervisor == FALSE\n \t\t\t\t&& $user->is_manager == FALSE\n \t\t\t\t&& $user->is_general_manager == FALSE\n \t\t\t\t&& $user->is_admin == FALSE){\n \t\t\treturn FALSE;\n \t\t}\n \t}else if($permission == PERMISSION_ADD_SURVEYOR\n \t\t\t|| $permission == PERMISSION_EDIT_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DELETE_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DETAIL_SURVEYOR){\n \t\treturn $user->is_admin;\n \t}\n\n \treturn TRUE;\n }",
"private function hasPermission()\n { $user = User::getLoggedInUser();\n $has_permission = false;\n if ($user->getCurrentRoleName() == \"instructor\") {\n $instructor = $user->getCurrentRoleData();\n if ($instructor->hasPermission(\"Edit Compliance Status\")) {\n $has_permission = true;\n }\n }\n\n return $has_permission;\n }",
"public function userHasPermission($user, string $permission): bool\n {\n return $user->hasTeamPermission($this, $permission);\n }",
"public function checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type = \"\")\r\n\t{\r\n\t\tglobal $rbacreview, $ilUser;\r\n\r\n\t\t// :TODO: create permission for parent node with type ?!\r\n\t\t\r\n\t\t$pf = new ilObjPortfolio($a_node_id, false);\r\n\t\tif(!$pf->getId())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// portfolio owner has all rights\r\n\t\tif($pf->getOwner() == $a_user_id)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// other users can only read\r\n\t\tif($a_permission == \"read\" || $a_permission == \"visible\")\r\n\t\t{\r\n\t\t\t// get all objects with explicit permission\r\n\t\t\t$objects = $this->getPermissions($a_node_id);\r\n\t\t\tif($objects)\r\n\t\t\t{\r\n\t\t\t\tinclude_once \"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php\";\r\n\t\t\t\t\r\n\t\t\t\t// check if given user is member of object or has role\r\n\t\t\t\tforeach($objects as $obj_id)\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch($obj_id)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_ALL:\t\t\t\t\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_ALL_PASSWORD:\r\n\t\t\t\t\t\t\t// check against input kept in session\r\n\t\t\t\t\t\t\tif(self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) || \r\n\t\t\t\t\t\t\t\t$a_permission == \"visible\")\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tcase ilWorkspaceAccessGUI::PERMISSION_REGISTERED:\r\n\t\t\t\t\t\t\tif($ilUser->getId() != ANONYMOUS_USER_ID)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tswitch(ilObject::_lookupType($obj_id))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcase \"grp\":\r\n\t\t\t\t\t\t\t\t\t// member of group?\r\n\t\t\t\t\t\t\t\t\tif(ilGroupParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"crs\":\r\n\t\t\t\t\t\t\t\t\t// member of course?\r\n\t\t\t\t\t\t\t\t\tif(ilCourseParticipants::_getInstanceByObjId($obj_id)->isAssigned($a_user_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"role\":\r\n\t\t\t\t\t\t\t\t\t// has role?\r\n\t\t\t\t\t\t\t\t\tif($rbacreview->isAssigned($a_user_id, $obj_id))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase \"usr\":\r\n\t\t\t\t\t\t\t\t\t// direct assignment\r\n\t\t\t\t\t\t\t\t\tif($a_user_id == $obj_id)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"function hasPermission($user, $perm, $arg = null) {\n\t\tforeach (array_keys($instances = $this->getItems()) as $key) {\n\t\t\tif ($instances[$key]->hasPermission($user, $perm, $arg))\n\t\t\t\treturn true;\n\t\t}\n\t\tif (null != ($creator = SyndNodeLib::getInstance($this->data['CREATE_NODE_ID'])) && $creator->hasAuthorization($user, $this) ||\n\t\t\tnull != ($updator = SyndNodeLib::getInstance($this->data['UPDATE_NODE_ID'])) && $updator->hasAuthorization($user, $this))\n\t\t\treturn true;\n\t\tif ('merge' == $perm && in_array($arg, array('INFO_NUMBER')))\n\t\t\treturn $this->hasPermission($user, 'write');\n\t\treturn parent::hasPermission($user, $perm, $arg);\n\t}",
"public function HasPermission()\n\t\t{\n\t\t\tstatic $perms = null;\n\t\t\tif ($perms === null) {\n\t\t\t\t$perms = $GLOBALS[\"ISC_CLASS_ADMIN_AUTH\"]->GetPermissions();\n\t\t\t}\n\n\t\t\tif (in_array(AUTH_Edit_Customers, $perms)\n\t\t\t\t&& in_array(AUTH_Edit_Orders, $perms)\n\t\t\t\t&& in_array(AUTH_Newsletter_Subscribers, $perms)) {\n\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function havePermission($permission){\n $roles_user = $this->roles;\n\n //recorro cada rol y lo comparo\n foreach ($roles_user as $role) {\n //si tiene full acceso a los permisos regreso true\n if ($role['full-access'] == 'Si') {\n return true;\n }\n //recorro los permisos correspondientes al rol\n foreach ($role->permissions as $permission_user) {\n //verifico si tiene entre sus permisos el permiso a verificar en la function\n //si lo tiene regreso true\n if ($permission_user->slug == $permission) {\n return true;\n }\n }\n }\n //sino tiene ningun permiso regreso false\n return false;\n }",
"public function __invoke($permission, $assert = null, $optionassert = [], $user = null)\n {\n return Common::isGranted($permission, $assert, $optionassert, $user);\n }",
"function check_permission( $permission ) {\n global $_SESSION;\n\n // read the permissions database\n $d = loadDB();\n\n // check if the current user\n $user_name = $_SESSION[\"logged\"];\n // is allowed to use permission\n $roles = array();\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"name\"] == $user_name) {\n $roles = array_merge($roles, $value[\"roles\"]);\n }\n }\n\n // for each role find the list of permissions\n $userpermissions = array();\n foreach ($d[\"roles\"] as $key => $value) { // all known roles \n foreach ($roles as $role) { // roles of the current user\n if ($value[\"id\"] == $role) {\n $userpermissions = array_merge($userpermissions, $value[\"permissions\"]);\n }\n }\n }\n // print_r($userpermissions);\n \n // for each found permission find the name and compare to requested permission\n foreach ($userpermissions as $perm) {\n foreach ($d[\"permissions\"] as $key => $value) {\n if ($perm == $value[\"id\"] && \n $value[\"name\"] == $permission) {\n audit( \"check_permission\", $permission.\" as \".$user_name);\n return true;\n }\n }\n }\n\n audit( \"check_permission failed\", $permission.\" as \".$user_name);\n return false;\n }",
"public function permission(User $user, $entity)\n {\n if ($entity->exists === false) {\n return $this->checkPermission('permission', $user, null);\n }\n return $user->campaign->id == $entity->campaign_id &&\n ($user->campaign->roles()->count() > 1 || $user->campaign->members()->count() > 1) &&\n $this->checkPermission('permission', $user, $entity);\n }",
"public function has_permission($permission) {\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 isUser()\n\t{\n\t\tif( $this->permission != array_search( 'user', $this->permissions ) )\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"private function _check_permission($user,$permission_key)\n {\n $roles = $user->roles()->get();\n foreach($roles as $role)\n {\n if( is_array(json_decode($role->permissions)) )\n {\n if(array_search($permission_key, json_decode($role->permissions)) !== false)\n {\n return true;\n }\n }else{\n return false;\n }\n } \n return false;\n }",
"public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }",
"public function isAuthorized($user = null)\n {\n // if (!$this->request->getParam('prefix')) {\n // return true;\n // }\n\n // Only admins can access admin functions\n if ($this->request->getParam('prefix') === 'admin') {\n return (bool)($user['role'] === 'admin');\n }\n\n // Default deny\n return false;\n }",
"public function hasPermissionTo($permission){\n\n return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission);\n }",
"public function isOwnedBy(UserInterface $user);",
"public function authorize($user, CakeRequest $request) {\n\t\tif (!empty($user['admin']) || $user['role'] == 'admin') {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// @todo implement permissions for other users\n\t\treturn true;\n\t}"
]
| [
"0.78761965",
"0.7459259",
"0.7392292",
"0.71690947",
"0.71351993",
"0.7104486",
"0.70984775",
"0.697913",
"0.6970846",
"0.69530064",
"0.69404703",
"0.68357897",
"0.68357897",
"0.68357897",
"0.68357897",
"0.6798091",
"0.6791315",
"0.6783455",
"0.67534757",
"0.6733131",
"0.67089766",
"0.6663035",
"0.6651571",
"0.66479933",
"0.6632932",
"0.66267586",
"0.6625871",
"0.6596692",
"0.6594861",
"0.65854526"
]
| 0.77514416 | 1 |
Remove the given user from the organization. | public function removeUser($user)
{
if ($user->current_organization_id === $this->id) {
$user->forceFill([
'current_organization_id' => null,
])->save();
}
$this->users()->detach($user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeUser(UserInterface $user);",
"public function remove($user) : void\n {\n $this->em->remove($user);\n $this->em->flush();\n }",
"public function removeUser(User $user): Organization\n {\n $this->users->removeElement($user);\n\n return $this;\n }",
"public function removeUser($user): void\n {\n if ($user->current_team_id === $this->id) {\n $user->forceFill([\n 'current_team_id' => null,\n ])->save();\n }\n\n $this->users()->detach($user);\n }",
"public function removeUser()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_user]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_user]);\n\t\t}\n\t}",
"public function removeUser(User $user)\n {\n // TODO\n throw new \\Exception(\"Not implemented\");\n }",
"public function remove_user() { return $this->STOR->remove_user(); }",
"public function deleteUser(User $user): void\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n }",
"public function removeTeamUser($user)\n {\n if ($user->current_team_id === $this->id) {\n $user->forceFill([\n 'current_team_id' => null,\n ])->save();\n }\n\n $this->users()->detach($user);\n }",
"public function delete_user($user);",
"public function dropUser( $user )\n {\n \n $person = $this->db->select( 'SELECT id_person from wbfsys_role_user where upper(name) = upper(\\''.$user.'\\') ', 'id_person', true );\n \n $this->db->delete( 'DELETE FROM wbfsys_role_user WHERE upper(name) = upper(\\''.$user.'\\') ' );\n \n if( $person )\n $this->db->delete( 'DELETE FROM core_person WHERE rowid = '.$person );\n \n }",
"public function destroy(User $user)\n {\n //TODO: montar excluir usuário\n }",
"public function removeUser($user) : self\n {\n return $this->users()->detach(is_a($user, user_model()) ? $user->id : $user);\n }",
"public function retract($user): void\n {\n $this->users()->detach($user);\n }",
"public function remove($user) : void\n {\n $sql = \"DELETE FROM users WHERE username = :username\";\n\n $stmt = $this->conn->prepare($sql);\n\n try {\n $stmt->execute([\n ':username' => $user->getUsername(),\n ]);\n \n } catch (PDOException $e) {\n throw new InvalidArgumentException($e->getMessage(), 500);\n }\n }",
"function remove(User $user, User $by) {\n if($this->isMember($user, $this->object)) {\n try {\n DB::beginWork('Removing user from project @ ' . __CLASS__);\n \n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'project_users WHERE user_id = ? AND project_id = ?', $user->getId(), $this->object->getId());\n\n $this->project_members = array(); // Reset interal is member cache\n\n AngieApplication::cache()->removeByModel('users');\n AngieApplication::cache()->removeByModel('projects');\n\n $this->clearAssignmentsByUser($user, $by);\n $this->clearSubscriptionsByUser($user, $by);\n $this->clearRemindersByUser($user, $by);\n\n EventsManager::trigger('on_project_user_removed', array($this->object, $user));\n \n DB::commit('User removed from project @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to remove user from project @ ' . __CLASS__);\n \n throw $e;\n } // try\n\n $user->projects()->clearProjectDataCache();\n } // if\n }",
"public function destory(User $user)\n {\n return $user->delete();\n }",
"public function destroy(User $user)\n {\n $this->authorize('add', User::class);\n $user->delete();\n }",
"public function removeUser(MrAuthUser $user)\n {\n if (!empty($user->id) && $user->isSynched() == TRUE)\n {\n $conditions = array();\n $conditions[] = \"group_id = {$this->id}\";\n $conditions[] = \"auth_id = {$user->id}\";\n if (!$writer->doDelete(\"MrAuthGroupUser\", $conditions, \"LIMIT 1\"))\n {\n return FALSE;\n }\n }\n else\n {\n // Not a valid user\n return FALSE;\n }\n \n return TRUE;\n }",
"private function remove_user(&$user) {\r\n\t\t$index = (int)$user->socket;\r\n\t\tif($this->socket_array[$index] == $user){\r\n\t\t\tunset($this->socket_array[$index]);\r\n\t\t}\r\n\t\t\r\n\t\t$user->remove();\r\n\t}",
"public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }",
"public function removeUser($user){\n\t\t\tif(!in_array($user, $this->lobby)){\n\t\t\t\t$index = array_search($user, $this->lobby);\n\t\t\t\tunset($this->lobby[$index]);\n\t\t\t}\n\t\t}",
"public function deleteUser()\n {\n $this->delete();\n }",
"function user_remove($user_info)\n {\n }",
"public function destroy(User $user)\n {\n $user->delete();\n }",
"public function destroy(User $user)\n {\n $user->delete();\n }",
"public function RemoveUser($id)\r\n {\r\n $this->customPDO->Remove('users', 'WHERE User_Id = ' . $id);\r\n }",
"public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }",
"public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }",
"public function removeUserRole(Request $request, User $user)\n {\n if ($request->role_id) {\n $user->roles()->detach($request->role_id);\n }\n return $this->successResponse('Deleted successfully');\n }"
]
| [
"0.7548875",
"0.73125964",
"0.7151303",
"0.70971394",
"0.70348465",
"0.6871468",
"0.6832823",
"0.68317175",
"0.67618054",
"0.67498326",
"0.67093813",
"0.66536903",
"0.6649883",
"0.65956724",
"0.6580687",
"0.6565703",
"0.65650463",
"0.65042067",
"0.6501498",
"0.6470058",
"0.6436009",
"0.63992286",
"0.63952166",
"0.63926226",
"0.63899416",
"0.63899416",
"0.6372921",
"0.63683",
"0.63683",
"0.6355784"
]
| 0.7915771 | 0 |
Purge all of the organization's resources. | public function purge()
{
$this->owner()->where('current_organization_id', $this->id)
->update(['current_organization_id' => null]);
$this->users()->where('current_organization_id', $this->id)
->update(['current_organization_id' => null]);
$this->users()->detach();
$this->delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}",
"public final function destroy_all()\n {\n }",
"public function clear()\n {\n foreach ($this->objectsRepository as $repository) {\n if ($repository instanceof Repository) {\n $repository->clear();\n }\n }\n parent::clear();\n $this->objectsRepository = [];\n }",
"public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}",
"public function cleanAll()\n {\n $this->filesystem->remove(self::getFilesList());\n }",
"public function purgeAllQueues()\n {\n $this->cleanup();\n }",
"public function deleteAll()\n {\n \\Core\\File\\System::rrmdir($this->_getPath(), false, true);\n }",
"public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }",
"public function clear()\n {\n $this->repository->clear();\n }",
"public function cleanup()\n\t{\n\t\t$this->getObject()->cleanup();\n\t}",
"protected function purge()\n {\n $this->view->dropResources();\n }",
"public function purge();",
"public function purge();",
"public function purge();",
"public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}",
"public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }",
"public function cleanup() : void\n {\n unset($this->groups);\n }",
"public function clearAll()\n {\n $this->clearDir($this->file_path . '/sb_Cache');\n }",
"public static function cleanUp()\n {\n foreach (glob(static::getYamlRoot() . '*') as $file) {\n is_file($file) and unlink($file);\n }\n foreach (glob('{' . static::getEntitiesRoot() . '*,' . static::getProxiesRoot() . '*' . '}', GLOB_BRACE) as $file) {\n is_file($file) and unlink($file);\n is_dir(basename($file)) and rmdir(basename($file));\n is_dir($file) and rmdir($file);\n }\n !is_dir(static::getYamlRoot()) and mkdir(static::getYamlRoot(), 0777, true);\n !is_dir(static::getEntitiesRoot()) and mkdir(static::getEntitiesRoot(), 0777, true);\n !is_dir(static::getProxiesRoot()) and mkdir(static::getProxiesRoot(), 0777, true);\n }",
"public function purge() {}",
"public function clearDatabase()\n {\n $purger = new ORMPurger($this->getEntityManager());\n $purger->purge();\n }",
"public function cleanup(){\n\t\t$accountBookings = Billing_Controller_AccountBooking::getInstance()->getByBookingId($this->getId());\n\t\t\n\t\tforeach($accountBookings as $accountBooking){\n\t\t\tBilling_Controller_AccountBooking::getInstance()->delete(array($accountBooking->getId()));\n\t\t}\n\t}",
"public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }",
"public function clearAll() {}",
"public function clearAll();",
"public function clearAll();",
"public function cleanup()\n {\n foreach ($this->processes as $process) {\n $process->cleanup();\n }\n }",
"function cleanDBonPurge() {\n $sl = new SoftwareLicense();\n $sl->deleteByCriteria(['softwares_id' => $this->fields['id']]);\n\n $this->deleteChildrenAndRelationsFromDb(\n [\n Item_Project::class,\n SoftwareVersion::class,\n ]\n );\n }",
"public static final function destroy_all_for_all_users()\n {\n }",
"public function removeAllCache()\n {\n $this->removeBasicCache();\n $this->deleteDirectory($this->pubStatic);\n $this->deleteDirectory($this->varViewPreprocessed);\n $this->deleteDirectory($this->varGeneration);\n $this->deleteDirectory($this->generated);\n }"
]
| [
"0.6868069",
"0.6665217",
"0.65212077",
"0.64799875",
"0.6351496",
"0.62412184",
"0.6239488",
"0.62375826",
"0.6190614",
"0.61804485",
"0.615592",
"0.61409706",
"0.61409706",
"0.61409706",
"0.6133542",
"0.61221206",
"0.60923845",
"0.6087483",
"0.607421",
"0.60663617",
"0.6060108",
"0.60468644",
"0.601377",
"0.60045815",
"0.59618384",
"0.59618384",
"0.59518015",
"0.5950795",
"0.5927933",
"0.59154785"
]
| 0.68605137 | 1 |
data cache seconds (1H) Counstructor of class AresAttend init property companyid and emplyee seq no (psn_id) | function __construct($companyid, $emp_seqno) {
global $g_db_sql;
$this->companyID = $companyid;
$this->empSeqNo = $emp_seqno;
$this->DBConn = &$g_db_sql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }",
"function __construct()\n {\n $this->id = 0;\n $this->issuedDate = date('Y-m-d H:i:s');\n $this->returnDate = date('Y-m-d H:i:s');\n $this->fine = 0;\n $this->bookId = 0;\n $this->userId = 0;\n }",
"function __construct() { \r\n\t\t\t\t$this->id;\r\n\t\t\t\t$this->cpf;\r\n\t\t\t\t$this->email;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}",
"public function __construct()\n\t{\n\t\t$this->cache_ttl = intval(ee()->TMPL->fetch_param('ttl'));\n\t\t// For speed and API purposes, limit the cache to 30sec minimum\n\t\tif ($this->cache_ttl < 30)\n\t\t{\n\t\t\t$this->cache_ttl = 30;\n\t\t}\n\t}",
"private function __construct(){\r\n $this->ttl_by_type = array(\r\n 'short' => 300 , // 5 minutes\r\n 'default' => 7200, // 2 hours\r\n 'halfday' => 43200, // 12 hours\r\n 'day' => 86400, // 24 hours\r\n 'week' => 604800, // 7 days\r\n 'month' => 2592000, // 30 days (1 month)\r\n 'longterm' => 15811200 // 183 days (6 months)\r\n );\r\n }",
"public function __construct () {\n\t\tparent::__construct();\n\t\t\n \t$this->setId(new phpkit_id_URNInetId('urn:inet:middlebury.edu:id:implementations/apc_course'));\n \t$this->setDisplayName('APC Caching Course Manager');\n \t$this->setDescription('This is a CourseManager implementation that provides read-only, unauthenticated, access to course information stored in an underlying course manager.');\n\t}",
"function __construct()\n\t{\n\t\t// $this->cust_code = $cust_code;\n\t\t// $this->fecha_interaccion = $fecha_interaccion;\n\t\t// $this->tipo_interaccion = $tipo_interaccion;\n\t\t// $this->time_stamp = $time_stamp;\n }",
"public function __construct() {\n $this->time_start = 8;\n $this->time_end = 22;\n $this->no_slots = ($this->time_end - $this->time_start) + 1;\n $this->printed_to_edge = FALSE;\n $this->course_code_colours = array();\n $this->module_code_colours = array();\n\n global $CFG;\n\t\t\t$this->CFG = $CFG;\n require_once ($CFG->dirroot.'/lib/adodb/adodb.inc.php'); // include the necessary DB library\n \n $this->db = NewADOConnection('oci8'); // set up the connection\n //$this->db->debug=true;\n if (!$this->db->Connect('ebs.conel.ac.uk', 'ebsmoodle', '82814710', 'fs1')) {\n error('Can\\'t connect to EBS so can\\'t display timetable data', $this->wwwroot .'/my/index.php');\n }\n $this->db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t\t\n\t\t\tif ($start_date = $this->get_start_date_for_this_ac_year()) {\n\t\t\t\t$this->ac_year_start_date = $start_date;\n\t\t\t} else {\n\t\t\t\t$year = date('Y');\n\t\t\t\t$this->ac_year_start_date = mktime(0, 0, 0, 8, 1, $year, 0); // will revert to manual date if no record set in mdl_academic_years;\n }\n\t\t\t\n }",
"public function agency_meeting()\n {\n //获取该拍卖会信息\n $meeting = M('AuctionMeeting')->field('id, name, thumb, address, pre_starttime,pre_endtime, pre_address,starttime,endtime, agencyid, introduce')->find(I('get.id', '', 'int'));\n $this->meeting_res = $meeting;\n //dump($this->meeting_res);\n //p($this->meeting_res);\n\n $data['hits'] = array('exp', 'hits+1'); // 拍品点击量+1\n M('AuctionMeeting')->where(array('id' => I('get.id', 0, 'int')))->save($data); // 根据条件保存修改的数据\n\n#无数据\n //查询该拍卖会的最新预展信息\n $time = time();\n $this->meeting_yz = M('AuctionExhibit')->field('id, pre_starttime, pre_endtime')->where(\"UNIX_TIMESTAMP(starttime) > $time && meetingid >= '\" . mysql_real_escape_string(I('get.id', '', 'int')) . \"' && isshow = 1\")->order('starttime desc')->limit(1)->select();\n // p( $this->meeting_yz);//无数据\n#无数据\n //查询该拍卖会的最新拍卖信息\n $this->meeting_jg = M('AuctionExhibit')->field('id, starttime, endtime')->where(\"UNIX_TIMESTAMP(endtime) <= $time && meetingid >= '\" . mysql_real_escape_string(I('get.id', '', 'int')) . \"' && isshow = 1\")->order('starttime desc')->limit(1)->select();\n //p($this->meeting_jg);//无数据\n\n //获取该拍卖会所属机构信息\n $this->agency_res = $this->Model->field('id, name, address, thumb, tel, email, website, post')->where(array('id' => $meeting['agencyid']))->find();\n // p($this->agency_res);\n\n //获取该拍卖会下专场信息\n $this->list_num = M('AuctionMeeting')->where(array('pid' => I('get.id', '', 'int'), 'status' => 0))->count();\n// /p($this->list_num);\n// / $this->list = M('AuctionMeeting')->field('id, name, pid, money,pre_starttime, thumb, pre_endtime, starttime, address, endtime')->where(array('pid' => I('get.id', '', 'int'), 'status' => 0))->order('starttime desc')->select();\n\n $p = isset($_GET['p']) ? $_GET['p'] : 1;\n //每页显示的数量\n $prePage = 8;\n $list = M('AuctionMeeting')->field('id, name, pid, money,pre_starttime, thumb, pre_endtime, starttime, address, endtime')->where(array('pid' => I('get.id', '', 'int'), 'status' => 0))->order('starttime desc')->page($p . ',' . $prePage)->select();\n //p($list);\n $this->assign(\"list\", $list);\n $count = M('AuctionMeeting')->where(array('pid' => I('get.id', '', 'int'), 'status' => 0))->count(); // 查询满足要求的总记录数\n $Page = new \\Think\\Page($count, $prePage); // 实例化分页类 传入总记录数和每页显示的记录数\n $Page->setConfig('header', '共%TOTAL_ROW%条记录');\n $Page->setConfig('prev', '上一页');\n $Page->setConfig('next', '下一页');\n $Page->setConfig('first', '首页');\n $Page->setConfig('last', '尾页');\n\n $Page->setConfig('theme', '%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%');\n $show = $Page->show(); // 分页显示输出\n //p($show);\n $this->assign('page', $show); // 赋值分页输出\n\n //p($this->list);\n\n //拍品推荐\n $this->pptj_res = M('AuctionExhibit')->field('id, name, thumb, price, endprice, areaid, starttime')->where('isshow = 1')->limit(10)->order('hits desc')->select();\n //p( $this->pptj_res);\n //分配body css\n $this->assign(\"css\", 'selling-panel selling-preview-detail');\n $this->display('Front:agency_meeting');\n }",
"public function __construct() {\n $this->startup= new Date('2018-06-02 14:12:11+0200');\n $this->responsible= new Person(1549, 'Timm');\n }",
"public function set_data($r){\n if($r->stn_number == ''){ $this->complete = false; }\n\n //setting trip_id\n $this->trip_id = $r->trip_id;\n //calculating total_freight\n $this->total_freight += ($r->product_quantity * $r->freight_unit);\n //calculating total_freight_for_company\n $this->total_freight_for_company += ($r->company_freight_unit * $r->product_quantity);\n //setting tip_unique_data (this class variables)\n $this->customerId = $r->customer_id;\n $this->customerName = $r->customerName;\n\n $this->contractorId = $r->contractor_id ;\n $this->contractorName = $r->contractorName ;\n\n $this->companyId = $r->company_id ;\n $this->companyName = $r->companyName ;\n\n $this->tanker_id = $r->tanker_id ;\n $this->tanker_number = $r->tanker_number ;\n\n $this->entry_date = $r->entryDate ;\n $this->filling_date = $r->filling_date ;\n $this->receiving_date = $r->receiving_date ;\n $this->decanding_date = $r->decanding_date ;\n $this->stn_receiving_date = $r->stn_receiving_date ;\n $this->email_date = $r->email_date ;\n $this->invoice_date = $r->invoice_date ;\n\n $this->contractor_commission = $r->contractor_commission ;\n $this->contractor_commission_2 = $r->contractor_commission_2 ;\n $this->company_commission_1 = $r->company_commission_1 ;\n $this->company_commission_2 = $r->company_commission_2 ;\n $this->company_commission_3 = $r->company_commission_3 ;\n $this->company_freight = ($r->company_commission_1 +$r->company_commission_2+ $r->company_commission_3);\n\n $this->customer_freight = 100 - $this->contractor_commission;\n\n $this->driver_id_1 = $r->driver_id_1 ;\n $this->driver_name_1 = $r->driver_2_name ;\n\n $this->driver_id_2 = $r->driver_id_2 ;\n $this->driver_name_2 = $r->driver_2_name ;\n\n $this->driver_id_3 = $r->driver_id_3 ;\n $this->driver_name_3 = $r->driver_3_name ;\n\n $this->invoice_number = $r->invoice_number;\n\n $this->paid_to_customer = ($r->paid_to_customer != '')?$r->paid_to_customer:0;\n $this->payment_to_customer_date = $r->payment_to_customer_date;\n }",
"public function addAC($data){\n $advisory = new Advisory_Council;\n $advisory->fname = $data['fname'];\n\t \t$advisory->lname = $data['lname'];\n\t \t$advisory->mname = $data['mname'];\n\t \t$advisory->qualifier = $data['qname'];\n\t \t$advisory->gender = $data['gender'];\n\t \t$advisory->contactno = $data['mobile'];\n\t \t$advisory->landline = $data['landline'];\n\t \t$advisory->officename = $data['officename'];\n $advisory->officeaddress = $data['officeadd'];\n\t \t$advisory->email = $data['email'];\n\n\t \tif($data['durstart'] != \"\") {\n\t \t\t$advisory->startdate = $data['durstart'];\n\n\t \t}//if\n\t\tif($data['bdate'] != \"\") {\n\t \t\t$advisory->birthdate = $data['bdate'];\n\n\t \t}//if\n\n\t \t$advisory->fbuser = $data['facebook'];\n\t \t$advisory->twitteruser = $data['twitter'];\n\t \t$advisory->iguser = $data['instagram'];\n\n\t \t\n\n\t \t$advisory->street = $data['street'];\n\t \t$advisory->city = $data['city'];\n\t \t$advisory->province = $data['province'];\n\t \t$advisory->barangay = $data['barangay'];\n\n\n\t \tif($data['upphoto'] != \"\") {\n\t \t\t$advisory->imagepath = $this->loadphoto($data['upphoto']);\n\n\t \t}//if\n\n $advisory->advisory_position_id = $data['acposition'];\n $advisory->ac_sector_id = $data['acsector'];\n\n \t$advisory->second_id = $data['secondary'];\n\n\t if($data['tertiary'] != 'disitem') {\n\t \t$advisory->tertiary_id = $data['tertiary'];\n\t }//if\n\n\t if($data['quaternary'] != 'disitem') {\n\t \t$advisory->quaternary_id = $data['quaternary'];\n\t }//if\n\n $advisory->save();\n }",
"public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }",
"function __construct(){\n\t self::$all++;\n\t $this->id = self::$all;\n\t}",
"public function __construct() {\n parent::__construct(self::TABLE_NAME, self::ID, self::NAME);\n $this->_old_gcd_access_id = null;\n $this->_site_country = null;\n $this->_site_region_id = null;\n $this->_site_land_id = null;\n $this->_biome_type_id = null;\n $this->_site_type_id = null;\n $this->_basin_size_id = null;\n $this->_basin_size_value = null;\n $this->_catch_size_id = null;\n $this->_catch_size_value = null;\n $this->_local_veg_id = null;\n $this->_regional_veg_id = null;\n $this->_flow_type_id = null;\n $this->_site_id_status = 0 ;\n \n $this->_list_site_notes = array();\n $this->_liste_publi_id = array(); //xli initialisation des publications.\n\n $this->_temp_status_import_id = null;\n $this->_temp_latitude_value = null;\n $this->_temp_longitude_value = null;\n $this->_temp_elevation_value = null;\n $this->_temp_charcoal_pref_unit_id = null;\n $this->_temp_water_depth_value = null;\n $this->_temp_age_model_method_id = null;\n $this->_temp_data_source_id = null;\n $this->_temp_database_version_id = null;\n $this->_temps_age_units_id = null;\n $this->_list_core = array();\n }",
"public function __construct() {\n\t\tforeach ($this as $key => $value) \n\t\t\t$this->$key = '';\n\t\t$this->log_date = $this->seller_PP_ProfileStartDate = $this->timestmp = '0000-00-00 00:00:00';\n\t\t$this->vendor_id = 0;\n\t}",
"protected function obtainDataReferences()\n\t{\n\t\t$obCache = new CPHPCache;\n\t\tif ($obCache->StartDataCache($this->arParams[\"CACHE_TIME\"],\n\t\t\tLANGUAGE_ID.\n\t\t\tSITE_ID\n\t\t\t))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$cachedData = array();\n\n\t\t\t\t/////////////////////\n\t\t\t\t/////////////////////\n\n\t\t\t\t// Person type\n\t\t\t\t$dbPType = CSalePersonType::GetList(array(\"SORT\"=>\"ASC\"));\n\t\t\t\twhile ($arPType = $dbPType->Fetch())\n\t\t\t\t\t$cachedData['PERSON_TYPE'][$arPType[\"ID\"]] = $arPType;\n\n\t\t\t\t// Tax list\n\t\t\t\t$dbTaxList = CSaleOrderTax::GetList(array(\"APPLY_ORDER\" => \"ASC\"));\n\t\t\t\twhile ($arTaxList = $dbTaxList->Fetch())\n\t\t\t\t\t$cachedData['TAX'] = $arTaxList;\n\n\t\t\t\t// Save statuses for Filter form\n\t\t\t\t$dbStatus = CSaleStatus::GetList(array(\"SORT\"=>\"ASC\"), array(\"LID\"=>LANGUAGE_ID));\n\t\t\t\twhile ($arStatus = $dbStatus->Fetch())\n\t\t\t\t\t$cachedData['STATUS'][$arStatus[\"ID\"]] = $arStatus;\n\n\t\t\t\t$dbPaySystem = CSalePaySystem::GetList(array(\"SORT\"=>\"ASC\"));\n\t\t\t\twhile ($arPaySystem = $dbPaySystem->Fetch())\n\t\t\t\t\t$cachedData['PAYSYS'][$arPaySystem[\"ID\"]] = $arPaySystem;\n\n\t\t\t\t$dbDelivery = CSaleDelivery::GetList(array(\"SORT\"=>\"ASC\"));\n\t\t\t\twhile ($arDelivery = $dbDelivery->Fetch())\n\t\t\t\t\t$cachedData['DELIVERY'][$arDelivery[\"ID\"]] = $arDelivery;\n\n\t\t\t\t$dbDelivery = CSaleDeliveryHandler::GetList(array(), array(array(\"SITE_ID\" => SITE_ID)));\n\t\t\t\twhile ($arDeliveryHandler = $dbDelivery->Fetch())\n\t\t\t\t\t$cachedData['DELIVERY_HANDLERS'][$arDeliveryHandler[\"SID\"]] = $arDeliveryHandler;\n\n\t\t\t\t/////////////////////\n\t\t\t\t/////////////////////\n\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$obCache->AbortDataCache();\n\t\t\t\tthrow $e;\n\t\t\t}\n\n\t\t\t$obCache->EndDataCache($cachedData);\n\n\t\t}\n\t\telse\n\t\t\t$cachedData = $obCache->GetVars();\n\n\t\t$this->dbResult = array_merge($this->dbResult, $cachedData);\n\t}",
"private function __construct0() {\n\t\t\t$this->idea_uniqueId = $this->createUniqueId();\n\t\t}",
"public function __construct()\n {\n $now = new \\DateTime();\n $this->number = 'CR' . $now->format('Y') . $now->format('m') . '-';\n $this->dateCreation = new \\DateTime();\n $this->dateEnlevement = new \\DateTime();\n $this->heureEnlevement = new \\DateTime('14:00');\n $this->dateRetour = new \\DateTime('NOW + 2 day');\n $this->heureRetour = new \\DateTime('14:00');\n $this->effectue = false;\n $this->annule = false;\n $this->factureRecue = false;\n $this->mailSent = false;\n $this->nbJoursExploit = 1;\n $this->avecHayon = false;\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 }",
"public function __construct($aid) {\n\t\t$this->profile['AffiliateID'] = $aid;\n\t}",
"public function __construct($aid) {\n\t\t$this->profile['AffiliateID'] = $aid;\n\t}",
"function __construct1($hhID){\n\t\t$this->householdId = $hhID;\n\t}",
"public function create_instance($record = null, array $options = null) {\n global $DB;\n $record = (array)$record;\n $record['showdescription'] = 1;\n $record['offlinesessions'] = 1;\n $return = parent::create_instance($record, $options);\n // Add 2 sessions.\n $session = new stdClass();\n $session->register = $return->cmid;\n $session->userid = 15000;\n $session->login = time() - 5000;\n $session->logout = time();\n $session->duration = 5000;\n $session->onlinesess = 0;\n $session->refcourse = $return->course;\n $session->comments = 'comment1';\n $DB->insert_record('attendanceregister_session', $session);\n\n $aggregate = new stdClass();\n $aggregate->register = $return->cmid;\n $aggregate->userid = 15000;\n $aggregate->onlinesess = 0;\n $aggregate->refcourse = $return->course;\n $aggregate->duration = 3000;\n $aggregate->total = 0;\n $aggregate->grandtotal = 0;\n $DB->insert_record('attendanceregister_aggregate', $aggregate);\n\n $lock = new stdClass();\n $lock->register = $return->cmid;\n $lock->userid = 15000;\n $lock->takenon = time();\n $DB->insert_record('attendanceregister_lock', $lock);\n\n $session = new stdClass();\n $session->register = $return->cmid;\n $session->userid = 15000;\n $session->login = time() - 5000;\n $session->logout = time() + 8000;\n $session->duration = 13000;\n $session->onlinesess = 1;\n $session->refcourse = $return->course;\n $session->comments = 'comment2';\n $DB->insert_record('attendanceregister_session', $session);\n\n $aggregate = new stdClass();\n $aggregate->register = $return->cmid;\n $aggregate->userid = 15000;\n $aggregate->onlinesess = 1;\n $aggregate->refcourse = $return->course;\n $aggregate->duration = 800;\n $aggregate->total = 0;\n $aggregate->grandtotal = 1;\n $DB->insert_record('attendanceregister_aggregate', $aggregate);\n\n $lock = new stdClass();\n $lock->register = $return->cmid;\n $lock->userid = 15000;\n $lock->takenon = time();\n $DB->insert_record('attendanceregister_lock', $lock);\n\n return $return;\n }",
"function attendance_construct_sessions_data_for_add($formdata, mod_attendance_structure $att) {\n global $CFG;\n\n $sesstarttime = $formdata->sestime['starthour'] * HOURSECS + $formdata->sestime['startminute'] * MINSECS;\n $sesendtime = $formdata->sestime['endhour'] * HOURSECS + $formdata->sestime['endminute'] * MINSECS;\n $sessiondate = $formdata->sessiondate + $sesstarttime;\n $duration = $sesendtime - $sesstarttime;\n if (empty(get_config('attendance', 'enablewarnings'))) {\n $absenteereport = get_config('attendance', 'absenteereport_default');\n } else {\n $absenteereport = empty($formdata->absenteereport) ? 0 : 1;\n }\n\n $now = time();\n\n if (empty(get_config('attendance', 'studentscanmark'))) {\n $formdata->studentscanmark = 0;\n }\n\n if (empty(get_config('attendance', 'allowupdatestatus'))) {\n $formdata->allowupdatestatus = 0;\n }\n\n $calendarevent = 0;\n if (isset($formdata->calendarevent)) { // Calendar event should be created.\n $calendarevent = 1;\n }\n\n $sessions = array();\n if (isset($formdata->addmultiply)) {\n $startdate = $sessiondate;\n $enddate = $formdata->sessionenddate + DAYSECS; // Because enddate in 0:0am.\n\n if ($enddate < $startdate) {\n return null;\n }\n\n // Getting first day of week.\n $sdate = $startdate;\n $dinfo = usergetdate($sdate);\n if ($CFG->calendar_startwday === '0') { // Week start from sunday.\n $startweek = $startdate - $dinfo['wday'] * DAYSECS; // Call new variable.\n } else {\n $wday = $dinfo['wday'] === 0 ? 7 : $dinfo['wday'];\n $startweek = $startdate - ($wday - 1) * DAYSECS;\n }\n\n $wdaydesc = array(0 => 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');\n\n while ($sdate < $enddate) {\n if ($sdate < strtotime('+1 week', $startweek)) {\n $dinfo = usergetdate($sdate);\n if (isset($formdata->sdays) && array_key_exists($wdaydesc[$dinfo['wday']], $formdata->sdays)) {\n $sess = new stdClass();\n $sess->sessdate = make_timestamp($dinfo['year'], $dinfo['mon'], $dinfo['mday'],\n $formdata->sestime['starthour'], $formdata->sestime['startminute']);\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->absenteereport = $absenteereport;\n $sess->studentpassword = '';\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n $sess->automark = !empty($formdata->automark) ? $formdata->automark : 0;\n $sess->automarkcmid = !empty($formdata->automarkcmid) ? $formdata->automarkcmid : 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark)) { // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (isset($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (isset($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n } else {\n $sess->subnet = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n $sess->preventsharedip = 0;\n $sess->preventsharediptime = '';\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n $sdate = strtotime(\"+1 day\", $sdate); // Set start to tomorrow.\n } else {\n $startweek = strtotime(\"+\".$formdata->period.' weeks', $startweek);\n $sdate = $startweek;\n }\n }\n } else {\n $sess = new stdClass();\n $sess->sessdate = $sessiondate;\n $sess->duration = $duration;\n $sess->descriptionitemid = $formdata->sdescription['itemid'];\n $sess->description = $formdata->sdescription['text'];\n $sess->descriptionformat = $formdata->sdescription['format'];\n $sess->calendarevent = $calendarevent;\n $sess->timemodified = $now;\n $sess->studentscanmark = 0;\n $sess->allowupdatestatus = 0;\n $sess->autoassignstatus = 0;\n $sess->subnet = '';\n $sess->studentpassword = '';\n $sess->automark = 0;\n $sess->automarkcompleted = 0;\n\n if (!empty($formdata->automarkcmid)) {\n $sess->automarkcmid = $formdata->automarkcmid;\n } else {\n $sess->automarkcmid = 0;\n }\n\n $sess->absenteereport = $absenteereport;\n $sess->includeqrcode = 0;\n $sess->rotateqrcode = 0;\n $sess->rotateqrcodesecret = '';\n\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->preventsharediptime)) {\n $sess->preventsharediptime = $formdata->preventsharediptime;\n }\n\n if (isset($formdata->studentscanmark) && !empty($formdata->studentscanmark)) {\n // Students will be able to mark their own attendance.\n $sess->studentscanmark = 1;\n if (!empty($formdata->allowupdatestatus)) {\n $sess->allowupdatestatus = $formdata->allowupdatestatus;\n } else {\n $sess->allowupdatestatus = 0;\n }\n if (isset($formdata->autoassignstatus) && !empty($formdata->autoassignstatus)) {\n $sess->autoassignstatus = 1;\n }\n if (!empty($formdata->randompassword)) {\n $sess->studentpassword = attendance_random_string();\n } else if (!empty($formdata->studentpassword)) {\n $sess->studentpassword = $formdata->studentpassword;\n }\n if (!empty($formdata->includeqrcode)) {\n $sess->includeqrcode = $formdata->includeqrcode;\n }\n if (!empty($formdata->rotateqrcode)) {\n $sess->rotateqrcode = $formdata->rotateqrcode;\n $sess->studentpassword = attendance_random_string();\n $sess->rotateqrcodesecret = attendance_random_string();\n }\n if (!empty($formdata->usedefaultsubnet)) {\n $sess->subnet = $att->subnet;\n } else {\n $sess->subnet = $formdata->subnet;\n }\n\n if (!empty($formdata->automark)) {\n $sess->automark = $formdata->automark;\n }\n if (!empty($formdata->preventsharedip)) {\n $sess->preventsharedip = $formdata->preventsharedip;\n }\n if (!empty($formdata->studentsearlyopentime)) {\n $sess->studentsearlyopentime = $formdata->studentsearlyopentime;\n }\n }\n $sess->statusset = $formdata->statusset;\n\n attendance_fill_groupid($formdata, $sessions, $sess);\n }\n\n return $sessions;\n}",
"public function __construct(){\n $this->loggerM = LoggerMgr::Instance()->getLogger(__CLASS__);\n \n $this->loggerM->trace(\"Enter\");\n parent::__construct();\n\t\t$this->tableDefinitionM = new TableDef(self::TB_TimetableTableC);\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::IdColumnC,ColumnType::integerC));\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::NameColumnC,ColumnType::stringC));\n\t\t$this->tableDefinitionM->addColumn(new ColumnDef(\n self::DetailColumnC,ColumnType::stringC));\n\t\t$this->tableDefinitionM->addKey(self::IdColumnC);\n \n $this->tableMappingM = new TableMapping();\n \n $this->tableMappingM->addTable(self::phisicalTB_TIMETABLEC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_TIMETABLEC ,\n self::phisicalTB_TIMETABLEIdColumnC ,\n self::IdColumnC,\n ColumnType::integerC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_TIMETABLEC ,\n self::phisicalTB_TIMETABLENameColumnC ,\n self::NameColumnC,\n ColumnType::stringC);\n $this->tableMappingM->addColumn(\n self::phisicalTB_TIMETABLEC ,\n self::phisicalTB_TIMETABLEDetailColumnC ,\n self::DetailColumnC,\n ColumnType::stringC);\n \n $this->tableMappingM->addKey(self::phisicalTB_TIMETABLEC,\n self::phisicalTB_TIMETABLEIdColumnC );\n \n \n $this->loggerM->trace(\"Exit\");\n\t}",
"function __construct(){\r\n\t\t$this->mIDCache\t\t\t= MY_DB_IN . \"-\" . SAFE_VERSION . \"-\" . SAFE_REVISION;\r\n \t\t$this->init();\r\n }",
"public function __construct($pk_alumno_act, $name, $name_act, $fecha, $lugar, $hora)\n {\n //$this->qr = $qr;\n $this->pk_alumno_act = $pk_alumno_act;\n $this->name = $name;\n $this->name_act = $name_act;\n $this->fecha = $fecha;\n $this->lugar = $lugar;\n $this->hora = $hora;\n\n }",
"protected static function getBaseTcaCacheIdentifier() {}",
"public function __construct(int $expires = 84000)\n {\n $this->created = time();\n $this->expires = $expires;\n $this->expires = $this->created + $this->expires;\n }"
]
| [
"0.5240664",
"0.5141448",
"0.5135935",
"0.51110375",
"0.50918",
"0.50866574",
"0.5068535",
"0.5063079",
"0.5024779",
"0.49958226",
"0.49533644",
"0.48866495",
"0.48836768",
"0.48739",
"0.48620456",
"0.4853372",
"0.48451996",
"0.4844883",
"0.48437938",
"0.48278078",
"0.48161954",
"0.48161954",
"0.47887072",
"0.4786541",
"0.47554848",
"0.47311315",
"0.47202745",
"0.4717958",
"0.47122133",
"0.4699845"
]
| 0.51518625 | 1 |
end function SaveLeaveForm(); Check Begin/End time is in schedule | public function checkLeaveApplyTimeArea($emp_seq_no,$company_id,$begin_time,$end_time)
{
if(empty($begin_time) || empty($end_time)) return 'no parameter';
//$this->DBConn->debug = 1;
$sql= <<<eof
select count(*) cnt
from hr_carding
where psn_id = :emp_seqno
and psn_seg_segment_no = :company_id
and ((breakbegin is null and
to_date(:begin_time, 'yyyy-mm-dd hh24:mi') between intime and outtime) or
(breakbegin is not null and
(to_date(:begin_time1, 'yyyy-mm-dd hh24:mi') between intime and
breakbegin or to_date(:begin_time2, 'yyyy-mm-dd hh24:mi') between
breakend and outtime)))
eof;
$rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,
'company_id'=>$company_id,
'begin_time'=>$begin_time,
'begin_time1'=>$begin_time,
'begin_time2'=>$begin_time));
if($rs==0) return '1';
$sql = <<<eof
select count(*) cnt
from hr_carding
where psn_id = :emp_seqno
and psn_seg_segment_no = :company_id
and ((breakbegin is null and
to_date(:end_time, 'yyyy-mm-dd hh24:mi') between intime and
outtime) or
(breakbegin is not null and
(to_date(:end_time1, 'yyyy-mm-dd hh24:mi') between intime and
breakbegin or to_date(:end_time2, 'yyyy-mm-dd hh24:mi') between
breakend and outtime)))
eof;
$rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,
'company_id'=>$company_id,
'end_time'=>$end_time,
'end_time2'=>$end_time,
'end_time1'=>$end_time));
if($rs==0) return '2';
return 'ok';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_working_time($empID, $start, $end) \n {\n \n require_once('models/Hours.class.php');\n \n if ($end <= $start)\n return false;\n \n //Check new hours are within the businesses opening hours\n $hours = new Hours($this->db);\n \n if (!$hours->checkWithinHours($start) || !$hours->checkWithinHours($end)){\n \n $this->redirect(\"WorkerAvailability.php?error=outside_opening_hours\");\n die();\n }\n \n while ($start < $end)\n {\n $sd = $start->format(\"Y-m-d H:i:s\");\n $q = $this->db->prepare(\"SELECT dateTime FROM TimeSlot WHERE dateTime = ?;\"); // check appointment exists\n $q->bind_param('s', $sd);\n \n if (!$q->execute())\n return false;\n \n $result = $q->get_result();\n\n if (mysqli_num_rows($result) > 0) \n {\n $cw = 1;\n $row = mysqli_fetch_array($result); \n \n $q = $this->db->prepare(\"SELECT dateTime, empID FROM CanWork WHERE empID = ? AND dateTime = ?;\"); // check CanWork not already updated\n \n $rows = 0;\n \n if ($q)\n {\n $q->bind_param('ss', $empID, $row['dateTime']);\n \n if (!$q->execute())\n return false;\n \n $result = $q->get_result();\n $rows = mysqli_num_rows($result);\n } \n \n \n \n if ($rows == 0) \n {\n $q = $this->db->prepare(\"INSERT INTO CanWork (empID, dateTime) VALUES (?, ?)\");\n $q->bind_param('ss', $empID, $row['dateTime']);\n \n if (!$q->execute())\n return false;\n }\n \n else return false; // overlaps not accepted\n }\n else \n {\n echo \"failed <br>\";\n // exception\n return false;\n }\n \n $start->modify('+'.MINIMUM_INTERVAL.' minutes');\n }\n \n return true;\n }",
"private function __checkIfExistsOfSchedule(Model $schedule_model,$room_id,$start,$end)\r\n\t{\r\n\t\t$conditions=array();\r\n\t\t//$start=\"20180101\";\r\n\t\t$schedule_model->unbindFully();\r\n\t\t$conditions[\"and\"][\"CONCAT({$schedule_model->name}.start_month_prefix,lpad({$schedule_model->name}.start_day,2,0)) between ? AND ?\"]=array($start,$end);\r\n\t\t$conditions[\"and\"][\"{$schedule_model->name}.del_flg\"]=0;\r\n\r\n\t\t//the last day of schedule indivisually.\r\n\t\t$conditions[]=\"1=1 group by {$schedule_model->name}.reserve_id\";\r\n\t\t$fields=array(\"{$schedule_model->name}.reserve_id\",\"MAX(CONCAT({$schedule_model->name}.start_month_prefix,lpad({$schedule_model->name}.start_day,2,0))) as date\");\r\n\t\t$data=$schedule_model->find(\"all\",array(\"conditions\"=>$conditions,\"fields\"=>$fields));\r\n\t\tif(empty($data)) return true;\r\n\r\n\t\t//target reservations.\r\n\t\t$reserve_ids=array_unique(Set::extract($data,\"{}.{$schedule_model->name}.reserve_id\"));\r\n\t\t$schedule_lastdays=Set::combine($data,\"{n}.{$schedule_model->name}.reserve_id\",\"{}.0.date\");\r\n\r\n\t\t//$room_id=3;\r\n\t\t$conditions=array();\r\n\t\t$association=$this->K9DataReservation->association[\"hasMany\"][\"K9DataSchedulePlan\"];\r\n\t\t//$association[\"conditions\"][\"K9DataSchedulePlan.room_id\"]=$room_id;\r\n\t\t$association[\"conditions\"][\"K9DataSchedulePlan.del_flg\"]=0;\r\n\t\t$association[\"order\"]=array(\"K9DataSchedulePlan.start DESC\");\r\n\t\t$conditions[\"and\"][\"K9DataReservation.id\"]=$reserve_ids;\r\n\t\t$this->K9DataReservation->bindModel(array(\"hasMany\"=>array(\"K9DataSchedulePlan\"=>$association)));\r\n\t\t$this->K9DataReservation->unbindModel(array(\"belongsTo\"=>array(\"K9DataGuest\")));\r\n\t\t$data=$this->K9DataReservation->find(\"all\",array(\"conditions\"=>$conditions));\r\n\t\t//there is no posivily can't find reservation based on reservation_ids;\r\n\t\t//if(empty($data)) throw new Exception(__(\"正常に処理が終了しませんでした\"));\r\n\r\n\t\t//it shuld be ununique data dosen't come from frontside but just in case this function is being working here.\r\n\t\t$res=$this->__checkIfHasAlreadySetOn($room_id,$data,$schedule_lastdays,array( \"start\"=>$start,\"end\"=>$end ));\r\n\t\tif(empty($res)) return false;\r\n\t\treturn true;\r\n\t}",
"public function check_leave(){\n\t\t// when the form submitted\n\t\tif(empty($this->data['Leave']['leave_from']) || empty($this->data['Leave']['leave_to'])){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}",
"public function control(){\r\n $result=parent::control();\r\n if ($result==\"OK\") { $result=\"\"; }\r\n \r\n $old = $this->getOld();\r\n \r\n if($this->idLeaveType==NULL){\r\n $result.='<br/>' . i18n('idLeaveTypeMandatory');\r\n }\r\n \r\n if($this->idEmployee==NULL){\r\n $result.='<br/>' . i18n('idEmployeeMandatory');\r\n }\r\n\r\n // At least one EmployeeLeaveEarned unclosed by leave type\r\n if ($old->idle==0 and $this->idle==1) {\r\n $unclosedEmpLE = $this->getEmployeeLeaveEarnedForAnEmployee($this->idEmployee,$this->idLeaveType, false,false);\r\n if (!count($unclosedEmpLE)) {\r\n $result.='<br/>' . i18n('AtLeastOneOpenedEmployeeLeaveEarned'); \r\n }\r\n }\r\n \r\n // startDate/endDate/quantity must be defined/undefined at the same time\r\n if($this->leftQuantity==null and $this->quantity==0) {\r\n $this->leftQuantity = $this->quantity;\r\n }\r\n if( ! (\r\n ($this->startDate==null && $this->endDate==null && $this->quantity==null && $this->leftQuantity==null) || \r\n ($this->startDate!==null && $this->endDate!==null && ($this->quantity!==null && $this->quantity!==\"\") && \r\n ($this->leftQuantity!==null && $this->leftQuantity!==\"\") \r\n ))\r\n )\r\n {\r\n $result.='<br/>' . i18n('errorQuantityStartDateEndDateMustBeDefinedTogether');\r\n }\r\n \r\n //if the endDate is set before the startDate\r\n if($this->startDate > $this->endDate){\r\n $result.='<br/>' . i18n('invalidEndDate');\r\n }\r\n \r\n if($this->quantity!=null && $this->quantity<=0){\r\n $result.='<br/>' . i18n('invalidQuantity');\r\n }\r\n \r\n //TO DO: MESSAGE CONFIRM\r\n //multiple infinite or infinite=>finite\r\n //control if there is already a leaveEarned (with same idEmployee/idLeaveType) with null dates and quantity \r\n //(a leaveEarned with null dates and quantity means that the employee can ask as many leaves as he wants for this leaveType, so there cannot be at the same time \r\n //a leaveEarned which indicate the right to ask an unlimited number of leaves \r\n //and another with a quantity which indicate that the employee can ask a limited number of leaves) \r\n $clauseWhere=\"idEmployee = \".$this->idEmployee.\" AND idLeaveType = \".$this->idLeaveType.\" AND quantity IS NULL AND idle=0\";\r\n if($this->id!=NULL){\r\n $clauseWhere.=\" AND id <>\".$this->id;\r\n }\r\n $lvEarnedQNullList=$this->getSqlElementsFromCriteria(null,false,$clauseWhere);\r\n if($lvEarnedQNullList){\r\n $result.='<br/>' . i18n('errorMustDeleteNullLeaveEarnedFirst');\r\n }\r\n \r\n //TO DO: MESSAGE CONFIRM\r\n //finite=>infinite\r\n $clauseWhere=\"idEmployee = \".$this->idEmployee.\" AND idLeaveType = \".$this->idLeaveType.\" AND quantity IS NOT NULL AND idle=0\";\r\n if($this->id!=NULL){\r\n $clauseWhere.=\" AND id <>\".$this->id;\r\n }\r\n $lvEarnedQNotNullList=$this->getSqlElementsFromCriteria(null,false,$clauseWhere);\r\n if($this->quantity==null && $lvEarnedQNotNullList){\r\n $result.='<br/>' . i18n('errorMustCloseNotNullLeaveEarnedFirst');\r\n }\r\n \r\n //control if there is already a leaveEarned with the same dates/idEmployee/idLeaveType\r\n if($this->startDate!=null && $this->endDate!=null){\r\n $start=(new DateTime($this->startDate))->format('Y-m-d');\r\n $end=(new DateTime($this->endDate))->format('Y-m-d');\r\n $clauseWhere=\"idLeaveType=\".$this->idLeaveType.\" AND idEmployee=\".$this->idEmployee.\" AND idle=0 AND ( (startDate>='$start' AND NOT (startDate>'$end')) OR \"\r\n . \"(endDate<='$end' AND NOT (endDate<'$start')) OR \"\r\n . \"(startDate<='$start' AND endDate>='$end') )\";\r\n if($this->id!=null){\r\n $clauseWhere.=\"AND id <>\".$this->id;\r\n }\r\n $list=$this->getSqlElementsFromCriteria(null,false,$clauseWhere);\r\n if($list){\r\n $result.='<br/>' . i18n('errorLeaveEarnedOverlap');\r\n }\r\n }\r\n \r\n \r\n //TO DO: MESSAGE CONFIRM\r\n //a left cannot be superior to quantity\r\n if($this->quantity!=NULL){\r\n if($this->leftQuantity > $this->quantity){\r\n $result.='<br/>' . i18n('errorLeftQSuperiorToQuantity');\r\n }\r\n }\r\n \r\n $old = $this->getOld();\r\n //constraint: can't create a leaveEarned with a startDate that is not valid anymore compared to today \r\n if($this->startDate!=$old->startDate || $this->endDate != $old->endDate){\r\n $critContract=array(\"idEmployee\"=>$this->idEmployee,\"idle\"=>\"0\");\r\n \r\n $empContract = SqlElement::getFirstSqlElementFromCriteria(\"EmploymentContract\",$critContract);\r\n $critLvTypeOfEmpContractType = array(\r\n \"idLeaveType\"=>$this->idLeaveType, \r\n \"idEmploymentContractType\"=>$empContract->idEmploymentContractType, \r\n \"idle\"=>\"0\"\r\n );\r\n $lvTypeOfEmpContractType = SqlElement::getFirstSqlElementFromCriteria(\"LeaveTypeOfEmploymentContractType\",$critLvTypeOfEmpContractType);\r\n if($lvTypeOfEmpContractType){\r\n if($lvTypeOfEmpContractType->validityDuration!=null){\r\n $thisStartDateTime=new DateTime($this->startDate);\r\n $testStart=new DateTime(\"now\");\r\n $testDateInterval = new DateInterval(\"P\".$lvTypeOfEmpContractType->validityDuration.\"M\");\r\n $testStart->sub($testDateInterval);\r\n if($thisStartDateTime < $testStart){\r\n $result.='<br/>' . i18n('errorLvEarnedStartDateNotValidAnymore');\r\n }\r\n }\r\n }\r\n }\r\n \r\n //quantity and leftQuantity must be modulos of 0.5\r\n if($this->quantity!==null && trim($this->quantity)!==\"\" && $this->leftQuantity!==null && trim($this->leftQuantity)!==\"\"){\r\n if(! (fmod($this->quantity, 0.5) == 0) || ! (fmod($this->leftQuantity, 0.5) == 0)){\r\n $result.='<br/>' . i18n('errorLeftQuantityOrQuantityNotModuloOfZeroPointFive');\r\n }\r\n }\r\n \r\n $defaultControl=parent::control();\r\n if ($defaultControl!='OK') {\r\n $result.=$defaultControl;\r\n }\r\n\r\n if ($result==\"\") $result='OK';\r\n \r\n return $result;\r\n }",
"function check_availability($room, $fromTime, $toTime) {\n global $DB;\n\n //Case 1: startTime(new)->starttime(existing)->endTime(new)->endtime(existing)\n if ($reservation = get_reservation_byTime($room, $fromTime)) {\n\n return $reservation;\n\n }\n //Case 2: starttime(existing)->startTime(new)->endtime(existing)->endTime(new)\n else if ($reservation = get_reservation_byTime($room, $toTime - 600)) {\n \n return $reservation;\n }\n //Case 3: starttime(existing)->startTime(new)->endTime(new)->endtime(existing)\n //is a combination of case 1 and 2 and is therefore already taken care of\n //Case 4: startTime(new)->starttime(existing)->endtime(existing)->endTime(new)\n \n else if ($reservation = $DB->get_records_select('roomscheduler_reservations', 'location=\\'' . $room . '\\' AND active=\\'1\\' AND startdate>=\\'' . $fromTime . '\\' AND enddate<=\\'' . $toTime . '\\'',$params=null, $sort='', $fields='*', $limitfrom=0, $limitnum=1)) {\n\n if(is_array($reservation)){\n return end($reservation);\n}\n }\n //Case 5: no conflict\n else {\n return false;\n }\n}",
"public function session_validate(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$leave_from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$leave_to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$diff = $this->diff_date($leave_from, $leave_to);\t\t\t\n\t\t\tif($diff > 0 && $this->data['Leave']['session'] != 'D'){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}",
"public function checkTimeEnd(): bool;",
"function preSaveCheck($request) {\n\t\t$convertAll = false;\n\t\t$convertTS = false;\n\t\t$convertTE = false;\n\t\tif (empty($request['stop_watch'])) {\n\t\t\tif($request['action'] == 'TimecontrolAjax'){\n\t\t\t\tswitch ($request['fldName']) {\n\t\t\t\t\tcase 'time_start':\n\t\t\t\t\t\t$convertTS = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'time_end':\n\t\t\t\t\t\t$convertTE = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$convertAll = true;\n\t\t\t}\n\t\t\tif (($convertAll || $convertTS) && (!empty($this->column_fields['date_start']) and !empty($this->column_fields['time_start']))) {\n\t\t\t\t$dt = new DateTimeField($this->column_fields['date_start']);\n\t\t\t\t$fmtdt = $dt->convertToDBFormat($this->column_fields['date_start']);\n\t\t\t\t$time_start = DateTimeField::convertToDBTimeZone($fmtdt.' '.$this->column_fields['time_start']);\n\t\t\t\t$this->column_fields['date_start'] = $time_start->format('Y-m-d');\n\t\t\t\t$ts = $time_start->format('H:i:s');\n\t\t\t\t$this->column_fields['time_start'] = $ts;\n\t\t\t}\n\t\t\tif (($convertAll || $convertTE) && (!empty($this->column_fields['date_end']) and !empty($this->column_fields['time_end']))) {\n\t\t\t\t$dt = new DateTimeField($this->column_fields['date_end']);\n\t\t\t\t$fmtdt = $dt->convertToDBFormat($this->column_fields['date_end']);\n\t\t\t\t$time_end = DateTimeField::convertToDBTimeZone($fmtdt.' '.$this->column_fields['time_end']);\n\t\t\t\t$this->column_fields['date_end'] = $time_end->format('Y-m-d');\n\t\t\t\t$te = $time_end->format('H:i:s');\n\t\t\t\t$this->column_fields['time_end'] = $te;\n\t\t\t}\n\t\t}\n\t}",
"function checkTimeRange($params) {\n\n if (!isset($params['start_date']) || $params['start_date'] == null) {\n return -1;\n }\n \n if (!isset($params['stop_date']) || $params['stop_date'] == null) {\n return -2;\n }\n \n if (!isset($params['start_time']) || $params['start_time'] == null) {\n return -3;\n }\n \n if (!isset($params['end_time']) || $params['end_time'] == null) {\n return -4;\n }\n \n $startTime = $params['start_date'] . ' ' . $params['start_time'];\n $emdTime = $params['stop_date'] . ' ' . $params['end_time'];\n \n if(strtotime($startTime) > strtotime($emdTime)) {\n return -5;\n }\n return 1;\n }",
"function _isValidEndDate()\r\n {\r\n if (strtotime($this->data[$this->name]['end_date']) > strtotime(date('Y-m-d H:i:s'))) {\r\n return true;\r\n }\r\n return false;\r\n }",
"function store(){\n\n date_default_timezone_set( 'Asia/Manila' );\n\n $buffer = '2 Hours';\n\n //INITIAL CHECKS\n if( $_POST['startTime'] < date( 'H:i:s', strtotime( '8:00 am' ) ) || $_POST['startTime'] > date( 'H:i:s', strtotime( '5:00 pm' ) ) ){\n redirect( route( 'reservations?alert=1' ) );\n return false;\n }\n\n $request_start = date( 'Y-m-d H:i:s', strtotime( $_POST['reservation_startdate'].\" \".$_POST['startTime'] ) );\n $duration = where( 'reservation_categories', \"reservation_category = '{$_POST['reservation']}'\")[0]['reservation_duration'];\n\n //Get and Set End of Requested event\n $request_end = date_add(\n date_create( $request_start ),\n date_interval_create_from_date_string( $duration ));\n\n $request_end = date_format( $request_end, 'Y-m-d H:i:s' );\n //END\n\n //Get and Set request date with buffer\n $request_buffered = date_sub(\n date_create( $request_start ),\n date_interval_create_from_date_string( $buffer )\n );\n\n $request_buffered = date_format( $request_buffered, 'Y-m-d H:i:s' );\n //END\n\n\n //First line of defense in checking whether there is already an existing reservation\n $first_check = where( 'reservations', \"'{$request_buffered}' < reservation_enddate AND reservation_enddate < '{$request_end}'\" );\n\n if( !empty( $first_check )){\n\n redirect( route( 'dashboard/reservation/create?alert=1' ) );\n return false;\n\n }\n\n //Last line of defense to check an existing reservation\n $second_check = where( 'reservations', \"'{$request_buffered}' < reservation_startdate AND reservation_startdate < '{$request_end}'\" );\n\n if( !empty( $second_check ) ){\n\n redirect( route( 'dashboard/reservation/create?alert=1' ) );\n return false;\n }\n\n\n\n $data = [\n\n 'reserver_name' => $_POST['reserver_name'],\n 'reserver_contact' => $_POST['reserver_contact'],\n 'reservation' => $_POST['reservation'],\n 'reservation_startdate' => $request_start,\n 'reservation_enddate' => $request_end,\n 'facilitator' => $_POST['facilitator'],\n 'approved_by' => $_POST['approved_by'],\n 'approved_date' => date( 'Y-m-d H:i:s' ),\n 'reservation_status' => 'Approved',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n\n\n ];\n\n\n insert('reservations', $data );\n\n //START SMS\n $settings = get( 'settings', 1);\n\n if( !insert('reservations', $data ) ){\n redirect( route( 'reservations?alert=2' ) );\n }\n\n $number = $_POST['reserver_contact'];\n $message = $settings[0]['approved_message'];\n $apicode = $settings[0]['sms_key'];\n\n //Notify admin\n itexmo( $number, $message, $apicode );\n\n redirect( route( 'dashboard/reservation' ) );\n return true;\n}",
"public function add_schedule() {\n\t\t$data['page'] = 'Schedule';\n\t\t$data['pagetitle']='Manage '.$data['page'].' | Add '.$data['page'];\n\t\t$data['ckeditor']=false;\n\t\t$data['gridTable']=false;\n\t\t\n\t\t$formSubmit = $this->input->post('Submit');\n\t\tif($formSubmit==\"Save\")\n\t\t{\n\t\t\tif($this->input->post('is_to_be_confirm')=='on')\n\t\t\t{\n\t\t\t\t$is_to_be_confirm=1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$is_to_be_confirm=0;\n\t\t\t}\n\t\t\t$tblName = \"schedule\";\n\t\t\t$start_date=date('Y-m-d H:i',strtotime($this->input->post('start_date')));\n\t\t\t$end_date=date('Y-m-d H:i',strtotime($this->input->post('end_date')));\n\t\t\t\n\t\t\t\n\t\t\t\t\t$data = array('total_over_id' =>$this->input->post('total_over_id'),\n\t\t\t\t\t\t\t\t 'stage_id' =>$this->input->post('stage_id'),\n\t\t\t\t\t\t\t\t 'venue_id' =>$this->input->post('venue_id'),\n\t\t\t\t\t\t\t\t 'tournament_group_id_1'=>$this->input->post('tournament_group_id1'),\n\t\t\t\t\t\t\t\t 'tournament_group_id_2'=>$this->input->post('tournament_group_id2'),\n\t\t\t\t\t\t\t\t 'team_id_1' =>$this->input->post('team_id_1'),\n\t\t\t\t\t\t\t\t 'team_id_2' =>$this->input->post('team_id_2'),\n\t\t\t\t\t\t\t\t 'start_date' =>$start_date,\n\t\t\t\t\t\t\t\t 'end_date' =>$end_date,\n\t\t\t\t\t\t\t\t 'is_to_be_confirm'=>$is_to_be_confirm,\n\t\t\t\t\t\t\t\t 'is_active'=>1\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$id=$this->input->post('schedule_id');\n\t\t\t\t\t$fieldName=\"schedule_id\";\n\t\t\t\t\t$this->common->update_record($fieldName,$id,$tblName,$data);\n\t\t\t\t\t$this->session->set_flashdata('msg', 'Schedule has been added successfully.');\n\t\t\t\t\tredirect('admin/schedule','refresh'); //redirect in manage with msg\t\n\t\t\t\t//}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t$data['tournament']=$this->tournament->get_tournament();\n\t\t$data['stage']=$this->schedule->get_stage();\n\t\t$data['venue']=$this->schedule->get_venue();\n\t\t$data['over']=$this->schedule->get_over();\n\t\t$this->load->view('admin/controls/vwHeader');\n\t\t$this->load->view('admin/controls/vwLeft',$data);\n\t\t$this->load->view('admin/controls/vwFooterJavascript',$data);\n\t\t$this->load->view('admin/vwAddSchedule',$data); \n\t\t$this->load->view('admin/controls/vwFooter');\n\t\t\n\t}",
"public function set_standard_schedule() {\n $this->load->model('hrd_model');\n $this->data['title'] = \"Kelola Jadwal\";\n $this->data['subtitle'] =\"Kelola Jadwal\";\n\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n $this->data['message_success'] = $this->session->flashdata('message_success');\n\n\n if (isset($_POST) && !empty($_POST)) {\n $office_hour_id=$this->input->post(\"office_hour\");\n $employees=$this->input->post(\"employees\");\n $start_date=$this->input->post(\"start_date\");\n $end_date=$this->input->post(\"end_date\");\n $repeat=$this->input->post(\"repeat\");\n $start_time=$this->input->post(\"start_time\");\n $end_time=$this->input->post(\"end_time\");\n\n $office_hour=$this->hrd_model->get_one(\"hr_office_hours\", $office_hour_id);\n $return=array();\n $return['status']=true;\n $return['message']=\"\";\n\n\n if ($office_hour_id == \"\" || $office_hour_id = 0) {\n if (($start_time == \"\") || ($end_time == \"\")) {\n $return['status']=false;\n $return['message']=\"Jam Mulai dan Jam Akhir harus diisi\";\n } else {\n $office_hour_id = 0;\n $checkin_time = $start_time;\n $checkout_time = $end_time;\n } \n } else {\n $office_hour_id = $this->input->post(\"office_hour\");\n $checkin_time = $office_hour->checkin_time;\n $checkout_time = $office_hour->checkout_time;\n }\n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id = $employees[$x];\n $checking_schedule = $this->hrd_model->checking_schedule(array(\"start_date\"=>$start_date,\"end_date\"=>$end_date,\"repeat\"=>$repeat,\"user_id\"=>$user_id));\n if(sizeof($checking_schedule)>0){\n $return['status']=false;\n foreach($checking_schedule as $c){\n $return['message'].=$c->name.\" sudah mempunyai jadwal di tanggal \".date(\"d/m/Y\",strtotime($c->start_date)).($c->enum_repeat==1 ? \" dan berlaku seterusnya\" : \" s/d \".date(\"d/m/Y\",strtotime($c->end_date))).\"<br>\"; \n }\n }\n }\n\n if (!empty($employees)){\n\n if($return['status']==true){\n \n\n for($x=0;$x<sizeof($employees);$x++){\n $user_id=$employees[$x];\n\n if($repeat == 1){\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => '0000-00-00',\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n } else {\n\n $save_data = array(\n 'user_id' => $user_id,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'enum_repeat' => $repeat,\n 'free_day' => 0,\n 'is_special_schedule' => 0\n );\n\n }\n\n $save_data = $this->hrd_model->save('hr_schedules', $save_data); \n\n if($save_data){\n $save_detail = array(\n 'schedule_id' => $save_data,\n 'office_hour_id' => $office_hour_id,\n 'start_time' => $checkin_time,\n 'end_time' => $checkout_time\n );\n $this->hrd_model->save('hr_schedule_detail', $save_detail);\n }\n\n } \n \n }\n }\n\n \n redirect(base_url(SITE_ADMIN.'/hrd_schedule/set_standard_schedule','refresh'));\n\n \n } else {\n $store = $this->data['setting']['store_id'];\n $this->data['office_hours']= $this->hrd_model->get(\"hr_office_hours\")->result();\n\n $usersch = array();\n $get_user_id = $this->hrd_model->get(\"hr_schedules\")->result();\n foreach ($get_user_id as $key) {\n array_push($usersch, $key->user_id);\n }\n\n $this->data['data_url'] = base_url(SITE_ADMIN . '/hrd_schedule/get_employee_schedule_data');\n $this->data['employees']=$this->hrd_model->get_employee_schedule(array(\"active\"=>1, \"store_id\" => $store),false);\n\n \n $this->data['content'] .= $this->load->view('admin/hrd/set_schedule_standard_view', $this->data, true);\n $this->render('hrd');\n }\n\n }",
"public function checkInput()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tif($this->getDisabled())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$post = $_POST[$this->getPostVar()];\n\t\tif(!is_array($post))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$start = $post[\"start\"];\n\t\t$end = $post[\"end\"];\n\t\t\n\t\t// if full day is active, ignore time format\n\t\t$format = $post['tgl']\n\t\t\t? 0\n\t\t\t: $this->getDatePickerTimeFormat();\n\t\t\n\t\t// always done to make sure there are no obsolete values left\n\t\t$this->setStart(null);\n\t\t$this->setEnd(null);\n\t\t\n\t\t$valid_start = false;\n\t\tif(trim($start))\n\t\t{\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($start, $format);\n\t\t\tif($parsed)\n\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t$this->setStart($parsed);\n\t\t\t\t$valid_start = true;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($end))\n\t\t{\n\t\t\t$valid_start = true;\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\n\t\t$valid_end = false;\t\t\n\t\tif(trim($end))\n\t\t{\t\t\t\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($end, $format);\t\t\n\t\t\tif($parsed)\n\t\t\t{\n\t\t\t\t$this->setEnd($parsed);\n\t\t\t\t$valid_end = true;\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($start))\n\t\t{\t\t\t\t\t\n\t\t\t$valid_end = true;\t\t\t\n\t\t}\n\t\t\n\t\tif($this->getStartYear())\n\t\t{\n\t\t\tif($valid_start && \n\t\t\t\t$this->getStart()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_start = false;\n\t\t\t}\n\t\t\tif($valid_end && \n\t\t\t\t$this->getEnd()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_end = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$valid = ($valid_start && $valid_end);\t\n\t\t\n\t\tif($valid && \n\t\t\t$this->getStart() && \n\t\t\t$this->getEnd() &&\n\t\t\tilDateTime::_after($this->getStart(), $this->getEnd()))\t\t\t\n\t\t{\n\t\t\t$valid = false;\t\t\t\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->invalid_input_start = $start;\n\t\t\t$this->invalid_input_end = $end;\n\t\t\t\n\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t\n\t\t\t$this->setAlert($lng->txt(\"form_msg_wrong_date\"));\n\t\t}\t\n\t\telse\n\t\t{\t\t\t\n\t\t\tif($this->getStart() &&\n\t\t\t\t$this->getEnd())\n\t\t\t{\n\t\t\t\t// getInput() should return a generic format\t\n\t\t\t\t$post_format = $format\n\t\t\t\t\t? IL_CAL_DATETIME\n\t\t\t\t\t: IL_CAL_DATE;\t\t\t\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = $this->getStart()->get($post_format);\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = $this->getEnd()->get($post_format);\t\t\t\t\n\t\t\t\tunset($_POST[$this->getPostVar()][\"tgl\"]);\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($valid)\n\t\t{\n\t\t\t$valid = $this->checkSubItemsInput();\n\t\t}\n\t\t\n\t\treturn $valid;\n\t}",
"function room_reservations_admin_settings_reminders_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $reminder_time = $form_state['values']['reminder_time'];\n $reminder_cutoff = $form_state['values']['reminder_cutoff'];\n if ($reminder_time < $reminder_cutoff) {\n $field = 'reminder_time';\n $message = t(\"'Send reminder daily at' time cannot be earlier than 'Send reminders for reservations created before' time.\");\n form_set_error($field, check_plain($message));\n }\n }\n}",
"function onlyEndInput($beginTime, $endTime){\n if($beginTime == null && $endTime != null) {\n return true;\n }\n else {\n return false;\n }\n}",
"public static function validate_form_schedule( $form ) {\n\t\tif ( rgar( $form, 'scheduleForm' ) ) {\n\t\t\t$local_time_start = sprintf( '%s %02d:%02d %s', $form['scheduleStart'], $form['scheduleStartHour'], $form['scheduleStartMinute'], $form['scheduleStartAmpm'] );\n\t\t\t$local_time_end = sprintf( '%s %02d:%02d %s', $form['scheduleEnd'], $form['scheduleEndHour'], $form['scheduleEndMinute'], $form['scheduleEndAmpm'] );\n\t\t\t$timestamp_start = strtotime( $local_time_start . ' +0000' );\n\t\t\t$timestamp_end = strtotime( $local_time_end . ' +0000' );\n\t\t\t$now = current_time( 'timestamp' );\n\n\t\t\tif ( ! empty( $form['scheduleStart'] ) && $now < $timestamp_start ) {\n\t\t\t\treturn empty( $form['schedulePendingMessage'] ) ? '<p>' . esc_html__( 'This form is not yet available.', 'gravityforms' ) . '</p>' : '<p>' . GFCommon::gform_do_shortcode( $form['schedulePendingMessage'] ) . '</p>';\n\t\t\t} elseif ( ! empty( $form['scheduleEnd'] ) && $now > $timestamp_end ) {\n\t\t\t\treturn empty( $form['scheduleMessage'] ) ? '<p>' . esc_html__( 'Sorry. This form is no longer available.', 'gravityforms' ) . '</p>' : '<p>' . GFCommon::gform_do_shortcode( $form['scheduleMessage'] ) . '</p>';\n\t\t\t}\n\t\t}\n\n\t}",
"public function update_leave() {\n\n\t\tif(!$this->session->userdata('user_id')>0){\n\t\t\tredirect('login');\n\t\t}\n\t\t\n\t\t$form_data = $this->input->post();\n\t\t\n\t\t$form_data['user_id'] = $this->session->userdata('user_id');\n\t\t$leave_id = $form_data['leave_id'];\n\t\t\n\t\tif($form_data['leave_plan'] =='half_day' || $form_data['leave_plan']=='one_day') {\n\t\t\t$form_data['leave_start_date'] = $form_data['date'];\n\t\t\t$form_data['leave_end_date'] = $form_data['date'];\n\t\t\tunset($form_data['date']);\n\t\t}\n\t\t\n\t\t$this->load->model('leaves');\n\t\t$result = $this->leaves->update_leaves($form_data);\n\t\tif($result){\n\t\t\t$this->session->set_flashdata('success', 'You have successfully updated your leave');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->flashdata('error','Sorry We are unable to process the request');\n\t\t}\n\t\tredirect('user/landing/edit_leave/'.$leave_id);\n\n\t}",
"function new_reservation($room, $fromTime, $toTime, $subject, $category, $description='', $allDay=0, $recurrence_id=0, $printresult=0) {\n global $USER, $DB;\n\n /*\n if ($colision = check_availability($room, $fromTime, $toTime)) {\n echo '<b>COLLISION!!! : </b>';\n print_r($colision);\n }\n * \n */\n \n//check if start time == end time\n//this should result in no reservation\n \n$starttime_notEqual_endtime = !($fromTime == $toTime);\n\n if ($starttime_notEqual_endtime && !check_availability($room, $fromTime, $toTime)) {\n $reservation = new stdClass();\n $reservation->subject = $subject;\n $reservation->startdate = $fromTime;\n $reservation->enddate = $toTime;\n $reservation->alldayevent = $allDay;\n $reservation->meetingorganizer = $USER->id;\n $reservation->categories = $category;\n $reservation->description = $description;\n $reservation->location = $room;\n $reservation->active = 1;\n $reservation->confirm = 0;\n $reservation->recurrence_id = $recurrence_id;\n\n \n\n $reservationID = $DB->insert_record('roomscheduler_reservations', $reservation);\n\n if($printresult){//used if want id of reservation returned with ajax\n print $reservationID;\n }\n\n return $reservationID;\n } else {\n return false;\n }\n}",
"public function schedule(){\n\t\t$this->load->model('Sup_admin');\n\t\t$this->load->model('Crud_model');\n\t\t$this->load->model('Admin_model');\n\t\t$this->load->model('profile_model');\n\t\t$this->form_validation->set_rules('date', 'Meeting Date', 'required');\n\t\t$this->form_validation->set_rules('stime', 'Start Time', 'required');\n\t\t$this->form_validation->set_rules('etime', 'End Time', 'required|callback_time['.$this->input->post('stime').']');\n\t\t\n\t\t$csrf_token=$this->security->get_csrf_hash();\n\t\tif ($this->form_validation->run() == FALSE)\n {\n\t\t\t$ab=array('res'=>0,'errors'=>validation_errors(),'csrf_token'=>$csrf_token);\n echo json_encode($ab);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//functionality\n\t\t\t\t$d = $this->input->post('date');\n\t\t\t\t$st= $this->input->post('stime');\n\t\t\t\t$et=$this->input->post('etime');\n\t\t\t\t$res = explode(\"-\", $d);\n\t\t\t\t$span= $res[2].\"-\".$res[1].\"-\".$res[0].\" \".$st.\" - \".$res[2].\"-\".$res[1].\"-\".$res[0].\" \".$et;\n\t\t\t\t$start_time = substr($span,0,16);\n\t\t\t\t$end_time=substr($span,19,35);\n\t\t\t\t$noti_head=\"New Meeting\";\n\t\t\t\t$st=mdate('%Y-%m-%d at %H:%i hrs', strtotime( $start_time ));\n\t\t\t\t$et=mdate('%Y-%m-%d at %H:%i hrs', strtotime( $end_time ));\n\t\t\t\t$noti_text=\"The next meeting has been scheduled on \".$st.\" and it will end on \".$et.\".\";\n\t\t\t\t$target_audience=\"NMEET00\";\n\t\t\t\t\t$radiosel=2;//broadcast\n\t\t\t\t\t$audience_ut=$this->session->userdata('user_type');\t\n\t\t\t\t\t$audience_loc=$this->session->userdata('location_code');\n\t\t\t\t\t$audience_desig_only=$this->session->userdata('desig');\n\t\t\t\t//2hours relaxation on the provided time\n\t\t\t\t$start_time= mdate('%Y-%m-%d %H:%i',strtotime('-2 hours', strtotime( $start_time )));\n\t\t\t\t$end_time= mdate('%Y-%m-%d %H:%i',strtotime('+2 hours', strtotime( $end_time )));\n\t\t\t\t$data=array(\n\t\t\t\t\t'start_time'=> $start_time,\n\t\t\t\t\t'end_time'=> $end_time,\n\t\t\t\t\t'active_status'=>1\n\t\t\t\t);\n\t\t\t\t$this->db->trans_off();\n\t\t\t\t$this->db->trans_strict(FALSE);\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->Admin_model->meeting_schedule($data);\n\t\t\t\t//$this->load->view('schedule',$data);\n\t\t\t\t$this->profile_model->savenotifs($target_audience,$noti_text,$noti_head,$audience_ut,$audience_loc,$audience_desig_only,$radiosel);\n\t\t\t\t$this->Crud_model->audit_upload($this->session->userdata('loginid'),\n\t\t\t\t\t\t\t\t\t\t\t\tcurrent_url(),\n\t\t\t\t\t\t\t\t\t\t\t\t'Meeting Schedule Updated',\n\t\t\t\t\t\t\t\t\t\t\t\t$start_time.' - '.$end_time);\n\t\t\t\t$this->db->trans_complete();\n\n\t\t\t$ab=array('csrf_token'=>$csrf_token,'res'=>1);\n\t\t\techo json_encode($ab);\n\t\t}\n\t}",
"public function add_leave() {\n\n\t\tif(!$this->session->userdata('user_id')>0){\n\t\t\tredirect('login');\n\t\t}\n\t\t\n\t\t$form_data = $this->input->post();\n\t\t\n\t\t$form_data['user_id'] = $this->session->userdata('user_id');\n\n\t\t//set the start date and end date for the one day and half day leave\n\t\tif($form_data['leave_plan'] =='half_day' || $form_data['leave_plan']=='one_day') {\n\t\t\t$form_data['leave_start_date'] = $form_data['date'];\n\t\t\t$form_data['leave_end_date'] = $form_data['date'];\n\t\t\tunset($form_data['date']);\n\t\t}\n\t\t\n\t\t$this->load->model('leaves');\n\n\t\t$result = $this->leaves->add_leaves($form_data);\n\n\t\tif($result){\n\t\t\t$this->session->set_flashdata('success', 'You have successfully applied for the leave');\n\t\t}else{\n\t\t\t$this->session->flashdata('error','Sorry We are unable to process the request');\n\t\t}\n\t\tredirect('user/landing/add_leaves');\n\n\t}",
"public function postLeaveRequest(Request $request, $id)\n {\n\n $user = User::find($id);\n\n $startDateTimeStamp = strtotime($_POST['startDate']);\n $endDateTimeStamp = strtotime($_POST['endDate']);\n $startDay = (int) (Date('N', $startDateTimeStamp));\n $endDay = (int) (Date('N', $endDateTimeStamp));\n\n //dd($startDay);\n //dd( $_POST['noOfDays'] );\n\n if ($_POST['noOfDays'] === 'Invalid Date range' || $_POST['noOfDays'] === 'Exceeds max no of days ' || $_POST['noOfDays'] === \" \" || $_POST['noOfDays'] === \"\") {\n session()->flash('statusDanger', \"You cannot apply for leave with the date range specified\");\n\n //return redirect('/applyForLeave/'. $id);\n return redirect()->back()->withInput();\n }\n\n if (($startDay > 5) && ($startDay <= 7)) {\n\n session()->flash('statusDanger', \"You cannot start your leave on weekends\");\n\n return redirect()->back()->withInput();\n }\n\n if (($endDay > 5) && ($endDay <= 7)) {\n session()->flash('statusDanger', \"You cannot end your leave on weekends\");\n\n return redirect()->back()->withInput();\n }\n\n\n $noOfDays = explode(\" \", $request->noOfDays)[0];\n\n\n if (!(is_numeric($noOfDays))) {\n session()->flash('statusDanger', \"The daterange selected is invalid, ensure that the startdate occurs before the enddate, and \n that you are not trying to apply for leave days that exceed your current allocation\");\n\n return redirect()->back()->withInput();\n }\n\n\n Auth::user()->sendLeaveRequest($request->leaveType, $request->startDate, $request->endDate, $noOfDays, $request->lineManager, $request->comments);\n\n if (Auth::user()->validRequest) {\n session()->flash('status', 'Your request has been successfully sent!');\n\n return redirect('/');\n }\n\n if (!(Auth::user()->validRequest)) {\n\n return redirect()->back()->withInput();\n }\n\n }",
"public function inavailability() {\n\t\tif ( $this->is_session_started() === FALSE ){\n\t\t\tsession_start();\n\t\t}\n\t\t//Check if user has logged in\n\t\tif (!isset($_SESSION[\"user_name\"]) || $_SESSION[\"user_name\"] == '') {\n redirect('login/index');\n }\n\t\telse\n\t\t{\n\t\t\t//Change the timezone\n\t\t\t$timezone = $this->settings_model->get_time_zone();\n\t\t\tif (function_exists('date_default_timezone_set'))\n\t\t\t\tdate_default_timezone_set($timezone);\n\n\n\t\t\t$this->form_validation->set_rules('start_date', 'Start Date', 'required');\n\t\t\t$this->form_validation->set_rules('start_time', 'Start Time', 'required');\n\t\t\t$this->form_validation->set_rules('end_date', 'End Date', 'required');\n $this->form_validation->set_rules('end_time', 'End Time', 'required');\n\t\t\t$this->form_validation->set_rules('doctor', 'Doctor Name', 'required');\n\n\t\t\t$level = $_SESSION['category'];\n\t\t\tif ($level == 'Doctor'){\n\t\t\t\t$id = $_SESSION['id'];\n\t\t\t\t$data['doctors']=$this->admin_model->get_doctor($id);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data['doctors'] = $this->admin_model->get_doctor();\n\t\t\t}\n\n\t\t\t$data['clinic_start_time'] = $this->settings_model->get_clinic_start_time();\n $data['clinic_end_time'] = $this->settings_model->get_clinic_end_time();\n\t\t\t$data['time_interval'] = $this->settings_model->get_time_interval();\n\t\t\t$data['def_dateformate']=$this->settings_model->get_date_formate();\n\t\t\t$data['def_timeformate']=$this->settings_model->get_time_formate();\n\t\t\tif ($this->form_validation->run() === FALSE)\n\t\t\t{\n\t\t\t\t/**Do Nothing*/\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->doctor_model->insert_availability();\n }\n\t\t\t$data['availability'] = $this->appointment_model->get_dr_inavailability();\n\t\t\t$this->load->view('templates/header');\n\t\t\t$this->load->view('templates/menu');\n\t\t\t$this->load->view('inavailability',$data);\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}",
"function remindAboutGuardsPastLeave(){\n\t$guards_on_leave = array();\n\t$leave_end_dates = array();\n\t$lastschedule = array();\n\t\n\t$leaveresult = mysql_query(\"SELECT * FROM leaveapplications WHERE isactive = 'Y'\");\n\t\n\twhile($line = mysql_fetch_array($leaveresult,MYSQL_ASSOC)){\n\t\t//Check for those who are on leave\n\t\tif(($line['leavetype'] == \"Annual\" && $line['gmapproved'] == \"Y\") || ($line['leavetype'] == \"Pass Leave\" && $line['humanresourceapproved'] == \"Y\" && $line['payrollclerkapproved'] == \"Y\") || ($line['humanresourceapproved'] == \"Y\" && $line['operationsapproved'] == \"Y\" && $line['payrollclerkapproved'] == \"Y\")){\n\t\t\n\t\t\tif((strtotime($line['leavestartdate']) < strtotime(\"now\")) && (strtotime($line['leaveenddate']) < strtotime(\"now\"))){\n\t\t\t\t\n\t\t\t\tarray_push($guards_on_leave, $line['guardid']);\n\t\t\t\tarray_push($leave_end_dates, $line['leaveenddate']);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//If they are still on leave after the leave end date, show a message on the dashboard\n\t//First, pick the last entered row in the schedule and determine the current status of \n\t//the guard\n\t$scheduleresult = mysql_query(\"SELECT * FROM guardschedule\");\n\t\n\t//Looks for the last entered schedule\t\n\tif(mysql_data_seek($scheduleresult, (mysql_num_rows($scheduleresult) - 1))){\n\t\t$lastschedule = mysql_fetch_assoc($scheduleresult);\n\t\t$schedulearray_normal = split(\",\",$lastschedule[\"schedule\"]);\n\t\t$schedulearray_overtime = split(\",\",$lastschedule[\"overtimeentry\"]);\n\t\t\n\t\t//Go through those on leave to check for those not yet reported\n\t\tfor($i=0;$i<count($guards_on_leave);$i++){\n\t\t\t$ispresent = \"\";\n\t\t\t\n\t\t\t//Check the normal schedule for their current status\n\t\t\tfor($k=0;$k<count($schedulearray_normal);$k++){\n\t\t\t\t$guardstatus = split(\"=\",$schedulearray_normal[$k]);\n\t\t\t\tif($guards_on_leave[$i] == $guardstatus[0] && $guardstatus[1] == \"Leave\"){\n\t\t\t\t\t$ispresent = \"FALSE\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Also check the overtime schedule in case the guard just worked overtime\n\t\t\tfor($j=0;$j<count($schedulearray_overtime);$j++){\n\t\t\t\t$guardstatus = split(\"=\",$schedulearray_overtime[$j]);\n\t\t\t\tif($guards_on_leave[$i] == $guardstatus[0] && $guardstatus[1] == \"Leave\"){\n\t\t\t\t\t$ispresent = \"FALSE\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//If the guard is not yet back and no message was recorded to the same effect,\n\t\t\t// record a new msg\n\t\t\t$guardname_array = getRowAsArray(\"SELECT p.firstname, p.lastname, p.othernames FROM guards g, persons p WHERE g.personid = p.id AND g.guardid = '\".$guards_on_leave[$i].\"'\");\n\t\t\tif($ispresent == \"FALSE\" && (howManyRows(\"SELECT * FROM messages WHERE reason = 'STILL ON LEAVE' AND details LIKE '%\".$guardname_array[\"firstname\"].\" \".$guardname_array[\"lastname\"].\"%' AND details LIKE '%\".date(\"d-M-Y\",strtotime($leave_end_dates[$i])).\"%'\") == 0)){\n\t\t\t\t\n\t\t\t\tmysql_query(\"INSERT INTO messages (reason, details, sentby, sentto, date) VALUES ('STILL ON LEAVE', '\".$guardname_array[\"firstname\"].\" \".$guardname_array[\"lastname\"].\" is still on leave. His authorised leave ended on \".date(\"d-M-Y\",strtotime($leave_end_dates[$i])).\".', '', '1,80,81,84,85', NOW())\");\n\t\t\t}\n\t\t}\n\t}\n}",
"function room_reservations_admin_settings_default_hours_validate($form_id, &$form_state) {\n $days = array(\n t('Sunday'),\n t('Monday'),\n t('Tuesday'),\n t('Wednesday'),\n t('Thursday'),\n t('Friday'),\n t('Saturday'),\n );\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n for ($day = 0; $day < 7; $day++) {\n $open = TRUE;\n $second_shift = FALSE;\n $first_shift_open\n = $form_state['values']['day_' . $day]['first_shift_open_' . $day];\n $first_shift_close\n = $form_state['values']['day_' . $day]['first_shift_close_' . $day];\n $second_shift_open\n = $form_state['values']['day_' . $day]['second_shift_open_' . $day];\n $second_shift_close\n = $form_state['values']['day_' . $day]['second_shift_close_' . $day];\n $int_first_shift_open\n = intval(\n $form_state['values']['day_' . $day]['first_shift_open_' . $day]);\n $int_first_shift_close\n = intval(\n $form_state['values']['day_' . $day]['first_shift_close_' . $day]);\n $int_second_shift_open\n = intval(\n $form_state['values']['day_' . $day]['second_shift_open_' . $day]);\n $int_second_shift_close\n = intval(\n $form_state['values']['day_' . $day]['second_shift_close_' . $day]);\n // Closed.\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999) && \n ($int_second_shift_open == 9999) && \n ($int_second_shift_close == 9999)) {\n $open = FALSE;\n }\n // First shift.\n if ($open) {\n if ($int_first_shift_open == 9999) {\n $field = 'day_' . $day . '][first_shift_open_' . $day;\n $message = t('!day - First shift open is required.', \n array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_close == 9999) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close is required.', \n array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_open >= $int_first_shift_close) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close must be later than first shift\n open.', array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n }\n // Second shift.\n if ($open) {\n if (($int_second_shift_open != 9999) || \n ($int_second_shift_close != 9999)) {\n $second_shift = TRUE;\n }\n }\n if ($second_shift) {\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999)) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Cannot have a second shift without a first\n shift.', array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open == 9999) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open is missing.', \n array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_close == 9999) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close is missing.', \n array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open <= $int_first_shift_close) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open must be later than first\n shift close.', array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open >= $int_second_shift_close) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close must be later than second\n shift opten.', array('!day' => $days[$day]));\n form_set_error($field, check_plain($message));\n }\n }\n }\n }\n}",
"public function AddReservation($Room_id,$cust_id,$B_date,$E_date)\n{\n$DB=new DBManager();\n\n$DBegin=date_create($B_date);\n$DEnd=date_create($E_date);\n\n$diff=date_diff($DBegin,$DEnd);\n$interval = $DBegin->diff($DEnd);\n$intervalDays=$interval->days;\n\n\n$sql1=\"INSERT INTO reservation(cust_id,dateBegin,DateEnd,Room_id,period) VALUES ('$cust_id','$B_date','$E_date','$Room_id','$intervalDays')\";\n$resSel=$DB->AddDB($sql1);\n\n$sql2=\"UPDATE room SET status=1 WHERE id='$Room_id'\";\n$resUP=$DB->updateDB($sql2);\n\nif($resUP == \"Updated\")\n{\n return \" ***** Congratulations , You Reserved Room Successfully ***** \";\n}\nelse return \"problem\";\n\n}",
"public function check_class_register_deadline(){\n $sessionID = $this->input->post('class_session_id');\n // set correct timezone\n date_default_timezone_set(\"America/New_York\");\n // collect the current time \n $currentTime = date(\"h:i:s\");\n $currentDate = date(\"Y/m/d\");\n \n //search of session date\n $this->db->select('*');\n $this->db->where('class_session_id', $sessionID);\n $getSessionInfo = $this->db->get('class_sessions'); \n $fetchDate = $getSessionInfo->row(); \n $scheduledDate = $fetchDate->date;\n echo $scheduledDate; \n // check is the date is right\n \n if($currentDate == $scheduledDate ){\n \n // get session start time\n $fetchStartTime = $getSessionInfo->row();\n $scheduledStartTime = $fetchStartTime->start_time;\n // get session cut off time\n $fetchCutOffTime = $getSessionInfo->row();\n $scheduledCutOffTime = $fetchCutOffTime->cut_off_time; \n \n \n if($currentTime >= $scheduledStartTime && $currentTime < $scheduledCutOffTime){\n \n return true; \n \n \n }else{\n \n return false; \n \n }\n \n }else{\n \n echo \"This is the wrong day for the class session to be registered.\";\n \n }\n }",
"function edit_reservation($room, $reservation_id, $fromTime, $toTime, $subject, $category, $description='', $allDay=0, $recurrence_id=0) {\n global $USER, $DB;\n\n\n if (!check_availability_excluding_id($room, $fromTime, $toTime,$reservation_id)) {\n $reservation = new stdClass();\n\n $reservation->id = $reservation_id;\n $reservation->subject = $subject;\n $reservation->startdate = $fromTime;\n $reservation->enddate = $toTime;\n $reservation->alldayevent = $allDay;\n $reservation->meetingorganizer = $USER->id;\n $reservation->categories = $category;\n $reservation->description = $description;\n $reservation->active = 1;\n $reservation->confirm = 0;\n $reservation->recurrence_id = $recurrence_id;\n\n return $DB->update_record('roomscheduler_reservations', $reservation);\n } else {\n return false;\n }\n}",
"function add_shedule(){\n\t\t\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$act_mode \t= mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$cmbtype \t\t= mysqli_real_escape_string($con,$_POST['cmbtype']);\n\t\t$cmbexamtype = mysqli_real_escape_string($con,$_POST['cmbexamtype']);\n\t\t$cmbbatch = mysqli_real_escape_string($con,$_POST['cmbbatch']);\n\t\t$cmbclroom \t= mysqli_real_escape_string($con,$_POST['cmbclroom']);\n\t\t$cmblecturer \t= mysqli_real_escape_string($con,$_POST['cmblecturer']);\n\t\t$txtdosch = mysqli_real_escape_string($con,$_POST['txtdosch']);\n\t\t$txtstime \t= mysqli_real_escape_string($con,$_POST['txtstime']);\n\t\t$txtetime \t= mysqli_real_escape_string($con,$_POST['txtetime']);\t\n\t\t\n\t\t$sqlget1 =\"SELECT * FROM shedule WHERE schtype='$cmbtype' AND examtype='$cmbexamtype' AND batchID='$cmbbatch' AND lecID ='$cmblecturer' AND clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' AND endtime <='$txtetime');\";\n\t\t\n\t\t\n\t\t$resultget1 = mysqli_query($con,$sqlget1) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget1= mysqli_fetch_assoc($resultget1);\n\t\t\n\t\t\n\t\t$sqlget2 =\"SELECT * FROM shedule WHERE lecID ='$cmblecturer' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget2 = mysqli_query($con,$sqlget2) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget2= mysqli_fetch_assoc($resultget2);\n\t\t\n\t\t$sqlget3 =\"SELECT * FROM shedule WHERE clroomID ='$cmbclroom' AND date='$txtdosch' AND (starttime >='$txtstime' OR endtime <='$txtetime');\";\n\t\t\n\t\t$resultget3 = mysqli_query($con,$sqlget3) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget3= mysqli_fetch_assoc($resultget3);\n\t\n\t\t\t\n\t\tif(count($recget1)>0){\n\t\t\t$recget1 =\"sch1\";\n\t\t\techo json_encode($recget1);\n\t\t}\n\t\telse if(count($recget2)>0){\n\t\t\t$recget2 =\"sch2\";\n\t\t\techo json_encode($recget2);\n\t\t}\n\t\telse if(count($recget3)>0){\n\t\t\t$recget3 =\"sch3\";\n\t\t\techo json_encode($recget3);\n\t\t}\n\n\t\telse{\n\t\t\n\t\t$sth = $dbh->prepare('INSERT INTO shedule (schtype,examtype,date,starttime,endtime,batchID,clroomID,lecID,schstatus) VALUES(?,?,?,?,?,?,?,?,?);');\n\t\t$sth->execute(Array($cmbtype,$cmbexamtype,$txtdosch,$txtstime,$txtetime,$cmbbatch,$cmbclroom,$cmblecturer,1));\n\n\t\t\t\tif(count($sth)<0){\n\t\t\t\t\t \n\t\t\t\t\t $status =\"false\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\n\t\t\t\t\t$status =\"true\";\n\t\t\t\t}\n\t\n\t\t\t\techo json_encode($status);\n\n\t\t} \n\n\t}",
"function room_reservations_admin_settings_daily_hours_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $month_value = $form_state['values']['month'];\n $month = intval(drupal_substr($month_value, 5));\n $year = drupal_substr($month_value, 0, 4);\n // Days in the month.\n $days = date('t', mktime(0, 0, 0, $month, 1, $year));\n for ($day = 0; $day < $days; $day++) {\n // Day of the week.\n $dow = date('l', mktime(0, 0, 0, $month, $day + 1, $year));\n // Day of month.\n $dom = $day + 1;\n $open = TRUE;\n $second_shift = FALSE;\n $first_shift_open\n = $form_state['values']['day_' . $day]['first_shift_open_' . $day];\n $first_shift_close\n = $form_state['values']['day_' . $day]['first_shift_close_' . $day];\n $second_shift_open\n = $form_state['values']['day_' . $day]['second_shift_open_' . $day];\n $second_shift_close\n = $form_state['values']['day_' . $day]['second_shift_close_' . $day];\n $int_first_shift_open\n = intval(\n $form_state['values']['day_' . $day]['first_shift_open_' . $day]);\n $int_first_shift_close\n = intval(\n $form_state['values']['day_' . $day]['first_shift_close_' . $day]);\n $int_second_shift_open\n = intval(\n $form_state['values']['day_' . $day]['second_shift_open_' . $day]);\n $int_second_shift_close\n = intval(\n $form_state['values']['day_' . $day]['second_shift_close_' . $day]);\n // Closed.\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999) && \n ($int_second_shift_open == 9999) && \n ($int_second_shift_close == 9999)) {\n $open = FALSE;\n }\n // First shift.\n if ($open) {\n if ($int_first_shift_open == 9999) {\n $field = 'day_' . $day . '][first_shift_open_' . $day;\n $message = t('!day - First shift open is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_close == 9999) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_open >= $int_first_shift_close) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close must be later than first shift\n open.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n // Second shift.\n if ($open) {\n if (($int_second_shift_open != 9999) || \n ($int_second_shift_close != 9999)) {\n $second_shift = TRUE;\n }\n }\n if ($second_shift) {\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999)) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Cannot have a second shift without a first\n shift.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open == 9999) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_close == 9999) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open <= $int_first_shift_close) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open must be later than first\n shift close.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open >= $int_second_shift_close) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close must be later than second\n shift opten.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n }\n }\n}"
]
| [
"0.6411033",
"0.6213766",
"0.61829895",
"0.61028147",
"0.60903883",
"0.5967542",
"0.594961",
"0.59386164",
"0.5921601",
"0.5879071",
"0.58617383",
"0.5836859",
"0.58085257",
"0.580083",
"0.5790211",
"0.576505",
"0.5764775",
"0.5764677",
"0.5761994",
"0.5756933",
"0.57551515",
"0.5745244",
"0.57367784",
"0.57355726",
"0.5723387",
"0.5720642",
"0.5715413",
"0.5681716",
"0.566604",
"0.56602705"
]
| 0.6781268 | 0 |
end getLeaveApply() Get leave apply headcount in flow by department | function getLeaveApplyCountByDept($whoami = 'assistant')
{
$create_by = $whoami=='admin' ? '' : ' and a.create_by = \''.$_SESSION['user']['user_seq_no'].'\' ';
$sql = <<<eof
select c.segment_no as dept_seq_no,
c.segment_no_sz as dept_id,
c.segment_name as dept_name,
a.flow_status,
decode(a.flow_status, '01', '已提交', '02', '流程中', '暂存') as flow_status_desc,
count(a.absence_seq_no) as trows
from ehr_leave_in_flow_v a, hr_personnel_base b, gl_segment c
where a.company_id = b.seg_segment_no
and a.emp_seq_no = b.id
and b.seg_segment_no = c.seg_segment_no
and b.seg_segment_no_department = c.segment_no
and a.company_id = :company_id
and a.flow_status < '03'
$create_by
group by c.segment_no, c.segment_no_sz ,c.segment_name, a.flow_status
order by c.segment_no_sz
eof;
//$this->DBConn->debug =1;
return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function employee_leave_status()\n\t{\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('accepted'=>'', 'accepted_count'=>'','pending'=>'', 'pending_count'=>'','rejected'=>'', 'rejected_count'=>'');\n\t\t\n\t\t//accepted\n\t\t$Return['accepted'] = $this->lang->line('xin_approved');\n\t\t$Return['accepted_count'] = accepted_leave_request();\n\t\t// pending\n\t\t$Return['pending'] = $this->lang->line('xin_pending');\n\t\t$Return['pending_count'] = pending_leave_request();\n\t\t// rejected\n\t\t$Return['rejected'] = $this->lang->line('xin_rejected');\n\t\t$Return['rejected_count'] = rejected_leave_request();\n\t\t$this->output($Return);\n\t\texit;\n\t}",
"function getOvertimeApplyCountByDept($whoami = 'assistant')\n {\n $create_by = $whoami=='admin' ? '' : ' and a.create_by = \\''.$_SESSION['user']['user_seq_no'].'\\' ';\n $sql = <<<eof\n\t\t\tselect c.segment_no as dept_seq_no,\n\t\t\t\t c.segment_no_sz as dept_id,\n\t\t\t\t c.segment_name as dept_name,\n\t\t\t\t a.flow_status,\n\t\t\t\t decode(a.flow_status,'01','已提交','02','流程中','暂存') as flow_status_desc,\n\t\t\t\t count(a.overtime_flow_seqno) as trows\n\t\t\t from ehr_overtime_in_flow_v a,\n\t\t\t hr_personnel_base b,\n\t\t\t\t gl_segment c\n\t\t\t where a.company_id = b.seg_segment_no\n\t\t\t and a.emp_seq_no = b.id\n\t\t\t and b.seg_segment_no = c.seg_segment_no\n\t\t\t and b.seg_segment_no_department = c.segment_no\n\t\t\t and a.company_id = :company_id \n\t\t\t and a.flow_status < '03'\n\t\t\t $create_by\n\t\t\tgroup by c.segment_no,c.segment_no_sz,c.segment_name,a.flow_status\n\t\t\torder by c.segment_no_sz\neof;\n //$this->DBConn-> debug = 1;\n return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));\n }",
"function getEmployeeLeaveRemain($db, $strIDEmployee)\n{\n $intResult = 0;\n if ($strIDEmployee === \"\") {\n return $intResult;\n }\n $arrCuti = getEmployeeLeaveQuota($db, $strIDEmployee);\n $intLeaveQuotaPrev = $arrCuti['prevQuota'];\n $intLeaveQuotaCurr = $arrCuti['currQuota'];\n if ($intLeaveQuotaPrev == 0) {\n $intLeaveTakenPrev = 0; // anggap aja gak ada\n $intLeaveHolidayPrev = 0; //\n } else {\n $intLeaveTakenPrev = $arrCuti['prevTaken'];\n $intLeaveHolidayPrev = $arrCuti['prevHoliday'];\n }\n if ($intLeaveQuotaCurr == 0) {\n $intLeaveTakenCurr = 0; // anggap aja gak ada\n $intLeaveHolidayCurr = 0; //\n } else {\n $intLeaveTakenCurr = $arrCuti['currTaken'];\n $intLeaveHolidayCurr = $arrCuti['currHoliday'];\n }\n $intResult = $intLeaveQuotaPrev + $intLeaveQuotaCurr;\n $intResult -= ($intLeaveTakenCurr + $intLeaveTakenPrev);\n $intResult -= ($intLeaveHolidayCurr + $intLeaveHolidayPrev);\n return $intResult;\n}",
"public function apply_leave($id=null){\n $this->layout = 'dashboard';\n $leavesArray = array();\n \n if(!empty($this->data)){\n \n $leavesArray = $this->data; \n $leavePolicy = $this->Common->leavePolicy($this->data['Leave']['leavetype_id']); \n $total_leave = $this->Allottedleave->query(\"SELECT ((SELECT SUM( Allottedleave.values ) FROM `allottedleaves` AS `Allottedleave` WHERE Allottedleave.leavetype_id = \".$this->data['Leave']['leavetype_id'].\" AND Allottedleave.employeetype_id = ( \n SELECT Staff.employeetype_id FROM `staffs` AS `Staff` WHERE Staff.id = \".$this->data['Leave']['staff_id'].\" ) AND Allottedleave.year = \".date('Y').\") - SUM( Leave.total_leaves )\n )left_leave FROM `leaves` AS `Leave` WHERE Leave.staff_id = \".$this->data['Leave']['staff_id'].\" AND Leave.leave_year = \".date('Y').\" AND leavetype_id = \".$this->data['Leave']['leavetype_id'].\" AND Leave.absence_status = 'Approved'\");\n \n //$total_leave = $this->Allottedleave->find('all',array('fields'=>array('SUM(values)'),'conditions'=>array('Allottedleave.leavetype_i'=>$this->data['Leave']['leavetype_id'],'Allottedleave.employeetype_id'=>($this->Staff->find('all','fields'=>array('Staff.employeetype_id'),'conditions'=>array('Staff.id'=>$this->data['Leave']['staff_id'])))))))));\n if($total_leave > 0){\n $diff = abs(strtotime($this->data['Leave']['to_date']) - strtotime($this->data['Leave']['from_date'])); \n $days = floor(($diff)/ (60*60*24));\n /***************Checking for leave policy****************/\n /*if($leavePolicy[0]['Policyleave']['no_of_days_to_apply_in_advance'] =='N'){\n $leavesArray['Leave']['total_leaves'] = $days;\n }else{ \n $applyleaveadvance = $leavePolicy[0]['Policyleave']['no_of_days_to_apply_in_advance'];\n $from = $this->data['Leave']['from_date'];\n $policy_date = date('d-m-Y',strtotime($applyleaveadvance));\n $from_applydate = date('d-m-Y',strtotime($from));\n $date_diff = date('d-m-Y', strtotime($from_applydate. ' - 15 days'));\n \n if((strtotime($from_applydate) <= strtotime($date_diff))){ \n $leavesArray['Leave']['total_leaves'] = $days;\n }\n else{\n \n $this->Session->setFlash('Sorry as per leave policy you can apply leave'.$days.'before.');\n $this->redirect(array('Controller'=>'users','action'=>'home'));\n } \n }*/\n /***************Policy check ends *****************************/\n /*********************Data Insertion Block Start*****************************/\n $leavesArray['Leave']['leave_year'] = date('Y');\n $staff_name = $this->Common->staff_name($this->data['Leave']['staff_id']); \n $leavesArray['Leave']['absence_request_by'] = $staff_name;\n $leavesArray['Leave']['absence_type'] = 1; //for leave\n $leavesArray['Leave']['updated_by'] = $this->Session->read('USERNAME');\n $leavesArray['Leave']['total_leaves'] = $days; \n $this->Leave->create(); \n if ($this->Leave->save($leavesArray)) //saving the data in table\n {\n //$this->email($this->Session->read('Userapprauth'),$days); \n $this->Session->setFlash('Leave Updated Sucessfully !!');\n $this->redirect(Router::url('/', true).'leaves/viewleave');\n } \n /*******************************Insertion and redirect block ends*********************************/\n }//if clause\n else{\n $this->Session->setFlash('Sorry you didn\\'t have enough balance to apply leave !!');\n $this->redirect(array('controller'=>'staffs','action'=>'index'));\n \n }\n $leavesArray['Leave']['staff_id'] = $this->data['Leave']['staff_id'];\n $leavesArray['Leave']['leave_year'] = date('Y');\n $leavesArray['Leave']['from_date']=$this->data['Leave']['from_date'];\n $leavesArray['Leave']['to_date']=$this->data['Leave']['to_date'];\n $leavesArray['Leave']['leavetype_id']=$this->data['Leave']['leavetype_id'];\n $staff_name = $this->Common->staff_name($this->data['Leave']['staff_id']); \n $leavesArray['Leave']['absence_request_by'] = $staff_name;\n $leavesArray['Leave']['absence_type'] = 1; //for leave\n $leavesArray['Leave']['absence_status'] = $this->data['Leave']['absence_status'];\n $leavesArray['Leave']['updated_by'] = $this->Session->read('USERNAME'); \n $this->Leave->create(); \n if ($this->Leave->save($leavesArray)) //saving the data in table\n {\n $this->Session->setFlash('Leave Apply Sucessfully !!');\n $this->redirect(array('controller'=>'staffs','action'=>'index'));\n } \n \n }\n else{\n \n //$this->set('staff_id',$id);\n $this->data = $this->Leave->read(null, $id);\n \n \n }\n }",
"function GetLeaveCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$user_seq_no = $_SESSION [\"user\"] [\"user_seq_no\"];\n\t\t$stmt = \"begin pk_erp.p_set_segment_no(:company_id); pk_erp.p_set_username(:user_seq_no); end;\";\n\n\t\t$this->DBConn->Execute($stmt, array (\"company_id\" => $companyid, \"user_seq_no\" => $user_seq_no));\n\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno'\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\t\t$sql_string = <<<_GetLeaveCount_\n\t\t\t SELECT year, absence_name, absence_seq_no,hours\n\t\t\t\t\t FROM (SELECT A.*, ROWNUM RN\n\t\t\t\t\t\t\t FROM (SELECT my_time year, absence_name, absence_seq_no,sum(hours) hours\n\t\t\t\t\t\t\t\t\t FROM ehr_absence_v\n\t\t\t\t\t\t\t\t\t WHERE company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by my_time, absence_name, absence_seq_no\n\t\t\t\t\t\t\t\t\t order by my_time desc) A\n\t\t\t\t\t\t\t WHERE ROWNUM < = $cond_2)\n WHERE RN > = $cond_1\n_GetLeaveCount_;\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"public function f_get_leaveAppliedDtls($emp_cd)\r\n {\r\n\r\n $sql = $this->db->query(\" SELECT * FROM td_leave_dtls WHERE emp_no ='$emp_cd' AND \r\n YEAR(trans_dt) = YEAR(CURDATE()) AND trans_type = 'T' \");\r\n return $sql->result();\r\n\r\n\r\n }",
"function applyleavestaff($id=null){\n $this->layout = 'dashboard';\n $userName = $this->Session->read('USERNAME'); \n if(!empty($this->data)){ \n $leavePolicy = $this->Common->leavePolicy($this->data['Leave']['leavetype_id']); //getting leave policy for leave type \n /**********Calculating total leaves for employee****************/\n $total_leave = $this->Allottedleave->query(\"SELECT ((SELECT SUM( Allottedleave.values ) FROM `allottedleaves` AS `Allottedleave` WHERE Allottedleave.leavetype_id = \".$this->data['Leave']['leavetype_id'].\" AND Allottedleave.employeetype_id = ( \n SELECT Staff.employeetype_id FROM `staffs` AS `Staff` WHERE Staff.id = \".$this->data['Leave']['staff_id'].\" ) AND Allottedleave.year = \".date('Y').\") - SUM( Leave.total_leaves )\n )left_leave FROM `leaves` AS `Leave` WHERE Leave.staff_id = \".$this->data['Leave']['staff_id'].\" AND Leave.leave_year = \".date('Y').\" AND leavetype_id = \".$this->data['Leave']['leavetype_id'].\" AND Leave.absence_status = 'Approved'\");\n /***********************************************************/\n if($total_leave >0){\n $diff = abs(strtotime($this->data['Leave']['to_date']) - strtotime($this->data['Leave']['from_date'])); \n /*******************Half day Condition*******************/\n if($this->data['Leave']['half_day']==='1'){\n $days = floor(($diff)/ (60*60*24));\n /*******To check if half day date is greater than 1 day *************/\n if($days > 1){\n $this->Session->setFlash('Enter Correct Leave Day !!');\n $this->redirect(Router::url('/', true).'leave/applyleavestaff');\n }\n else{\n $days = $this->data['Leave']['leave_half'];\n }\n /**************Condition End*********************/\n }else{\n $days = floor(($diff)/ (60*60*24));\n }\n /*************Ends**********************/ \n \n /***************Checking for leave policy****************/\n if($leavePolicy[0]['Policyleave']['no_of_days_to_apply_in_advance'] =='N'){\n $leavesArray['Leave']['total_leaves'] = $days;\n }else{ \n $applyleaveadvance = $leavePolicy[0]['Policyleave']['no_of_days_to_apply_in_advance'];\n $from = $this->data['Leave']['from_date'];\n $policy_date = date('d-m-Y',strtotime($applyleaveadvance));\n $from_applydate = date('d-m-Y',strtotime($from));\n $date_diff = date('d-m-Y', strtotime($from_applydate. ' - 15 days'));\n \n if((strtotime($from_applydate) <= strtotime($date_diff))){ \n $leavesArray['Leave']['total_leaves'] = $days;\n }\n else{\n $base_url = Router::url('/', true); \n $this->Session->setFlash('Sorry as per leave policy you can apply leave'.$date_diff.'before.');\n $this->redirect($base_url.'users/home');\n } \n }\n /***************Policy check ends *****************************/\n /*********************Data Insertion Block Start*****************************/\n $leavesArray['Leave']['staff_id'] = $this->data['Leave']['staff_id'];\n $leavesArray['Leave']['leave_year'] = date('Y');\n $leavesArray['Leave']['from_date']=$this->data['Leave']['from_date'];\n $leavesArray['Leave']['to_date']=$this->data['Leave']['to_date'];\n $leavesArray['Leave']['leavetype_id']=$this->data['Leave']['leavetype_id'];\n $staff_name = $this->Common->staff_name($this->data['Leave']['staff_id']); \n $leavesArray['Leave']['absence_request_by'] = $staff_name;\n $leavesArray['Leave']['absence_type'] = 1; //for leave\n $leavesArray['Leave']['absence_status'] = \"Pending\";\n $leavesArray['Leave']['updated_by'] = $this->Session->read('USERNAME');\n $leavesArray['Leave']['absence_desc'] = $this->data['Leave']['absence_desc']; \n $this->Leave->create(); \n if ($this->Leave->save($leavesArray)) //saving the data in table\n {\n \n //$this->email($this->Session->read('Userapprauth'),$days); \n $this->Session->setFlash('Leave Apply Sucessfully !!');\n $this->redirect(Router::url('/', true).'users/home');\n } \n /*******************************Insertion and redirect block ends*********************************/\n \n }else{\n \n $base_url = Router::url('/', true);\n $this->Session->setFlash('Sorry you don\\'t have enough leave to apply.');\n $this->redirect($base_url.'users/home');\n }\n }else{ \n /*********For Supervisor****************/\n if($userName !='admin'){\n $id = $this->Session->read('LOGEDID');\n }\n /*****************************/ \n $this->set('staff_id',$id);\n \n }\n \n }",
"function GetLeaveSalaryCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\n\t\t//得到登陆员工的计薪期间代码 add by Jack\n\t\t$period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno' and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\n\t\t$sql_string = <<<_GetSalaryLeaveCount_\n\t\t\t select year, absence_name, absence_seq_no, hours\n\t\t\t\t\t from (select A.*, rownum rn\n\t\t\t\t\t\t\t from (select period_detail_no year, absence_name, absence_seq_no,sum(hours) hours\n\t\t\t\t\t\t\t\t\t from ehr_absence_salary_v\n\t\t\t\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by period_detail_no,absence_name,absence_seq_no\n\t\t\t\t\t\t\t\t\t order by period_detail_no desc) A\n\t\t\t\t\t\t\t where rownum <= $cond_2)\n\t\t\t\t\t where rn >= $cond_1\n_GetSalaryLeaveCount_;\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"public function f_get_hr_recom(){\n\n $sql = $this->db->query(\"select count(*) lv_count \n from td_leaves_trans \n where recommendation_status = 1\n and rejection_status = 0\n and approval_status = 0\");\n return $sql->row();\n }",
"function getEmployeeLeaveQuota($db, $strIDEmployee, $strDate = \"\")\n{\n $arrResult = [\n \"currYear\" => \"\",\n \"prevYear\" => \"\",\n \"currQuota\" => 0, // jatah cuti tahun ini\n \"prevQuota\" => 0, // jatah cuti 1 tahun sebelumnya\n \"prevRemain\" => 0, // sisa cuti 1 tahun sebelumnya\n \"currRemain\" => 0, // sisa cuti\n \"prevHoliday\" => 0, // liburan cuti 1 tahun sebelulmnya\n \"currHoliday\" => 0, // liburan tahun ini\n \"prevTaken\" => 0, // yang diambil tahun lalu\n \"currTaken\" => 0, // yang diambil tahun ini\n ];\n if ($strIDEmployee == \"\") {\n return $arrResult;\n }\n if ($strDate == \"\") {\n $strDate = date(\"Y-m-d\");\n } // default\n $dtNow = getdate();\n // cari data employee\n $arrEmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_status, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n if (!isset($arrEmp['join_date'])) {\n return $arrResult;\n } // gak ketemu datanya\n if ($arrEmp['join_date'] == \"\") {\n return $arrResult;\n } // gak ada data\n if ($arrEmp['kerja'] == 0) {\n return $arrResult;\n } else {\n // sudah dapat jatah cuti\n $arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($arrEmp['join_date']);\n if ((($arrJoinDate['month'] * 30) + $arrJoinDate['day']) > (($arrDate['month'] * 30) + $arrDate['day'])) {\n // belum lewat masa berlaku\n $intYear = $arrDate['year'] - 1;\n $intYearPrev = $arrDate['year'] - 2;\n } else {\n $intYear = $arrDate['year'];\n $intYearPrev = $arrDate['year'] - 1;\n }\n $arrResult['prevYear'] = $intYearPrev;\n $arrResult['currYear'] = $intYear;\n // cari data dari leave history\n $bolCurr = false;\n $bolPrev = false;\n $strSQL = \"SELECT * FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \";\n $strSQL .= \"AND (\\\"year\\\" = '$intYear' OR \\\"year\\\" = '$intYearPrev') \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari hari libur cuti\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = getLeaveHoliday($db, $rowDb['start_date'], $rowDb['finish_date']);\n if ($rowDb['year'] == $intYear) {\n $arrResult['currQuota'] = $rowDb['total'];\n $arrResult['currTaken'] = $rowDb['used'];\n $arrResult['currHoliday'] = $intHoliday;\n $arrResult['currRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolCurr = true; // sudah ada data\n } else if ($rowDb['year'] == $intYearPrev) {\n $arrResult['prevQuota'] = $rowDb['total'];\n $arrResult['prevTaken'] = $rowDb['used'];\n $arrResult['prevHoliday'] = $intHoliday;\n $arrResult['prevRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolPrev = true;\n }\n }\n if (!$bolPrev) {\n // cari jatah bulan sebelumnya\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYearPrev,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['prevQuota'] = $arrLeave['total'];\n $arrResult['prevTaken'] = $arrLeave['used'];\n $arrResult['prevHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['prevRemain'] = $arrResult['prevQuota'] - $arrResult['prevTaken'] - $arrResult['prevHoliday'];\n }\n // jika OUTSOURCE, maka jatah kemarin tidak ada\n /*\n if ($arrEmp['employee_status'] == STATUS_OUTSOURCE)\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }\n else if ($arrEmp['kerja'] == 1) // jika baru kerja satu hari, jatah sebelumnya juga gak ada --- ANEH, khusus Artajasa kayaknya\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }*/\n if (!$bolCurr) {\n // cari jatah bulan ini\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYear,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['currQuota'] = $arrLeave['total'];\n $arrResult['currTaken'] = $arrLeave['used'];\n $arrResult['currHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['currRemain'] = $arrResult['currQuota'] - $arrResult['currTaken'] - $arrResult['currHoliday'];\n }\n }\n return $arrResult;\n}",
"public function f_get_hr_comp(){\n\n $sql = $this->db->query(\"select count(*) lv_comp_count \n from td_comp_apply \n where recommendation_status = 1\n and rejection_status = 0\n and approval_status = 0\");\n return $sql->row();\n }",
"function getLeaveHoliday($db, $strStartDate, $strFinishDate)\n{\n $intResult = 0;\n if ($strStartDate == \"\" || $strFinishDate == \"\") {\n return 0;\n }\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStartDate' AND '$strFinishDate' \";\n $resTmp = $db->execute($strSQL);\n if ($rowTmp = $db->fetchrow($resTmp)) {\n if ($rowTmp['total'] != \"\") {\n $intResult = $rowTmp['total'];\n }\n }\n return $intResult;\n}",
"public function getLeaveList()\n {\n $uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : 0;\n $query = $this->db->query(\"SELECT Id,`ApplyDate`, `LeaveFrom`, `LeaveTo`, LeaveValidDays, `LeaveReason`, `LeaveStatus`, `ApproverComment` FROM `EmployeeLeave` WHERE EmployeeId=? order by Id desc limit 30\",\n\t\tarray(\n $uid\n ));\n $res = array();\n\t\t\n foreach ($query->result() as $row) {\n $data = array();\n\t\t\t$data['leaveid'] = $row->Id;\n\t\t\t$todaydate=date(\"Y-m-d\");\n\t\t\t$data['withdrawlsts'] = true;\n\t\t\tif(strtotime($todaydate)>strtotime($row->LeaveFrom))\n\t\t\t\t$data['withdrawlsts'] = false;\n $data['date'] = date(\"dS M'y\", strtotime($row->ApplyDate));\n $data['from'] = date(\"dS M'y\", strtotime($row->LeaveFrom));\n $data['to'] = date(\"dS M'y\", strtotime($row->LeaveTo));\n $data['days'] = ' (' . $row->LeaveValidDays . ')';\n $data['status'] = $this->getpendingatstatus($row->LeaveStatus, $row->Id);// TODO dynamic with the status pending on which employee.\n $data['reason'] = $row->LeaveReason != '' || $row->LeaveReason != null ? $row->LeaveReason : '-';\n $data['comment'] = $row->ApproverComment != '' || $row->ApproverComment != null ? $row->ApproverComment : '-';\n //$data['comment']=$row->ApproverComment;\n $res[] = $data;\n }\n echo json_encode($res);\n }",
"public function f_get_leave_closing($emp_cd){\n\n $sql = $this->db->query(\"select ml_bal,el_bal,comp_off_bal\n from td_leave_balance\n where emp_code = '$emp_cd'\n and balance_dt = (select max(balance_dt)\n from td_leave_balance\n where emp_code = '$emp_cd')\n and trans_cd = (select max(trans_cd)\n from td_leave_balance\n where emp_code = '$emp_cd'\n and balance_Dt =(select max(balance_dt)\n from td_leave_balance\n where emp_code = '$emp_cd'))\");\n return $sql->row();\n\n\n }",
"public function addLeave() {\n try {\n if (!($this->leave instanceof Base_Model_ObtorLib_App_Core_Employee_Entity_Leave)) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception(\" Leave Entity not initialized\");\n } else {\n $objLeave = new Base_Model_ObtorLib_App_Core_Employee_Dao_Leave();\n $objLeave->leave = $this->leave;\n return $objLeave->addLeave();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception($ex);\n }\n }",
"public function getLeave()\n {\n return $this->get(self::_LEAVE);\n }",
"public function f_pendig_leave($userId,$date){\n\n $sql = $this->db->query(\"select count(*)pending_lv \n from td_leaves_trans\n where approval_status = 1\n and rejection_status = 0\n and emp_code = '$userId'\n and from_dt > '$date'\");\n\n return $sql->row(); \n }",
"function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"function GetNumAnnouncement($NETWORK,$companyID,$attendeeID){\r\n\r\nglobal $NETWORK;\r\n\r\n$SQL_Ann = \"select * from announcement where network= '\".$NETWORK.\"'\";\r\n\r\n\r\n$objAnn=get_obj_info($SQL_Ann, array(\"Announcementid\"));\r\n$TotalAnn = count($objAnn);\r\n\r\n\r\n$SQL_AnnRead = \"select * from announcement_log where compid =\".$companyID.\"\"; \r\n\r\n\r\nif ($attendeeID!=\"\"){\r\n\t$SQL_AnnRead = $SQL_AnnRead .\" and attendeeID =\".$attendeeID.\" \";\r\n\r\n}\r\n\r\n$objAnnRead=get_obj_info($SQL_AnnRead, array(\"Announcementid\"));\r\n$TotalRead = count($objAnnRead);\r\n\r\nif ($TotalRead < $TotalAnn){\r\n\t\t$NumNotRead = $TotalAnn - $TotalRead;\r\n}else{\r\n\t\t$NumNotRead =0;\r\n\r\n}\r\nreturn $NumNotRead;\r\n\r\n}",
"function erp_hr_count_departments() {\n\n return \\WeDevs\\ERP\\HRM\\Models\\Department::count();\n}",
"public function checkLeaveApplyTimeArea($emp_seq_no,$company_id,$begin_time,$end_time)\n {\n if(empty($begin_time) || empty($end_time)) return 'no parameter';\n //$this->DBConn->debug = 1;\n $sql= <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:begin_time, 'yyyy-mm-dd hh24:mi') between intime and outtime) or\n (breakbegin is not null and\n (to_date(:begin_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:begin_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'begin_time'=>$begin_time,\n 'begin_time1'=>$begin_time,\n 'begin_time2'=>$begin_time));\n if($rs==0) return '1';\n $sql = <<<eof\n select count(*) cnt\n from hr_carding\n where psn_id = :emp_seqno\n and psn_seg_segment_no = :company_id\n and ((breakbegin is null and\n to_date(:end_time, 'yyyy-mm-dd hh24:mi') between intime and\n outtime) or\n (breakbegin is not null and\n (to_date(:end_time1, 'yyyy-mm-dd hh24:mi') between intime and\n breakbegin or to_date(:end_time2, 'yyyy-mm-dd hh24:mi') between\n breakend and outtime)))\neof;\n $rs = $this->DBConn->GetOne($sql,array('emp_seqno'=>$emp_seq_no,\n 'company_id'=>$company_id,\n 'end_time'=>$end_time,\n 'end_time2'=>$end_time,\n 'end_time1'=>$end_time));\n if($rs==0) return '2';\n return 'ok';\n }",
"public function allottedLeave(){\n if(empty($this->data)){\n //$alloted_leavesdata = $this->\n }\n else{\n \n }\n \n }",
"public function f_get_hod_recom($emp_cd){\n\n $sql = $this->db->query(\"select count(*) lv_count \n from td_leaves_trans \n where recommendation_status = 0\n and emp_code in (select managed_emp\n from md_manager\n where manage_by = '$emp_cd')\");\n return $sql->row();\n }",
"public function f_get_hod_comp($emp_cd){\n\n $sql = $this->db->query(\"select count(*) lv_comp_count \n from td_comp_apply \n where recommendation_status = 0\n and emp_code in (select managed_emp\n from md_manager\n where manage_by = '$emp_cd')\");\n return $sql->row();\n }",
"public function gettimeoffpendingatstatus($sts,$leaveid){\n\tif($sts==3){\n\t\t\t\t\t\t$pendingapprover=$this->gettimeoffApproverPendingSts($leaveid,3);\n\t\t\t\t\t\t$pendingapp=$this->getEmployeeName($pendingapprover);\t\t\t\n\t\t\t\t\t\tif($pendingapp==\"\")\n\t\t\t\t\t\t\treturn \"Pending\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn \"Pending\";\n\t\t\t\t\t\t/* return \"Pending at $pendingapp\";// removing pending at condition as per discussion with badi ma'am */\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn $this->getleavetype($sts);\n\t\t\t\t\t}\n\t}",
"function getNoOfHolidays ()\n {\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE name = 'holiday'\";\n $stmt = $this->connection->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->holiday_entitlement = $row['entitlement'];\n return $this->holiday_entitlement;\n }",
"public function executeLeavesReport() {\n $this->auth->checkIfOperationIsAllowed('native_report_leaves');\n $this->lang->load('leaves', $this->language);\n \n $month = $this->input->get(\"month\") === FALSE ? 0 : $this->input->get(\"month\");\n $year = $this->input->get(\"year\") === FALSE ? 0 : $this->input->get(\"year\");\n $entity = $this->input->get(\"entity\") === FALSE ? 0 : $this->input->get(\"entity\");\n $children = filter_var($this->input->get(\"children\"), FILTER_VALIDATE_BOOLEAN);\n $requests = filter_var($this->input->get(\"requests\"), FILTER_VALIDATE_BOOLEAN);\n \n //Compute facts about dates and the selected month\n if ($month == 0) {\n $start = sprintf('%d-01-01', $year);\n $end = sprintf('%d-12-31', $year);\n $total_days = date(\"z\", mktime(0,0,0,12,31,$year)) + 1;\n } else {\n $start = sprintf('%d-%02d-01', $year, $month);\n $lastDay = date(\"t\", strtotime($start)); //last day of selected month\n $end = sprintf('%d-%02d-%02d', $year, $month, $lastDay);\n $total_days = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n }\n \n $this->load->model('organization_model');\n $this->load->model('leaves_model');\n $this->load->model('types_model');\n $this->load->model('dayoffs_model');\n $types = $this->types_model->getTypes();\n \n //Iterate on all employees of the entity \n $users = $this->organization_model->allEmployees($entity, $children);\n $result = array();\n $leave_requests = array();\n \n foreach ($users as $user) {\n $result[$user->id]['identifier'] = $user->identifier;\n $result[$user->id]['firstname'] = $user->firstname;\n $result[$user->id]['lastname'] = $user->lastname;\n $date = new DateTime($user->datehired);\n $result[$user->id]['datehired'] = $date->format(lang('global_date_format'));\n $result[$user->id]['department'] = $user->department;\n $result[$user->id]['position'] = $user->position;\n $result[$user->id]['contract'] = $user->contract;\n $non_working_days = $this->dayoffs_model->lengthDaysOffBetweenDates($user->contract_id, $start, $end);\n $opened_days = $total_days - $non_working_days;\n \n //If the user has selected All months\n if ($month == 0) {\n $leave_duration = 0;\n for ($ii = 1; $ii <13; $ii++) {\n $linear = $this->leaves_model->linear($user->id, $ii, $year, FALSE, FALSE, TRUE, FALSE);\n $leave_duration += $this->leaves_model->monthlyLeavesDuration($linear);\n $leaves_detail = $this->leaves_model->monthlyLeavesByType($linear);\n //Init type columns\n foreach ($types as $type) {\n if (array_key_exists($type['name'], $leaves_detail)) {\n if (!array_key_exists($type['name'], $result[$user->id])) {\n $result[$user->id][$type['name']] = 0;\n }\n $result[$user->id][$type['name']] += \n $leaves_detail[$type['name']];\n } else {\n $result[$user->id][$type['name']] = '';\n }\n }\n }\n if ($requests) $leave_requests[$user->id] = $this->leaves_model->getAcceptedLeavesBetweenDates($user->id, $start, $end);\n $work_duration = $opened_days - $leave_duration;\n } else {\n $linear = $this->leaves_model->linear($user->id, $month, $year, FALSE, FALSE, TRUE, FALSE);\n $leave_duration = $this->leaves_model->monthlyLeavesDuration($linear);\n $work_duration = $opened_days - $leave_duration;\n $leaves_detail = $this->leaves_model->monthlyLeavesByType($linear);\n if ($requests) $leave_requests[$user->id] = $this->leaves_model->getAcceptedLeavesBetweenDates($user->id, $start, $end);\n //Init type columns\n foreach ($types as $type) {\n if (array_key_exists($type['name'], $leaves_detail)) {\n $result[$user->id][$type['name']] = $leaves_detail[$type['name']];\n } else {\n $result[$user->id][$type['name']] = '';\n }\n }\n }\n $result[$user->id]['leave_duration'] = $leave_duration;\n $result[$user->id]['total_days'] = $total_days;\n $result[$user->id]['non_working_days'] = $non_working_days;\n $result[$user->id]['work_duration'] = $work_duration;\n }\n\n $table = '';\n $thead = '';\n $tbody = '';\n $line = 2;\n $i18n = array(\"identifier\", \"firstname\", \"lastname\", \"datehired\", \"department\", \"position\", \"contract\");\n foreach ($result as $user_id => $row) {\n $index = 1;\n $tbody .= '<tr>';\n foreach ($row as $key => $value) {\n if ($line == 2) {\n if (in_array($key, $i18n)) {\n $thead .= '<th>' . lang($key) . '</th>';\n } else {\n $thead .= '<th>' . $key . '</th>';\n }\n }\n $tbody .= '<td>' . $value . '</td>';\n $index++;\n }\n $tbody .= '</tr>';\n //Display a nested table listing the leave requests\n if ($requests) {\n if (count($leave_requests[$user_id])) {\n $tbody .= '<tr><td colspan=\"' . count($row) . '\">';\n $tbody .= '<table class=\"table table-bordered table-hover\" style=\"width: auto !important;\">';\n $tbody .= '<thead><tr>';\n $tbody .= '<th>' . lang('leaves_index_thead_id'). '</th>';\n $tbody .= '<th>' . lang('leaves_index_thead_start_date'). '</th>';\n $tbody .= '<th>' . lang('leaves_index_thead_end_date'). '</th>';\n $tbody .= '<th>' . lang('leaves_index_thead_type'). '</th>';\n $tbody .= '<th>' . lang('leaves_index_thead_duration'). '</th>';\n $tbody .= '</tr></thead>';\n $tbody .= '<tbody>';\n //Iterate on leave requests\n foreach ($leave_requests[$user_id] as $request) {\n $date = new DateTime($request['startdate']);\n $startdate = $date->format(lang('global_date_format'));\n $date = new DateTime($request['enddate']);\n $enddate = $date->format(lang('global_date_format'));\n $tbody .= '<tr>';\n $tbody .= '<td><a href=\"' . base_url() . 'leaves/view/'. $request['id']. '\" target=\"_blank\">'. $request['id']. '</a></td>';\n $tbody .= '<td>'. $startdate . ' (' . lang($request['startdatetype']). ')</td>';\n $tbody .= '<td>'. $enddate . ' (' . lang($request['enddatetype']). ')</td>';\n $tbody .= '<td>'. $request['type'] . '</td>';\n $tbody .= '<td>'. $request['duration'] . '</td>';\n $tbody .= '</tr>';\n }\n $tbody .= '</tbody>';\n $tbody .= '</table>';\n $tbody .= '</td></tr>';\n } else {\n $tbody .= '<tr><td colspan=\"' . count($row) . '\">----</td></tr>';\n }\n }\n $line++;\n }\n $table = '<table class=\"table table-bordered table-hover\">' .\n '<thead>' .\n '<tr>' .\n $thead .\n '</tr>' .\n '</thead>' .\n '<tbody>' .\n $tbody .\n '</tbody>' .\n '</table>';\n \n echo $table;\n }",
"public function f_get_report_openingBalance($emp_cd)\r\n {\r\n\r\n $sql = $this->db->query(\" SELECT trans_dt, SUM(cl_bal) AS cl_bal, SUM(el_bal) AS el_bal, SUM(ml_bal) AS ml_bal, SUM(od_bal) AS od_bal FROM td_leave_dtls\r\n WHERE emp_no = $emp_cd AND trans_type = 'O' /*AND YEAR(trans_dt) = YEAR(CURDATE())*/ \r\n GROUP BY trans_dt, emp_no, trans_type \");\r\n\r\n return $sql->result();\r\n\r\n }",
"function saveEmployeeLeaveHistory($db, $strIDEmployee, $intYear = \"\", $strJoinDate = \"\", $strEmpStatus = 1)\n{\n global $_SESSION;\n $intPCB = getSetting(\"pcb\"); //periode cuti besar\n $intJCB = getSetting(\"jcb\"); //jatah cuti besar\n $intJCN = getSetting(\"jcn\"); //jatah cuti normal\n $arrResult = [\n \"total\" => 0, // jatah\n \"used\" => 0, // terpakai\n \"holiday\" => 0, // hari libur cuti\n \"remain\" => 0, // sisa cuti\n \"startDate\" => \"\",\n \"finishDate\" => \"\",\n ];\n if ($strIDEmployee === \"\") {\n return $arrResult;\n }\n if ($intYear === \"\" || !is_numeric($intYear)) {\n $intYear = date(\"Y\");\n }\n if ($strJoinDate == \"\") { // cari joinDate jika tidak disertakan\n $arrTmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n $strJoinDate = $arrTmp['join_date'];\n }\n // extrak data tanggalnya\n //$arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($strJoinDate);\n // cari tanggal awal dan akhir\n $strStart = $intYear . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $strFinish = ($intYear + 1) . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $arrResult['startDate'] = $strStart;\n $arrResult['finishDate'] = $strFinish;\n $intDur = $intYear - $arrJoinDate['year'];\n $intQuota = (($intDur % $intPCB == 0) && $intDur > 0) ? $intJCB : $intJCN;\n // hitung jatah, berdasarkan selisih tahun\n //if ($intDur < 5) $intQuota = 12;\n //else if ($intDur < 10) $intQuota = 15;\n //else $intQuota = 20;\n //if ($strEmpStatus == 2 && $intQuota > 12) $intQuota = 12; // maks 12\n // cari cuti yang telah diambil\n $arrLeave = getEmployeeLeaveAnnualByYear($db, $intYear, \"\", $strIDEmployee);\n $intLeave = (isset($arrLeave[$strIDEmployee])) ? $arrLeave[$strIDEmployee] : 0;\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = 0;\n /*\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStart' AND '$strFinish' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n if ($rowDb['total'] != \"\") $intHoliday = $rowDb['total'];\n }\n */\n // SIMPAN DI LEAVE HISTORY\n $strModifiedByID = (isset($_SESSION['sessionUserID'])) ? $_SESSION['sessionUserID'] : \"-1\";\n $strSQL = \"DELETE FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \"; // hapus dulu\n $strSQL .= \"AND \\\"year\\\" = '$intYear'; \";\n $strSQL .= \"INSERT INTO hrd_leave_history (created, modified_by, created_by, \";\n $strSQL .= \"id_employee, \\\"year\\\", start_date, finish_date, \";\n $strSQL .= \"total, used, holiday) \";\n $strSQL .= \"VALUES(now(), '$strModifiedByID', '$strModifiedByID', '$strIDEmployee', \";\n $strSQL .= \"'$intYear', '$strStart', '$strFinish', '$intQuota', '$intLeave', '$intHoliday') \";\n $resExec = $db->execute($strSQL);\n $arrResult['total'] = $intQuota;\n $arrResult['used'] = $intLeave;\n $arrResult['holiday'] = $intHoliday;\n $arrResult['remain'] = $intQuota - $intLeave - $intHoliday;\n return $arrResult;\n}",
"protected function getLeaveAssignDateLimit() {\n // If no leave period, don't allow apply/assign beyond next calender year\n $todayNextYear = new DateTime();\n $todayNextYear->add(new DateInterval('P1Y'));\n \n if ($this->getConfigService()->isLeavePeriodDefined()) {\n $period = $this->getLeavePeriodService()->getCurrentLeavePeriodByDate($todayNextYear->format('Y-m-d'));\n $maxDate = $period[1];\n } else {\n $nextYear = $todayNextYear->format('Y');\n $maxDate = $nextYear . '-12-31';\n } \n \n return $maxDate;\n }"
]
| [
"0.5992548",
"0.58455986",
"0.5750903",
"0.5694354",
"0.5660426",
"0.56336814",
"0.5567983",
"0.55663174",
"0.55105513",
"0.5378777",
"0.5370628",
"0.53343016",
"0.5324018",
"0.52999467",
"0.5297209",
"0.52082217",
"0.51942164",
"0.5176838",
"0.51262724",
"0.51182884",
"0.51050144",
"0.50879484",
"0.5069261",
"0.50482684",
"0.50423056",
"0.50252485",
"0.50039464",
"0.500152",
"0.4996996",
"0.49406475"
]
| 0.7336114 | 0 |
end getApplyCountByDept() Get Overtime apply headcount in flow by department | function getOvertimeApplyCountByDept($whoami = 'assistant')
{
$create_by = $whoami=='admin' ? '' : ' and a.create_by = \''.$_SESSION['user']['user_seq_no'].'\' ';
$sql = <<<eof
select c.segment_no as dept_seq_no,
c.segment_no_sz as dept_id,
c.segment_name as dept_name,
a.flow_status,
decode(a.flow_status,'01','已提交','02','流程中','暂存') as flow_status_desc,
count(a.overtime_flow_seqno) as trows
from ehr_overtime_in_flow_v a,
hr_personnel_base b,
gl_segment c
where a.company_id = b.seg_segment_no
and a.emp_seq_no = b.id
and b.seg_segment_no = c.seg_segment_no
and b.seg_segment_no_department = c.segment_no
and a.company_id = :company_id
and a.flow_status < '03'
$create_by
group by c.segment_no,c.segment_no_sz,c.segment_name,a.flow_status
order by c.segment_no_sz
eof;
//$this->DBConn-> debug = 1;
return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLeaveApplyCountByDept($whoami = 'assistant')\n {\n $create_by = $whoami=='admin' ? '' : ' and a.create_by = \\''.$_SESSION['user']['user_seq_no'].'\\' ';\n $sql = <<<eof\n select c.segment_no as dept_seq_no,\n\t\t\t c.segment_no_sz as dept_id,\n\t\t\t c.segment_name as dept_name,\n\t\t\t a.flow_status,\n\t\t\t decode(a.flow_status, '01', '已提交', '02', '流程中', '暂存') as flow_status_desc,\n\t\t\t count(a.absence_seq_no) as trows\n\t\t\t from ehr_leave_in_flow_v a, hr_personnel_base b, gl_segment c\n\t\t\t where a.company_id = b.seg_segment_no\n\t\t\t and a.emp_seq_no = b.id\n\t\t\t and b.seg_segment_no = c.seg_segment_no\n\t\t\t and b.seg_segment_no_department = c.segment_no \n and a.company_id = :company_id\n and a.flow_status < '03'\n $create_by\n group by c.segment_no, c.segment_no_sz ,c.segment_name, a.flow_status\n order by c.segment_no_sz\neof;\n //$this->DBConn->debug =1;\n return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));\n }",
"public function performance_ranking()\n {\n // transaction count = service + service applications + service application requirements\n // department and city\n\n // department counter\n $all_deparments = lookup_all_departments_and_offices();\n $department_with_counts = array();\n\n foreach ($all_deparments as $department) {\n\n $transaction_count = 0;\n // get services\n if ($department['parent'] == 1) {\n $where = array(\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0\n );\n } else {\n $where = array(\n 'DepartmentID' => $department['DepartmentID'],\n 'SubDepartmentID' => $department['id']\n );\n }\n $department_services = lookup_all('Service_Services', $where);\n foreach ($department_services as $service) {\n\n // 1 count per service\n $transaction_count++;\n\n // get service applications\n $service_applications = lookup_all('Service_Applications', array('ServiceID' => $service['id']), false);\n\n foreach ($service_applications as $service_application) {\n // 1 count per service application\n $transaction_count++;\n\n // each requirements has 1 count\n $transaction_count += $service_application['RequirementCount'];\n }\n\n }\n\n if ($transaction_count > 0) {\n $department_with_counts[] = array(\n 'parent' => $department['parent'],\n 'id' => $department['id'],\n 'name' => $department['Name'],\n 'code' => trim(preg_replace(\"/\\([^)]+\\)/\",\"\", $department['Code'])),\n 'logo' => logo_filename($department['Logo']),\n 'count' => $transaction_count\n );\n }\n\n }\n\n usort($department_with_counts, function($a, $b) {\n if ($a['count'] == $b['count']) {\n return 0;\n }\n return ($a['count'] > $b['count']) ? -1 : 1;\n });\n\n\n // city counter\n $city_with_counts = array();\n\n $city_service_counts = $this->db->query('SELECT COUNT(*) AS count, MunicipalityCityID\n FROM Service_Services\n WHERE MunicipalityCityID IS NOT NULL\n AND deletedAt IS NULL\n GROUP BY MunicipalityCityID')->result_array();\n\n foreach ($city_service_counts as $city_service_count) {\n $city_with_counts[$city_service_count['MunicipalityCityID']] = $city_service_count['count'];\n }\n\n $city_application_counts = $this->db->query('SELECT COUNT(*) AS applicationCount, SUM(RequirementCount) AS requirementsCount, MunicipalityCityID\n FROM Service_Applications\n WHERE MunicipalityCityID IS NOT NULL\n AND deletedAt IS NULL\n GROUP BY MunicipalityCityID')->result_array();\n foreach ($city_application_counts as $city_application_count) {\n if (isset($city_with_counts[$city_application_count['MunicipalityCityID']])) {\n $city_with_counts[$city_application_count['MunicipalityCityID']] += ($city_application_count['applicationCount'] + $city_application_count['requirementsCount']);\n } else {\n $city_with_counts[$city_application_count['MunicipalityCityID']] = ($city_application_count['applicationCount'] + $city_application_count['requirementsCount']);\n }\n }\n\n foreach ($city_with_counts as $code => $count) {\n $cityInfo = lookup_row('UtilLocCityMun', $code, 'citymunCode');\n $city_with_counts[$code] = array(\n 'code' => $code,\n 'count' => $count,\n 'name' => $cityInfo->citymunDesc,\n 'logo' => logo_filename($cityInfo->logo),\n 'type' => $cityInfo->type\n );\n }\n\n usort($city_with_counts, function($a, $b) {\n if ($a['count'] == $b['count']) {\n return 0;\n }\n return ($a['count'] > $b['count']) ? -1 : 1;\n });\n\n response_json(array(\n 'status' => true,\n 'data' => array(\n 'department' => array_slice($department_with_counts, 0, 10), // limit 10\n 'city' => array_slice($city_with_counts, 0, 10)\n )\n ), 30);\n\n }",
"public function getTotalCasesInDept(){\n $dept = $this->dept;\n $users = User::where(['department' => $dept->id])->select('users.id')->get();\n $sum = 0;\n foreach($users as $user){\n $numberOfCasesIntaken = LegalCase::where(['staff' => $user->id])->count();\n $sum += $numberOfCasesIntaken;\n }\n return $sum;\n }",
"function erp_hr_count_departments() {\n\n return \\WeDevs\\ERP\\HRM\\Models\\Department::count();\n}",
"function fndepartmentCount() {\n\t\t$this->db->select(\"count(*) as selectCount\");\n\t\t$vResult = $this->db->get(t_department)->result();\n\t\tif($vResult) {\n\t\t\treturn $vResult[0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getUnapprovedCount();",
"public function f_get_hr_comp(){\n\n $sql = $this->db->query(\"select count(*) lv_comp_count \n from td_comp_apply \n where recommendation_status = 1\n and rejection_status = 0\n and approval_status = 0\");\n return $sql->row();\n }",
"public function getDepartmentsCount(): int\n {\n list($filters, $bindings) = $this->createFilters('dep');\n\n return DB::selectOne(\n \"SELECT \n count(*) as count \n FROM $this->table dep WHERE 1 $filters\",\n $bindings\n )->count ?? 0;\n }",
"function getVerbRuleCount($dateWindow, $rule, $filter, $interval, $dateFormat) {\n\t\t$interval = new DateInterval($interval);\n\t\t$begin = new DateTime(date('Y-08-01', strtotime($dateWindow)));\n\t\t$end = new DateTime( date('Y-m-d',time()));\n\t\t$daterange = new DatePeriod($begin, $interval, $end);\n\t\n\t\t$data = array();\n\t\tforeach ($daterange as $date) {\n\t\t\t//In a leap year this creates an irreconcilable offset so skip this day\n\t\t\tif($date->format(\"d-M\") != '29-Feb') {\n\t\t\t\t$conditions = array('rule_id' => $rule);\n\t\t\t\t$conditions = array_merge($conditions,array('DimensionDate.date >='=>$date->format(\"Y-m-d\")));\n\t\t\t\t$date->add($interval);\n\t\t\t\t$conditions = array_merge($conditions,array('DimensionDate.date <'=>$date->format(\"Y-m-d\")));\n\t\t\t\t$conditions = array_merge($conditions,$filter);\n\t\t\t\t//Iterate through rule condition to get count of each condition\n\t\t\t\t$rule_conditions = $this->Condition->get_rule_conditions($rule);\n\t\t\t\tforeach ($rule_conditions[0]['Condition'] as $rule_condition) {\n\t\t\t\t\t$conditions = array_merge($conditions, array('condition_id' => $rule_condition['id']));\n $cacheName = 'verb_rule_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $conditions, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\", //array of field names\n )\n );\n Cache::write($cacheName, $value, 'long');\n }\n\t\t\t\t\tif($value[0]['total']) {\n\t\t\t\t\t\t$count = $value[0]['total'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$data[$rule_condition['name']][] = array((string)$date->format($dateFormat) => $count);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"function getResubmitCount(){\n\t\t$sectionDecisionDao = DAORegistry::getDAO('SectionDecisionDAO');\n\t\treturn $sectionDecisionDao->getResubmitCount($this->getDateDecided(), $this->getArticleId(), $this->getReviewType(), $this->getRound());\n\t}",
"function getIPPieCount($dateWindow, $rule, $filter, $interval, $dateFormat) {\n\t\t$start = strtotime($dateWindow);\n\t\n\t\t$data = array();\n\t\t\n\t\t$conditions = array('rule_id' => $rule);\n\t\t$conditions = array_merge($conditions,array('DimensionDate.date >='=>date(\"Y-m-d\", $start)));\n\t\t$conditions = array_merge($conditions,$filter);\n\t\t\n\t\t//Iterate through rule condition to get count of each condition\n\t\t$rule_conditions = $this->Condition->get_rule_conditions($rule);\n\t\t$zero_condition = array_merge($conditions, array('condition_id' => 0));\n\t\tforeach ($rule_conditions[0]['Condition'] as $rule_condition) {\n\t\t\t$conditions = array_merge($conditions, array('condition_id' => $rule_condition['id']));\n $cacheName = 'ip_pie_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $conditions, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\", //array of field names\n ));\n Cache::write($cacheName, $value, 'long');\n }\n\t\t\tif($value[0]['total']) {\n\t\t\t\t$count = $value[0]['total'];\n\t\t\t}else{\n\t\t\t\t$count = 0;\n\t\t\t}\n\t\t\t$data[$rule][] = array($rule_condition['name'] => $count);\n\t\t}\n\t\t\n\t\t//Creates the other record for IP address with zero condition\n $cacheName = 'ip_pie_other_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $zero_condition, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\",\n ));\n Cache::write($cacheName, $value, 'long');\n }\n\t\tif($value[0]['total']) {\n\t\t\t$count = $value[0]['total'];\n\t\t}else{\n\t\t\t$count = 0;\n\t\t}\n\t\t$data[$rule][] = array('Other' => $count);\n\t\treturn $data;\n\t}",
"function getIPRuleCount($dateWindow, $rule, $filter, $interval, $dateFormat) {\n\t\t$interval = new DateInterval($interval);\n\t\t$begin = new DateTime(date('Y-08-01', strtotime($dateWindow)));\n\t\t$end = new DateTime( date('Y-m-d',time()));\n\t\t$daterange = new DatePeriod($begin, $interval, $end);\n\t\n\t\t$data = array();\n\t\tforeach ($daterange as $date) {\n\t\t\t//In a leap year this creates an irreconcilable offset so skip this day\n\t\t\tif($date->format(\"d-M\") != '29-Feb') {\n\t\t\t\t$conditions = array('rule_id' => $rule);\n\t\t\t\t$conditions = array_merge($conditions,array('DimensionDate.date >='=>$date->format(\"Y-m-d\")));\n\t\t\t\t$date->add($interval);\n\t\t\t\t$conditions = array_merge($conditions,array('DimensionDate.date <'=>$date->format(\"Y-m-d\")));\n\t\t\t\t$conditions = array_merge($conditions, $filter);\n\t\t\t\t//Iterate through rule condition to get count of each condition\n\t\t\t\t$rule_conditions = $this->Condition->get_rule_conditions($rule);\n\t\t\t\t$zero_condition = array_merge($conditions, array('condition_id' => 0));\n\t\t\t\tforeach ($rule_conditions[0]['Condition'] as $rule_condition) {\n\t\t\t\t\t$conditions = array_merge($conditions, array('condition_id' => $rule_condition['id']));\n $cacheName = 'ip_rule_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $conditions, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\", //array of field names\n )\n );\n Cache::write($cacheName, $value, 'long');\n }\n\t\t\t\t\tif($value[0]['total']) {\n\t\t\t\t\t\t$count = $value[0]['total'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$data[$rule_condition['name']][] = array((string)$date->format($dateFormat) => $count);\n\t\t\t\t}\n\t\t\t\t//Creates the other record for IP address with zero condition\n $cacheName = 'ip_rule_other_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $zero_condition, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\",\n ) //array of field names\n );\n Cache::write($cacheName, $value, 'long');\n }\n\t\t\t\tif($value[0]['total']) {\n\t\t\t\t\t$count = $value[0]['total'];\n\t\t\t\t}else{\n\t\t\t\t\t$count = 0;\n\t\t\t\t}\n\t\t\t\t$data['Other'][] = array((string)$date->format($dateFormat) => $count);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"public function getPlanificationPeriodsCount($timetable)\n {\n $qb = $this->createQueryBuilder('pl');\n $qb->select($queryBuilder->expr()->count('pl'));\n $qb->where('pl.timetable = :timetable')->setParameter('timetable', $timetable);\n\n $query = $qb->getQuery();\n $singleScalar = $query->getSingleScalarResult();\n return $singleScalar;\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"function getRulePieCount($dateWindow, $rule, $filter) {\n\t\t$start = strtotime($dateWindow);\n\t\n\t\t$data = array();\n\t\t\n\t\t$conditions = array('rule_id' => $rule);\n\t\t$conditions = array_merge($conditions,array('DimensionDate.date >='=>date(\"Y-m-d\", $start)));\n\t\t$conditions = array_merge($conditions,$filter);\n\t\t\n\t\t//Iterate through rule condition to get count of each condition\n\t\t$rule_conditions = $this->Condition->get_rule_conditions($rule);\n\n\t\tforeach ($rule_conditions[0]['Condition'] as $rule_condition) {\n\t\t\t$conditions = array_merge($conditions, array('condition_id' => $rule_condition['id']));\n $cacheName = 'rule_pie_count.'.$this->formatCacheConditions($conditions);\n $value = Cache::read($cacheName, 'long');\n if (!$value) {\n $value = $this->find('first', array(\n 'conditions' => $conditions, //array of conditions\n 'contain' => array(\n 'DimensionDate' => array(\n 'fields' => array(\n 'DimensionDate.date'\n )\n ),\n 'System' => array(\n 'fields' => array(\n 'System.id'\n )\n )\n ),\n 'fields' => \"SUM(FactSummedVerbRuleDatetime.total) as total\", //array of field names\n )\n );\n Cache::write($cacheName, $value, 'long');\n }\n\t\t\tif($value[0]['total']) {\n\t\t\t\t$count = $value[0]['total'];\n\t\t\t}else{\n\t\t\t\t$count = 0;\n\t\t\t}\n\t\t\t$data[$rule][] = array($rule_condition['name'] => $count);\n\t\t}\n\t\treturn $data;\n\t}",
"public function computeCount() {\n $count = 0;\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n $count = count($data);\n }\n }\n return $count;\n }",
"public function getInterval_reports_day_total($filter, $pos, $count = 20, $onlycount = 0) {\r\n\r\n $utils = new Utils();\r\n\r\n if ($onlycount) {\r\n $res = $this->db->query(\"SELECT COUNT(*) FROM queue_cdr\");\r\n $row = $res->fetch(\\PDO::FETCH_NUM);\r\n return intval($row[0]);\r\n }\r\n\r\n $demand = \" SELECT \";\r\n $demand.= \" SUBSTRING(calldate,1,10) AS calldate_day, \";\r\n\r\n// Interval reports hour=3 / day=else(in use) / week=2 / month=4\r\n/*\r\n if($filter['type']==2) $demand.= \"\r\n\t\t\t\tDAYOFWEEK(calldate) AS calldate_weekday, \";\r\n else if($filter['type']==3) $demand.= \"\r\n SUBSTRING(calldate,12,2) AS calldate_hour, \";\r\n else if($filter['type']==4) $demand.= \"\r\n SUBSTRING(calldate,1,7) AS calldate_month, \";\r\n-> else $demand.= \"\r\n SUBSTRING(calldate,1,10) AS calldate_day, \";\r\n*/\r\n\r\n $demand.= \"\t\r\n count(*) AS count_calls,\r\n SUM(talktime) AS sum_talktime,\r\n SUM(holdtime) AS sum_holdtime,\r\n count(IF(reason = 'COMPLETEAGENT',1,NULL)) AS completeagent_calls,\r\n count(IF(reason = 'COMPLETECALLER',1,NULL)) AS completecaller_calls,\r\n count(IF(reason = 'TRANSFER',1,NULL)) AS transfer_calls,\r\n count(IF(reason = 'ABANDON',1,NULL)) AS abandon_calls,\r\n count(IF(reason = 'EXITEMPTY',1,NULL)) AS exitempty_calls,\r\n count(IF(reason = 'EXITWITHTIMEOUT',1,NULL)) AS exitwithtimeout_calls,\r\n count(IF(reason = 'EXITWITHKEY',1,NULL)) AS exitwithkey_calls,\r\n count(IF(reason = 'SYSCOMPAT',1,NULL)) AS syscompat_calls,\r\n MAX(holdtime) AS holdtime_max,\r\n MAX(talktime) AS talktime_max,\r\n MIN(holdtime) AS holdtime_min,\r\n MIN(IF(talktime,talktime,NULL)) AS talktime_min\r\n FROM queue_cdr \";\r\n\r\n// Time settings\r\n\r\n if(isset($filter['t1']) && isset($filter['t2'])) $demand = $demand.\"\r\n WHERE calldate>'\".$filter['t1'].\"' AND calldate<'\".$filter['t2'].\"' \";\r\n else $demand = $demand.\"\r\n WHERE Now()-calldate < 86400 \";\r\n\r\n // $demand = $demand.\" WHERE UNIX_TIMESTAMP(calldate)>UNIX_TIMESTAMP('\".$t1.\"') AND UNIX_TIMESTAMP(calldate)<UNIX_TIMESTAMP('\".$t2.\"') \";\r\n\r\n// Filters\r\n\r\n if(isset($filter['filter'])) {\r\n if($filter['filter']==2) $demand = $demand.\"\r\n AND (reason = 'COMPLETEAGENT' OR reason = 'COMPLETECALLER' OR reason = 'TRANSFER') AND !outgoing \";\r\n else if($filter['filter']==3) $demand = $demand.\"\r\n AND (reason = 'ABANDON' OR reason = 'EXITWITHTIMEOUT' OR reason = 'EXITEMPTY' OR reason = 'EXITWITHTKEY') AND !outgoing \";\r\n else if($filter['filter']==4) $demand = $demand.\"\r\n AND outgoing=1 \";\r\n else $demand = $demand.\"\r\n AND !outgoing AND reason != 'RINGNOANSWER' \";\r\n }\r\n else $demand = $demand.\"\r\n AND !outgoing AND reason != 'RINGNOANSWER' \";\r\n\r\n if(isset($filter['src'])) $demand = $demand.\r\n \"\tAND src LIKE '%\".$filter['src'].\"%' \";\r\n\r\n $que = $this->auth->allowed_queues();\r\n $queues = $utils->sql_allowed_queues($que);\r\n $demand.= $queues;\r\n\r\n\r\n// Interval reports hour=3 / day=else(in use) / week=2 / month=4\r\n\r\n if($filter['type']==2) $demand.= \"\r\n\t\t\tGROUP BY DAYOFWEEK(calldate) \";\r\n else if($filter['type']==3) $demand.= \"\r\n GROUP BY SUBSTRING(calldate,12,2) \";\r\n else if($filter['type']==4) $demand.= \"\r\n GROUP BY SUBSTRING(calldate,1,7) \";\r\n else $demand.= \"\r\n GROUP BY SUBSTRING(calldate,1,10) \";\r\n\r\n\r\n $result = $this->db->query($demand);\r\n $cdr_report = [];\r\n $i = -1;\r\n while($myrow = $result->fetch(\\PDO::FETCH_ASSOC)) {\r\n $i++;\r\n $cdr_report[$i] = $myrow;\r\n };\r\n\r\n for($j=0; $j<=$i; $j++) {\r\n $b = explode(\"-\",$cdr_report[$j]['calldate_day']);\r\n switch ($b[1]) {\r\n case 1:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"January1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"January1\".\" \".$b[0];\r\n break;\r\n case 2:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"February1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"February1\".\" \".$b[0];\r\n break;\r\n case 3:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"March1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"March1\".\" \".$b[0];\r\n break;\r\n case 4:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"April1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"April1\".\" \".$b[0];\r\n break;\r\n case 5:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"May1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"May1\".\" \".$b[0];\r\n break;\r\n case 6:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"June1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"June1\".\" \".$b[0];\r\n break;\r\n case 7:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"July1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"July1\".\" \".$b[0];\r\n break;\r\n case 8:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"August1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"August1\".\" \".$b[0];\r\n break;\r\n case 9:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"September1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"September1\".\" \".$b[0];\r\n break;\r\n case 10:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"October1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"October1\".\" \".$b[0];\r\n break;\r\n case 11:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"November1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"November1\".\" \".$b[0];\r\n break;\r\n case 12:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1].\"-\".$b[2];\r\n $cdr_report[$j]['calldate2'] = $b[2].\" \".\"December1\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = $b[2].\" \".\"December1\".\" \".$b[0];\r\n break;\r\n };\r\n\r\n// Interval reports hour=3 / day=else(in use) / week=2 / month=4\r\n/*\r\n if($filter['type']==2) {\r\n\t\tif($cdr_report[$j]['calldate_weekday']==1) { $cdr_report[$j]['calldate'] = 0; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Sunday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==2) { $cdr_report[$j]['calldate'] = 1; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Monday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==3) { $cdr_report[$j]['calldate'] = 2; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Tuesday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==4) { $cdr_report[$j]['calldate'] = 3; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Wednesday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==5) { $cdr_report[$j]['calldate'] = 4; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Thursday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==6) { $cdr_report[$j]['calldate'] = 5; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Friday\"); }\r\n\t\telse if($cdr_report[$j]['calldate_weekday']==7) { $cdr_report[$j]['calldate'] = 6; $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_short'] = translate(\"Saturday\"); };\r\n\t}\r\n\r\n else if($filter['type']==3) {\r\n if($cdr_report[$j]['calldate_hour']==\"01\" || $cdr_report[$j]['calldate_hour']==\"21\") $cdr_report[$j]['calldate_short'] = $cdr_report[$j]['calldate'] = $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_hour'].\" \".translate(\"hour1\");\r\n else if(($cdr_report[$j]['calldate_hour']>\"01\" && $cdr_report[$j]['calldate_hour']<\"05\") || ($cdr_report[$j]['calldate_hour']>\"21\")) $cdr_report[$j]['calldate_short'] = $cdr_report[$j]['calldate'] = $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_hour'].\" \".translate(\"hour2\");\r\n else if(($cdr_report[$j]['calldate_hour']>\"04\" && $cdr_report[$j]['calldate_hour']<\"21\") || ($cdr_report[$j]['calldate_hour']==\"00\")) $cdr_report[$j]['calldate_short'] = $cdr_report[$j]['calldate'] = $cdr_report[$j]['calldate2'] = $cdr_report[$j]['calldate_hour'].\" \".translate(\"hour3\");\r\n }\r\n\r\n else if($filter['type']==4) {\r\n $b = explode(\"-\",$cdr_report[$j]['calldate_month']);\r\n switch ($b[1]) {\r\n case 1:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"January\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"January\".\" \".$b[0];\r\n break;\r\n case 2:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"February\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"February\".\" \".$b[0];\r\n break;\r\n case 3:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"March\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"March\".\" \".$b[0];\r\n break;\r\n case 4:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"April\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"April\".\" \".$b[0];\r\n break;\r\n case 5:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"May\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"May\".\" \".$b[0];\r\n break;\r\n case 6:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"June\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"June\".\" \".$b[0];\r\n break;\r\n case 7:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"July\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"July\".\" \".$b[0];\r\n break;\r\n case 8:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"August\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"August\".\" \".$b[0];\r\n break;\r\n case 9:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"September\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"September\".\" \".$b[0];\r\n break;\r\n case 10:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"October\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"October\".\" \".$b[0];\r\n break;\r\n case 11:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"November\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"November\".\" \".$b[0];\r\n break;\r\n case 12:\r\n $cdr_report[$j]['calldate'] = $b[0].\"-\".$b[1];\r\n $cdr_report[$j]['calldate2'] = \"December\".\" \".$b[0];\r\n $cdr_report[$j]['calldate_short'] = \"December\".\" \".$b[0];\r\n break;\r\n };\r\n }\r\n\r\n-> else {\r\n }\r\n*/\r\n $cdr_report[$j]['calls_served'] = $cdr_report[$j]['completeagent_calls'] + $cdr_report[$j]['completecaller_calls'] + $cdr_report[$j]['transfer_calls'];\r\n $cdr_report[$j]['calls_unserved'] = $cdr_report[$j]['abandon_calls'] + $cdr_report[$j]['exitwithtimeout_calls'] + $cdr_report[$j]['exitempty_calls'] + $cdr_report[$j]['exitwithkey_calls'] + $cdr_report[$j]['syscompat_calls'];\r\n $cdr_report[$j]['calls_total'] = $cdr_report[$j]['calls_served'] + $cdr_report[$j]['calls_unserved'];\r\n $cdr_report[$j]['calls_served_per'] = round(($cdr_report[$j]['calls_served']*100/$cdr_report[$j]['calls_total']),1);\r\n $cdr_report[$j]['calls_unserved_per'] = round(($cdr_report[$j]['calls_unserved']*100/$cdr_report[$j]['calls_total']),1);\r\n $sum_talktime = $cdr_report[$j]['talktime_sum'] = $cdr_report[$j]['sum_talktime'];\r\n $sum_holdtime = $cdr_report[$j]['holdtime_sum'] = $cdr_report[$j]['sum_holdtime'];\r\n $cdr_report[$j]['sum_talktime'] = $utils->time_format($cdr_report[$j]['sum_talktime']);\r\n $cdr_report[$j]['sum_holdtime'] = $utils->time_format($cdr_report[$j]['sum_holdtime']);\r\n $cdr_report[$j]['calls_served_chart'] = '\r\n <div style=\"float:left;width:120px;\">\r\n <div class=\"chart_calls_default_right\">'.$cdr_report[$j]['calls_served'].' ('.$cdr_report[$j]['calls_served_per'].'%)</div>\r\n <div class=\"chart_calls_served\" style=\"width:'.$cdr_report[$j]['calls_served_per'].'%;\"></div>\r\n </div>\r\n ';\r\n $cdr_report[$j]['calls_unserved_chart'] = '\r\n <div style=\"float:right;width:120px;\">\r\n <div class=\"chart_calls_default_left\">'.$cdr_report[$j]['calls_unserved'].' ('.$cdr_report[$j]['calls_unserved_per'].'%)</div>\r\n <div class=\"chart_calls_unserved\" style=\"width:'.$cdr_report[$j]['calls_unserved_per'].'%;\"></div>\r\n </div>\t\t\r\n ';\r\n $cdr_report[$j]['sum_talktime_chart'] = '\r\n <div style=\"float:right;width:120px;\">\r\n <div class=\"chart_calls_default_right\">'.$cdr_report[$j]['sum_talktime'].'</div>\r\n <div class=\"chart_calls_served\" style=\"width:'.round(($sum_talktime*100/($sum_talktime+$sum_holdtime)),1).'%;\"></div>\r\n </div>\r\n ';\r\n $cdr_report[$j]['sum_holdtime_chart'] = '\r\n <div style=\"float:left;width:120px;\">\r\n <div class=\"chart_calls_default_left\">'.$cdr_report[$j]['sum_holdtime'].'</div>\r\n <div class=\"chart_calls_unserved\" style=\"width:'.round(($sum_holdtime*100/($sum_talktime+$sum_holdtime)),1).'%;\"></div>\r\n </div>\t\t\r\n ';\r\n };\r\n return [$cdr_report, $i];\r\n }",
"function getRCCACountUnderReview()\n{\n\tglobal $dbObjMirrors;\n\n\t$RCCAQuery = \"SELECT State,count(*) as cnt\n\t\t\t\t\tFROM [mirrors].[dbo].[View_LSIP2_RCCA]\n\t\t\t\t\tWHERE [mirrors].[dbo].[View_LSIP2_RCCA].[Ready_For_Arch_Review]='Yes' and State='Submitted'\n\t\t\t\t\tGROUP BY State\";\n\n\t$RCCAResult = $dbObjMirrors->executeQuery($RCCAQuery);\n\n\treturn $RCCAResult;\n}",
"function getGrantsAppliedCount() {\n\t\treturn $this->getOption(self::STAT_TOTAL_APPLIED, 0);\n\t}",
"function getOverallRemain(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl));\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}",
"function GetNumAnnouncement($NETWORK,$companyID,$attendeeID){\r\n\r\nglobal $NETWORK;\r\n\r\n$SQL_Ann = \"select * from announcement where network= '\".$NETWORK.\"'\";\r\n\r\n\r\n$objAnn=get_obj_info($SQL_Ann, array(\"Announcementid\"));\r\n$TotalAnn = count($objAnn);\r\n\r\n\r\n$SQL_AnnRead = \"select * from announcement_log where compid =\".$companyID.\"\"; \r\n\r\n\r\nif ($attendeeID!=\"\"){\r\n\t$SQL_AnnRead = $SQL_AnnRead .\" and attendeeID =\".$attendeeID.\" \";\r\n\r\n}\r\n\r\n$objAnnRead=get_obj_info($SQL_AnnRead, array(\"Announcementid\"));\r\n$TotalRead = count($objAnnRead);\r\n\r\nif ($TotalRead < $TotalAnn){\r\n\t\t$NumNotRead = $TotalAnn - $TotalRead;\r\n}else{\r\n\t\t$NumNotRead =0;\r\n\r\n}\r\nreturn $NumNotRead;\r\n\r\n}",
"public function getActivitiesCount() : int;",
"public function totalCount();",
"public function totalCount();",
"public function countDepartmentCopyrightContributions($department)\n\t{\n \t$column = 'departments.int_id';\n\t\t$copyrightCount = $this->copyrightCounter($column, \n\t\t\t$department->int_id);\n\t\treturn $copyrightCount;\n\t}",
"public function getSummaryCount($mode, $defFilter) \n\t{\n\t\tif ($mode == 'riskLevel') {\n\t\t\t$sql = \"select count(1) as numcount, risk_level \n\t\t\t\t\tfrom t_risk\n\t\t\t\t\twhere risk_input_by = ?\n\t\t\t\t\tgroup by risk_level\";\n\t\t\t$par = array('uid' => $defFilter['userid']);\n\t\t}\n\t\t\n\t\tif ($mode == 'risk') {\n\t\t\t$sql = \"select count(1) as numcount, risk_level \n\t\t\t\t\tfrom t_risk\n\t\t\t\t\twhere risk_status in (3)\n\t\t\t\t\tgroup by risk_level\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'riskregister') {\n\t\t\t$sql = \"select count(1) as numcount\n\t\t\t\tfrom m_user a \n\t\t\t\tjoin m_division b on a.division_id = b.division_id\n\t\t\t\tjoin (\n\t\t\t\t\tselect min(risk_status) as risk_status, risk_input_by from t_risk\n\t\t\t\t\twhere\n\t\t\t\t\trisk_status = 2\n\t\t\t\t\tgroup by risk_input_by\n\t\t\t\t) b on a.username = b.risk_input_by\n\t\t\t\t\t\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'treatment') {\n\t\t\t$sql = \"select count(1) as numcount, risk_level \n\t\t\t\t\tfrom t_risk\n\t\t\t\t\twhere risk_status = 5\n\t\t\t\t\tgroup by risk_level\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'actionplan') {\n\t\t\t$sql = \"select count(1) as numcount, b.risk_level \n\t\t\t\t\tfrom \n\t\t\t\t\tt_risk_action_plan a join t_risk b on a.risk_id = b.risk_id\n\t\t\t\t\twhere a.action_plan_status = 3\n\t\t\t\t\tgroup by b.risk_level\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'kri') {\n\t\t\t$sql = \"select count(1) as numcount, b.risk_level \n\t\t\t\t\tfrom \n\t\t\t\t\tt_kri a join t_risk b on a.risk_id = b.risk_id\n\t\t\t\t\twhere \n\t\t\t\t\ta.kri_status = 2\n\t\t\t\t\tgroup by b.risk_level\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'change') {\n\t\t\t$sql = \"select count(1) as numcount, b.risk_level \n\t\t\t\t\tfrom \n\t\t\t\t\tt_cr_risk a join t_risk b on a.risk_id = b.risk_id\n\t\t\t\t\twhere \n\t\t\t\t\ta.cr_status = 0\n\t\t\t\t\tgroup by b.risk_level\";\n\t\t\t$par = array();\n\t\t}\n\t\t\n\t\tif ($mode == 'myriskowned') {\n\t\t\t$sql = \"select count(1) as numcount, risk_level \n\t\t\t\t\tfrom t_risk\n\t\t\t\t\twhere risk_status > 2\n\t\t\t\t\tand risk_division = ?\n\t\t\t\t\tgroup by risk_level\";\n\t\t\t$par = array('uid' => $defFilter['division_id']);\n\t\t}\n\t\t\n\t\tif ($mode == 'myactionplan') {\n\t\t\t$sql = \"select count(1) as numcount, b.risk_level \n\t\t\t\t\tfrom \n\t\t\t\t\tt_risk_action_plan a join t_risk b on a.risk_id = b.risk_id\n\t\t\t\t\twhere \n\t\t\t\t\ta.action_plan_status > 0\n\t\t\t\t\tand b.risk_division = ?\n\t\t\t\t\tgroup by b.risk_level\";\n\t\t\t$par = array('uid' => $defFilter['division_id']);\n\t\t}\n\t\t\n\t\tif ($mode == 'mykri') {\n\t\t\t$sql = \"select count(1) as numcount, b.risk_level \n\t\t\t\t\tfrom \n\t\t\t\t\tt_kri a join t_risk b on a.risk_id = b.risk_id\n\t\t\t\t\twhere \n\t\t\t\t\ta.kri_owner = ?\n\t\t\t\t\tgroup by b.risk_level\";\n\t\t\t$par = array('uid' => $defFilter['division_id']);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$query = $this->db->query($sql, $par);\n\t\t$res = array();\n\t\tforeach($query->result_array() as $row) {\n\t\t\t$res[] = $row;\n\t\t}\n\t\t\n\t\treturn $res;\n\t}",
"public function computeCount() {\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=0', array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->totalCount = $json->response->numFound;\n }\n }\n return $this->totalCount;\n }",
"function countCvsent($pid)\n\t\t {\n\t\t $sql = \"SELECT COUNT(DISTINCT cand_id) As cnt FROM pof_candidates WHERE pofid =\".$pid.\" AND stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' ) \";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t\t }"
]
| [
"0.67124176",
"0.58212084",
"0.5773002",
"0.57698154",
"0.55831176",
"0.55545324",
"0.5554515",
"0.5523479",
"0.5514865",
"0.5313998",
"0.5269442",
"0.5233259",
"0.5216297",
"0.5206505",
"0.5206505",
"0.5206505",
"0.5204486",
"0.5143869",
"0.5111746",
"0.5107604",
"0.50958914",
"0.50906545",
"0.50852054",
"0.5082258",
"0.50675756",
"0.50675756",
"0.5037586",
"0.50030774",
"0.50013345",
"0.4989748"
]
| 0.7454167 | 0 |
end function GetOvertimeSalaryList() Get employee leaveyearlist | function GetLeaveYearList($type = NULL) {
$companyid = $this->companyID;
$emp_seqno = $this->empSeqNo;
$_where = empty($type) ? " and emp_seq_no = '$emp_seqno'" : "";
$sql_string = <<<eof
select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year1,
substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year2
from ehr_absence_v
where company_id = '$companyid'
$_where
order by substrb(to_char(my_day, 'YYYY-MM-DD'), 0, 4) desc
eof;
return $this->DBConn->GetArray($sql_string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetSalaryYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct yyyy as year1,\n yyyy as year2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by yyyy desc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"function GetOvertimeYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_OvertimeYearList_\n select distinct substrb(my_day, 0,4) as year1,\n substrb(my_day, 0,4) as year2\n from ehr_overtime_v\n where company_id = '$companyid'\n $_where\n order by substrb(my_day,0,4) desc\n_OvertimeYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"function GetYearList() {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year as year1,\n\t\t\t\t\t my_year as year2\n\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t where company_id = '$companyid'\n and emp_seq_no = '$emp_seqno'\n\t\t\t\t group by my_year\n\t\t\t\t order by my_year desc\n_YearHolidayList_;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"public static function getList($idle=null,$idEmployee=null) {\r\n $lvEarned = new EmployeeLeaveEarned();\r\n $crit=[];\r\n if ($idle!==null) {\r\n $crit[\"idle\"]=\"$idle\";\r\n }\r\n if($idEmployee){\r\n $crit[\"idEmployee\"]=$idEmployee;\r\n }\r\n $lvEarnedList = $lvEarned->getSqlElementsFromCriteria($crit);\r\n return $lvEarnedList;\r\n }",
"function GetSalaryMonthList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct mm as mm1,\n mm as mm2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by mm asc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"function GetLeaveMonthList($type = NULL) {\n $companyid = $this->companyID;\n //$emp_seqno = $this->empSeqNo;\n $emp_seqno = $_SESSION [\"user\"] [\"emp_seq_no\"];\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_LeaveYearList_\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) asc\n_LeaveYearList_;\n //print $sql_string;\n return $this->DBConn->GetArray($sql_string);\n }",
"public function employeeSalaryList() {\n $self = 'employee-salary-list';\n if (\\Auth::user()->user_name !== 'admin') {\n $get_perm = permission::permitted($self);\n\n if ($get_perm == 'access denied') {\n return redirect('permission-error')->with([\n 'message' => '您没有权限访问这个页面',\n 'message_important' => true\n ]);\n }\n }\n\n $employee = Employee::where('user_name', '!=', 'admin')->where('status', 'active')->get();\n return view('admin.employee-salary-list', compact('employee'));\n }",
"function getEmployeesSalary() {\n $query = \"SELECT a.emp_nip, a.emp_fullname, a.emp_branch, b.dept_division, b.dept_position, b.dept_level,\n c.*\n FROM employee a\n LEFT JOIN department b ON b.master_nip = a.emp_nip\n LEFT JOIN payroll_salary c ON c.master_nip = a.emp_nip\";\n $result = $this->db->query($query);\n\n return $result->result();\n }",
"function salary() {\n if (empty($this->bio_salary)) {\n if ( $this->page[\"Bio\"] == \"\" ) $this->openpage (\"Bio\",\"person\");\n $pos_s = strpos($this->page[\"Bio\"],\"<h5>Salary</h5>\");\n $pos_e = strpos($this->page[\"Bio\"],\"</table\",$pos_s);\n $block = substr($this->page[\"Bio\"],$pos_s,$pos_e - $pos_s);\n if (preg_match_all(\"/<tr.*?<td.*?>(.*?)<\\/td>.*?<td.*?>(.*?)<\\/td>/ms\",$block,$matches)) { // for each table row\n $mc = count($matches[0]);\n for ($i=0;$i<$mc;++$i) {\n if (preg_match(\"/\\/title\\/tt(\\d{7})\\/\\\">(.*?)<\\/a>\\s*\\((\\d{4})\\)/\",$matches[1][$i],$match)) {\n $movie[\"imdb\"] = $match[1];\n $movie[\"name\"] = $match[2];\n $movie[\"year\"] = $match[3];\n } else {\n $movie[\"name\"] = $matches[1][$i];\n }\n $this->bio_salary[] = array(\"movie\"=>$movie,\"salary\"=>$matches[2][$i]);\n }\n }\n }\n return $this->bio_salary;\n }",
"public function get_holiday_list($year) {\n for ($i = 1; $i <= 12; $i++) { // query for months\n if ($i >= 1 && $i <= 9) { // if i<=9 concate with Mysql.becuase on Mysql query fast in two digit like 01.\n $start_date = $year . \"-\" . '0' . $i . '-' . '01';\n $end_date = $year . \"-\" . '0' . $i . '-' . '31';\n } else {\n $start_date = $year . \"-\" . $i . '-' . '01';\n $end_date = $year . \"-\" . $i . '-' . '31';\n }\n $get_holiday_list[$i] = $this->settings_model->get_holiday_list_by_date($start_date, $end_date); // get all report by start date and in date \n }\n return $get_holiday_list; // return the result\n }",
"public function dataProviderSalary() {\n return [\n [2018, 11, '2018-11-30'],\n [2018, 12, '2018-12-31'],\n ];\n\n }",
"function loadLedger($year,$id){\r\n$sql = \"SELECT payroll.*, employee.employeeName FROM payroll, employee WHERE payroll.employeeId='$id' AND employee.employeeId='$id' AND payroll.year= '$year' ORDER BY sn DESC\";\r\nreturn $this->query($sql);\r\n}",
"public function getEmployeeLeaveEarnedForAnEmployee($idEmployee, $idLeaveType=null, $withClosed=true, $selfInclude=true) {\r\n $clauseWhere = \"idEmployee = \".$idEmployee;\r\n if ($idLeaveType!=null) {\r\n $clauseWhere .= \" AND idLeaveType=$idLeaveType\"; \r\n }\r\n if (!$withClosed) {\r\n $clauseWhere .= \" AND idle=0\";\r\n }\r\n if (!$selfInclude) {\r\n $clauseWhere .= \" AND id\".($this->id?\"<>\".$this->id:\" IS NOT NULL\");\r\n } \r\n $listEmpLE = $this->getSqlElementsFromCriteria(null, false, $clauseWhere);\r\n return $listEmpLE;\r\n }",
"public function get_employee_salary($emp_id=Null)\n\t{\n\t\tif($res = $this->Employee_model->employee_by_id($emp_id)){\n\t\t\techo json_encode($res->emp_sallary);\n\t\t}else{\n\t\t\techo 0;\n\t\t}\n\t}",
"function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}",
"function get_emp_list11($email1 ,$year1)\r\n\t{\r\n\t\t$email = trim(Yii::app()->user->getState(\"employee_email\"));\r\n\t\t$connection=Yii::app()->db;\r\n\t\t$sql = \"select distinct `Employee_id` from `kpi_auto_save` use index (emp_index) where appraisal_id1 = '\".$email.\"' and (final_kra_status !='') AND (`goal_set_year`='\".$year1.\"') \";\r\n\t\t$command=$connection->createCommand($sql);\r\n\t\t$rows=$command->queryAll();\t\t\r\n\t\treturn $rows;\r\n\t}",
"public function getLeaveList()\n {\n $uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : 0;\n $query = $this->db->query(\"SELECT Id,`ApplyDate`, `LeaveFrom`, `LeaveTo`, LeaveValidDays, `LeaveReason`, `LeaveStatus`, `ApproverComment` FROM `EmployeeLeave` WHERE EmployeeId=? order by Id desc limit 30\",\n\t\tarray(\n $uid\n ));\n $res = array();\n\t\t\n foreach ($query->result() as $row) {\n $data = array();\n\t\t\t$data['leaveid'] = $row->Id;\n\t\t\t$todaydate=date(\"Y-m-d\");\n\t\t\t$data['withdrawlsts'] = true;\n\t\t\tif(strtotime($todaydate)>strtotime($row->LeaveFrom))\n\t\t\t\t$data['withdrawlsts'] = false;\n $data['date'] = date(\"dS M'y\", strtotime($row->ApplyDate));\n $data['from'] = date(\"dS M'y\", strtotime($row->LeaveFrom));\n $data['to'] = date(\"dS M'y\", strtotime($row->LeaveTo));\n $data['days'] = ' (' . $row->LeaveValidDays . ')';\n $data['status'] = $this->getpendingatstatus($row->LeaveStatus, $row->Id);// TODO dynamic with the status pending on which employee.\n $data['reason'] = $row->LeaveReason != '' || $row->LeaveReason != null ? $row->LeaveReason : '-';\n $data['comment'] = $row->ApproverComment != '' || $row->ApproverComment != null ? $row->ApproverComment : '-';\n //$data['comment']=$row->ApproverComment;\n $res[] = $data;\n }\n echo json_encode($res);\n }",
"function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}",
"public function f_get_leaveAppliedDtls($emp_cd)\r\n {\r\n\r\n $sql = $this->db->query(\" SELECT * FROM td_leave_dtls WHERE emp_no ='$emp_cd' AND \r\n YEAR(trans_dt) = YEAR(CURDATE()) AND trans_type = 'T' \");\r\n return $sql->result();\r\n\r\n\r\n }",
"public function employees_with_leaves()\n {\n $params = array('header' => $this->_leaveheaders, \n 'class' => array('table table-striped table-bordered dt-table'));\n \n $this->_ci->load->library('MY_table', $params, 'regemployees');\n \n $empleaves = $this->_ci->employees->regular_employees_with_leaves();\n \n if (isset($empleaves) && !empty($empleaves))\n {\n for ($i = 0; $i < count($empleaves); $i++)\n {\n $tabledata[] = array($this->_leavemodal($empleaves[$i]->EmployeeNumber),\n $empleaves[$i]->FirstName,\n $empleaves[$i]->LastName,\n $empleaves[$i]->Vacation,\n $empleaves[$i]->Emergency,\n $empleaves[$i]->Sick,\n $empleaves[$i]->Maternity,\n $empleaves[$i]->Paternity,);\n }\n \n if (isset($tabledata) && !empty($tabledata))\n {\n return $this->_ci->regemployees->generate($tabledata);\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }",
"function saveEmployeeLeaveHistory($db, $strIDEmployee, $intYear = \"\", $strJoinDate = \"\", $strEmpStatus = 1)\n{\n global $_SESSION;\n $intPCB = getSetting(\"pcb\"); //periode cuti besar\n $intJCB = getSetting(\"jcb\"); //jatah cuti besar\n $intJCN = getSetting(\"jcn\"); //jatah cuti normal\n $arrResult = [\n \"total\" => 0, // jatah\n \"used\" => 0, // terpakai\n \"holiday\" => 0, // hari libur cuti\n \"remain\" => 0, // sisa cuti\n \"startDate\" => \"\",\n \"finishDate\" => \"\",\n ];\n if ($strIDEmployee === \"\") {\n return $arrResult;\n }\n if ($intYear === \"\" || !is_numeric($intYear)) {\n $intYear = date(\"Y\");\n }\n if ($strJoinDate == \"\") { // cari joinDate jika tidak disertakan\n $arrTmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n $strJoinDate = $arrTmp['join_date'];\n }\n // extrak data tanggalnya\n //$arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($strJoinDate);\n // cari tanggal awal dan akhir\n $strStart = $intYear . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $strFinish = ($intYear + 1) . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $arrResult['startDate'] = $strStart;\n $arrResult['finishDate'] = $strFinish;\n $intDur = $intYear - $arrJoinDate['year'];\n $intQuota = (($intDur % $intPCB == 0) && $intDur > 0) ? $intJCB : $intJCN;\n // hitung jatah, berdasarkan selisih tahun\n //if ($intDur < 5) $intQuota = 12;\n //else if ($intDur < 10) $intQuota = 15;\n //else $intQuota = 20;\n //if ($strEmpStatus == 2 && $intQuota > 12) $intQuota = 12; // maks 12\n // cari cuti yang telah diambil\n $arrLeave = getEmployeeLeaveAnnualByYear($db, $intYear, \"\", $strIDEmployee);\n $intLeave = (isset($arrLeave[$strIDEmployee])) ? $arrLeave[$strIDEmployee] : 0;\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = 0;\n /*\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStart' AND '$strFinish' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n if ($rowDb['total'] != \"\") $intHoliday = $rowDb['total'];\n }\n */\n // SIMPAN DI LEAVE HISTORY\n $strModifiedByID = (isset($_SESSION['sessionUserID'])) ? $_SESSION['sessionUserID'] : \"-1\";\n $strSQL = \"DELETE FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \"; // hapus dulu\n $strSQL .= \"AND \\\"year\\\" = '$intYear'; \";\n $strSQL .= \"INSERT INTO hrd_leave_history (created, modified_by, created_by, \";\n $strSQL .= \"id_employee, \\\"year\\\", start_date, finish_date, \";\n $strSQL .= \"total, used, holiday) \";\n $strSQL .= \"VALUES(now(), '$strModifiedByID', '$strModifiedByID', '$strIDEmployee', \";\n $strSQL .= \"'$intYear', '$strStart', '$strFinish', '$intQuota', '$intLeave', '$intHoliday') \";\n $resExec = $db->execute($strSQL);\n $arrResult['total'] = $intQuota;\n $arrResult['used'] = $intLeave;\n $arrResult['holiday'] = $intHoliday;\n $arrResult['remain'] = $intQuota - $intLeave - $intHoliday;\n return $arrResult;\n}",
"function getEmployeeLeaveQuota($db, $strIDEmployee, $strDate = \"\")\n{\n $arrResult = [\n \"currYear\" => \"\",\n \"prevYear\" => \"\",\n \"currQuota\" => 0, // jatah cuti tahun ini\n \"prevQuota\" => 0, // jatah cuti 1 tahun sebelumnya\n \"prevRemain\" => 0, // sisa cuti 1 tahun sebelumnya\n \"currRemain\" => 0, // sisa cuti\n \"prevHoliday\" => 0, // liburan cuti 1 tahun sebelulmnya\n \"currHoliday\" => 0, // liburan tahun ini\n \"prevTaken\" => 0, // yang diambil tahun lalu\n \"currTaken\" => 0, // yang diambil tahun ini\n ];\n if ($strIDEmployee == \"\") {\n return $arrResult;\n }\n if ($strDate == \"\") {\n $strDate = date(\"Y-m-d\");\n } // default\n $dtNow = getdate();\n // cari data employee\n $arrEmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_status, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n if (!isset($arrEmp['join_date'])) {\n return $arrResult;\n } // gak ketemu datanya\n if ($arrEmp['join_date'] == \"\") {\n return $arrResult;\n } // gak ada data\n if ($arrEmp['kerja'] == 0) {\n return $arrResult;\n } else {\n // sudah dapat jatah cuti\n $arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($arrEmp['join_date']);\n if ((($arrJoinDate['month'] * 30) + $arrJoinDate['day']) > (($arrDate['month'] * 30) + $arrDate['day'])) {\n // belum lewat masa berlaku\n $intYear = $arrDate['year'] - 1;\n $intYearPrev = $arrDate['year'] - 2;\n } else {\n $intYear = $arrDate['year'];\n $intYearPrev = $arrDate['year'] - 1;\n }\n $arrResult['prevYear'] = $intYearPrev;\n $arrResult['currYear'] = $intYear;\n // cari data dari leave history\n $bolCurr = false;\n $bolPrev = false;\n $strSQL = \"SELECT * FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \";\n $strSQL .= \"AND (\\\"year\\\" = '$intYear' OR \\\"year\\\" = '$intYearPrev') \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari hari libur cuti\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = getLeaveHoliday($db, $rowDb['start_date'], $rowDb['finish_date']);\n if ($rowDb['year'] == $intYear) {\n $arrResult['currQuota'] = $rowDb['total'];\n $arrResult['currTaken'] = $rowDb['used'];\n $arrResult['currHoliday'] = $intHoliday;\n $arrResult['currRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolCurr = true; // sudah ada data\n } else if ($rowDb['year'] == $intYearPrev) {\n $arrResult['prevQuota'] = $rowDb['total'];\n $arrResult['prevTaken'] = $rowDb['used'];\n $arrResult['prevHoliday'] = $intHoliday;\n $arrResult['prevRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolPrev = true;\n }\n }\n if (!$bolPrev) {\n // cari jatah bulan sebelumnya\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYearPrev,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['prevQuota'] = $arrLeave['total'];\n $arrResult['prevTaken'] = $arrLeave['used'];\n $arrResult['prevHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['prevRemain'] = $arrResult['prevQuota'] - $arrResult['prevTaken'] - $arrResult['prevHoliday'];\n }\n // jika OUTSOURCE, maka jatah kemarin tidak ada\n /*\n if ($arrEmp['employee_status'] == STATUS_OUTSOURCE)\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }\n else if ($arrEmp['kerja'] == 1) // jika baru kerja satu hari, jatah sebelumnya juga gak ada --- ANEH, khusus Artajasa kayaknya\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }*/\n if (!$bolCurr) {\n // cari jatah bulan ini\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYear,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['currQuota'] = $arrLeave['total'];\n $arrResult['currTaken'] = $arrLeave['used'];\n $arrResult['currHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['currRemain'] = $arrResult['currQuota'] - $arrResult['currTaken'] - $arrResult['currHoliday'];\n }\n }\n return $arrResult;\n}",
"public function listApprovelAction($year = \"notset\")\n {\n $em = $this->getDoctrine()->getManager();\n \n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:RoomReservation');\n\n $query = $repository->createQueryBuilder('rr')\n ->where('rr.approved = -1')\n ->orderBy('rr.date', 'ASC')\n ->getQuery();\n\n $roomReservations = $query->getResult();\n \n return $this->render('roomreservation/approvellist.html.twig', array(\n 'roomReservations' => $roomReservations\n ));\n }",
"public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}",
"public function getWorkExperience()\n {\n global $conn;\n if (!isset($conn))\n {\n $this->connect();\n }\n\n $query = 'SELECT year_start, year_end, company_name, company_description, official_title, daily_duties, extra_duties, featured_duties, awards, takeaways\n FROM work_experience\n ORDER BY year_start';\n $sth = $conn->prepare($query, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));\n if ($sth->execute())\n {\n $new_array = array();\n $work_experience_array = $sth->fetchAll();\n foreach ($work_experience_array as $work_experience)\n {\n if ($work_experience['year_end'] == 0)\n {\n array_unshift($new_array, $work_experience);\n }\n else\n {\n $new_array[] = $work_experience;\n }\n }\n return $new_array;\n }\n else\n {\n return 'No work experience found.';\n }\n }",
"function GetYearHoliday($the_year = NULL, $cond_1, $cond_2) {\n\t\t$_where = empty($the_year) ? \"\" : \"and my_year = $the_year\";\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year,\n\t\t\t\t\t in_date,\n\t\t\t\t\t year_holidays,\n\t\t\t\t\t /*year_adjust_days,--HCP version v.1.0.5.4.1 no this filed*/\n\t\t\t\t\t nvl(already_rest_days,0) as already_rest_days,\n\t\t\t\t\t defered_year_days,\n\t\t\t\t\t defered_adjust_days,\n\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t nvl(already_rest_ddays,0) as already_rest_ddays,\n\t\t\t\t\t active_date,\n\t\t\t\t\t expired_date\n\t\t\t\t\tfrom (select A.*,rownum rn\n\t\t\t\t\t\t from (select my_year,\n\t\t\t\t\t\t\t\t\t\t in_date,\n\t\t\t\t\t\t\t\t\t year_holidays,\n\t\t\t\t\t\t\t\t\t already_rest_days,\n\t\t\t\t\t\t\t\t\t defered_year_days,\n\t\t\t\t\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t\t\t\t\t already_rest_ddays,\n\t\t\t\t\t\t\t\t\t active_date,\n\t\t\t\t\t\t\t\t\t expired_date\n\t\t\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t and emp_seq_no = '$emp_seqno'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t order by year_holidays desc) A\n\t\t\t\t\t\t\t\t where rownum <=$cond_2)\n\t\t\t\t\t\t\twhere rn >=$cond_1\n\t\t\t\t\t\t\torder by year_holidays desc\n_YearHolidayList_;\n\t\t// print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\n\t}",
"public function get_year_permastruct()\n {\n }",
"function getEvenYears( $years ) {\n\t\t$years = array_flip( $years );\n\t\tforeach( $years as $year => $id ) {\n\t\t\t$years[$year] = \"5\";\n\t\t\tif( $year % 2 == 0 ) unset( $years[$year] );\n\t\t}\n\t\treturn $years;\n\t}",
"public function withEmployeeSalariesOver($numEmployees, $salary)\n {\n $report = new DepartmentsWithXEmployeesOverYSalary($numEmployees, $salary);\n $result = $report->generate();\n return response()->json($result);\n }"
]
| [
"0.7196621",
"0.6901974",
"0.6703271",
"0.6568221",
"0.65071464",
"0.64385736",
"0.6197685",
"0.60343254",
"0.5906446",
"0.58947176",
"0.573848",
"0.57361674",
"0.573034",
"0.5711803",
"0.5654879",
"0.56530905",
"0.56395644",
"0.5587332",
"0.5586587",
"0.5551208",
"0.554424",
"0.55113554",
"0.54827154",
"0.5480047",
"0.5437943",
"0.54284865",
"0.5428481",
"0.5420276",
"0.5364317",
"0.5341878"
]
| 0.70457697 | 1 |
end function GetLeaveList() Get employ salary period year | function GetSalaryYearList($type = NULL) {
$companyid = $this->companyID;
$emp_seqno = $this->empSeqNo;
//得到登陆员工的计薪期间代码 add by Jack
$period_master_id = $this->DBConn->GetOne("select period_master_id from hr_personnel where id = '" . $emp_seqno . "'");
$_where = is_null($type) ? " and period_master_id = nvl('" . $period_master_id . "', period_master_id)" : "";
$sql_string = <<<_LeaveYearList_
select distinct yyyy as year1,
yyyy as year2
from hr_period_detail
where seg_segment_no = '$companyid'
$_where
order by yyyy desc
_LeaveYearList_;
return $this->DBConn->GetArray($sql_string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetLeaveYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<eof\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day, 'YYYY-MM-DD'), 0, 4) desc\neof;\n return $this->DBConn->GetArray($sql_string);\n }",
"function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"function GetYearList() {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year as year1,\n\t\t\t\t\t my_year as year2\n\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t where company_id = '$companyid'\n and emp_seq_no = '$emp_seqno'\n\t\t\t\t group by my_year\n\t\t\t\t order by my_year desc\n_YearHolidayList_;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"function GetLeaveMonthList($type = NULL) {\n $companyid = $this->companyID;\n //$emp_seqno = $this->empSeqNo;\n $emp_seqno = $_SESSION [\"user\"] [\"emp_seq_no\"];\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_LeaveYearList_\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) as month2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day,'YYYY-MM-DD'), 6,2) asc\n_LeaveYearList_;\n //print $sql_string;\n return $this->DBConn->GetArray($sql_string);\n }",
"function GetSalaryMonthList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct mm as mm1,\n mm as mm2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by mm asc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"public static function getList($idle=null,$idEmployee=null) {\r\n $lvEarned = new EmployeeLeaveEarned();\r\n $crit=[];\r\n if ($idle!==null) {\r\n $crit[\"idle\"]=\"$idle\";\r\n }\r\n if($idEmployee){\r\n $crit[\"idEmployee\"]=$idEmployee;\r\n }\r\n $lvEarnedList = $lvEarned->getSqlElementsFromCriteria($crit);\r\n return $lvEarnedList;\r\n }",
"public function dataProviderSalary() {\n return [\n [2018, 11, '2018-11-30'],\n [2018, 12, '2018-12-31'],\n ];\n\n }",
"function GetOvertimeYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_OvertimeYearList_\n select distinct substrb(my_day, 0,4) as year1,\n substrb(my_day, 0,4) as year2\n from ehr_overtime_v\n where company_id = '$companyid'\n $_where\n order by substrb(my_day,0,4) desc\n_OvertimeYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}",
"public function get_holiday_list($year) {\n for ($i = 1; $i <= 12; $i++) { // query for months\n if ($i >= 1 && $i <= 9) { // if i<=9 concate with Mysql.becuase on Mysql query fast in two digit like 01.\n $start_date = $year . \"-\" . '0' . $i . '-' . '01';\n $end_date = $year . \"-\" . '0' . $i . '-' . '31';\n } else {\n $start_date = $year . \"-\" . $i . '-' . '01';\n $end_date = $year . \"-\" . $i . '-' . '31';\n }\n $get_holiday_list[$i] = $this->settings_model->get_holiday_list_by_date($start_date, $end_date); // get all report by start date and in date \n }\n return $get_holiday_list; // return the result\n }",
"function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}",
"public function years_range()\r\n {\r\n // end date.\r\n if(!($this->start && $this->end)){\r\n return NULL;\r\n }\r\n return array($this->start->format('Y'), $this->end->format('Y'));\r\n }",
"public function getLeaveList()\n {\n $uid = isset($_REQUEST['uid']) ? $_REQUEST['uid'] : 0;\n $query = $this->db->query(\"SELECT Id,`ApplyDate`, `LeaveFrom`, `LeaveTo`, LeaveValidDays, `LeaveReason`, `LeaveStatus`, `ApproverComment` FROM `EmployeeLeave` WHERE EmployeeId=? order by Id desc limit 30\",\n\t\tarray(\n $uid\n ));\n $res = array();\n\t\t\n foreach ($query->result() as $row) {\n $data = array();\n\t\t\t$data['leaveid'] = $row->Id;\n\t\t\t$todaydate=date(\"Y-m-d\");\n\t\t\t$data['withdrawlsts'] = true;\n\t\t\tif(strtotime($todaydate)>strtotime($row->LeaveFrom))\n\t\t\t\t$data['withdrawlsts'] = false;\n $data['date'] = date(\"dS M'y\", strtotime($row->ApplyDate));\n $data['from'] = date(\"dS M'y\", strtotime($row->LeaveFrom));\n $data['to'] = date(\"dS M'y\", strtotime($row->LeaveTo));\n $data['days'] = ' (' . $row->LeaveValidDays . ')';\n $data['status'] = $this->getpendingatstatus($row->LeaveStatus, $row->Id);// TODO dynamic with the status pending on which employee.\n $data['reason'] = $row->LeaveReason != '' || $row->LeaveReason != null ? $row->LeaveReason : '-';\n $data['comment'] = $row->ApproverComment != '' || $row->ApproverComment != null ? $row->ApproverComment : '-';\n //$data['comment']=$row->ApproverComment;\n $res[] = $data;\n }\n echo json_encode($res);\n }",
"protected function getLeaveAssignDateLimit() {\n // If no leave period, don't allow apply/assign beyond next calender year\n $todayNextYear = new DateTime();\n $todayNextYear->add(new DateInterval('P1Y'));\n \n if ($this->getConfigService()->isLeavePeriodDefined()) {\n $period = $this->getLeavePeriodService()->getCurrentLeavePeriodByDate($todayNextYear->format('Y-m-d'));\n $maxDate = $period[1];\n } else {\n $nextYear = $todayNextYear->format('Y');\n $maxDate = $nextYear . '-12-31';\n } \n \n return $maxDate;\n }",
"function getEmployeeLeaveQuota($db, $strIDEmployee, $strDate = \"\")\n{\n $arrResult = [\n \"currYear\" => \"\",\n \"prevYear\" => \"\",\n \"currQuota\" => 0, // jatah cuti tahun ini\n \"prevQuota\" => 0, // jatah cuti 1 tahun sebelumnya\n \"prevRemain\" => 0, // sisa cuti 1 tahun sebelumnya\n \"currRemain\" => 0, // sisa cuti\n \"prevHoliday\" => 0, // liburan cuti 1 tahun sebelulmnya\n \"currHoliday\" => 0, // liburan tahun ini\n \"prevTaken\" => 0, // yang diambil tahun lalu\n \"currTaken\" => 0, // yang diambil tahun ini\n ];\n if ($strIDEmployee == \"\") {\n return $arrResult;\n }\n if ($strDate == \"\") {\n $strDate = date(\"Y-m-d\");\n } // default\n $dtNow = getdate();\n // cari data employee\n $arrEmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_status, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n if (!isset($arrEmp['join_date'])) {\n return $arrResult;\n } // gak ketemu datanya\n if ($arrEmp['join_date'] == \"\") {\n return $arrResult;\n } // gak ada data\n if ($arrEmp['kerja'] == 0) {\n return $arrResult;\n } else {\n // sudah dapat jatah cuti\n $arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($arrEmp['join_date']);\n if ((($arrJoinDate['month'] * 30) + $arrJoinDate['day']) > (($arrDate['month'] * 30) + $arrDate['day'])) {\n // belum lewat masa berlaku\n $intYear = $arrDate['year'] - 1;\n $intYearPrev = $arrDate['year'] - 2;\n } else {\n $intYear = $arrDate['year'];\n $intYearPrev = $arrDate['year'] - 1;\n }\n $arrResult['prevYear'] = $intYearPrev;\n $arrResult['currYear'] = $intYear;\n // cari data dari leave history\n $bolCurr = false;\n $bolPrev = false;\n $strSQL = \"SELECT * FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \";\n $strSQL .= \"AND (\\\"year\\\" = '$intYear' OR \\\"year\\\" = '$intYearPrev') \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari hari libur cuti\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = getLeaveHoliday($db, $rowDb['start_date'], $rowDb['finish_date']);\n if ($rowDb['year'] == $intYear) {\n $arrResult['currQuota'] = $rowDb['total'];\n $arrResult['currTaken'] = $rowDb['used'];\n $arrResult['currHoliday'] = $intHoliday;\n $arrResult['currRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolCurr = true; // sudah ada data\n } else if ($rowDb['year'] == $intYearPrev) {\n $arrResult['prevQuota'] = $rowDb['total'];\n $arrResult['prevTaken'] = $rowDb['used'];\n $arrResult['prevHoliday'] = $intHoliday;\n $arrResult['prevRemain'] = $rowDb['total'] - $intHoliday - $rowDb['used'];\n $bolPrev = true;\n }\n }\n if (!$bolPrev) {\n // cari jatah bulan sebelumnya\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYearPrev,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['prevQuota'] = $arrLeave['total'];\n $arrResult['prevTaken'] = $arrLeave['used'];\n $arrResult['prevHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['prevRemain'] = $arrResult['prevQuota'] - $arrResult['prevTaken'] - $arrResult['prevHoliday'];\n }\n // jika OUTSOURCE, maka jatah kemarin tidak ada\n /*\n if ($arrEmp['employee_status'] == STATUS_OUTSOURCE)\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }\n else if ($arrEmp['kerja'] == 1) // jika baru kerja satu hari, jatah sebelumnya juga gak ada --- ANEH, khusus Artajasa kayaknya\n {\n $arrResult['prevQuota'] = 0;\n $arrResult['prevTaken'] = 0;\n $arrResult['prevHoliday'] = 0;\n $arrResult['prevRemain'] = 0;\n }*/\n if (!$bolCurr) {\n // cari jatah bulan ini\n $arrLeave = saveEmployeeLeaveHistory(\n $db,\n $strIDEmployee,\n $intYear,\n $arrEmp['join_date'],\n $arrEmp['employee_status']\n );\n $arrResult['currQuota'] = $arrLeave['total'];\n $arrResult['currTaken'] = $arrLeave['used'];\n $arrResult['currHoliday'] = getLeaveHoliday($db, $arrLeave['startDate'], $arrLeave['finishDate']);\n $arrResult['currRemain'] = $arrResult['currQuota'] - $arrResult['currTaken'] - $arrResult['currHoliday'];\n }\n }\n return $arrResult;\n}",
"function saveEmployeeLeaveHistory($db, $strIDEmployee, $intYear = \"\", $strJoinDate = \"\", $strEmpStatus = 1)\n{\n global $_SESSION;\n $intPCB = getSetting(\"pcb\"); //periode cuti besar\n $intJCB = getSetting(\"jcb\"); //jatah cuti besar\n $intJCN = getSetting(\"jcn\"); //jatah cuti normal\n $arrResult = [\n \"total\" => 0, // jatah\n \"used\" => 0, // terpakai\n \"holiday\" => 0, // hari libur cuti\n \"remain\" => 0, // sisa cuti\n \"startDate\" => \"\",\n \"finishDate\" => \"\",\n ];\n if ($strIDEmployee === \"\") {\n return $arrResult;\n }\n if ($intYear === \"\" || !is_numeric($intYear)) {\n $intYear = date(\"Y\");\n }\n if ($strJoinDate == \"\") { // cari joinDate jika tidak disertakan\n $arrTmp = getEmployeeInfoByID(\n $db,\n $strIDEmployee,\n \"join_date, employee_id, EXTRACT(year FROM AGE('$strDate', join_date)) AS kerja \"\n );\n $strJoinDate = $arrTmp['join_date'];\n }\n // extrak data tanggalnya\n //$arrDate = extractDate($strDate);\n $arrJoinDate = extractDate($strJoinDate);\n // cari tanggal awal dan akhir\n $strStart = $intYear . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $strFinish = ($intYear + 1) . \"-\" . $arrJoinDate['month'] . \"-\" . $arrJoinDate['day'];\n $arrResult['startDate'] = $strStart;\n $arrResult['finishDate'] = $strFinish;\n $intDur = $intYear - $arrJoinDate['year'];\n $intQuota = (($intDur % $intPCB == 0) && $intDur > 0) ? $intJCB : $intJCN;\n // hitung jatah, berdasarkan selisih tahun\n //if ($intDur < 5) $intQuota = 12;\n //else if ($intDur < 10) $intQuota = 15;\n //else $intQuota = 20;\n //if ($strEmpStatus == 2 && $intQuota > 12) $intQuota = 12; // maks 12\n // cari cuti yang telah diambil\n $arrLeave = getEmployeeLeaveAnnualByYear($db, $intYear, \"\", $strIDEmployee);\n $intLeave = (isset($arrLeave[$strIDEmployee])) ? $arrLeave[$strIDEmployee] : 0;\n // cari hari libur yang dicatat sebagai cuti\n $intHoliday = 0;\n /*\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStart' AND '$strFinish' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n if ($rowDb['total'] != \"\") $intHoliday = $rowDb['total'];\n }\n */\n // SIMPAN DI LEAVE HISTORY\n $strModifiedByID = (isset($_SESSION['sessionUserID'])) ? $_SESSION['sessionUserID'] : \"-1\";\n $strSQL = \"DELETE FROM hrd_leave_history WHERE id_employee = '$strIDEmployee' \"; // hapus dulu\n $strSQL .= \"AND \\\"year\\\" = '$intYear'; \";\n $strSQL .= \"INSERT INTO hrd_leave_history (created, modified_by, created_by, \";\n $strSQL .= \"id_employee, \\\"year\\\", start_date, finish_date, \";\n $strSQL .= \"total, used, holiday) \";\n $strSQL .= \"VALUES(now(), '$strModifiedByID', '$strModifiedByID', '$strIDEmployee', \";\n $strSQL .= \"'$intYear', '$strStart', '$strFinish', '$intQuota', '$intLeave', '$intHoliday') \";\n $resExec = $db->execute($strSQL);\n $arrResult['total'] = $intQuota;\n $arrResult['used'] = $intLeave;\n $arrResult['holiday'] = $intHoliday;\n $arrResult['remain'] = $intQuota - $intLeave - $intHoliday;\n return $arrResult;\n}",
"public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}",
"public function get_year_permastruct()\n {\n }",
"public function getEmployeeLeaveEarnedForAnEmployee($idEmployee, $idLeaveType=null, $withClosed=true, $selfInclude=true) {\r\n $clauseWhere = \"idEmployee = \".$idEmployee;\r\n if ($idLeaveType!=null) {\r\n $clauseWhere .= \" AND idLeaveType=$idLeaveType\"; \r\n }\r\n if (!$withClosed) {\r\n $clauseWhere .= \" AND idle=0\";\r\n }\r\n if (!$selfInclude) {\r\n $clauseWhere .= \" AND id\".($this->id?\"<>\".$this->id:\" IS NOT NULL\");\r\n } \r\n $listEmpLE = $this->getSqlElementsFromCriteria(null, false, $clauseWhere);\r\n return $listEmpLE;\r\n }",
"function GetYearHoliday($the_year = NULL, $cond_1, $cond_2) {\n\t\t$_where = empty($the_year) ? \"\" : \"and my_year = $the_year\";\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year,\n\t\t\t\t\t in_date,\n\t\t\t\t\t year_holidays,\n\t\t\t\t\t /*year_adjust_days,--HCP version v.1.0.5.4.1 no this filed*/\n\t\t\t\t\t nvl(already_rest_days,0) as already_rest_days,\n\t\t\t\t\t defered_year_days,\n\t\t\t\t\t defered_adjust_days,\n\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t nvl(already_rest_ddays,0) as already_rest_ddays,\n\t\t\t\t\t active_date,\n\t\t\t\t\t expired_date\n\t\t\t\t\tfrom (select A.*,rownum rn\n\t\t\t\t\t\t from (select my_year,\n\t\t\t\t\t\t\t\t\t\t in_date,\n\t\t\t\t\t\t\t\t\t year_holidays,\n\t\t\t\t\t\t\t\t\t already_rest_days,\n\t\t\t\t\t\t\t\t\t defered_year_days,\n\t\t\t\t\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t\t\t\t\t already_rest_ddays,\n\t\t\t\t\t\t\t\t\t active_date,\n\t\t\t\t\t\t\t\t\t expired_date\n\t\t\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t and emp_seq_no = '$emp_seqno'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t order by year_holidays desc) A\n\t\t\t\t\t\t\t\t where rownum <=$cond_2)\n\t\t\t\t\t\t\twhere rn >=$cond_1\n\t\t\t\t\t\t\torder by year_holidays desc\n_YearHolidayList_;\n\t\t// print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\n\t}",
"function exeGetYearPeriod() {\n $exeGetYearPeriod = $this->db->query(\"SELECT *\n FROM yearperiod\n ORDER BY id ASC\");\n \n if($exeGetYearPeriod->num_rows() > 0) {\n return $exeGetYearPeriod->result_array();\n } else {\n return false;\n }\n }",
"function salary() {\n if (empty($this->bio_salary)) {\n if ( $this->page[\"Bio\"] == \"\" ) $this->openpage (\"Bio\",\"person\");\n $pos_s = strpos($this->page[\"Bio\"],\"<h5>Salary</h5>\");\n $pos_e = strpos($this->page[\"Bio\"],\"</table\",$pos_s);\n $block = substr($this->page[\"Bio\"],$pos_s,$pos_e - $pos_s);\n if (preg_match_all(\"/<tr.*?<td.*?>(.*?)<\\/td>.*?<td.*?>(.*?)<\\/td>/ms\",$block,$matches)) { // for each table row\n $mc = count($matches[0]);\n for ($i=0;$i<$mc;++$i) {\n if (preg_match(\"/\\/title\\/tt(\\d{7})\\/\\\">(.*?)<\\/a>\\s*\\((\\d{4})\\)/\",$matches[1][$i],$match)) {\n $movie[\"imdb\"] = $match[1];\n $movie[\"name\"] = $match[2];\n $movie[\"year\"] = $match[3];\n } else {\n $movie[\"name\"] = $matches[1][$i];\n }\n $this->bio_salary[] = array(\"movie\"=>$movie,\"salary\"=>$matches[2][$i]);\n }\n }\n }\n return $this->bio_salary;\n }",
"public function employeeSalaryList() {\n $self = 'employee-salary-list';\n if (\\Auth::user()->user_name !== 'admin') {\n $get_perm = permission::permitted($self);\n\n if ($get_perm == 'access denied') {\n return redirect('permission-error')->with([\n 'message' => '您没有权限访问这个页面',\n 'message_important' => true\n ]);\n }\n }\n\n $employee = Employee::where('user_name', '!=', 'admin')->where('status', 'active')->get();\n return view('admin.employee-salary-list', compact('employee'));\n }",
"function calc_date_range_years($start, $end)\n{\n\t$years = array();\n\t\n\t$start_prts = explode('-', $start);\n\t$end_prts = explode('-', $end);\n\t\n\t$years[] = $start_prts[0];\n\t\n\tfor ($i=$start_prts[0]; $i<$end_prts[0]; $i++)\n\t{\n\t\t$years[] = $i + 1;\n\t}\n\t\n\treturn $years;\n}",
"public function f_get_leaveAppliedDtls($emp_cd)\r\n {\r\n\r\n $sql = $this->db->query(\" SELECT * FROM td_leave_dtls WHERE emp_no ='$emp_cd' AND \r\n YEAR(trans_dt) = YEAR(CURDATE()) AND trans_type = 'T' \");\r\n return $sql->result();\r\n\r\n\r\n }",
"public function getLastYearData() {\n\t\t$dates = getPeriods('LastYear');\n\t\treturn $this->getDataByInterval($dates['startMonth'], $dates['startYear'], $dates['endMonth'], $dates['endYear'], 12);\t\t\n\t}",
"function getEmployeesSalary() {\n $query = \"SELECT a.emp_nip, a.emp_fullname, a.emp_branch, b.dept_division, b.dept_position, b.dept_level,\n c.*\n FROM employee a\n LEFT JOIN department b ON b.master_nip = a.emp_nip\n LEFT JOIN payroll_salary c ON c.master_nip = a.emp_nip\";\n $result = $this->db->query($query);\n\n return $result->result();\n }",
"function loadLedger($year,$id){\r\n$sql = \"SELECT payroll.*, employee.employeeName FROM payroll, employee WHERE payroll.employeeId='$id' AND employee.employeeId='$id' AND payroll.year= '$year' ORDER BY sn DESC\";\r\nreturn $this->query($sql);\r\n}",
"public function getLeavesRight($isQuantityToCalculate=false, $forActualPeriod=true) {\r\n $leavesRight['quantity']=null;\r\n $leavesRight['left']=null;\r\n $leavesRight['startDate']=null;\r\n $leavesRight['endDate']=null;\r\n \r\n $contract=null;\r\n $right = getActualLeaveContractualValues($this->idEmployee, $this->idLeaveType, $contract);\r\n if ($contract==null) {\r\n return $leavesRight;\r\n }\r\n $customQuantity = getActualLeaveConstractCustomQuantity($this->idLeaveType, $contract, $this->idEmployee);\r\n $contractStartDateString = $contract->startDate;\r\n if ($contract->endDate!=null) {\r\n $endDate=new DateTime($contract->endDate);\r\n } else {\r\n $endDate = null;\r\n }\r\n\r\n if ($right!=null) {\r\n if ($right->periodDuration and trim($right->periodDuration)!=\"\") {\r\n if (!$right->earnedPeriod or trim($right->earnedPeriod)==\"\") {\r\n $right->earnedPeriod = $right->periodDuration; \r\n } \r\n }\r\n $currentDate = new DateTime();\r\n if ($forActualPeriod) { // For actual period\r\n $currentDateString = $currentDate->format(\"Y-m-d\");\r\n $year = $currentDate->format(\"Y\");\r\n } else { // For next period\r\n // Contract is ended and end contract date < current Date => No quantity earned\r\n if ($contract->endDate!=null and $endDate < $currentDate) { \r\n return $leavesRight; \r\n }\r\n \r\n if ($right->periodDuration and trim($right->periodDuration)!=\"\") {\r\n // For earned period < period duration => No quantity earned\r\n if ($right->earnedPeriod < $right->periodDuration) {\r\n return $leavesRight;\r\n }\r\n // Year is the current year + period duration, if not null\r\n $currentDate = new DateTime();\r\n $currentDate->add(new DateInterval('P'.$right->periodDuration.'M'));\r\n $currentDateString = $currentDate->format(\"Y-m-d\");\r\n $year = $currentDate->format(\"Y\");\r\n } else {\r\n return $leavesRight;\r\n } \r\n // If fact, it's like contract start date is the current date\r\n $beginDate = new DateTime();\r\n $beginDateString = $beginDate->format(\"Y-m-d\");\r\n if ($contractStartDateString < $beginDateString) {\r\n $contractStartDateString = $beginDateString;\r\n }\r\n }\r\n if ($right->startDayPeriod and trim($right->startDayPeriod)!=\"\") {\r\n $day = ($right->startDayPeriod>9?$right->startDayPeriod:\"0\".$right->startDayPeriod); \r\n } else {\r\n $day=\"01\";\r\n }\r\n if ($right->startMonthPeriod and trim($right->startMonthPeriod)!=\"\") {\r\n $month = ($right->startMonthPeriod>9?$right->startMonthPeriod:\"0\".$right->startMonthPeriod);\r\n $startDate = new DateTime($year.\"-\".$month.\"-\".$day);\r\n $leavesRight['startDate'] = $startDate->format(\"Y-m-d\");\r\n } else {\r\n $month = $currentDate->format(\"m\");\r\n $startDate = new DateTime($year.\"-\".$month.\"-\".$day);\r\n }\r\n if ($right->periodDuration and trim($right->periodDuration)!=\"\" and $endDate==null) {\r\n $endDate = clone $startDate;\r\n $endDate->add(new DateInterval('P'.$right->periodDuration.'M'));\r\n $endDate->sub(new DateInterval(\"P1D\"));\r\n $leavesRight['endDate'] = $endDate->format(\"Y-m-d\");\r\n }\r\n \r\n // No endDate => Quantity is infinite\r\n if ($endDate==null) {\r\n if ($contract->endDate!=null) {\r\n $contractEndDateString = $contract->endDate->format(\"Y-m-d\");\r\n // If contract has endDate < currentDate => no right\r\n if ($contractEndDateString < $currentDateString) {\r\n $leavesRight['quantity']=0+$customQuantity;\r\n $leavesRight['left']=0+$customQuantity;\r\n $leavesRight['startDate']=$startDate->format(\"Y-m-d\");\r\n $leavesRight['endDate']=$endDate->format(\"Y-m-d\");\r\n return $leavesRight;\r\n } else { // endate = contract end Date\r\n $endDate = clone $contract->endDate;\r\n }\r\n } else {\r\n if ($right->quantity==0) {\r\n $leavesRight['quantity']=0;\r\n }\r\n return $leavesRight;\r\n } \r\n } else {\r\n if ($contract->endDate !=null and $contract->endDate < $currentDate) {\r\n $leavesRight['endDate'] = $contract->endDate;\r\n }\r\n }\r\n // No calculation => Quantity and left are stored values\r\n if (!$isQuantityToCalculate) {\r\n $leavesRight['quantity']=($customQuantity==0?$right->quantity:($right->quantity==null?$customQuantity:$right->quantity+$customQuantity)); \r\n $leavesRight['left']=$leavesRight['quantity'];\r\n return $leavesRight;\r\n }\r\n \r\n $contractStartDate= new DateTime($contractStartDateString);\r\n $periodDuration = $right->periodDuration; \r\n $quantity = $right->quantity;\r\n $earnedPeriod = $right->earnedPeriod;\r\n // Start and End Date for calculation\r\n if ($earnedPeriod<$periodDuration) {\r\n $calcStartDate = clone $startDate;\r\n $calcStartDateString = $calcStartDate->format(\"Y-m-d\");\r\n if ($calcStartDateString<$contractStartDateString) {\r\n $calcStartDate = clone $contractStartDate;\r\n $calcStartDateString = $contractStartDateString; \r\n }\r\n\r\n $calcEndDate = new DateTime();\r\n $calcEndDateString = $calcEndDate->format(\"Y-m-t\");\r\n $calcEndDate = new DateTime($calcEndDateString); \r\n $calcEndDate->sub(new DateInterval(\"P\".$earnedPeriod.\"M\"));\r\n $calcEndDateString = $calcEndDate->format(\"Y-m-d\");\r\n if ($calcEndDateString<$calcStartDateString) {\r\n $calcEndDate = clone $calcStartDate;\r\n $calcEndDateString = $calcStartDateString;\r\n }\r\n \r\n } else {\r\n $calcStartDate = clone $contractStartDate;\r\n $calcStartDateString = $contractStartDateString;\r\n\r\n $calcEndDate = clone $endDate;\r\n $calcEndDate->sub(new DateInterval('P'.$earnedPeriod.'M'));\r\n $calcEndDateString = $calcEndDate->format(\"Y-m-d\");\r\n }\r\n // StartDate of activ Employment Contract is greater that endDate of calculation\r\n // => Quantity and Left = 0\r\n if ($contractStartDateString >= $calcEndDateString) {\r\n $leavesRight['quantity']=0+$customQuantity; \r\n $leavesRight['left']=$leavesRight['quantity'];\r\n return $leavesRight;\r\n }\r\n \r\n // Calculate difference in month between calcEndDate and contract start date\r\n $diff = $calcEndDate->diff($calcStartDate);\r\n $diffMonths = ($diff->format('%y') * 12) + $diff->format('%m')+1;\r\n // Must have integer quotity or not\r\n if ($right->isIntegerQuotity) {\r\n $quotityDays=0;\r\n $quotity = round($quantity/$periodDuration,0);\r\n } else {\r\n $quotityDays = abs($contractStartDate->format(\"d\") - $startDate->format(\"d\"))/30;\r\n $quotity = $quantity/$periodDuration;\r\n }\r\n \r\n $earned = (float) ($quotity*$diffMonths) - $quotityDays;\r\n $earnedRounded = round($earned,1);\r\n $mod = (fmod($earnedRounded,0.5)>=0.5?0.5:0);\r\n if ($diffMonths>$periodDuration) {\r\n $theQuantity = $quantity;\r\n } else {\r\n $theQuantity = min($quantity,round($earnedRounded,0)-$mod);\r\n }\r\n if ($forActualPeriod) {\r\n $leavesRight['quantity'] = $theQuantity+$customQuantity;\r\n } else {\r\n $leavesRight['quantity'] = max(0,$right->quantity - $theQuantity)+$customQuantity;\r\n }\r\n // Left is initialized with old left + different between old quantity and calculated quantity\r\n if ($theQuantity>0) {\r\n $diffQuantity = $theQuantity - $this->quantity;\r\n $left = $this->leftQuantity + $diffQuantity + $customQuantity;\r\n if ($left<0) {\r\n $leavesRight['left']=0;\r\n } else {\r\n $leavesRight['left']=min($leavesRight['quantity'],$left);\r\n }\r\n } else {\r\n $leavesRight['left']=0;\r\n }\r\n }\r\n return $leavesRight;\r\n }",
"public function getYear() {}"
]
| [
"0.7499659",
"0.72605914",
"0.68106073",
"0.66638887",
"0.6639648",
"0.6121603",
"0.6065935",
"0.6064997",
"0.605567",
"0.59831697",
"0.5963949",
"0.59489715",
"0.5944892",
"0.5908262",
"0.5903367",
"0.5879197",
"0.58611387",
"0.5772488",
"0.5725122",
"0.57229984",
"0.57218874",
"0.56932324",
"0.56896085",
"0.56856155",
"0.5674823",
"0.56640136",
"0.5655203",
"0.56244826",
"0.55534536",
"0.55441254"
]
| 0.7392082 | 1 |
end function getVacationLeft() Get year holiday year list | function GetYearList() {
$companyid = $this->companyID;
$emp_seqno = $this->empSeqNo;
$sql_string = <<<_YearHolidayList_
select my_year as year1,
my_year as year2
from ehr_year_holiday_v
where company_id = '$companyid'
and emp_seq_no = '$emp_seqno'
group by my_year
order by my_year desc
_YearHolidayList_;
return $this->DBConn->GetArray($sql_string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_holidays($inc_year){\n\t//$year = date(\"Y\");\n\t$year = $inc_year;\n\n\t// $holidays[] = new Holiday(\"New Year's Day\", get_timestamp(\"$year-1-1\"));\n\t$holidays[] = new Holiday(\"Republic Day\", get_timestamp(\"$year-1-26\"));\n\t// $holidays[] = new Holiday(\"Labour Day\", ordinal_day(1, 'Mon', 3, $year));\n\t// $holidays[] = new Holiday(\"Anzac Day\", get_timestamp(\"$year-4-25\"));\n\t//$holidays[] = new Holiday(\"St. Patrick's Day\", get_timestamp(\"$year-3-17\"));\n\t// TODO: $holidays[] = new Holiday(\"Good Friday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Easter\", easter_date($year));\n\t// TODO: $holidays[] = new Holiday(\"Easter Monday\", easter_date($year));\n\t// $holidays[] = new Holiday(\"Foundation Day\", ordinal_day(1, 'Mon', 6, $year));\n\t// $holidays[] = new Holiday(\"Queen's Birthday\", ordinal_day(1, 'Mon', 10, $year));\n\t//$holidays[] = new Holiday(\"Memorial Day\", memorial_day($year));\n\t//$holidays[] = new Holiday(\"Mother's Day\", ordinal_day(2, 'Sun', 5, $year));\n\t//$holidays[] = new Holiday(\"Father's Day\", ordinal_day(3, 'Sun', 6, $year));\n\t//$holidays[] = new Holiday(\"Independence Day\", get_timestamp(\"$year-7-4\"));\n\t//$holidays[] = new Holiday(\"Labor Day\", ordinal_day(1, 'Mon', 9, $year));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"$year-12-25\"));\n\t$holidays[] = new Holiday(\"Dussera\", get_timestamp(\"2010-10-15\"));\n\t$holidays[] = new Holiday(\"Ugadi\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"kanada Rajyotshava\", get_timestamp(\"$year-11-1\"));\n\t$holidays[] = new Holiday(\"Christmas\", get_timestamp(\"2010-3-16\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-04\"));\n\t$holidays[] = new Holiday(\"Diwali\", get_timestamp(\"2010-11-05\"));\n\t// $holidays[] = new Holiday(\"Boxing Day\", get_timestamp(\"$year-12-26\"));\n\n\t$numHolidays = count($holidays) - 1;\n\t$out_array = array();\n\n\tfor ($i = 0; $i < $numHolidays; $i++){\n\t\t$out_array[] = $holidays[$i]->date;\n\t}\n\tunset($holidays);\n\treturn $out_array;\n}",
"function GetYearHoliday($the_year = NULL, $cond_1, $cond_2) {\n\t\t$_where = empty($the_year) ? \"\" : \"and my_year = $the_year\";\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$sql_string = <<<_YearHolidayList_\n\t\t\t\tselect my_year,\n\t\t\t\t\t in_date,\n\t\t\t\t\t year_holidays,\n\t\t\t\t\t /*year_adjust_days,--HCP version v.1.0.5.4.1 no this filed*/\n\t\t\t\t\t nvl(already_rest_days,0) as already_rest_days,\n\t\t\t\t\t defered_year_days,\n\t\t\t\t\t defered_adjust_days,\n\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t nvl(already_rest_ddays,0) as already_rest_ddays,\n\t\t\t\t\t active_date,\n\t\t\t\t\t expired_date\n\t\t\t\t\tfrom (select A.*,rownum rn\n\t\t\t\t\t\t from (select my_year,\n\t\t\t\t\t\t\t\t\t\t in_date,\n\t\t\t\t\t\t\t\t\t year_holidays,\n\t\t\t\t\t\t\t\t\t already_rest_days,\n\t\t\t\t\t\t\t\t\t defered_year_days,\n\t\t\t\t\t\t\t\t\t defered_expried_date,\n\t\t\t\t\t\t\t\t\t already_rest_ddays,\n\t\t\t\t\t\t\t\t\t active_date,\n\t\t\t\t\t\t\t\t\t expired_date\n\t\t\t\t\t\t from ehr_year_holiday_v\n\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t and emp_seq_no = '$emp_seqno'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t order by year_holidays desc) A\n\t\t\t\t\t\t\t\t where rownum <=$cond_2)\n\t\t\t\t\t\t\twhere rn >=$cond_1\n\t\t\t\t\t\t\torder by year_holidays desc\n_YearHolidayList_;\n\t\t// print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\n\t}",
"public function get_holiday_list($year) {\n for ($i = 1; $i <= 12; $i++) { // query for months\n if ($i >= 1 && $i <= 9) { // if i<=9 concate with Mysql.becuase on Mysql query fast in two digit like 01.\n $start_date = $year . \"-\" . '0' . $i . '-' . '01';\n $end_date = $year . \"-\" . '0' . $i . '-' . '31';\n } else {\n $start_date = $year . \"-\" . $i . '-' . '01';\n $end_date = $year . \"-\" . $i . '-' . '31';\n }\n $get_holiday_list[$i] = $this->settings_model->get_holiday_list_by_date($start_date, $end_date); // get all report by start date and in date \n }\n return $get_holiday_list; // return the result\n }",
"public static function getHolidaysInYear($year) {\n $criteria = new CDbCriteria();\n $criteria->addCondition('YEAR(t.date) = ' . $year);\n $models = self::model()->findAll($criteria);\n $aRetVal = [];\n foreach ($models as $model) {\n // Check if plan was approved\n $plan = HrHolidayPlans::model()->findByPk($year);\n if ($plan && $plan->isApproved()) {\n $aRetVal[$model->date] = $model->date;\n }\n }\n \n return $aRetVal;\n }",
"public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}",
"public function getHolidays()\n {\n\t\t$db = $this->getDbo();\n\t\t$rHolidays = array();\n\t\t\n\t\t$query = $db->getQuery(true)\n\t\t\t->select('a.*')\n\t\t\t->from('#__cooltouraman_holiday AS a')\n\t\t\t->where('1');\n\t\t\t\n\t\t$db->setQuery($query);\n\t\t\n\t\t$holidays = $db->loadObjectlist();\n\t\t\n\t\tforeach($holidays as $holiday)\n\t\t{ \n\t\t\t$thisYear = new DateTime();\n\t\t\t$nextYear = new DateTime();\n\t\t\t$nextYear->modify('+ 1 year');\n\t\t\t\n\t\t\tif ($holiday->year === '*')\n\t\t\t\t\t$holiday->year = $thisYear->format(\"Y\");\n\t\t\t\n\t\t\tif ($holiday->year === $thisYear->format(\"Y\") || $holiday->year === $nextYear->format(\"Y\"))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$holidayDate = new DateTime($holiday->year.'-'.$holiday->month.'-'.$holiday->day);\n\t\t\t\t$monthName = strtoupper($holidayDate->format(\"F\"));\n\n\t\t\t\tif(!isset($rHolidays[$monthName]))\n\t\t\t\t\t$rHolidays[$monthName] = array();\n\t\t\t\t\n\t\t\t\t$rHolidays[$monthName][$holidayDate->format(\"d-m-Y\")]['day'] = $holidayDate->format(\"d\");\n\t\t\t\t$rHolidays[$monthName][$holidayDate->format(\"d-m-Y\")]['title'] = $holiday->title;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rHolidays;\n }",
"function holidays () {\n\t$year = date(\"Y\");\n\t$p = date(\"N\", strtotime(\"February 1, $year\")) == 1 ? 'second' : 'third';\n\t$easter = date(\"Y-m-d\", easter_date($year));\n\n\t$holday_descriptions = array(\n\t\t\"January 1, $year\",\n\t\t\"January $year third Monday\",\n\t\t\"February $year $p Monday\",\n\t\t\"$easter - 2 days\",\n\t\t\"last Monday of May $year\",\n\t\t\"July 4, $year\",\n\t\t\"september $year first monday\",\n\t\t\"fourth Thursday of November $year\",\n\t\t\"December 25, $year\"\n\t);\n\n\t$holday_dates = array();\n\n\tforeach ($holday_descriptions as $d) {\n\t\t$holday_dates[] = date(\"Y-m-d\", strtotime($d));\n\t}\n\n\treturn $holday_dates;\n}",
"function GetLeaveYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<eof\n select distinct substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year1,\n substrb(to_char(my_day,'YYYY-MM-DD'), 0,4) as year2\n from ehr_absence_v\n where company_id = '$companyid'\n $_where\n order by substrb(to_char(my_day, 'YYYY-MM-DD'), 0, 4) desc\neof;\n return $this->DBConn->GetArray($sql_string);\n }",
"public function getTwoYearDates()\n {\n $current_year = date('Y-m-d',strtotime(date('Y-01-01')));\n $next_year = date('Y-m-d', strtotime('last day of december next year'));\n\n return Holiday::where('date', '>=', $current_year)\n ->where('date', '<=', $next_year)\n ->orderBy('date', 'asc')\n ->paginate(25);\n }",
"public function years_range()\r\n {\r\n // end date.\r\n if(!($this->start && $this->end)){\r\n return NULL;\r\n }\r\n return array($this->start->format('Y'), $this->end->format('Y'));\r\n }",
"function getYearList($selected = ''){\r\n\t$options = '';\r\n\tfor($i=2017;$i<=2025;$i++)\r\n\t{\r\n\t\t$selectedOpt = ($i == $selected)?'selected':'';\r\n\t\t$options .= '<option value=\"'.$i.'\" '.$selectedOpt.' >'.$i.'</option>';\r\n\t}\r\n\treturn $options;\r\n}",
"public function get_year_permastruct()\n {\n }",
"function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}",
"public function getYearList() \n {\t\t\n $this->db->select(\"to_char(cm_date, 'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.calendar_main\");\n $this->db->where(\"to_char(cm_date, 'yyyy')::numeric >= to_char(current_date, 'yyyy')::numeric - 15\");\n $this->db->group_by(\"to_char(cm_date, 'YYYY')\");\n $this->db->order_by(\"to_char(cm_date, 'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }",
"function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}",
"function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"function listHolidays($y=0)\n\t{\n\t\tglobal $GREGORIAN_MONTH, $GREGORIAN_DAY;\n\t\t//call with year $y for other than current year\n\t\tif ($y!=0) $this->holiday($y);\n\t\t//reset($this->holidays);\n\n\t\t//print (\"<pre>\");\n\t\t//print_r ($this->holidays);\n\t\t//print (\"</pre>\");\n\t\t//return;\n\n\t\tforeach($this->holidays as $k => $f)\n\t\t{\n\t\t\tjd_to_gregorian($f, $m, $d, $y);\n\t\t\t$d = \": \" . $GREGORIAN_DAY[jd_to_weekday($f)] . \", \" .\n\t\t\t\t$GREGORIAN_MONTH[$m] . \" $d, $y\";\n\n\t\t\t//print(\"<pre>\" . $f . \"--\" . $k . $d . \"</pre>\");\n\t\t\tprint($k . $d . \"<br />\");\n\n\t\t}\n\t}",
"function holiday ($yr=0)\n\t{\n\t\tif ($yr==0) $yr = (int)date(\"Y\");\n\t\t$this->bjd = gregorian_to_jd(1,1,$yr);\n\t\t$this->ejd = gregorian_to_jd(12,31,$yr);\n\n\t\t//add holidays easily define in the gregorian calendar\n\t\t$this->holidays = Array(\n\t\t\t\"newyearseve\" => gregorian_to_jd(12,31,$yr),\n\t\t\t\"valentinesday\"=> gregorian_to_jd(2,14,$yr),\n\t\t\t\"presidentsday\" => nth_weekday_jd(3,dMONDAY,2,$yr),\n\t\t\t\"stpatricksday\" => gregorian_to_jd(3,17,$yr),\n\t\t\t\"aprilfoolsday\" => gregorian_to_jd(4,1,$yr),\n\t\t\t\"cincodemayo\" => gregorian_to_jd(5,5,$yr),\n\t\t\t\"mothersday\" => nth_weekday_jd(2,dSUNDAY,5,$yr),\n\t\t\t\"memorialday\" => $this->memorialDay($yr),\n\t\t\t\"fathersday\" => nth_weekday_jd(3,dSUNDAY,6,$yr),\n\t\t\t\"fourthofjuly\" => gregorian_to_jd(7,4,$yr),\n\t\t\t\"laborday\" => nth_weekday_jd(1,dMONDAY,9,$yr),\n\t\t\t\"columbusday\" => nth_weekday_jd(2,dMONDAY,10,$yr),\n\t\t\t\"halloween\" => gregorian_to_jd(10,31,$yr), \n\t\t\t\"thanksgiving\" => nth_weekday_jd(4, dTHURSDAY, 11,$yr),\n\t\t\t\"christmas\" => gregorian_to_jd(12,24,$yr),\n\t\t\t\"christmasday\" => gregorian_to_jd(12,25,$yr),\n\t\t\t\"mardigras\" => easter_jd($yr,-47),\n\t\t\t\"easter\" =>\teaster_jd($yr)\n\t\t);\n\t\t\t\n\t\tasort($this->holidays);\n\t}",
"public static function getYears() \n\t{\n\t\t$year=array();\n\t\tfor($i=date(\"Y\");$i>2004;$i--)\n\t\t\t$year[]=$i;\n\t\treturn $year;\n\t}",
"function getYearList($selected = ''){\n $options = '';\n for($i=2015;$i<=2025;$i++)\n {\n $selectedOpt = ($i == $selected)?'selected':'';\n $options .= '<option value=\"'.$i.'\" '.$selectedOpt.' >'.$i.'</option>';\n }\n return $options;\n}",
"function get_all_hazard_fiscal_years($conn) {\n $query_date = \"SELECT MIN(date), MAX(date) FROM hazard\";\n $dates = exec_query($conn, $query_date);\n $min_date = DateTime::createFromFormat('Y-m-d', $dates[0][0]);\n $max_date = DateTime::createFromFormat('Y-m-d', $dates[0][1]);\n $min_fiscal_year = get_corresponding_fiscal_year($min_date);\n $max_fiscal_year = get_corresponding_fiscal_year($max_date);\n return range($min_fiscal_year, $max_fiscal_year);\n}",
"public function getYears() {\r\n\t\t$year = array();\r\n\t\t$current_year = strftime(\"%Y\");\r\n\t\tfor($i = 2000; $i <= $current_year+1 && $y = strftime(\"%Y\", mktime(0,0,0,0,0,$i)); ++$i) {\r\n\t\t\t$year[$i] = array('id' => $i, 'name' => $y+1);\r\n\t\t}\r\n\t\treturn $year; //array\r\n\t}",
"public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }",
"function getYearList($selected = '') {\r\n $options = '';\r\n for ($i = 2017; $i <= 2025; $i++) {\r\n $selectedOpt = ($i == $selected) ? 'selected' : '';\r\n $options .= '<option value=\"' . $i . '\" ' . $selectedOpt . ' >' . $i . '</option>';\r\n }\r\n return $options;\r\n}",
"public function getFiscalYears(){\n\t\t$connection=Database::getConnection();\n\t\t$query=\"SELECT fiscalYear, typeOfFunding FROM fundingsource\";\n\t\t$result_obj=\"\";\n\t\t$result_obj=$connection->query($query);\n\t\ttry{\n\t\t\twhile($result = $result_obj->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t$items[]=$result;\n\t\t\t}\n\t\t\treturn($items);\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}",
"function getUpcomingHolidays($date=NULL) {\n\t\tif (!$date) $date = time();\n\t\t$year = date('Y');\n\t\t$rs = aql::select(\"ct_holiday { slug, date where date is not null order by date_order asc }\");\n\t\tforeach ($rs as $r) {\n\t\t\tif (strtotime($r['date'].'/'.$year) > $date ) $this_years_holidays[$r['slug']] = strtotime($r['date'].'/'.$year);\n\t\t\telse $next_years_holidays[$r['slug']] = strtotime($r['date'].'/'.($year+1));\n\t\t}\n\t\treturn(array_merge($this_years_holidays,$next_years_holidays));\n}",
"function getYearList($selected = '') {\n $options = '';\n for ($i = 2015; $i <= 2025; $i++) {\n $selectedOpt = ($i == $selected) ? 'selected' : '';\n $options .= '<option value=\"' . $i . '\" ' . $selectedOpt . ' >' . $i . '</option>';\n }\n return $options;\n}",
"private function calculateNewYearHolidays(): void\n {\n $newYearsDay = new DateTime(\"$this->year-01-01\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n $dayAfterNewYearsDay = new DateTime(\"$this->year-01-02\", DateTimeZoneFactory::getDateTimeZone($this->timezone));\n\n switch ($newYearsDay->format('w')) {\n case 0:\n $newYearsDay->add(new DateInterval('P1D'));\n $dayAfterNewYearsDay->add(new DateInterval('P1D'));\n break;\n case 5:\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n case 6:\n $newYearsDay->add(new DateInterval('P2D'));\n $dayAfterNewYearsDay->add(new DateInterval('P2D'));\n break;\n }\n\n $this->addHoliday(new Holiday('newYearsDay', [], $newYearsDay, $this->locale));\n $this->addHoliday(new Holiday('dayAfterNewYearsDay', [], $dayAfterNewYearsDay, $this->locale));\n }",
"function GetOvertimeYearList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n $_where = empty($type) ? \" and emp_seq_no = '$emp_seqno'\" : \"\";\n $sql_string = <<<_OvertimeYearList_\n select distinct substrb(my_day, 0,4) as year1,\n substrb(my_day, 0,4) as year2\n from ehr_overtime_v\n where company_id = '$companyid'\n $_where\n order by substrb(my_day,0,4) desc\n_OvertimeYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"function years()\n{\n $years = array();\n for($i=date('Y');$i>(date('Y') - 100); $i--)\n $years[$i] = $i;\n return $years;\n}"
]
| [
"0.6918246",
"0.6891626",
"0.6884324",
"0.66335684",
"0.6537352",
"0.65346974",
"0.6352782",
"0.6327184",
"0.6308216",
"0.6285487",
"0.6107228",
"0.6077901",
"0.60723084",
"0.6051222",
"0.6046207",
"0.60125107",
"0.60069215",
"0.5999907",
"0.59834105",
"0.5943277",
"0.59258837",
"0.5923044",
"0.5915608",
"0.5911144",
"0.58939224",
"0.58801854",
"0.5834748",
"0.5816666",
"0.5813207",
"0.57948565"
]
| 0.7366537 | 0 |
end function GetLeaveCount() Get employee salary leave counts | function GetLeaveSalaryCount($wherecond, $cond_1, $cond_2, $type = NULL) {
$companyid = $this->companyID;
$emp_seqno = $this->empSeqNo;
//得到登陆员工的计薪期间代码 add by Jack
$period_master_id = $this->DBConn->GetOne("select period_master_id from hr_personnel where id = '" . $emp_seqno . "'");
$_where = is_null($type) ? " and emp_seq_no = '$emp_seqno' and period_master_id = nvl('" . $period_master_id . "', period_master_id)" : " and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'";
$sql_string = <<<_GetSalaryLeaveCount_
select year, absence_name, absence_seq_no, hours
from (select A.*, rownum rn
from (select period_detail_no year, absence_name, absence_seq_no,sum(hours) hours
from ehr_absence_salary_v
where company_id = '$companyid'
$_where
$wherecond
group by period_detail_no,absence_name,absence_seq_no
order by period_detail_no desc) A
where rownum <= $cond_2)
where rn >= $cond_1
_GetSalaryLeaveCount_;
//print $sql_string;
return $this->DBConn->GetArray($sql_string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }",
"public function getEmployeesCount() {\n return $this->getTable()->getEmployeesCount();\n }",
"public function employee_leave_status()\n\t{\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('accepted'=>'', 'accepted_count'=>'','pending'=>'', 'pending_count'=>'','rejected'=>'', 'rejected_count'=>'');\n\t\t\n\t\t//accepted\n\t\t$Return['accepted'] = $this->lang->line('xin_approved');\n\t\t$Return['accepted_count'] = accepted_leave_request();\n\t\t// pending\n\t\t$Return['pending'] = $this->lang->line('xin_pending');\n\t\t$Return['pending_count'] = pending_leave_request();\n\t\t// rejected\n\t\t$Return['rejected'] = $this->lang->line('xin_rejected');\n\t\t$Return['rejected_count'] = rejected_leave_request();\n\t\t$this->output($Return);\n\t\texit;\n\t}",
"function GetLeaveCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$user_seq_no = $_SESSION [\"user\"] [\"user_seq_no\"];\n\t\t$stmt = \"begin pk_erp.p_set_segment_no(:company_id); pk_erp.p_set_username(:user_seq_no); end;\";\n\n\t\t$this->DBConn->Execute($stmt, array (\"company_id\" => $companyid, \"user_seq_no\" => $user_seq_no));\n\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno'\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\t\t$sql_string = <<<_GetLeaveCount_\n\t\t\t SELECT year, absence_name, absence_seq_no,hours\n\t\t\t\t\t FROM (SELECT A.*, ROWNUM RN\n\t\t\t\t\t\t\t FROM (SELECT my_time year, absence_name, absence_seq_no,sum(hours) hours\n\t\t\t\t\t\t\t\t\t FROM ehr_absence_v\n\t\t\t\t\t\t\t\t\t WHERE company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by my_time, absence_name, absence_seq_no\n\t\t\t\t\t\t\t\t\t order by my_time desc) A\n\t\t\t\t\t\t\t WHERE ROWNUM < = $cond_2)\n WHERE RN > = $cond_1\n_GetLeaveCount_;\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"public function get_number_of_leaves() {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"SELECT COUNT(*)\r\n\t\t\tFROM `joins`\r\n\t\t\tWHERE user_id = '$this->user_id'\r\n\t\t\tAND status = '\" . self::LEFT_STATUS . \"'\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t\t$this->number_of_leaves = $result->fetch_row()[0];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthrow new UnexpectedValueException('UnexpectedValueException occured on method call get_number_of_joins');\r\n\t\t}\r\n\t}",
"public function xtestGetNumOfLeave() {\n\n $leaveRequestDao = $this->getMock('LeaveRequestDao', array('getNumOfLeave'));\n $leaveRequestDao->expects($this->once())\n ->method('getNumOfLeave')\n ->with(1, 'LTY001')\n ->will($this->returnValue(10));\n\n $this->leaveRequestService->setLeaveRequestDao($leaveRequestDao);\n\n $this->assertEquals(10, $this->leaveRequestService->getNumOfLeave(1, 'LTY001'));\n\n }",
"function getEmployeeLeaveRemain($db, $strIDEmployee)\n{\n $intResult = 0;\n if ($strIDEmployee === \"\") {\n return $intResult;\n }\n $arrCuti = getEmployeeLeaveQuota($db, $strIDEmployee);\n $intLeaveQuotaPrev = $arrCuti['prevQuota'];\n $intLeaveQuotaCurr = $arrCuti['currQuota'];\n if ($intLeaveQuotaPrev == 0) {\n $intLeaveTakenPrev = 0; // anggap aja gak ada\n $intLeaveHolidayPrev = 0; //\n } else {\n $intLeaveTakenPrev = $arrCuti['prevTaken'];\n $intLeaveHolidayPrev = $arrCuti['prevHoliday'];\n }\n if ($intLeaveQuotaCurr == 0) {\n $intLeaveTakenCurr = 0; // anggap aja gak ada\n $intLeaveHolidayCurr = 0; //\n } else {\n $intLeaveTakenCurr = $arrCuti['currTaken'];\n $intLeaveHolidayCurr = $arrCuti['currHoliday'];\n }\n $intResult = $intLeaveQuotaPrev + $intLeaveQuotaCurr;\n $intResult -= ($intLeaveTakenCurr + $intLeaveTakenPrev);\n $intResult -= ($intLeaveHolidayCurr + $intLeaveHolidayPrev);\n return $intResult;\n}",
"function getLeaveApplyCountByDept($whoami = 'assistant')\n {\n $create_by = $whoami=='admin' ? '' : ' and a.create_by = \\''.$_SESSION['user']['user_seq_no'].'\\' ';\n $sql = <<<eof\n select c.segment_no as dept_seq_no,\n\t\t\t c.segment_no_sz as dept_id,\n\t\t\t c.segment_name as dept_name,\n\t\t\t a.flow_status,\n\t\t\t decode(a.flow_status, '01', '已提交', '02', '流程中', '暂存') as flow_status_desc,\n\t\t\t count(a.absence_seq_no) as trows\n\t\t\t from ehr_leave_in_flow_v a, hr_personnel_base b, gl_segment c\n\t\t\t where a.company_id = b.seg_segment_no\n\t\t\t and a.emp_seq_no = b.id\n\t\t\t and b.seg_segment_no = c.seg_segment_no\n\t\t\t and b.seg_segment_no_department = c.segment_no \n and a.company_id = :company_id\n and a.flow_status < '03'\n $create_by\n group by c.segment_no, c.segment_no_sz ,c.segment_name, a.flow_status\n order by c.segment_no_sz\neof;\n //$this->DBConn->debug =1;\n return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));\n }",
"function getLeaveHoliday($db, $strStartDate, $strFinishDate)\n{\n $intResult = 0;\n if ($strStartDate == \"\" || $strFinishDate == \"\") {\n return 0;\n }\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStartDate' AND '$strFinishDate' \";\n $resTmp = $db->execute($strSQL);\n if ($rowTmp = $db->fetchrow($resTmp)) {\n if ($rowTmp['total'] != \"\") {\n $intResult = $rowTmp['total'];\n }\n }\n return $intResult;\n}",
"function getGuardLeaveDays($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$leavedays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif($assgnarr[1] == \"Leave\" && $assgnarr[0] == $guardid){\n\t\t\t\t\t$leavedays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $leavedays;\n}",
"public function xtestGetNumOfAvaliableLeave() {\n\n $leaveRequestDao = $this->getMock('LeaveRequestDao', array('getNumOfAvaliableLeave'));\n $leaveRequestDao->expects($this->once())\n ->method('getNumOfAvaliableLeave')\n ->with(1, 'LTY002')\n ->will($this->returnValue(15));\n\n $this->leaveRequestService->setLeaveRequestDao($leaveRequestDao);\n\n $this->assertEquals(15, $this->leaveRequestService->getNumOfAvaliableLeave(1, 'LTY002'));\n\n }",
"public function employees() \r\n\t{\r\n\t\t$query = \"SELECT count(id_radnik) as Zaposlenih FROM \" . $this->table;\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\t\t$stmt->execute();\r\n\r\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$zaposlenih = $row['Zaposlenih'];\r\n\t\treturn $zaposlenih;\r\n\t}",
"public function employees_with_leaves()\n {\n $params = array('header' => $this->_leaveheaders, \n 'class' => array('table table-striped table-bordered dt-table'));\n \n $this->_ci->load->library('MY_table', $params, 'regemployees');\n \n $empleaves = $this->_ci->employees->regular_employees_with_leaves();\n \n if (isset($empleaves) && !empty($empleaves))\n {\n for ($i = 0; $i < count($empleaves); $i++)\n {\n $tabledata[] = array($this->_leavemodal($empleaves[$i]->EmployeeNumber),\n $empleaves[$i]->FirstName,\n $empleaves[$i]->LastName,\n $empleaves[$i]->Vacation,\n $empleaves[$i]->Emergency,\n $empleaves[$i]->Sick,\n $empleaves[$i]->Maternity,\n $empleaves[$i]->Paternity,);\n }\n \n if (isset($tabledata) && !empty($tabledata))\n {\n return $this->_ci->regemployees->generate($tabledata);\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }\n else\n {\n $this->_ci->leave_listings->add_row(array('data' => 'No results found.', \n 'colspan' => count($this->_leaveheaders)));\n return $this->_ci->regemployees->generate();\n }\n }",
"function GetOvertimeSalaryCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\n\t\t//得到登陆员工的计薪期间代码 add by Jack\n\t\t$period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno' and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\n\t\t$sql_string = <<<_GetSalaryLeaveCount_\n\t\t\t select year, ot_fee_type, ot_fee_type_id, hours\n\t\t\t\t\t from (select A.*, rownum rn\n\t\t\t\t\t\t\t from (select period_detail_no year, ot_fee_type, ot_fee_type_id,sum(hours) hours\n\t\t\t\t\t\t\t\t\t from ehr_overtime_salary_v\n\t\t\t\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by period_detail_no,ot_fee_type,ot_fee_type_id\n\t\t\t\t\t\t\t\t\t order by period_detail_no desc) A\n\t\t\t\t\t\t\t where rownum <= $cond_2)\n\t\t\t\t\t where rn >= $cond_1\n_GetSalaryLeaveCount_;\n\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"function assign_subordinate_count($employee) {\n\t$count = 0;\n\t//Get subordinate employees of current employee\n\t$employees = $employee->getSubordinates();\n\t//Add to count\n\t$count += count($employees);\n\t//Recursively add all subordinate employees number of employees to current employees count\n\tforeach($employees AS $emp) {\n\t\t$count += assign_subordinate_count($emp);\n\t}\n\t//Update number of subordinate employees for this employee\n\t$employee->setNumSubordinates($count);\n\t//Destroy the subordinates attribute so returned data will be flat array/chop off multidimensional array\n\t$employee->destroySubordinates();\n\treturn $count;\n}",
"public function getNumberOfEmployees(): ?int;",
"public function addLeave() {\n try {\n if (!($this->leave instanceof Base_Model_ObtorLib_App_Core_Employee_Entity_Leave)) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception(\" Leave Entity not initialized\");\n } else {\n $objLeave = new Base_Model_ObtorLib_App_Core_Employee_Dao_Leave();\n $objLeave->leave = $this->leave;\n return $objLeave->addLeave();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception($ex);\n }\n }",
"public function showUserLeaveSummary()\n {\n\n $user = User::find(Auth::user()->id);\n $userGender = session('global_user')->employee->Emp_Gender;\n\n //Getting no of days available to be taken for annual leave\n $carryOverDays = $user->COD_from_last_yr;\n $daysEarnedTillDate = Auth::user()->getDaysEarnedTillDate();\n $daysTaken = $user->no_of_leave_days_used;\n $daysAvailableForUse = $carryOverDays + $daysEarnedTillDate - $daysTaken;\n\n //Updating and saving the user with the new no of days available\n $user->no_of_leave_days_remaining = $daysAvailableForUse;\n $user->save();\n\n return view('pages.clientPages.summary', [\n 'annualEligibledays' => Auth::user()->getEligibleDays(),\n 'daysEarnedTillDate' => $daysEarnedTillDate,\n 'carryOverDays' => $user->COD_from_last_yr,\n 'daysAvailableForUse' => $user->no_of_leave_days_remaining,\n 'daysTaken' => $user->no_of_leave_days_used,\n 'sickLeaveDays' => $user->sick_leave,\n 'compassionateLeaveDays' => $user->compassionate_leave,\n 'studyLeaveDays' => $user->study_leave,\n 'paternityMaternityLeaveDays' => $user->paternity_maternity_leave,\n 'userGender' => $userGender,\n\n ]);\n }",
"public static function getEmployeesShiftCounts($shift_id){\n return DB::table('table_employee_shifts')\n ->join('table_employees', 'table_employee_shifts.employee_id', '=', 'table_employees.employee_id')\n ->join('table_shifts', 'table_employee_shifts.shift_id', '=', 'table_shifts.shift_id')\n ->select('table_shifts.shift_start','table_shifts.shift_end',\n 'table_shifts.shift_place','table_shifts.shift_id')\n ->where(['table_employee_shifts.shift_id' => $shift_id])\n ->orderByDesc('table_shifts.shift_start')\n ->count();\n }",
"function get_all_empresas_count()\n {\n $this->db->from('empresas');\n return $this->db->count_all_results();\n }",
"function count_all(){\n\t $this->db->count_all($this->tbl_Employeeinfo);\n\t \n return $this->db->count_all($this->tbl_Employeeinfo);\n }",
"public function getNbSalaries(): ?int {\n return $this->nbSalaries;\n }",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getTotalCount();",
"public function getAllDataEmployees(){\n\t\t\t$this->db->select('*')->from('tbl_employees');\n\t\t\treturn $this->db->count_all_results();\n\t\t}",
"function getNoOfHolidays ()\n {\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE name = 'holiday'\";\n $stmt = $this->connection->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->holiday_entitlement = $row['entitlement'];\n return $this->holiday_entitlement;\n }",
"function erp_hr_count_departments() {\n\n return \\WeDevs\\ERP\\HRM\\Models\\Department::count();\n}",
"public static function getList($idle=null,$idEmployee=null) {\r\n $lvEarned = new EmployeeLeaveEarned();\r\n $crit=[];\r\n if ($idle!==null) {\r\n $crit[\"idle\"]=\"$idle\";\r\n }\r\n if($idEmployee){\r\n $crit[\"idEmployee\"]=$idEmployee;\r\n }\r\n $lvEarnedList = $lvEarned->getSqlElementsFromCriteria($crit);\r\n return $lvEarnedList;\r\n }",
"function exeGetTotalEmp() { \n $exeGetTotalEmp = $this->db->query(\"SELECT *\n FROM employees\n WHERE status = 1\n ORDER BY firstname ASC, lastname ASC\");\n \n return $exeGetTotalEmp->num_rows(); \n }"
]
| [
"0.64199257",
"0.63947624",
"0.616039",
"0.60791993",
"0.6025198",
"0.59540063",
"0.5942229",
"0.5870206",
"0.58286893",
"0.5806926",
"0.57783395",
"0.5607926",
"0.5588843",
"0.55883634",
"0.55797553",
"0.557975",
"0.55685836",
"0.5494144",
"0.5390714",
"0.5389162",
"0.53801864",
"0.535458",
"0.5350524",
"0.5350524",
"0.5350524",
"0.5336888",
"0.53359425",
"0.53147644",
"0.53138244",
"0.53133744"
]
| 0.64501053 | 0 |
end function GetSalaryLeaveCount() Get employee salary overtime counts | function GetOvertimeSalaryCount($wherecond, $cond_1, $cond_2, $type = NULL) {
$companyid = $this->companyID;
$emp_seqno = $this->empSeqNo;
//得到登陆员工的计薪期间代码 add by Jack
$period_master_id = $this->DBConn->GetOne("select period_master_id from hr_personnel where id = '" . $emp_seqno . "'");
$_where = is_null($type) ? " and emp_seq_no = '$emp_seqno' and period_master_id = nvl('" . $period_master_id . "', period_master_id)" : " and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'";
$sql_string = <<<_GetSalaryLeaveCount_
select year, ot_fee_type, ot_fee_type_id, hours
from (select A.*, rownum rn
from (select period_detail_no year, ot_fee_type, ot_fee_type_id,sum(hours) hours
from ehr_overtime_salary_v
where company_id = '$companyid'
$_where
$wherecond
group by period_detail_no,ot_fee_type,ot_fee_type_id
order by period_detail_no desc) A
where rownum <= $cond_2)
where rn >= $cond_1
_GetSalaryLeaveCount_;
//print $sql_string;
return $this->DBConn->GetArray($sql_string);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetLeaveSalaryCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\n\t\t//得到登陆员工的计薪期间代码 add by Jack\n\t\t$period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno' and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\n\t\t$sql_string = <<<_GetSalaryLeaveCount_\n\t\t\t select year, absence_name, absence_seq_no, hours\n\t\t\t\t\t from (select A.*, rownum rn\n\t\t\t\t\t\t\t from (select period_detail_no year, absence_name, absence_seq_no,sum(hours) hours\n\t\t\t\t\t\t\t\t\t from ehr_absence_salary_v\n\t\t\t\t\t\t\t\t\t where company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by period_detail_no,absence_name,absence_seq_no\n\t\t\t\t\t\t\t\t\t order by period_detail_no desc) A\n\t\t\t\t\t\t\t where rownum <= $cond_2)\n\t\t\t\t\t where rn >= $cond_1\n_GetSalaryLeaveCount_;\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"public function countEmployee(){\n\t\t\t\t\t return count($this->listeEmployee());\n\t\t\t\t\t }",
"public function getEmployeesCount() {\n return $this->getTable()->getEmployeesCount();\n }",
"public function calculateSalaryDay()\n {\n /**\n * (numberOfDays + indexOfFirstDay + 6) mod 7\n * gives you the numeric representation of the last day of the month \n */\n $lastDay = ($this->_numberOfDays + $this->_startsOn + 6) % 7;\n if ($lastDay == 0) {\n return $this->_numberOfDays - (7 - $this->_altSalaryDay);\n } else if ($lastDay == 6) {\n return $this->_numberOfDays - (6 - $this->_altSalaryDay);\n } else {\n return $this->_numberOfDays;\n }\n }",
"function GetLeaveCount($wherecond, $cond_1, $cond_2, $type = NULL) {\n\t\t$companyid = $this->companyID;\n\t\t$emp_seqno = $this->empSeqNo;\n\t\t$user_seq_no = $_SESSION [\"user\"] [\"user_seq_no\"];\n\t\t$stmt = \"begin pk_erp.p_set_segment_no(:company_id); pk_erp.p_set_username(:user_seq_no); end;\";\n\n\t\t$this->DBConn->Execute($stmt, array (\"company_id\" => $companyid, \"user_seq_no\" => $user_seq_no));\n\n\t\t$_where = is_null($type) ? \" and emp_seq_no = '$emp_seqno'\" : \" and pk_user_priv.f_user_priv(emp_seq_no) = 'Y'\";\n\t\t$sql_string = <<<_GetLeaveCount_\n\t\t\t SELECT year, absence_name, absence_seq_no,hours\n\t\t\t\t\t FROM (SELECT A.*, ROWNUM RN\n\t\t\t\t\t\t\t FROM (SELECT my_time year, absence_name, absence_seq_no,sum(hours) hours\n\t\t\t\t\t\t\t\t\t FROM ehr_absence_v\n\t\t\t\t\t\t\t\t\t WHERE company_id = '$companyid'\n\t\t\t\t\t\t\t\t\t $_where\n\t\t\t\t\t\t\t\t\t $wherecond\n\t\t\t\t\t\t\t\t\t group by my_time, absence_name, absence_seq_no\n\t\t\t\t\t\t\t\t\t order by my_time desc) A\n\t\t\t\t\t\t\t WHERE ROWNUM < = $cond_2)\n WHERE RN > = $cond_1\n_GetLeaveCount_;\n\t\t//print $sql_string;\n\t\treturn $this->DBConn->GetArray($sql_string);\n\t}",
"function getLeaveApplyCountByDept($whoami = 'assistant')\n {\n $create_by = $whoami=='admin' ? '' : ' and a.create_by = \\''.$_SESSION['user']['user_seq_no'].'\\' ';\n $sql = <<<eof\n select c.segment_no as dept_seq_no,\n\t\t\t c.segment_no_sz as dept_id,\n\t\t\t c.segment_name as dept_name,\n\t\t\t a.flow_status,\n\t\t\t decode(a.flow_status, '01', '已提交', '02', '流程中', '暂存') as flow_status_desc,\n\t\t\t count(a.absence_seq_no) as trows\n\t\t\t from ehr_leave_in_flow_v a, hr_personnel_base b, gl_segment c\n\t\t\t where a.company_id = b.seg_segment_no\n\t\t\t and a.emp_seq_no = b.id\n\t\t\t and b.seg_segment_no = c.seg_segment_no\n\t\t\t and b.seg_segment_no_department = c.segment_no \n and a.company_id = :company_id\n and a.flow_status < '03'\n $create_by\n group by c.segment_no, c.segment_no_sz ,c.segment_name, a.flow_status\n order by c.segment_no_sz\neof;\n //$this->DBConn->debug =1;\n return $this->DBConn->CacheGetArray(self::DATA_CACHE_SECONDS,$sql,array('company_id'=>$this->companyID));\n }",
"function getLeaveHoliday($db, $strStartDate, $strFinishDate)\n{\n $intResult = 0;\n if ($strStartDate == \"\" || $strFinishDate == \"\") {\n return 0;\n }\n $strSQL = \"SELECT count(id) AS total FROM hrd_calendar WHERE status='t' AND leave='t' \";\n $strSQL .= \"AND holiday BETWEEN '$strStartDate' AND '$strFinishDate' \";\n $resTmp = $db->execute($strSQL);\n if ($rowTmp = $db->fetchrow($resTmp)) {\n if ($rowTmp['total'] != \"\") {\n $intResult = $rowTmp['total'];\n }\n }\n return $intResult;\n}",
"function getEmployeeLeaveRemain($db, $strIDEmployee)\n{\n $intResult = 0;\n if ($strIDEmployee === \"\") {\n return $intResult;\n }\n $arrCuti = getEmployeeLeaveQuota($db, $strIDEmployee);\n $intLeaveQuotaPrev = $arrCuti['prevQuota'];\n $intLeaveQuotaCurr = $arrCuti['currQuota'];\n if ($intLeaveQuotaPrev == 0) {\n $intLeaveTakenPrev = 0; // anggap aja gak ada\n $intLeaveHolidayPrev = 0; //\n } else {\n $intLeaveTakenPrev = $arrCuti['prevTaken'];\n $intLeaveHolidayPrev = $arrCuti['prevHoliday'];\n }\n if ($intLeaveQuotaCurr == 0) {\n $intLeaveTakenCurr = 0; // anggap aja gak ada\n $intLeaveHolidayCurr = 0; //\n } else {\n $intLeaveTakenCurr = $arrCuti['currTaken'];\n $intLeaveHolidayCurr = $arrCuti['currHoliday'];\n }\n $intResult = $intLeaveQuotaPrev + $intLeaveQuotaCurr;\n $intResult -= ($intLeaveTakenCurr + $intLeaveTakenPrev);\n $intResult -= ($intLeaveHolidayCurr + $intLeaveHolidayPrev);\n return $intResult;\n}",
"function assign_subordinate_count($employee) {\n\t$count = 0;\n\t//Get subordinate employees of current employee\n\t$employees = $employee->getSubordinates();\n\t//Add to count\n\t$count += count($employees);\n\t//Recursively add all subordinate employees number of employees to current employees count\n\tforeach($employees AS $emp) {\n\t\t$count += assign_subordinate_count($emp);\n\t}\n\t//Update number of subordinate employees for this employee\n\t$employee->setNumSubordinates($count);\n\t//Destroy the subordinates attribute so returned data will be flat array/chop off multidimensional array\n\t$employee->destroySubordinates();\n\treturn $count;\n}",
"public function employee_leave_status()\n\t{\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('accepted'=>'', 'accepted_count'=>'','pending'=>'', 'pending_count'=>'','rejected'=>'', 'rejected_count'=>'');\n\t\t\n\t\t//accepted\n\t\t$Return['accepted'] = $this->lang->line('xin_approved');\n\t\t$Return['accepted_count'] = accepted_leave_request();\n\t\t// pending\n\t\t$Return['pending'] = $this->lang->line('xin_pending');\n\t\t$Return['pending_count'] = pending_leave_request();\n\t\t// rejected\n\t\t$Return['rejected'] = $this->lang->line('xin_rejected');\n\t\t$Return['rejected_count'] = rejected_leave_request();\n\t\t$this->output($Return);\n\t\texit;\n\t}",
"public function showUserLeaveSummary()\n {\n\n $user = User::find(Auth::user()->id);\n $userGender = session('global_user')->employee->Emp_Gender;\n\n //Getting no of days available to be taken for annual leave\n $carryOverDays = $user->COD_from_last_yr;\n $daysEarnedTillDate = Auth::user()->getDaysEarnedTillDate();\n $daysTaken = $user->no_of_leave_days_used;\n $daysAvailableForUse = $carryOverDays + $daysEarnedTillDate - $daysTaken;\n\n //Updating and saving the user with the new no of days available\n $user->no_of_leave_days_remaining = $daysAvailableForUse;\n $user->save();\n\n return view('pages.clientPages.summary', [\n 'annualEligibledays' => Auth::user()->getEligibleDays(),\n 'daysEarnedTillDate' => $daysEarnedTillDate,\n 'carryOverDays' => $user->COD_from_last_yr,\n 'daysAvailableForUse' => $user->no_of_leave_days_remaining,\n 'daysTaken' => $user->no_of_leave_days_used,\n 'sickLeaveDays' => $user->sick_leave,\n 'compassionateLeaveDays' => $user->compassionate_leave,\n 'studyLeaveDays' => $user->study_leave,\n 'paternityMaternityLeaveDays' => $user->paternity_maternity_leave,\n 'userGender' => $userGender,\n\n ]);\n }",
"function getNoOfHolidays ()\n {\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE name = 'holiday'\";\n $stmt = $this->connection->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->holiday_entitlement = $row['entitlement'];\n return $this->holiday_entitlement;\n }",
"function getGuardLeaveDays($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$leavedays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif($assgnarr[1] == \"Leave\" && $assgnarr[0] == $guardid){\n\t\t\t\t\t$leavedays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn $leavedays;\n}",
"public function computeSalary()\n {\n /**\n * Payments are done every 15th and 30th of every month\n * For 15th:\n * Day 1 to 14th of the month plus day 30 and 31st of the previous month\n * For 30th:\n * Day 15th to 29th\n */\n\n // check if today is the 15th or 30th / 28th for Feb\n $today = new \\DateTime();\n $day_today = $today->format( 'd' );\n $is_leap_year = intval( date('Y') ) % 4 == 0;\n\n // compute salary only on the 15th and the 30th\n if( $day_today == 15 ){\n // get teacher whose salary was not computed yet\n $teachers = ( new TeacherPivot )->getSalaryUnprocessedAsOf( $today->format('Y-m-d') );\n foreach( $teachers as $teacher ){\n $teacher->processDailyIncome();\n }\n }elseif( $day_today == 30 ){\n\n }elseif( $day_today == 28 && date('m') == 2 && !$is_leap_year ){\n\n }elseif( $day_today == 29 && date('m') == 2 && $is_leap_year ){\n\n }\n\n }",
"function getBusinessDayCount($startStamp,$endStamp){\n\t\t$dateTmp=$startStamp;\n\t\t$businessDays=0;\n\t\t$loopEnd=false;\n\t\twhile(!$loopEnd){\n\t\t\t$dateTmp = DateAdd($dateTmp,\"d\",1);\n\t\t\tif(isBusinessDay($dateTmp)){\n\t\t\t\t$businessDays++;\n\t\t\t}\n\t\t\tif($dateTmp==$endStamp){\n\t\t\t\t$loopEnd=true;\n\t\t\t}\n\t\t}\n\t\treturn $businessDays;\n\t}",
"public static function getEmployeesShiftCounts($shift_id){\n return DB::table('table_employee_shifts')\n ->join('table_employees', 'table_employee_shifts.employee_id', '=', 'table_employees.employee_id')\n ->join('table_shifts', 'table_employee_shifts.shift_id', '=', 'table_shifts.shift_id')\n ->select('table_shifts.shift_start','table_shifts.shift_end',\n 'table_shifts.shift_place','table_shifts.shift_id')\n ->where(['table_employee_shifts.shift_id' => $shift_id])\n ->orderByDesc('table_shifts.shift_start')\n ->count();\n }",
"public function getNbSalaries(): ?int {\n return $this->nbSalaries;\n }",
"function getEmployeesSalary() {\n $query = \"SELECT a.emp_nip, a.emp_fullname, a.emp_branch, b.dept_division, b.dept_position, b.dept_level,\n c.*\n FROM employee a\n LEFT JOIN department b ON b.master_nip = a.emp_nip\n LEFT JOIN payroll_salary c ON c.master_nip = a.emp_nip\";\n $result = $this->db->query($query);\n\n return $result->result();\n }",
"public static function getEmployeeShiftsCounts($employee_id){\n return DB::table('table_employee_shifts')\n ->join('table_employees', 'table_employee_shifts.employee_id', '=', 'table_employees.employee_id')\n ->join('table_shifts', 'table_employee_shifts.shift_id', '=', 'table_shifts.shift_id')\n ->where(['table_employee_shifts.employee_id' => $employee_id])\n ->count();\n }",
"function getEmployeeLeaveAnnualByYear($db, $strYear, $strSection = \"\", $strIDEmployee = \"\")\n{\n $arrResult = [];\n // langsung dipisah sesuai jenis absennya\n if ($strYear == \"\") {\n return $arrResult;\n }\n $strFrom = \"$strYear-01-01\";\n $strThru = \"$strYear-12-31\";\n $strSQL = \"SELECT id_employee, leave_duration FROM hrd_absence AS t1 LEFT JOIN hrd_employee AS t2 ON t1.id_employee = t2.id\n WHERE t1.status >= '\" . REQUEST_STATUS_APPROVED . \"' \";\n if ($strSection != \"\") {\n $strSQL .= \"AND (t2.section_code = '$strSection') \";\n }\n if ($strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id = '$strIDEmployee' \";\n }\n $strSQL .= \"AND \\\"leave_year\\\" = '$strYear' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n // cari total waktu\n $intTotal = $rowDb['leave_duration'];\n if (isset($arrResult[$rowDb['id_employee']])) {\n $arrResult[$rowDb['id_employee']] += $intTotal;\n } else {\n $arrResult[$rowDb['id_employee']] = $intTotal;\n }\n }\n return $arrResult;\n}",
"public function getSalary($post){ \n\t\treturn $this->structure[$post]['salary'];\n\t}",
"function getBusinessDayCount_timestamp($startStamp,$endStamp){\n\t\t$startStamp=timestamp2utime($startStamp);\n\t\t$endStamp=timestamp2utime($endStamp);\n\t\t$dateTmp=$startStamp;\n\t\t$businessDays=0;\n\t\t$loopEnd=false;\n\t\twhile(!$loopEnd){\n\t\t\t$dateTmp = DateAdd($dateTmp,\"d\",1);\n\t\t\tif(isBusinessDay($dateTmp)){\n\t\t\t\t$businessDays++;\n\t\t\t}\n\t\t\tif($dateTmp==$endStamp){\n\t\t\t\t$loopEnd=true;\n\t\t\t}\n\t\t}\n\t\treturn $businessDays;\n\t}",
"function salary() {\n if (empty($this->bio_salary)) {\n if ( $this->page[\"Bio\"] == \"\" ) $this->openpage (\"Bio\",\"person\");\n $pos_s = strpos($this->page[\"Bio\"],\"<h5>Salary</h5>\");\n $pos_e = strpos($this->page[\"Bio\"],\"</table\",$pos_s);\n $block = substr($this->page[\"Bio\"],$pos_s,$pos_e - $pos_s);\n if (preg_match_all(\"/<tr.*?<td.*?>(.*?)<\\/td>.*?<td.*?>(.*?)<\\/td>/ms\",$block,$matches)) { // for each table row\n $mc = count($matches[0]);\n for ($i=0;$i<$mc;++$i) {\n if (preg_match(\"/\\/title\\/tt(\\d{7})\\/\\\">(.*?)<\\/a>\\s*\\((\\d{4})\\)/\",$matches[1][$i],$match)) {\n $movie[\"imdb\"] = $match[1];\n $movie[\"name\"] = $match[2];\n $movie[\"year\"] = $match[3];\n } else {\n $movie[\"name\"] = $matches[1][$i];\n }\n $this->bio_salary[] = array(\"movie\"=>$movie,\"salary\"=>$matches[2][$i]);\n }\n }\n }\n return $this->bio_salary;\n }",
"public function getNumberOfEmployees(): ?int;",
"public function get_employee_salary($emp_id=Null)\n\t{\n\t\tif($res = $this->Employee_model->employee_by_id($emp_id)){\n\t\t\techo json_encode($res->emp_sallary);\n\t\t}else{\n\t\t\techo 0;\n\t\t}\n\t}",
"function count_all(){\n\t $this->db->count_all($this->tbl_Employeeinfo);\n\t \n return $this->db->count_all($this->tbl_Employeeinfo);\n }",
"function calculateNroll($section_num, $semester, $year, $course_num, $course_dept){\n //Query to get the number of students\n $result = mysql_query(\"Select count(*) FROM take T WHERE '$section_num' = T.section_num and '$semester'=T.semester and '$year'=T.year and '$course_num'=T.course_num and '$course_dept'=T.course_dept;\") or die(mysql_error());\n $row = mysql_fetch_array($result);\n return $row['count(*)'];\n}",
"public function xtestGetNumOfLeave() {\n\n $leaveRequestDao = $this->getMock('LeaveRequestDao', array('getNumOfLeave'));\n $leaveRequestDao->expects($this->once())\n ->method('getNumOfLeave')\n ->with(1, 'LTY001')\n ->will($this->returnValue(10));\n\n $this->leaveRequestService->setLeaveRequestDao($leaveRequestDao);\n\n $this->assertEquals(10, $this->leaveRequestService->getNumOfLeave(1, 'LTY001'));\n\n }",
"public function getTotalCount();",
"public function getTotalCount();"
]
| [
"0.65682435",
"0.61639524",
"0.60845685",
"0.5994487",
"0.58704835",
"0.57600844",
"0.574301",
"0.5719955",
"0.57115006",
"0.5634806",
"0.547222",
"0.5467732",
"0.5456569",
"0.5444778",
"0.5441354",
"0.5428105",
"0.5419038",
"0.5384231",
"0.5379259",
"0.5376799",
"0.53401065",
"0.53376293",
"0.53135735",
"0.52872413",
"0.52683634",
"0.5249872",
"0.5242152",
"0.5237295",
"0.5227545",
"0.5227545"
]
| 0.62724745 | 1 |
Get Leave Name by Id | public function getLeaveNameById($absid){
$sql = <<<eof
select absence_name
from hr_absence_type
where seg_segment_no = :companyid
and absence_type_id = :absid
eof;
//$this->DBConn->debug = 1;
return $this->DBConn->CacheGetOne(self::DATA_CACHE_SECONDS,$sql,array('companyid' => $this->companyID,'absid'=>$absid));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLeave($id) {\n try {\n $objLeave = new Base_Model_ObtorLib_App_Core_Employee_Dao_Leave();\n $leave = $objLeave->getLeave($id);\n return $leave;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception($e);\n }\n }",
"static function get_name($id) {\r\n\t\t\tif (trim($id)=='') {\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$all = self::get_all();\r\n\t\t\treturn $all[$id][0];\r\n\t\t}",
"function getNameFromId($id='') {\n\t\tif(!$id) return '';\n\t\t$result = $this->select('name',\"`store_id` = '\".$this->store_id.\"' AND id = '$id'\");\n\t\tif($result) return $result[0]['name'];\n\t\treturn '';\n\t}",
"public function loadJoinedEmployeeName($id) {\r\n\t\t$table = self::table;\r\n\t\treturn $this->clean($this->getLeftJoined(\r\n\t\t\tarray(\r\n\t\t\t\tself::table, \r\n\t\t\t\t'ofaEmployees'), \r\n\t\t\t'employeeId', \r\n\t\t\t'id',\r\n\t\t\tarray(),\r\n\t\t\tarray(\r\n\t\t\t\t'firstName',\r\n\t\t\t\t'middleInitial',\r\n\t\t\t\t'lastName',\r\n\t\t\t\t'email'),\r\n\t\t\tarray(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'column' => 'groupId',\r\n\t\t\t\t\t'value' => $id))\r\n\t\t\t\t\t\r\n /*array(\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'column' => 'listFirst',\r\n\t\t\t\t\t'order' => 'DESC'),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'column' => 'lastName',\r\n 'order' => 'ASC'))*/\r\n ));\r\n\t}",
"public function get_leave_type_by_id($id){\n $this->db->where('leave_type_id',$id);\n $query = $this->db->get('leave_type');\n return $query->row();\n }",
"public static function getStopName($id){\n return self::getStop($id)->data->attributes->name;\n }",
"static function getNameOf ($id)\n {\n return get (self::$NAMES, $id, false);\n }",
"function entityName( $id ) ;",
"public function getLeave()\n {\n return $this->get(self::_LEAVE);\n }",
"function get_gov_name($id)\n{\n $con = mysqli_connect('localhost','root','','bloodbank');\n mysqli_query($con,'SET CHARACTER SET utf8');\n mysqli_query($con,' DEFAULT COLLATE utf8_general_ci');\n $select_govern_name_with_id = mysqli_fetch_all(mysqli_query($con, \"Select * from governorate where id=\".$id.\" \"), MYSQLI_ASSOC);\n\n return $select_govern_name_with_id[0]['name'];\n}",
"static function getName($id) {\n $campaign = self::get($id);\n if (count($campaign)>0) return $campaign['name'];\n return '';\n }",
"function getDepartmentsName($id = null) {\n\t\t// import department db\n\t\tApp::import('Model','Department');\n\t\t$this->Department = & new Department();\n\t\t# fetch list of active departments \n\t\t$departments_name = $this->Department->find('all',array('conditions'=>array('Department.status'=>'1' , 'Department.id'=>$id),'fields'=>array('id','name')));\n\t\treturn $departments_name;\n\t}",
"public function getId(): string\n {\n return $this->name;\n }",
"public function getName()\n {\n return $this->id;\n }",
"static public function getNameById($id) {\n\t\t$mAction=new Maerdo_Model_Action();\n\t\t$result=$mAction->find($id);\n\t\treturn($result->name);\n\t}",
"public static function getMemberName($id){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT first_name,last_name\n FROM member\n WHERE id = :id\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n\t}",
"function getGroupName($id=0) {\n return getOne(\"SELECT group_name FROM `group` WHERE id = ?\",[$id]);\n}",
"public function get_receive_department($id){\n\t\tglobal $con;\n\t\t$department_name=\"\";\n\t\t$query=\"SELECT name FROM system_departments\n\t\t\t\tWHERE id=\\\"$id\\\" LIMIT 1\";\n\t\t$result=array();\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$department_name=$value['name'];\n\t\t}\n\n\t\treturn $department_name;\n\t}",
"public function getProveedorName($id)\n {\n //Extraer el proveedor del articulo proveedor\n $articuloProveedorProvider = new CActiveDataProvider('ARTICULOPROVEEDOR', array(\n 'criteria' => array(\n 'condition' => 'id='.$id,\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //Extraer el proveedor del articulo proveedor\n $dProvider = $articuloProveedorProvider->getData();\n $proveedoresProvider = new CActiveDataProvider('PROVEEDORES', array(\n 'criteria' => array(\n 'condition' => 'id='.$dProvider[0]['idProveedor'],\n ) ,\n 'pagination'=>array(\n 'pageSize'=>2000,\n ),\n ));\n //retornar el valor\n $return = $proveedoresProvider->getData();\n return $return[0]['Nombre'];\n }",
"function getGameNameById($game_id){\r\n\t\t\t$game=$this->fetchRow('id = '.$game_id)->toArray();\r\n\t\t\treturn $game['name'];\r\n\t\t}",
"function get_user_name_by_id($id = 0) {\r\n\r\n\t\t$field = 'name';\r\n\r\n\t\t$users = $this->users_model->get_users_by_id($id, $field);\r\n\r\n\t\t$result = $users['name'];\r\n\r\n\t\treturn $result;\r\n\r\n\t}",
"public static function getNameUserById($id){\n $name = User::select('name')->where('id','=',$id)->get();\n return $name[0]->name;\n }",
"public static function location_name($id) {\n \n $city = Location::model()->findByPK($id);\n return $city->name;\n }",
"function get_service_name($id){\n $answer=$GLOBALS['connect']->query(\"SELECT name FROM SERVICES WHERE id='$id'\");\n $data=$answer->fetch();\n return $data[\"name\"];\n }",
"function get_menu_name($menu_id)\n\t\t\t {\n\t\t\t \n\t\t\t \t$this->db->select('*');\n\t\t\t\t\t\n\t\t\t\t$this->db->where('id',$menu_id);\n\n\t\t\t\t$query\t=\t\t$this->db->get('oxm_menu');\n\t\t\t\t\n\t\t\t\t$temp=$query->row();\n\t\t\t\t\n\t\t\t\treturn $temp->menu_name;\n\t\t\t\t\n\t\t\t}",
"function getName($id){\n\t\tglobal $connection;\n\n\t\t$sql=\"SELECT * FROM users WHERE id='{$id}'\";\n\t\t$query=mysqli_query($connection, $sql);\n\t\t$name=NULL;\n\n\t\tif(mysqli_num_rows($query)==1){\n\t\t\twhile($row=mysqli_fetch_array($query)){\n\t\t\t\t$name=$row['name'];\n\t\t\t}\n\t\t}\n\t\treturn $name;\n\t}",
"public function get_individual_leave($individual_id)\n\t{\n\t\t//retrieve all users\n\t\t$this->db->from('leave_duration, leave_type');\n\t\t$this->db->select('leave_duration.*, leave_type.leave_type_name');\n\t\t$this->db->order_by('start_date', 'DESC');\n\t\t$this->db->where(array('leave_duration.individual_id' => $individual_id, 'leave_duration.leave_type_id' => 'leave_type.leave_type_id'));\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}",
"public function getName($id, $tableName, $lan) {\n //pr($lan);\n $nameData='';\n $tableEntity = TableRegistry::get($tableName);\n $data = $tableEntity->find()\n ->select(['id', 'name'])\n ->where(['id' => $id])\n ->first();\n if(!empty($data->name)){\n $dataNm = json_decode($data->name,TRUE);\n }\n if(!empty($dataNm[$lan])){\n \n \n //pr($dataNm);\n $nameData = $dataNm[$lan];\n // pr($nameData);\n }elseif(!empty($dataNm['en_US'])){\n $nameData = $dataNm['en_US'];\n } \n return $nameData;\n }",
"function get_client_name($id){\n $answer=$GLOBALS['connect']->query(\"SELECT name, firstName FROM USERS WHERE id='$id'\");\n $data=$answer->fetch();\n return $data[\"name\"].\" \".$data[\"firstName\"];\n\n }",
"public function getseo_name($id){\n $seoqry = DB::table('venue_master')\n ->where('creater_id',$id)\n ->select('*')\n ->first();\n return $seoqry->id;\n }"
]
| [
"0.67155856",
"0.6453286",
"0.642756",
"0.6303219",
"0.62868243",
"0.628169",
"0.616171",
"0.6120603",
"0.61145467",
"0.61011165",
"0.59898",
"0.5979644",
"0.59782284",
"0.594393",
"0.59228945",
"0.5913162",
"0.5843821",
"0.5843091",
"0.58205277",
"0.58052695",
"0.5790691",
"0.57643074",
"0.5763569",
"0.5741441",
"0.5738803",
"0.5702338",
"0.5662434",
"0.56590253",
"0.5649719",
"0.56435597"
]
| 0.68787473 | 0 |
Sanitize number of decimals setting field. 1. User can only set absolute integer value as number of decimals. 2. number_decimals setting will be zero if no decimal separator defined | function __give_sanitize_number_decimals_setting_field( $value ) {
$value_changed = false;
$show_notice = false;
$old_value = $value;
if ( isset( $_POST['decimal_separator'] ) ) {
$value = ! empty( $_POST['decimal_separator'] ) ? $value : 0;
$value_changed = true;
}
if ( $value_changed && ( $old_value !== $value ) ) {
Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give' ) );
}
$value = absint( $value );
$is_currency_set_to_bitcoin = ( 'BTC' === give_get_option( 'currency' ) && ! isset( $_POST['currency'] ) ) || 'BTC' === $_POST['currency'];
if ( $is_currency_set_to_bitcoin && 8 < $value) {
$value = 8;
$show_notice = true;
}elseif ( ! $is_currency_set_to_bitcoin && 6 <= $value ) {
$value = 5;
$show_notice = true;
}
if( $show_notice ) {
Give_Admin_Settings::add_error(
'give-number-decimal',
sprintf(
__( 'The \'Number of Decimals\' option has been automatically set to %s because you entered a number higher than the maximum allowed.', 'give' ),
$value
)
);
}
return absint( $value );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __give_validate_decimal_separator_setting_field( $value ) {\n\t$thousand_separator = isset( $_POST['thousands_separator'] ) ? give_clean( $_POST['thousands_separator'] ) : '';\n\t$decimal_separator = isset( $_POST['decimal_separator'] ) ? give_clean( $_POST['decimal_separator'] ) : '';\n\n\tif ( $decimal_separator === $thousand_separator ) {\n\t\t$value = '';\n\t\t$_POST['number_decimals'] = 0;\n\t\tGive_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \\'Decimal Separator\\' option has automatically been set to empty because it can not be equal to the \\'Thousand Separator\\'', 'give' ) );\n\t}\n\n\treturn $value;\n}",
"function lalita_sanitize_decimal_integer( $input ) {\n\t\treturn abs( floatval( $input ) );\n\t}",
"function decimal($value) {\n return preg_replace('/\\.0+$/', '', $value);\n }",
"function cfc_edd_remove_decimals( $decimals ) {\n \n\treturn 0;\n}",
"static function decimal($value){\n\t\t$v = strpos($value, \",\");\n\t\t$p = strpos($value, \".\");\n\t\tif($v === false && $p === false){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\n\t\t}elseif($v !== false && $p === false){ // Virgula no separador decimal e sem separador de milhar\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($v === false && $p !== false){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\n\t\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\n\t\t\t$value = str_replace(\".\", \"\", $value);\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\n\t\t\t$value = str_replace(\",\", \"\", $value);\n\t\t}\n\t\tif(is_numeric($value)){\n\t\t\treturn $value;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"function vcex_validate_px_pct( $input ) {\n\tif ( ! $input ) {\n\t\treturn;\n\t}\n\tif ( 'none' === $input || '0px' === $input ) {\n\t\treturn '0';\n\t}\n\tif ( strpos( $input, '%' ) ) {\n\t\treturn wp_strip_all_tags( $input );\n\t}\n\tif ( $input = floatval( $input ) ) {\n\t\treturn wp_strip_all_tags( $input ) . 'px';\n\t}\n}",
"public function decimalsNotSet()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertEquals(1.564, $floatFilter->execute('1.564'));\n }",
"function sanitize_floats($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n}",
"public function sanitize($value) {\r\n\t\treturn is_numeric($value)\r\n\t\t\t? number_format((float)$value, 10, '.', '')\r\n\t\t\t: $this->escape($value);\r\n\t}",
"static public function Decimal($var, $flags = null) {\r\n\t\t\r\n\t\t$cleaned = filter_var($var, FILTER_SANITIZE_NUMBER_FLOAT, $flags | FILTER_FLAG_ALLOW_FRACTION);\r\n\t\treturn $cleaned == \"\" ? false : (float)$cleaned;\r\n\t\t\r\n\t}",
"function tc_sanitize_number( $value) {\r\n $value = esc_attr( $value); // clean input\r\n $value = (int) $value; // Force the value into integer type.\r\n return ( 0 < $value ) ? $value : null;\r\n }",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}",
"function getDecimals(): ?int;",
"protected function formatDefault()\n {\n return (false !== filter_var($this->input, FILTER_VALIDATE_FLOAT));\n }",
"function acadp_sanitize_amount( $amount, $currency_settings = array() ) {\n\n\t$is_negative = false;\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$thousands_sep = ! empty( $currency_settings[ 'thousands_separator' ] ) ? $currency_settings[ 'thousands_separator' ] : ',';\n\t$decimal_sep = ! empty( $currency_settings[ 'decimal_separator' ] ) ? $currency_settings[ 'decimal_separator' ] : '.';\n\n\t// Sanitize the amount\n\tif( $decimal_sep == ',' && false !== ( $found = strpos( $amount, $decimal_sep ) ) ) {\n\t\tif( ( $thousands_sep == '.' || $thousands_sep == ' ' ) && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t\t} else if( empty( $thousands_sep ) && false !== ( $found = strpos( $amount, '.' ) ) ) {\n\t\t\t$amount = str_replace( '.', '', $amount );\n\t\t}\n\n\t\t$amount = str_replace( $decimal_sep, '.', $amount );\n\t} else if( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t}\n\n\tif( $amount < 0 ) {\n\t\t$is_negative = true;\n\t}\n\n\t$amount = preg_replace( '/[^0-9\\.]/', '', $amount );\n\t$decimals = acadp_currency_decimal_count( 2, $currency );\n\t$amount = number_format( (double) $amount, $decimals, '.', '' );\n\n\tif( $is_negative ) {\n\t\t$amount *= -1;\n\t}\n\n\treturn apply_filters( 'acadp_sanitize_amount', $amount );\n\n}",
"function Cantidades_cd($valor){\t\n\n return number_format($valor,3,',','.');\n\n}",
"function Cantidades_sd($valor){\t\n\n return number_format($valor,0,',','.');\n\n}",
"function sanitize_float( $value, $key, array $data ) {\n\treturn (float) $value;\n}",
"function store_parse_decimal($value)\n {\n $point = config_item('store_currency_dec_point');\n $cleaned_value = preg_replace('/[^0-9\\-'.preg_quote($point, '/').']+/', '', $value);\n\n return str_replace($point, '.', $cleaned_value);\n }",
"function test_post_value_validation_sanitization_order() {\n\t\t$default_value = '0';\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$this->assertEquals( $post_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $post_value, $setting->post_value( $default_value ) );\n\t}",
"public static function decimal() {}",
"function test_validate_setting_values_validation_sanitization_order() {\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );\n\t\t$this->assertCount( 1, $validities );\n\t\t$this->assertEquals( array( 'numeric' => true ), $validities );\n\t}",
"public function param_decimal_places( $value = 0 )\n\t{\n\t\treturn array(\n\t\t\t'input' \t\t=> form_input('decimal_places', $value),\n\t\t\t'instructions'\t=> $this->CI->lang->line('decimal.decimal_places_instruction')\n\t\t);\n\t}",
"function FormataValor4($valor) {\r\n if ($valor != \"\" && !is_null($valor)) {\r\n return number_format($valor, 4, ',', '.');\r\n } else {\r\n return \"\";\r\n }\r\n}",
"function value_numeric($value){\r\n\t$value = trim($value);\r\n\t$v = strpos($value, \",\");\r\n\t$p = strpos($value, \".\");\r\n\tif($v === FALSE && $p === FALSE){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\r\n\t}elseif($v !== FALSE && $p === FALSE){ // Virgula no separador decimal e sem separador de milhar\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($v === FALSE && $p !== FALSE){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\r\n\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\r\n\t\t$value = str_replace(\".\", \"\", $value);\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\r\n\t\t$value = str_replace(\",\", \"\", $value);\r\n\t}\r\n//\tif((string)(float) $value == $value){\r\n\tif(is_numeric($value)){\r\n\t\tif(strcmp($value, round($value)) == 0 && $value < 2147483647){\r\n\t\t\t$value = (int) $value;\r\n\t\t}else{\r\n\t\t\t$value = (float) $value;\r\n\t\t}\r\n\t\treturn $value;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}",
"function sanitize_numbers($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n}",
"function paces_filter_price_text( $price ){\n $price = floatval( $price );\n $parts = explode( '.', (string)$price );\n\n if ( empty( $parts[1] ) ) {\n return $price;\n }\n if ( strlen( $parts[1] ) == 1 ) {\n $price = (string)$price . '0';\n }\n return $price;\n}",
"function opaljob_get_price_decimals() {\n return absint( opaljob_options( 'price_num_decimals', 2 ) );\n}",
"private function prep($value, $decimals = 0)\n\t{\n\t\treturn number_format((float) str_replace(',', '', $value), (int) $decimals, '.', false);\n\t}"
]
| [
"0.72048926",
"0.68482286",
"0.6499069",
"0.6497964",
"0.63227403",
"0.6210971",
"0.6199392",
"0.616552",
"0.60854816",
"0.59837306",
"0.59796643",
"0.59534365",
"0.59125394",
"0.5911606",
"0.58857584",
"0.5867944",
"0.58663374",
"0.58385867",
"0.5838353",
"0.58362997",
"0.5827257",
"0.5813845",
"0.5695207",
"0.56864583",
"0.56852645",
"0.56464636",
"0.5640038",
"0.56175923",
"0.5591202",
"0.55722654"
]
| 0.80446655 | 0 |
Sanitize number of decimals setting field. 1. User can only set absolute integer value as number of decimals. 2. number_decimals setting will be zero if no decimal separator defined | function __give_validate_decimal_separator_setting_field( $value ) {
$thousand_separator = isset( $_POST['thousands_separator'] ) ? give_clean( $_POST['thousands_separator'] ) : '';
$decimal_separator = isset( $_POST['decimal_separator'] ) ? give_clean( $_POST['decimal_separator'] ) : '';
if ( $decimal_separator === $thousand_separator ) {
$value = '';
$_POST['number_decimals'] = 0;
Give_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give' ) );
}
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __give_sanitize_number_decimals_setting_field( $value ) {\n\t$value_changed = false;\n\t$show_notice = false;\n\t$old_value = $value;\n\n\tif ( isset( $_POST['decimal_separator'] ) ) {\n\t\t$value = ! empty( $_POST['decimal_separator'] ) ? $value : 0;\n\t\t$value_changed = true;\n\t}\n\n\tif ( $value_changed && ( $old_value !== $value ) ) {\n\t\tGive_Admin_Settings::add_error( 'give-number-decimal', __( 'The \\'Number of Decimals\\' option has been automatically set to zero because the \\'Decimal Separator\\' is not set.', 'give' ) );\n\t}\n\n\t$value = absint( $value );\n\t$is_currency_set_to_bitcoin = ( 'BTC' === give_get_option( 'currency' ) && ! isset( $_POST['currency'] ) ) || 'BTC' === $_POST['currency'];\n\n\tif ( $is_currency_set_to_bitcoin && 8 < $value) {\n\t\t$value = 8;\n\t\t$show_notice = true;\n\t}elseif ( ! $is_currency_set_to_bitcoin && 6 <= $value ) {\n\t\t$value = 5;\n\t\t$show_notice = true;\n\t}\n\n\tif( $show_notice ) {\n\t\tGive_Admin_Settings::add_error(\n\t\t\t'give-number-decimal',\n\t\t\tsprintf(\n\t\t\t\t__( 'The \\'Number of Decimals\\' option has been automatically set to %s because you entered a number higher than the maximum allowed.', 'give' ),\n\t\t\t\t$value\n\t\t\t)\n\t\t);\n\t}\n\n\treturn absint( $value );\n}",
"function lalita_sanitize_decimal_integer( $input ) {\n\t\treturn abs( floatval( $input ) );\n\t}",
"function decimal($value) {\n return preg_replace('/\\.0+$/', '', $value);\n }",
"function cfc_edd_remove_decimals( $decimals ) {\n \n\treturn 0;\n}",
"static function decimal($value){\n\t\t$v = strpos($value, \",\");\n\t\t$p = strpos($value, \".\");\n\t\tif($v === false && $p === false){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\n\t\t}elseif($v !== false && $p === false){ // Virgula no separador decimal e sem separador de milhar\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($v === false && $p !== false){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\n\t\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\n\t\t\t$value = str_replace(\".\", \"\", $value);\n\t\t\t$value = str_replace(\",\", \".\", $value);\n\t\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\n\t\t\t$value = str_replace(\",\", \"\", $value);\n\t\t}\n\t\tif(is_numeric($value)){\n\t\t\treturn $value;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}",
"function vcex_validate_px_pct( $input ) {\n\tif ( ! $input ) {\n\t\treturn;\n\t}\n\tif ( 'none' === $input || '0px' === $input ) {\n\t\treturn '0';\n\t}\n\tif ( strpos( $input, '%' ) ) {\n\t\treturn wp_strip_all_tags( $input );\n\t}\n\tif ( $input = floatval( $input ) ) {\n\t\treturn wp_strip_all_tags( $input ) . 'px';\n\t}\n}",
"public function decimalsNotSet()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertEquals(1.564, $floatFilter->execute('1.564'));\n }",
"function sanitize_floats($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);\n}",
"public function sanitize($value) {\r\n\t\treturn is_numeric($value)\r\n\t\t\t? number_format((float)$value, 10, '.', '')\r\n\t\t\t: $this->escape($value);\r\n\t}",
"static public function Decimal($var, $flags = null) {\r\n\t\t\r\n\t\t$cleaned = filter_var($var, FILTER_SANITIZE_NUMBER_FLOAT, $flags | FILTER_FLAG_ALLOW_FRACTION);\r\n\t\treturn $cleaned == \"\" ? false : (float)$cleaned;\r\n\t\t\r\n\t}",
"function tc_sanitize_number( $value) {\r\n $value = esc_attr( $value); // clean input\r\n $value = (int) $value; // Force the value into integer type.\r\n return ( 0 < $value ) ? $value : null;\r\n }",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"function carton_format_decimal( $number, $dp = '' ) {\n\tif ( $dp == '' )\n\t\t$dp = intval( get_option( 'carton_price_num_decimals' ) );\n\n\t$number = number_format( (float) $number, (int) $dp, '.', '' );\n\n\tif ( strstr( $number, '.' ) )\n\t\t$number = rtrim( rtrim( $number, '0' ), '.' );\n\n\treturn $number;\n}",
"function getDecimals(): ?int;",
"protected function formatDefault()\n {\n return (false !== filter_var($this->input, FILTER_VALIDATE_FLOAT));\n }",
"function acadp_sanitize_amount( $amount, $currency_settings = array() ) {\n\n\t$is_negative = false;\n\n\tif( empty( $currency_settings ) ) {\n\t\t$currency_settings = get_option( 'acadp_currency_settings' );\n\t}\n\n\t$currency = ! empty( $currency_settings[ 'currency' ] ) ? $currency_settings[ 'currency' ] : 'USD';\n\t$thousands_sep = ! empty( $currency_settings[ 'thousands_separator' ] ) ? $currency_settings[ 'thousands_separator' ] : ',';\n\t$decimal_sep = ! empty( $currency_settings[ 'decimal_separator' ] ) ? $currency_settings[ 'decimal_separator' ] : '.';\n\n\t// Sanitize the amount\n\tif( $decimal_sep == ',' && false !== ( $found = strpos( $amount, $decimal_sep ) ) ) {\n\t\tif( ( $thousands_sep == '.' || $thousands_sep == ' ' ) && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t\t} else if( empty( $thousands_sep ) && false !== ( $found = strpos( $amount, '.' ) ) ) {\n\t\t\t$amount = str_replace( '.', '', $amount );\n\t\t}\n\n\t\t$amount = str_replace( $decimal_sep, '.', $amount );\n\t} else if( $thousands_sep == ',' && false !== ( $found = strpos( $amount, $thousands_sep ) ) ) {\n\t\t$amount = str_replace( $thousands_sep, '', $amount );\n\t}\n\n\tif( $amount < 0 ) {\n\t\t$is_negative = true;\n\t}\n\n\t$amount = preg_replace( '/[^0-9\\.]/', '', $amount );\n\t$decimals = acadp_currency_decimal_count( 2, $currency );\n\t$amount = number_format( (double) $amount, $decimals, '.', '' );\n\n\tif( $is_negative ) {\n\t\t$amount *= -1;\n\t}\n\n\treturn apply_filters( 'acadp_sanitize_amount', $amount );\n\n}",
"function Cantidades_cd($valor){\t\n\n return number_format($valor,3,',','.');\n\n}",
"function Cantidades_sd($valor){\t\n\n return number_format($valor,0,',','.');\n\n}",
"function sanitize_float( $value, $key, array $data ) {\n\treturn (float) $value;\n}",
"function store_parse_decimal($value)\n {\n $point = config_item('store_currency_dec_point');\n $cleaned_value = preg_replace('/[^0-9\\-'.preg_quote($point, '/').']+/', '', $value);\n\n return str_replace($point, '.', $cleaned_value);\n }",
"function test_post_value_validation_sanitization_order() {\n\t\t$default_value = '0';\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$this->assertEquals( $post_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $post_value, $setting->post_value( $default_value ) );\n\t}",
"public static function decimal() {}",
"function test_validate_setting_values_validation_sanitization_order() {\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );\n\t\t$this->assertCount( 1, $validities );\n\t\t$this->assertEquals( array( 'numeric' => true ), $validities );\n\t}",
"public function param_decimal_places( $value = 0 )\n\t{\n\t\treturn array(\n\t\t\t'input' \t\t=> form_input('decimal_places', $value),\n\t\t\t'instructions'\t=> $this->CI->lang->line('decimal.decimal_places_instruction')\n\t\t);\n\t}",
"function FormataValor4($valor) {\r\n if ($valor != \"\" && !is_null($valor)) {\r\n return number_format($valor, 4, ',', '.');\r\n } else {\r\n return \"\";\r\n }\r\n}",
"function value_numeric($value){\r\n\t$value = trim($value);\r\n\t$v = strpos($value, \",\");\r\n\t$p = strpos($value, \".\");\r\n\tif($v === FALSE && $p === FALSE){ // Valor inteiro sem separador de decimal e milhar (nao precisa de tratamento)\r\n\t}elseif($v !== FALSE && $p === FALSE){ // Virgula no separador decimal e sem separador de milhar\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($v === FALSE && $p !== FALSE){ // Ponto no separador de decimal e sem separador de milhar (nao precisa de tratamento)\r\n\t}elseif($v > $p){ // Virgula no separador de decimal e ponto no separador de milhar\r\n\t\t$value = str_replace(\".\", \"\", $value);\r\n\t\t$value = str_replace(\",\", \".\", $value);\r\n\t}elseif($p > $v){ // Ponto no separador de decimal e virgula no separador de milhar\r\n\t\t$value = str_replace(\",\", \"\", $value);\r\n\t}\r\n//\tif((string)(float) $value == $value){\r\n\tif(is_numeric($value)){\r\n\t\tif(strcmp($value, round($value)) == 0 && $value < 2147483647){\r\n\t\t\t$value = (int) $value;\r\n\t\t}else{\r\n\t\t\t$value = (float) $value;\r\n\t\t}\r\n\t\treturn $value;\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}",
"function sanitize_numbers($value)\n{\n return filter_var($value, FILTER_SANITIZE_NUMBER_INT);\n}",
"function paces_filter_price_text( $price ){\n $price = floatval( $price );\n $parts = explode( '.', (string)$price );\n\n if ( empty( $parts[1] ) ) {\n return $price;\n }\n if ( strlen( $parts[1] ) == 1 ) {\n $price = (string)$price . '0';\n }\n return $price;\n}",
"function opaljob_get_price_decimals() {\n return absint( opaljob_options( 'price_num_decimals', 2 ) );\n}",
"private function prep($value, $decimals = 0)\n\t{\n\t\treturn number_format((float) str_replace(',', '', $value), (int) $decimals, '.', false);\n\t}"
]
| [
"0.8045165",
"0.6848316",
"0.64986145",
"0.64974153",
"0.6322584",
"0.6210658",
"0.6199345",
"0.6164471",
"0.60842675",
"0.59840935",
"0.59784377",
"0.59532434",
"0.5913547",
"0.59117573",
"0.58863515",
"0.58664244",
"0.58663183",
"0.58382094",
"0.5838093",
"0.58369416",
"0.58271474",
"0.58143216",
"0.5695235",
"0.56878287",
"0.5684871",
"0.56457865",
"0.5638535",
"0.561756",
"0.5592442",
"0.5572062"
]
| 0.7205414 | 1 |
Give merge the json data and setting data. | function give_import_core_settings_merge_data( $json_to_array, $type, $host_give_options ) {
if ( 'merge' === $type ) {
$json_to_array_merge = array_merge( $host_give_options, $json_to_array );
$json_to_array = $json_to_array_merge;
}
return $json_to_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function merge(&$data) {\n\t\tarray_merge($this->data, $data);\n\t}",
"public function setJSON($data) {\n\t\t$this->json = $data;\n\t}",
"public function merge($input)\n\t{\n\t\t$values = (array) json_decode($this->json);\n\n\t\t$values = array_merge($values, $input);\n\n\t\t$this->json = json_encode($values);\n\n\t\t$this->count = count($values);\n\n\t\t// add the new inputs to our existing object\n\t\t// or else our json representation will be\n\t\t// out of sync with our values on this FieldValue\n\t\tforeach ($input as $key => $value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}",
"public function merge() {}",
"public function setJson($data)\n {\n $this->data['json'] = $data;\n return $this;\n }",
"public function set(){\n\t\t\t//Get incoming data\t\t\n\t\t\t$data = $this->data;\n\t\t\t\n\t\t\t//what action are we taking?\n\t\t\t$action = $this->action;\n\t\t\t\n\t\t\t//What data set are we taking action on. \n\t\t\t$action_set = $action. '_set';\n\t\t\t\n\t\t\t//load keys from that data set. \n\t\t\t$keys = $this->$action_set;\n\t\t\t//dump( __LINE__, __METHOD__, $data ); \n\t\t\t\n\t\t\t//Now we start to build. \n\t\t\tforeach( $keys as $key ){\n\t\t\t\tif( !empty( $data[ $key ] ) ){\n\t\t\t\t\t$this->data_set[ $key ] = $data[ $key ];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( !empty( $data[ 'data' ] ) && is_array( $data[ 'data' ] ) ){\n\t\t\t\t\t//looking deeper into the source arrays for data that matches the requesting field.\n\t\t\n\t\t\t\t\t//first check if field is available in top level of nested array. \n\t\t\t\t\tif( !empty( $data[ 'data' ][ $key ] ) ){\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $key ];\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//else look deeper by referencing the first word of the key to find it's associated array. \n\t\t\t\t\t$pos = strpos( $key, '_' );\n\t\t\t\t\t$sub_arr = substr( $key, 0, $pos );\n\t\t\t\t\t\n\t\t\t\t\tif( !isset( $data[ 'data' ][ $sub_arr ] ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t \n\t\t\t\t\tif( is_array( $data[ 'data' ][ $sub_arr ] ) ){\n\t\t\t\t\t\t$sub_key = substr( $key, $pos + 1 );\t\t\t\t\t\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $sub_arr ][ $sub_key ] ?? '';\n\t\t\t\t\t\tcontinue;\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/* if( strcmp( $key, 'src_data' ) === 0 ){\n\t\t\t\t\t$this->data_set[ 'src_data' ] = $data;\n\t\t\t\t\tcontinue;\n\t\t\t\t} */\n\t\t\t\t\n\t\t\t\t$this->data_set[ $key ] = '';\n\t\t\t}\t\n\t\t\t\n\t\t\t\n\t\t\t//The final data set is specific to the initiating action being performed \n\t\t\t//$this->data_set = $this->$action();\n\t\t\t\n\t\t\treturn true;\n\t\t}",
"public function setJsonData($data)\n {\n foreach ($data as $key => $datum) {\n $this->setData($this->_underscore($key), $datum);\n }\n\n return $this;\n }",
"protected function mapJson() {\n $post = json_decode(file_get_contents('php://input'), true);\n if(is_null($post)) return;\n foreach($post as $key => $value) {\n $this->data[$key] = $value;\n }\n }",
"public function mergeData($data) {\n if (empty($data)) return $this;\n\t\tforeach($data as $key=>$value) {\n\t\t\tif ((!array_key_exists($key, $this->_data) && ($key != $this->_key_field)) ||\n ($key != $this->_key_field) &&\n ($value != $this->_data[$key]) &&\n (isset($this->_structure['columns'][$key])\n || isset($this->_structure['relations'][$key])\n || isset($this->_structure['abilities'][$key]))) {\n $this->offsetSet($key, $value);\n } else {\n unset($data[$key]);\n }\n\t\t}\n return $this;\n\t}",
"private function _mergeSuperposable($data)\n {\n return ($data['data']);\n }",
"public static function importJson() {\n\t if(self::isJson()) {\n\t foreach (self::getJson() as $name => $value) {\n\t $_REQUEST[$name] = $value;\n\t }\n\t }\n\t}",
"public function merge()\n {\n $args = func_get_args();\n array_unshift($args, $this->data);\n $this->data = call_user_func_array('array_merge', $args);\n\n return $this; \n }",
"public function setData() \n {\n $serverNames = [];\n foreach($this->_jsonRequestedArr as $k=>$obj) {\n $serverNames[] = $obj->s_system;\n }\n $this->_jsonResponseArr[\"server_list\"] = $serverNames;\n }",
"public function mergeData($data1, $data2, &$result) {\n $result = $data1;\n\n if (isset($data2['overlays'])) {\n if ($data2['overlays']) {\n $result['overlays'] = $data2['overlays'];\n/* TODO: Decide what 'merge' means for overlays...\n foreach ($data2['overlays'] as $id=>$content) {\n $result['overlays'][$id] = $content;\n }\n*/\n } else {\n unset($result['overlays']);\n }\n }\n if (isset($data2['crawlers'])) {\n if ($data2['crawlers']) {\n $result['crawlers'] = $data2['crawlers'];\n/* TODO: Decide what 'merge' means for crawlers...\n foreach ($data2['crawlers'] as $id=>$content) {\n $result['crawlers'][$id] = $content;\n }\n*/\n } else {\n unset($result['crawlers']);\n }\n }\n if (isset($data2['pip'])) {\n if ($data2['pip']) {\n $result['pip'] = $data2['pip'];\n } else {\n unset($result['pip']);\n }\n }\n if (isset($data2['click_url'])) {\n if ($data2['click_url']) {\n $result['click_url'] = $data2['click_url'];\n } else {\n unset($result['click_url']);\n }\n }\n return null;\n }",
"public function setdefaultvalues(array $data,$type) \n {\n\n $defualtjsoncontent = json_decode(Storage::disk('local')->get('constants/defaultjson.json'), true);\n \n \n // $defualtjsoncontent->Header->style->language=$type;\n // if($type=\"en\"){\n // $defualtjsoncontent->Header->style->flxdir=\"row\";\n // $defualtjsoncontent->Header->style->direction=\"left\";\n // }else if($type=\"ar\"){\n // $defualtjsoncontent->Header->style->flxdir=\"row-reverse\";\n // $defualtjsoncontent->Header->style->direction=\"right\";\n // }\n \n\n \n $data['sitejson']=$defualtjsoncontent;\n $data['name']=$data['siteurl'];\n $data['enid']=null;\n $data['arid']=null;\n $data['about']=null;\n $data['web']=null;\n $data['email']=null;\n $data['address']=null;\n $data['telephone']=null;\n $data['telephone1']=null;\n $data['orders']='{}';\n $data['reservations']='{}';\n $data['status']=null;\n\n return $data;\n }",
"public function merge( array $data )\n\t\t{\n\t\t\t$this->_data = \\array_merge( $this->_data, $data );\n\t\t\treturn $this;\t\n\t\t}",
"public function setJson($key, $data)\n {\n \n $this->synchronized = false;\n $this->data[$key] = json_encode($data);\n \n }",
"protected function prepareJsonStructure(){\n\t\t\n\t}",
"public function setData() {\n\t\t$this->import($this->get());\n\t}",
"public function merge();",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }",
"function padma_merge_options($data){\n\n if(!empty(get_option('padma_communication_username'))){\n $data = array_merge(array('padma_username' => get_option('padma_communication_username')),$data);\n }\n\n if(!empty(get_option('padma_api_key'))){\n $data = array_merge($data,array('api_key' => get_option('padma_api_key')));\n }\n\n if(!empty(get_option('padma_site_name'))){\n $data = array_merge($data,array('contacted_from_site' => get_option('padma_site_name')));\n }\n\n return $data;\n}",
"public function merge( $data )\r\n {\r\n if (! empty( $data['items'] ))\r\n {\r\n foreach ( $data['items'] as $data_key => $data_item )\r\n {\r\n // does it exist in $this? if so, merge\r\n $exists = false;\r\n foreach ( $this->items as $key => $item )\r\n {\r\n if ($item['hash'] == $data_item['hash'])\r\n {\r\n $exists = true;\r\n $data_item['id'] = $item['id'];\r\n $this->items[$key] = $data_item;\r\n break;\r\n }\r\n }\r\n \r\n // otherwise add it\r\n if (! $exists)\r\n {\r\n $this->items[] = $data_item;\r\n }\r\n }\r\n \r\n $this->save();\r\n }\r\n \r\n return $this;\r\n }",
"abstract protected function getAdditionalJsonData(): array;",
"private function setAssetsFromData()\n {\n if (is_array($this->assetData)) {\n $assets = $this->grav['assets'];\n foreach ($this->assetData as $item) {\n $assetType = $item['type'];\n if ($assetType == 'css') {\n $assets->addCss($item['data']);\n } elseif ($assetType == 'js') {\n $assets->addJs($item['data'], $item['prio'], true, null, $item['where']);\n } elseif ($assetType == 'inlinejs') {\n $assets->addInlineJs($item['data'], $item['prio'], $item['where']);\n }\n }\n }\n }",
"public function mergeData(array ...$data)\n {\n return $this->setData(array_replace($this->getData(true), ...$data));\n }",
"function _wp_json_prepare_data($data)\n {\n }",
"protected function setJSON($json){\n\t\t$this->json = $json;\n\t}",
"public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }"
]
| [
"0.60601914",
"0.60102445",
"0.5903409",
"0.5755792",
"0.57529503",
"0.5749398",
"0.57249695",
"0.5715903",
"0.57078546",
"0.5655994",
"0.5648736",
"0.564348",
"0.56384003",
"0.56372446",
"0.56349105",
"0.56288904",
"0.55645573",
"0.5561464",
"0.5482028",
"0.54698884",
"0.5458335",
"0.5445901",
"0.5415803",
"0.536433",
"0.5363805",
"0.53476095",
"0.53464216",
"0.5343598",
"0.5330212",
"0.5290347"
]
| 0.610104 | 0 |
Backward Compatibility Cleanup User Roles. | function give_bc_1817_cleanup_user_roles( $caps ) {
if (
! give_has_upgrade_completed( 'v1817_cleanup_user_roles' ) &&
! isset( $caps['view_give_payments'] )
) {
give_v1817_process_cleanup_user_roles();
}
return $caps;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n\n if ( $this->role_exists( 'customer' ) ) {\n remove_role( 'customer' );\n }\n\n if ( $this->role_exists( 'shop_manager' ) ) {\n remove_role( 'shop_manager' );\n }\n }",
"function egsr_remove_wp_roles(){\n $wp_roles = new WP_Roles();\n // $wp_site_roles = egsr_custom_site_roles();\n $wp_site_roles = egsr_default_wp_site_roles();\n foreach ($wp_site_roles as $key => $value) {\n $role = get_role($key);\n if(isset($role->name) == $key){ // Check if Role exists already\n $wp_roles->remove_role($key); // Remove role + capabilities\n }\n }\n}",
"public function revokeAllRoles ();",
"function get_user_roles()\n{\n $roles = get_acl()->getRoles();\n foreach ($roles as $key => $val) {\n $roles[$val] = __(Inflector::humanize($val));\n unset($roles[$key]);\n }\n return $roles;\n}",
"function hook_roles() {\n\t\treturn null;\n\t}",
"private function remove_old_roles(){\n\t\t// If empty return true\n\t\tif( empty( $this->old_roles ) ) return true;\n\t\t/**\n\t\t * Loop through and remove the old roles\n\t\t * We are dropping them all, even if they are in the New Roles list\n\t\t * So that we can keep our capabilities up to date\n\t\t **/\n\t\tarray_walk( $this->old_roles, function( $role ){\n\t\t\tif( $role !== 'administrator' ) $this->wp_roles->remove_role( $role );\n\t\t});\n\t}",
"public function removeRoles() {\n $this->roles()->detach();\n }",
"function reset_role( $role ) {\n $default_roles = array(\n 'administrator' => array(\n 'switch_themes' => 1,\n 'edit_themes' => 1,\n 'activate_plugins' => 1,\n 'edit_plugins' => 1,\n 'edit_users' => 1,\n 'edit_files' => 1,\n 'manage_options' => 1,\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'import' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_10' => 1,\n 'level_9' => 1,\n 'level_8' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n 'delete_users' => 1,\n 'create_users' => 1,\n 'unfiltered_upload' => 1,\n 'edit_dashboard' => 1,\n 'update_plugins' => 1,\n 'delete_plugins' => 1,\n 'install_plugins' => 1,\n 'update_themes' => 1,\n 'install_themes' => 1,\n 'update_core' => 1,\n 'list_users' => 1,\n 'remove_users' => 1,\n 'add_users' => 1,\n 'promote_users' => 1,\n 'edit_theme_options' => 1,\n 'delete_themes' => 1,\n 'export' => 1,\n ),\n \n 'editor' => array(\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n ),\n \n 'author' => array(\n 'upload_files' => 1,\n 'edit_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'read' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n 'delete_published_posts' => 1,\n ),\n \n 'contributor' => array(\n 'edit_posts' => 1,\n 'read' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n ),\n \n 'subscriber' => array(\n 'read' => 1,\n 'level_0' => 1,\n ),\n \n 'display_name' => array(\n 'administrator' => 'Administrator',\n 'editor'\t=> 'Editor',\n 'author'\t=> 'Author',\n 'contributor' => 'Contributor',\n 'subscriber'\t=> 'Subscriber',\n ),\n \n );\n \n $role = strtolower( $role );\n \n remove_role( $role );\n \n return add_role( $role, $default_roles['display_name'][$role], $default_roles[$role] );\n}",
"public function uninstall()\r\n {\r\n // Remove Roles\r\n $objRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n $objSingleSiteInstall->dropTables();\r\n }",
"function egsr_deactivation(){\n egsr_add_default_wp_roles();\n}",
"function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"public function checkRoles() {\n global $wp_roles;\n $settings = $this->getSettings();\n $rolesNew = explode(',', $settings->rolesAllowed);\n foreach ($wp_roles->roles as $key => $role) {\n if (strtolower($role['name']) != 'administrator') {\n $name = strtolower($role['name']);\n $name = str_replace(\" \", \"_\", $name);\n if (in_array($key, $rolesNew) || $role['name'] == \"Chat Operator\") {\n $wp_roles->add_cap($key, 'visual_chat');\n } else {\n $wp_roles->remove_cap($key, 'visual_chat');\n }\n }\n }\n }",
"function _muckypup_database_get_roles () {\n\n\t$roles = array ();\n\t$user_roles = user_roles();\n\t\n\tunset ($user_roles[1]); // Deleting anonymous role. By default at index 1.\n\tunset ($user_roles[2]); // Deleting authenticated role. By default at index 2.\n\t\n\tforeach ($user_roles as $rid=>$user_role) {\n\t\t$roles[$rid] = $user_role;\n\t}\n\n\treturn $roles;\n}",
"function remove_role($role)\n {\n }",
"function editable_roles( $roles ){\n if( isset( $roles['administrator'] ) && !current_user_can('administrator') ){\n unset( $roles['administrator']);\n }\n return $roles;\n }",
"function populate_roles()\n {\n }",
"public function rolesForUser();",
"public function tearDown()\n {\n RolesProvider::store(null);\n }",
"function exchange_remove_user_management_for_editors() {\n\t$role = get_role( 'editor' );\n\t$caps = exchange_get_user_caps();\n\tforeach ( $caps as $cap ) {\n\t\t$role->remove_cap( $cap );\n\t}\n}",
"public function testRemoveUserRole()\n {\n $data = ['role' => 'administrator'];\n\n $this->removeUserRole($this->user->id, $data)\n ->assertRedirect();\n\n $this->assertNull(\n $this->user->roles()->where('name', $data['role'])->first()\n );\n }",
"function wp_roles()\n {\n }",
"public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }",
"public function removing_user_from_role_works()\n {\n $this->withoutExceptionHandling();\n\n $user = $this->createAdminUser();\n $admin = $this->createAdminUser();\n\n $response = $this->actingAs($admin)->get(route('remove-role', ['id' => $user->id, 'role' => 1]));\n\n $response->assertStatus(200);\n $response->assertViewIs('site.confirm');\n\n $See[] = $user->name;\n $See[] = __('user.confirm_remove_button');\n\n $response->assertSeeInOrder($See);\n\n $response = $this->actingAs($admin)->post(route('remove-role', ['id' => $user->id, 'role' => 1]), ['confirm' => true]);\n\n $data['user_id'] = $user->id;\n $data['role_id'] = 1;\n\n $this->assertDatabaseMissing('user_role', $data);\n\n $response->assertRedirect(route('profile', $user->id));\n }",
"function populate_roles_270()\n {\n }",
"function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NULL) {\n\n global $USER, $CFG;\n\n $success = true;\n\n $args = array('roleid', 'userid', 'groupid', 'contextid');\n $select = array();\n foreach ($args as $arg) {\n if ($$arg) {\n $select[] = $arg.' = '.$$arg;\n }\n }\n if (!empty($enrol)) {\n $select[] = \"enrol='$enrol'\";\n }\n\n if ($select) {\n if ($ras = get_records_select('role_assignments', implode(' AND ', $select))) {\n $mods = get_list_of_plugins('mod');\n foreach($ras as $ra) {\n /// infinite loop protection when deleting recursively\n if (!$ra = get_record('role_assignments', 'id', $ra->id)) {\n continue;\n }\n $success = delete_records('role_assignments', 'id', $ra->id) and $success;\n\n /// If the user is the current user, then reload the capabilities too.\n if (!empty($USER->id) && $USER->id == $ra->userid) {\n load_all_capabilities();\n }\n $context = get_record('context', 'id', $ra->contextid);\n\n /// Ask all the modules if anything needs to be done for this user\n foreach ($mods as $mod) {\n include_once($CFG->dirroot.'/mod/'.$mod.'/lib.php');\n $functionname = $mod.'_role_unassign';\n if (function_exists($functionname)) {\n $functionname($ra->userid, $context); // watch out, $context might be NULL if something goes wrong\n }\n }\n\n /// now handle metacourse role unassigment and removing from goups if in course context\n if (!empty($context) and $context->contextlevel == CONTEXT_COURSE) {\n\n // cleanup leftover course groups/subscriptions etc when user has \n // no capability to view course\n // this may be slow, but this is the proper way of doing it\n if (!has_capability('moodle/course:view', $context, $ra->userid)) {\n // remove from groups\n if ($groups = get_groups($context->instanceid, $ra->userid)) {\n foreach ($groups as $group) {\n delete_records('groups_members', 'groupid', $group->id, 'userid', $ra->userid);\n }\n }\n\n // delete lastaccess records\n delete_records('user_lastaccess', 'userid', $ra->userid, 'courseid', $context->instanceid);\n }\n\n //unassign roles in metacourses if needed\n if ($parents = get_records('course_meta', 'child_course', $context->instanceid)) {\n foreach ($parents as $parent) {\n sync_metacourse($parent->parent_course);\n }\n }\n }\n }\n }\n }\n\n return $success;\n}",
"function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}",
"public function remove_caps_from_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\t\t$all_capabilities = array_filter(\n\t\t\t$all_capabilities,\n\t\t\tstatic fn( $value ) => 'read' !== $value\n\t\t);\n\t\t$all_roles = wp_roles();\n\t\t$roles = array_values( (array) $all_roles->role_objects );\n\t\tforeach ( $roles as $role ) {\n\t\t\tif ( $role instanceof WP_Role ) {\n\t\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t\t$role->remove_cap( $cap );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires when removing the custom capabilities from existing roles.\n\t\t *\n\t\t * Can be used to remove the capabilities from other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_remove_capabilities', $all_capabilities );\n\t}",
"public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}"
]
| [
"0.69304734",
"0.673484",
"0.66832054",
"0.6680316",
"0.6652304",
"0.664843",
"0.6646092",
"0.6592885",
"0.6541036",
"0.6473279",
"0.642679",
"0.6266308",
"0.617287",
"0.6122844",
"0.6119875",
"0.6119174",
"0.61001444",
"0.6074629",
"0.6038468",
"0.601349",
"0.6009126",
"0.5999506",
"0.5984069",
"0.5972401",
"0.59691215",
"0.5963714",
"0.5951424",
"0.59448725",
"0.593906",
"0.59359956"
]
| 0.6928653 | 1 |
Get the current table status | protected function status(string $table)
{
if(!$this->tableStatus)
{
$this->tableStatus = \adminer\table_status1($table, true);
}
return $this->tableStatus;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatus()\n {\n $this->execute();\n \n return $this->status;\n }",
"public static function status()\n {\n return plexcel_status(self::getConnection());\n }",
"public function getCurrentTable() {}",
"public function getCurrentStatus()\n {\n return $this->currentStatus;\n }",
"public function tableStatus(): string\n {\n return sprintf(\n '<div class=\"table-status table-status-%s\">%s</div>',\n $this->status,\n config('status.options')[$this->status]\n );\n }",
"function getStatus()\n {\n if (!isset($this->bstatus) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->bstatus;\n }",
"function getStatus()\n {\n if (!isset($this->bstatus) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->bstatus;\n }",
"function getStatus() {\n\t\treturn $this->getData('status');\n\t}",
"public function status()\n {\n return $this->getStatus();\n }",
"public function status()\n {\n return $this->status->get($this->entity->status);\n }",
"public function getStatus()\r\n\t{\r\n\t\t$select\t= $this->_db->select()->from('Cron_Jobs', array('active'))->where('id = ?', $this->_getId());\r\n\t\t$status\t= $this->_db->fetchRow($select);\r\n\t\t\r\n\t\treturn $status['active'];\r\n\t}",
"public function status()\n {\n return $this->previousStatus;\n }",
"protected function getMessageStatusTable()\n {\n return $this->getTable('queue_message_status');\n }",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function get_status()\n {\n }",
"public function get_status()\n {\n }",
"public function getForDataTable()\n {\n return $this->status()->query()->withStatus();\n }",
"public function status()\n {\n return $this->status;\n }",
"protected static function status(): mixed\n\t{\n\t\treturn self::$query->status;\n\t}",
"public function getStatus()\n {\n return $this->getData('status');\n }",
"public function status() {\n\t\treturn $this->_status;\n\t}"
]
| [
"0.7441232",
"0.73778147",
"0.7285453",
"0.71327454",
"0.7065706",
"0.70638967",
"0.70638967",
"0.7062211",
"0.7007838",
"0.6988702",
"0.69833505",
"0.6983255",
"0.6980292",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6976606",
"0.6958806",
"0.6958806",
"0.6950106",
"0.6935302",
"0.6933313",
"0.6930761",
"0.69212663"
]
| 0.80175126 | 0 |
protection from creation through new Singleton | private function __clone() { /* ... @return Singleton */ } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __construct() { // singleton\n }",
"private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"private function __wakeup() { /* ... @return Singleton */ }",
"public static function getInstance(): self;",
"public function getInstance(): mixed;",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public static function getInstance();",
"public function getInstance(): object;",
"static public function getInstance() {\n return new static();\n }",
"public static function getInstance(){\n\n if(!(self::$_instance instanceof self))\n self::$_instance=new self();\n return self::$_instance;\n\n }",
"public static function getInstance() {\nstatic $instance;\n// Second call to this function will not get into the if-statement,\n// Because an instance of Singleton is now stored in the $instance\n// variable and is persisted through multiple calls\nif (!$instance) {\n// First call to this function will reach this line,\n// because the $instance has only been declared, not initialized\n$instance = new Singleton();\n} \nreturn $instance;\n}",
"public function __construct()\n {\n if (!self::$instance) {\n self::$instance = $this;\n //echo \"Create new object\";\n return self::$instance;\n } else {\n //echo \"Return old object\";\n return self::$instance;\n }\n }",
"public static abstract function createInstance();",
"function isSingleton(){\n return true;\n }"
]
| [
"0.7526285",
"0.73443913",
"0.73210305",
"0.73210305",
"0.73210305",
"0.73210305",
"0.73206085",
"0.73206085",
"0.73206085",
"0.7320445",
"0.7320445",
"0.7320445",
"0.7233613",
"0.71860725",
"0.7026312",
"0.7022457",
"0.7022457",
"0.7022457",
"0.7022457",
"0.7022457",
"0.7022457",
"0.7022457",
"0.7022457",
"0.69368124",
"0.6869013",
"0.6851894",
"0.6834429",
"0.6831588",
"0.68272185",
"0.6827144"
]
| 0.7382728 | 1 |
Add datetools variable Add datetools variable to twig templates for use in filtering collections | public function onTwigSiteVariables()
{
require_once __DIR__ . '/classes/datetools.php';
$args = [];
$args['config'] = $this->grav['config'];
$twig = $this->grav['twig'];
$twig->twig_vars['datetools'] = new DateTools($args);
//$twig->twig->addGlobal('datetools', new DateTools($args));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function twig_filter_sdate()\n\t{\n\t\treturn new \\Twig_SimpleFilter('sdate', function ($_string, $_max =\"day\", $_format =\"Y/m/d\")\n\t\t{\n\t\t\treturn \\lib\\utility::humanTiming($_string, $_max, $_format, $this->data->site['currentlang']);\n\t\t});\n\t}",
"public function twig_filter_tdate()\n\t{\n\t\treturn new \\Twig_SimpleFilter('tdate', function ($_string, $_format =\"Y/m/d\", $_convert = true)\n\t\t{\n\t\t\t$result = $_string;\n\t\t\tif($this->data->site['currentlang'] == 'fa')\n\t\t\t{\n\t\t\t\t$result = \\lib\\utility\\jdate::date($_format, $_string, $_convert);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = date($_format, strtotime($_string));\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t});\n\t}",
"public function twig_filter_jdate()\n\t{\n\t\treturn new \\Twig_SimpleFilter('jdate', function ($_string, $_format =\"Y/m/d\", $_convert = true)\n\t\t{\n\t\t\treturn \\lib\\utility\\jdate::date($_format, $_string, $_convert);\n\t\t});\n\t}",
"public function getFilters()\r\n {\r\n return array(\r\n 'localizeddate' => new Twig_Filter_Function('twig_localized_date_filter', array('needs_environment' => true)),\r\n );\r\n }",
"function template_date_select($params,&$smarty)\n {\n extract($params);\n \n if (empty($name)) {\n return;\n }\n \n $buffer = '<input type=\"text\" size=\"12\" maxlength=\"12\" name=\"'.$name.'\" value=\"'.$value.'\" /> (Format: mm/dd/yyyy)';\n return $buffer;\n }",
"function add_to_twig( $twig ) {\n\t\t// $twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t// $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"public function filter_timber_twig_add_functions( $twig ) {\n // Function to check if doing email and alternate strings\n $twig->addFunction( new \\Twig_SimpleFunction( 'if_email', function( $email_str, $standard_str ) {\n if ( $this->is_email() ) {\n return $email_str;\n }\n return $standard_str;\n } ) );\n\n // Get the current Unix epoch time in milliseconds\n $twig->addFunction( new \\Twig_SimpleFunction( 'now', function() {\n return round( microtime( true ) * 1000 );\n } ) );\n\n // Add WordPress' checked() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'checked', function( $checked, $current = true ) {\n return checked( $checked, $current );\n } ) );\n\n // Add WordPress' selected() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'selected', function( $selected, $current = true ) {\n return selected( $selected, $current );\n } ) );\n\n // Add WordPress' disabled() function to Twig\n $twig->addFunction( new \\Twig_SimpleFunction( 'disabled', function( $disabled, $current = true ) {\n return disabled( $disabled, $current );\n } ) );\n\n return $twig;\n }",
"public function stdWrap_dateDataProvider() {}",
"public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}",
"function add_to_twig($twig){\n\t\t$twig->addExtension(new Twig_Extension_StringLoader());\n\t\t// $twig->addFilter('myfoo', new Twig_Filter_Function('myfoo'));\n\t\treturn $twig;\n\t}",
"private function addTwigFunctions() : void {\n\t\t$msgFunc = new Twig_SimpleFunction( 'msg', function ( $key, $params = [] ) {\n\t\t\t$params = is_array( $params ) ? $params : [];\n\t\t\treturn $this->i18n->msg(\n\t\t\t\t$key, [ 'domain' => 'popular-pages', 'variables' => $params ]\n\t\t\t);\n\t\t} );\n\t\t$this->twig->addFunction( $msgFunc );\n\n\t\t// Fetching assessments info, case-insensitive.\n\t\t$assessmentFunc = new Twig_SimpleFunction(\n\t\t\t'assessments', function (\n\t\t\t\tstring $type, string $value\n\t\t\t) {\n\t\t\t\t$dataset = $this->api->getAssessmentConfig()[$type];\n\t\t\t\tforeach ( $dataset as $key => $values ) {\n\t\t\t\t\tif ( strtolower( $value ) === strtolower( $key ) ) {\n\t\t\t\t\t\treturn $values;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $dataset['Unknown'];\n\t\t\t} );\n\t\t$this->twig->addFunction( $assessmentFunc );\n\n\t\t// Add ucfirst() (Twig's capitalize() will make the other chars lowercase).\n\t\t$ucfirstFunc = new Twig_SimpleFilter( 'ucfirst', function ( string $value ) {\n\t\t\treturn ucfirst( $value );\n\t\t} );\n\t\t$this->twig->addFilter( $ucfirstFunc );\n\t}",
"function kcsite_add_events_date_filter() {\n\n\tglobal $wpdb, $wp_locale;\n\n\t$months = $wpdb->get_results( $wpdb->prepare( \"\n\t\tSELECT DISTINCT YEAR( meta_value ) AS year, MONTH( meta_value ) AS month\n\t\tFROM $wpdb->postmeta\n\t\tWHERE meta_key = %s\n\t\tORDER BY meta_value ASC\n\t\", '_EventStartDate' ) );\n\n\t$month_count = count( $months );\n\n\tif ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )\n\t\treturn;\n\n\t$m = isset( $_GET['_EventStartDate'] ) ? (int) $_GET['_EventStartDate'] : 0;\n\t?>\n\n\t<select id=\"EventStartDate-filter\" name='_EventStartDate'>\n\t\t<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Pasirinkite renginio datą' ); ?></option>\n\t<?php\n\tforeach ( $months as $arc_row ) {\n\t\tif ( 0 == $arc_row->year )\n\t\t\tcontinue;\n\n\t\t$month = zeroise( $arc_row->month, 2 );\n\t\t$year = $arc_row->year;\n\n\t\tprintf( \"<option %s value='%s'>%s</option>\\n\",\n\t\t\tselected( $m, $year . $month, false ),\n\t\t\tesc_attr( $arc_row->year . $month ),\n\t\t\t/* translators: 1: month name, 2: 4-digit year */\n\t\t\tsprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )\n\t\t);\n\t}\n\t?>\n\t</select>\n\t<?php\n}",
"public function getDateFilterHtml()\n {\n return $this->getChildHtml('date_filter');\n }",
"public function dateAction(Request $request)\n {\n $date = date('d M Y', time());\n\n return $this->render('default/date.html.twig', [ 'date' => $date]);\n }",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"function add_to_twig( $twig ) {\n\t\t$twig->addExtension( new Twig_Extension_StringLoader() );\n\t\t$twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));\n\t\treturn $twig;\n\t}",
"public function renderDefault()\n\t{\n\t\t$this->template->reservations = $this->reservations->findBy(array(),array('date' => 'DESC'));\n\n\t}",
"function twig_age_filter($birthdate)\n{\n if (!$birthdate instanceof \\DateTime) $birthdate = new \\DateTime($birthdate);\n $age = $birthdate->diff(new \\DateTime())->y;\n\n return $age;\n}",
"public function get_sidebar_dates(){\n\n $html = '<tr class=\"wm-widget-sub-title\"><td>Published:</td></tr><tr class=\"wm-widget-info\"><td>';\n $html .= get_the_date() . '</td></tr>';\n\n if( strtotime( get_the_date() ) < strtotime( get_the_modified_date() ) ){\n $html .= '<tr class=\"wm-widget-sub-title\"><td>Last Updated:</td></tr><tr class=\"wm-widget-info\"><td>';\n $html .= get_the_modified_date() . '</td></tr>';\n }\n\n return $html;\n }",
"public function getFilters()\n {\n return array_merge(parent::getFilters(), array(\n 'date' => new \\Twig_Filter_Function('ionic_date'),\n 'relativedate' => new \\Twig_Filter_Function('ionic_date_rel'),\n 'specialdate' => new \\Twig_Filter_Function('ionic_date_special'),\n 'url' => new \\Twig_Filter_Function('url'),\n 'nl2br_noescape' => new \\Twig_Filter_Function('nl2br'),\n 'limit' => new \\Twig_Filter_Function('Str::limit'),\n 'md5' => new \\Twig_Filter_Function('md5'),\n 'addslashes' => new \\Twig_Filter_Function('addslashes')\n ));\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 }",
"function embed_date_scripts() {\n\techo '<script>{';\n\t$suffix = 'min.js';\n\tif ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {\n\t\t$suffix = 'js';\n\t}\n\tinclude __DIR__ . '/js/frontend/date.' . $suffix;\n\techo '}</script>';\n}",
"function filterByDate($date) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_DATE);\n $this->setAdditionalProperty('date_filter_on', (string) $date);\n }",
"public function articles(){\n\n//j apelle ma constante depuis Service/ArticleHelper\n $articles = ArticlesHelper::articles;\n\n return $this->render(\"articles.html.twig\",[\n\n \"articles\"=> $articles\n ]);\n }",
"function tpl_item( $post, $include_date = true ) {\n\n\ttpl('item', 'default', array(\n\t\t'post' => $post\n\t) );\n\n}",
"function cmsmasters_post_date($template_type = 'page', $layout_type = 'default', $show = true) {\n\tif ($template_type == 'page') {\n\t\tif ($layout_type == 'masonry') {\n\t\t\t$out = '<span class=\"cmsmasters_post_date\">' . \n\t\t\t\t'<abbr class=\"published\" title=\"' . esc_attr(get_the_date()) . '\">' . \n\t\t\t\t\tesc_html(get_the_date()) . \n\t\t\t\t'</abbr>' . \n\t\t\t\t'<abbr class=\"dn date updated\" title=\"' . esc_attr(get_the_modified_date()) . '\">' . \n\t\t\t\t\tesc_html(get_the_modified_date()) . \n\t\t\t\t'</abbr>' . \n\t\t\t'</span>';\n\t\t} else {\n\t\t\t$out = '<span class=\"cmsmasters_post_date\">' . \n\t\t\t\t'<abbr class=\"published\" title=\"' . esc_attr(get_the_date()) . '\">' . \n\t\t\t\t\t'<span class=\"cmsmasters_day_mon\">' . esc_html(get_the_date('d.m')) . '</span>' . \n\t\t\t\t\t'<span class=\"cmsmasters_year\">' . esc_html(get_the_date('Y')) . '</span>' . \n\t\t\t\t'</abbr>' . \n\t\t\t\t'<abbr class=\"dn date updated\" title=\"' . esc_attr(get_the_modified_date()) . '\">' . \n\t\t\t\t\tesc_html(get_the_modified_date()) . \n\t\t\t\t'</abbr>' . \n\t\t\t'</span>';\n\t\t}\n\t} elseif ($template_type == 'post') {\n\t\t$cmsmasters_option = cmsmasters_get_global_options();\n\t\t\n\t\t$out = '';\n\t\t\n\t\tif ($cmsmasters_option[CMSMASTERS_SHORTNAME . '_blog_post_date']) {\n\t\t\t$out .= '<span class=\"cmsmasters_post_date\">' . \n\t\t\t\t'<abbr class=\"published\" title=\"' . esc_attr(get_the_date()) . '\">' . \n\t\t\t\t\tesc_html(get_the_date()) . \n\t\t\t\t'</abbr>' . \n\t\t\t\t'<abbr class=\"dn date updated\" title=\"' . esc_attr(get_the_modified_date()) . '\">' . \n\t\t\t\t\tesc_html(get_the_modified_date()) . \n\t\t\t\t'</abbr>' . \n\t\t\t'</span>';\n\t\t}\n\t}\n\t\n\t\n\tif ($show) {\n\t\techo $out;\n\t} else {\n\t\treturn $out;\n\t}\n}",
"function addSelectDate($title, $filter, $default = null) {\n\t\t\n\t\t$a = array();\n\t\t$a['id'] = 'filter_'.$filter;\n\t\t$name = 'filters['.$filter.']';\n\n\t\t$display_date = null;\n\t\t\n\t\tif (is_array($this->_mod_filters[$filter])) {\n\t\t\t$display_date = $true_date = implode('-', $this->_mod_filters[$filter]);\n\t\t} else if ($default) {\n\t\t\t$true_date = $default;\n\t\t}\n\t\t\n\t\t$field = Html::SelectDate($name, $true_date, $a);\n\t\t\n\t\t$this->_fields[$this->_row][] = array('html' => $field, 'value' => $display_date, 'title' => $title);\n\t}",
"private static function addFunctions()\n {\n \tself::$twig->addFunction(new \\Twig_SimpleFunction('asset', function ($asset) {\n return sprintf('%s', ltrim($asset, '/'));\n\t\t}));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('getBaseUrl', function () {\n return getBaseUrl();\n }));\n\n self::$twig->addFunction(new \\Twig_SimpleFunction('csrf_token', function () {\n return csrf_token();\n }));\n }",
"function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }"
]
| [
"0.64805746",
"0.6319663",
"0.62104416",
"0.5875237",
"0.5464264",
"0.544709",
"0.54314196",
"0.542009",
"0.5401588",
"0.54003084",
"0.5392354",
"0.53833145",
"0.537688",
"0.52713776",
"0.5256558",
"0.5256558",
"0.5256558",
"0.5242803",
"0.5239476",
"0.5230244",
"0.52241665",
"0.5223335",
"0.5159671",
"0.5138809",
"0.51310885",
"0.5119709",
"0.5109115",
"0.5104434",
"0.5059574",
"0.5044361"
]
| 0.6896119 | 0 |
Returns the data for the link to be created | public function getLinkData()
{
return array(
'loungetag' => $this->lounge->getLoungetag()
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDataLink()\n {\n return $this->dataLink;\n }",
"static public function createLink($data = [])\n\t{\n\t\t$link = new Link;\n\n\t\t// set the link fields\n\t\t$link->object_id = $data['object_id'];\n\t\t$link->object_type = $data['object_type'];\n\t\t$link->link_type = $data['link_type'];\n\t\t$link->link = $data['link'];\n\n\t\t// save the record to the DB\n\t\t$link->save();\n\n\t\t// return the new DB records id\n\t\treturn $link;\n\t}",
"public function getLink() {}",
"public function getLink();",
"public function getLink();",
"public function getLinkInfomation() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n\n $sLink = $this->input->post('link');\n\n if (!filter_var($sLink, FILTER_VALIDATE_URL)) {\n $sLink = 'http://'.$sLink;\n }\n\n $urlData = parse_url($sLink);\n \n $aMeta = getUrlMeta($sLink);\n \n $aMeta['host'] = str_replace('www.', '', $urlData['host']);\n \n echo json_encode($aMeta);\n die();\n }",
"public function getData()\n {\n $this->links;\n return $this->links;\n }",
"public function getLink(){\n return $this->link;\n }",
"public function getLink()\n {\n return $this->get('Link');\n }",
"public function jsonSerialize()\n {\n return $this->getLink();\n }",
"function getLink() {\n return new Hyperlink($this->getName(),\"/user/$this->id\",'userlink');\n }",
"function getLink() {return $this->_link;}",
"function getLink() {return $this->_link;}",
"function getLink() {\r\n return $this->_link;\r\n }",
"function getLink() {\r\n return $this->_link;\r\n }",
"public function getLink(): string;",
"public function getLink(): string;",
"function newDataObject() {\n\t\treturn new FooterLink();\n\t}",
"public function get_link() {\r\n return $this->link;\r\n }",
"public function getLink():string;",
"protected function CreateJson() {\n\t\t$obj = new \\stdClass;\n\t\t$obj->recordsList = parent::CreateJson();\n\n\t\t// add links from server\n\t\t$obj->link = new \\stdClass;\n\t\t$obj->link->href = $this->link_href;\n\t\t$obj->link->rel = $this->link_rel;\n\t\treturn $obj;\n\t}",
"public function getLink() {\n return $this->link;\n }",
"public function get_link()\n {\n\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }"
]
| [
"0.68948066",
"0.67588353",
"0.65730757",
"0.640034",
"0.640034",
"0.6324863",
"0.6227565",
"0.61531705",
"0.60761774",
"0.6072792",
"0.60581696",
"0.60498136",
"0.60498136",
"0.59445465",
"0.59445465",
"0.5940481",
"0.5940481",
"0.5939031",
"0.59382915",
"0.58543074",
"0.5837861",
"0.5824886",
"0.5823016",
"0.58147293",
"0.58147293",
"0.58147293",
"0.58147293",
"0.58147293",
"0.58147293",
"0.58147293"
]
| 0.7087102 | 0 |
Returns the data for the content to be created | public function getContentData()
{
return array(
'%lounge%' => $this->lounge->getName(),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function generateContent()\n {\n if (empty(static::$content)) {\n $idColumnName = $this->config->isReferential() ? 'code' : 'id';\n\n // fixtures\n $fixtures = [\n 'get' => $this->generateFixtures($this->config),\n 'get2' => $this->generateFixtures($this->config),\n 'post' => $this->generateFixtures($this->config),\n ];\n\n $fixtures['put'] = $fixtures['get'];\n $fixtures['delete'] = $fixtures['get'];\n\n if ($parent = $this->config->getParentEntity()) {\n $parentIdColumnName = $this->config->isReferential() ? 'code' : 'id';\n $fixtures['id1'] = $fixtures['get'][$parent->getEntityName()][$parentIdColumnName]['value'];\n $fixtures['get2'][$parent->getEntityName()][$parentIdColumnName]['value'] = '2';\n $fixtures['id2'] = $fixtures['get2'][$parent->getEntityName()][$parentIdColumnName]['value'];\n } else {\n $fixtures['id1'] = $fixtures['get'][$this->config->getEntityName()][$idColumnName]['value'];\n $fixtures['get2'][$this->config->getEntityName()][$idColumnName]['value'] = '2';\n $fixtures['id2'] = $fixtures['get2'][$this->config->getEntityName()][$idColumnName]['value'];\n }\n\n // form\n $describer = new FormSerializer($this->container->get('form.factory'), $this->container->get('router'));\n $formName = $this->config->getBundleName().'\\\\Form\\\\Type\\\\'.$this->config->getContextName().'\\\\'.$this->config->getEntityName().'Type';\n $form = $describer->normalize($this->createForm($formName));\n $formFields = [];\n foreach ($form->getFields() as $field) {\n $formFields[] = $field->getName();\n }\n\n // requiredFieldsListing\n $requiredFieldsForArray = [];\n $requiredFormFields = [];\n foreach ($form->getFields() as $field) {\n if ($field->isRequired()) {\n $requiredFieldsForArray[] = \"'{$field->getName()}'\";\n $requiredFormFields[] = $field->getName();\n }\n }\n\n $parentConfig = $this->config->getParentEntity();\n if (null !== $parentConfig) {\n $entityParentUse = $parentConfig->getNamespace().'\\\\'.$parentConfig->getEntityName();\n } else {\n $entityParentUse = '';\n }\n\n // content\n static::$content = [\n 'entity_name' => $this->config->getEntityName(),\n 'entity_use' => $this->config->getNamespace().'\\\\'.$this->config->getEntityName(),\n 'entity_parent_name' => $this->config->getParentEntity() ? $this->config->getParentEntity()->getEntityName() : null,\n 'entity_parent_use' => $entityParentUse,\n 'bundle_name' => $this->config->getBundleName(),\n 'context_name' => $this->config->getContextName(),\n 'route_name_prefix' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()),\n 'route_name_get' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_get',\n 'route_name_list' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_list',\n 'route_name_post' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_create',\n 'route_name_put' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_update',\n 'route_name_delete' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_delete',\n 'route_name_describe_form' => $this->getRouteNamePrefix().'_'.CaseConverter::convertToPascalCase($this->config->getEntityName()).'_describe_form',\n 'fields' => $this->config->getFields(),\n 'requiredFieldsForArray' => implode(', ', $requiredFieldsForArray),\n 'fixtures' => $fixtures,\n 'error_context' => lcfirst($this->config->getEntityName()),\n 'form' => $form,\n 'formFields' => $formFields,\n 'requiredFormFields' => $requiredFormFields,\n 'config' => $this->config,\n 'additionalInitFile' => $this->generateDataSubDirectoryPath().$this->generateDataYmlFilename(),\n 'abstractContextName' => $this->getAbstractContextTestName(),\n ];\n }\n\n return static::$content;\n }",
"public function getContent()\n {\n return $this->data;\n }",
"public function createData()\n {\n // TODO: Implement createData() method.\n }",
"public function getContentObject() {}",
"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();",
"public function getContent();",
"public function getContent();",
"public function getCreateData() {\n return array();\n }",
"public abstract function getContent();",
"public function getContent() { return $this->content; }",
"public function getContent()\n {\n \t$content = $this->content;\n return $content;\n }",
"public function getData()\n\t{\n\t\ttry\n\t\t{\n\n\t\t\treturn $content;\n\t\t}\n\t\tcatch (RuntimeException $e)\n\t\t{\n\t\t\t\t$content = '';\n\t\t\treturn $content;\n\n\t\t}\n\n\t}",
"function get_content() {\r\n\t\treturn $this->content;\r\n\t}"
]
| [
"0.6838061",
"0.6788304",
"0.67583317",
"0.67378324",
"0.66979104",
"0.66979104",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65621024",
"0.65030277",
"0.6490932",
"0.6476894",
"0.64642864",
"0.64469457",
"0.63835055"
]
| 0.68018174 | 1 |
Returns the data for the push data to be created | public function getPushData()
{
return array_merge(parent::getPushData(), array(
'element' => 'lounge',
'user' => $this->sender->getId(),
'publication_id' => $this->publication->getId()
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function buildPushData() : array\n {\n // Data container\n $data = [];\n\n // Set audience\n $data['audience'] = !empty($this->buildAudienceData()) ? $this->buildAudienceData() : 'all';\n\n // Set iOS data\n if (!empty($this->buildIOSData())) {\n $data['notification']['ios'] = $this->buildIOSData();\n }\n\n // Set Android data\n if (!empty($this->buildAndroidData())) {\n $data['notification']['android'] = $this->buildAndroidData();\n }\n\n // Set Windows data\n if (!empty($this->buildWnsData())) {\n $data['notification']['wns'] = $this->buildWnsData();\n }\n\n // Set device types\n $data['device_types'] = $this->getPlatforms();\n\n return $data;\n }",
"public function data()\n {\n return [\n 'MsgType' => $this->type(),\n 'MsgContent' => [\n 'UUID' => $this->UUID,\n 'ImageFormat' => $this->ImageFormat,\n 'ImageInfoArray' => $this->ImageInfoArray,\n ],\n ];\n }",
"public function getCreateData() {\n return array();\n }",
"public function payload()\n {\n $payload = parent::payload();\n\n $payload['job'] = $this->handler;\n\n $payload['data'] = unserialize($payload['Message']);\n\n return $payload;\n }",
"public function createData()\n {\n // TODO: Implement createData() method.\n }",
"public function data()\n\t{\n\t\t// the start of a new topic, so assign the topic_id to itself\n\t\t// and assign the topic accordingly\n\t\t\n\t\t//$type = $this->topic ? GalaxyAPIConstants::kTypeForumMessage : GalaxyAPIConstants::kTypeForumTopic;\n\t\t$topic = $this->topic ? $this->topic : $this->id;\n\t\t\n\t\treturn array('_id' => $this->id,\n\t\t\t 'title' => $this->title,\n\t\t 'body' => $this->body,\n\t\t 'author' => $this->author,\n\t\t 'source' => $this->context->source(),\n\t\t 'topic' => $topic,\n\t\t 'topic_origin' => $this->topic_origin,\n\t\t 'created' => $this->created,\n\t\t 'type' => GalaxyAPIConstants::kTypeForumMessage);\n\t}",
"protected function createPayload()\n {\n if ($this->data instanceof Closure) {\n $closure = serialize(new Helpers\\SerializableClosure($this->data));\n $data = compact('closure');\n } else {\n $data = $this->data;\n }\n\n return json_encode(array('id' => $this->id, 'class' => $this->class, 'data' => $data));\n }",
"public function get_data() {\n\t\treturn $this->data;\n\t}",
"public function get_data() {\r\n\t\treturn $this->data;\r\n\t}",
"protected function makeData()\n {\n return Arr::collapse([\n $this->template->getQueryData(),\n [\n 'apiKey' => $this->apiKey,\n 'to' => implode(', ', (array) $this->getRecipientEmails())\n ]\n ]);\n }",
"public function getPayload(){\n return $this->EventData;\n }",
"function get_data() {\r\n return $this->data;\r\n }",
"public function getRequestData() : array\n {\n return $this->buildPushData();\n }",
"public function stkPushResponseData()\n {\n date_default_timezone_set('Africa/Dar_es_Salaam');\n\n $stkCallbackResponse = file_get_contents('php://input');\n\n return $stkCallbackResponse;\n\n }",
"public function get_data() {\n return $this->data;\n }",
"public function get_payload();",
"public function get_data() {\r\n return $this->data;\r\n }",
"public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}",
"function getData() {\n\t\treturn $this->data;\n\t}",
"public function setPayload()\n {\n return [\n 'name' => $this->getName(),\n 'email' => $this->getEmail(),\n 'address' => $this->getAddress(),\n 'meta' => $this->getMeta(),\n ];\n }",
"public function payload();",
"public function payload();",
"public function getPayload();",
"public function getPayload();",
"public function getPayload();",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function buildData()\n {\n $message = $this->getMessage();\n\n if ($this->data == []) {\n return [\n 'success' => false,\n 'message' => $message\n ];\n }\n\n return [\n 'success' => false,\n 'message' => $message,\n 'data' => (object) $this->data\n ];\n }",
"public function get_data()\n {\n return $this->_data;\n }"
]
| [
"0.69161534",
"0.642543",
"0.6320657",
"0.63125664",
"0.6309152",
"0.6183175",
"0.61666375",
"0.6110096",
"0.6098857",
"0.607174",
"0.6063591",
"0.6035111",
"0.6026276",
"0.6015167",
"0.6004753",
"0.59802175",
"0.5969033",
"0.5959522",
"0.5908121",
"0.59055406",
"0.589637",
"0.589637",
"0.58810824",
"0.58810824",
"0.58810824",
"0.5822196",
"0.5822196",
"0.5822196",
"0.5807508",
"0.5803411"
]
| 0.7273095 | 0 |
Relation between themes and forums (one to many inverse) | public function forum()
{
return $this->belongsTo('App\Models\Forum');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function themes(){\n return $this->hasMany(Theme::class);\n }",
"public function getForum()\n {\n return $this->hasOne(Forum::class, ['id' => 'fk_forum']);\n }",
"public function topics()\n {\n return $this->hasMany('ForumTopic', 'forum_id', 'id');\n }",
"public function theme()\n {\n return $this->belongsTo('\\PushApi\\Models\\Theme');\n }",
"public function get_forum() { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Conversation->get_forum() function\n\t\t\treturn $this->forum;\n\t\t}",
"public function posts()\n {\n return $this->hasMany('Efed\\Models\\ForumPost', 'topic_id', 'id');\n }",
"public function forumPosts()\n {\n return $this->hasMany('\\App\\Model\\Post', 'idproject')->orderBy('lasteditdate', 'DESC');\n }",
"function removeFromForums()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n // delete category assignments\r\n $db->query( \"DELETE FROM eZForum_ForumCategoryLink WHERE ForumID='$this->ID'\" );\r\n }",
"function recycle_forum_categories()\n\t{\n\t\t$table_forum = Database :: get_course_table(TABLE_FORUM);\n\t\t$table_forumcat = Database :: get_course_table(TABLE_FORUM_CATEGORY);\n\t\t$sql = \"SELECT fc.cat_id FROM \".$table_forumcat.\" fc LEFT JOIN \".$table_forum.\" f ON fc.cat_id=f.forum_category WHERE f.forum_id IS NULL\";\n\t\t$res = api_sql_query($sql,__FILE__,__LINE__);\n\t\twhile ($obj = mysql_fetch_object($res))\n\t\t{\n\t\t\t$sql = \"DELETE FROM \".$table_forumcat.\" WHERE cat_id = \".$obj->cat_id;\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\n\t}",
"function cleanOrphan()\n {\n\t parent::cleanOrphan($this->db->prefix(\"xf_forums\"), \"forum_id\");\n\t parent::cleanOrphan($this->db->prefix(\"xf_posts\"), \"topic_id\");\n\t \n\t return true;\n }",
"public function topic()\n\t{\n\t\treturn $this->belongs_to('Forumtopic', 'forumtopic_id');\n\t}",
"function hm_get_related_posts() {\n\t\t\t\tthrow new Exception( 'hm_related_posts is not available, you must add theme supports for \"hm-related-posts\"' );\n\t\t\t}",
"public function thread()\n {\n return $this->belongsTo('\\Boxkode\\Forum\\Models\\Thread', 'parent_thread');\n }",
"function activite_forum_site($nbr_post_jour) {\r\n\r\n\t$pluged = unserialize($GLOBALS['meta']['plugin']);\r\n\r\n\tif (is_array($pluged['GAF'])) {\r\n\t\t$icone = \"<img src='\" . _DIR_PLUGINS . $pluged['GAF']['dir'] . \"/img_pack/gaf_ico-24.gif' border='0'>\";\r\n\t\t$url = generer_url_ecrire(\"gaf_admin\");\r\n\t\t$plugin = 'GAFoSPIP';\r\n\t} elseif (is_array($pluged['SPIPBB'])) {\r\n\t\t$icone = \"<img src='\" . _DIR_PLUGINS . $pluged['SPIPBB']['dir'] . \"/img_pack/spipbb-24.png' border='0'>\";\r\n\t\t$url = generer_url_ecrire(\"spipbb_admin\");\r\n\t\t$plugin = 'SpipBB';\r\n\t} else {\r\n\t\t$icone = http_img_pack('suivi-forum-24.gif', 'ico', '', '');\r\n\t\t$url = generer_url_ecrire(\"controle_forum\");\r\n\t}\r\n\r\n\t$aff = debut_cadre_relief('', true);\r\n\t$aff .= \"<div class='bouton_droite icone36'>\\n\"\r\n\t\t. \"<a href='\" . $url . \"' title='\"\r\n\t\t. ($plugin ? _T('actijour:voir_plugin') . $plugin : _T('actijour:voir_suivi_forums')) . \"'>\\n\"\r\n\t\t. $icone . \"</a>\\n\"\r\n\t\t. \"</div>\\n\"\r\n\t\t. \"<span class='bold'>\" . _T('actijour:forums') . \"</span><br />\";\r\n\r\n\t// nbr posts du jour sur vos forum\r\n\tif ($nbr_post_jour) {\r\n\t\t$aff .= $nbr_post_jour . \" \";\r\n\t} else {\r\n\t\t$aff .= _T('actijour:aucun');\r\n\t}\r\n\r\n\tif ($nbr_post_jour > 1) {\r\n\t\t$aff .= _T('actijour:messages');\r\n\t} else {\r\n\t\t$aff .= _T('actijour:message');\r\n\t}\r\n\r\n\t$aff .= \"<div class='nettoyeur'></div>\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}",
"public function posts(){\n\t\treturn $this->belongsToMany('Post', 'topics_posts');\n\t}",
"public function topic()\n {\n return $this->belongsTo('Reflex\\Forum\\Entities\\Categories\\Category', 'topic_id');\n }",
"public function getBlog()\n {\n return $this->hasOne(Post::className(), ['id' => 'blogId']);\n }",
"public function tackledTopics(){\n return $this->hasMany(Topic::class,'class');\n }",
"function forum_autoriser(){}",
"public function blogOfBlogCategories()\n {\n return $this->hasMany(Blog::class, 'blog_category_id');\n }",
"public function Forum() {\n\t $this->sql .= \" UNION\t\n\t SELECT 3, forum_id, thread_id, post_id, post_subject, LEFT(post_message, \".$this->nahlad.\") as post_message, post_datestamp\tFROM `fusion_posts`\n\t\t WHERE '\".$this->a.\"' > post_datestamp AND post_datestamp > '\".$this->b.\"'\tAND post_author = '\".$this->id.\"'\n\t \";\n\t}",
"public function topics() {\n\t\treturn $this->hasMany(Forum::getTopicClass(), \"section_id\")->orderBy(\"id\", \"desc\");\n\t}",
"public function threads(){\n return $this->belongsToMany('App\\Thread');\n }",
"function target_add_forum($forum)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $forum['name']);\n\n\tif (!isset($GLOBALS['cat_map'][ $forum['cat_id'] ])) {\n\t\tpf('WARNING: Create category for uncategorized forum.');\n\t\t$cat_id = q_singleval('SELECT MAX(id)+1 from '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat');\n\t\tif (!$cat_id) $cat_id = 1;\n\t\ttarget_add_cat(array('id'=>$cat_id, 'name'=>'Uncategorized Forums', 'description'=>'', 'view_order'=>$cat_id));\n\t\t$GLOBALS['cat_map'][ $forum['cat_id'] ] = $cat_id;\n\t}\n\n\t$forum_opt = 16;\t// Set tag_style to BBCode.\n\tif (!empty($forum['post_passwd'])) {\n\t\t$forum_opt |= 4;\t// Enable passwd_posting.\n\t}\n\n\t$frm = new fud_forum();\n\t$frm->cat_id = $GLOBALS['cat_map'][ $forum['cat_id'] ];\n\t$frm->name = $forum['name'];\n\t$frm->descr = $forum['description'];\n\t$frm->view_order = $forum['view_order'];\n\t$frm->post_passwd = $forum['post_passwd'];\n\t$frm->url_redirect = $forum['url_redirect'];\n\t$frm->forum_opt = $forum_opt;\n\t$frm->max_attach_size = 0;\t// No limit.\n\t$frm->max_file_attachments = 5;\t// Sensible default.\n\t$id = $frm->add('LAST');\n\t$GLOBALS['forum_map'][ (int)$forum['id'] ] = $id;\n/*\nfud_use('forum_adm.inc', true);\nfud_use('groups_adm.inc', true);\nfud_use('groups.inc');\n$nf = new fud_forum;\n// $cat_id, $name, $descr, $parent, $url_redirect, $post_passwd, $forum_icon,\n// $forum_opt, $date_created, $message_threshold, $max_attach_size,\n// $max_file_attachments\n$nf->cat_id = $GLOBALS['cat_map'][$c->pid];\n$nf->name = $c->name;\n$nf->description = $c->description;\n$nf->view_order = $c->disporder;\n$nf->post_passwd = $c->password;\n// $nf->cat_opt = 1|2;\n$GLOBALS['forum_map'][$c->fid] = $nf->add('LAST');\n*/\n}",
"protected static function _relations() {\n\n\t}",
"public function getForumManager() {\n\t\treturn $this -> forumManager;\n\t}",
"public function blog_category(){\n return $this->hasOne(Blog_category::class, 'id', 'category_id');\n }",
"public function Link()\n {\n return $this->belongsTo('CommunityLink');\n }",
"public function parent() {\n\t\treturn $this->hasOne(Forum::getSectionClass(), \"parent_id\");\n\t}",
"function replace_forum_text( $translated_text ) {\n if( is_bbpress() ){\n if ( $translated_text == 'Forum' ) {\n $translated_text = 'Forum Category';\n }\n }\n return $translated_text;\n}"
]
| [
"0.6176667",
"0.58164656",
"0.58061403",
"0.5566672",
"0.537207",
"0.5364745",
"0.53235245",
"0.526619",
"0.5185819",
"0.5093667",
"0.5035696",
"0.49804062",
"0.49785987",
"0.49575537",
"0.49047324",
"0.4840616",
"0.48382622",
"0.48373258",
"0.48310348",
"0.4826065",
"0.47984582",
"0.47940665",
"0.4792932",
"0.47914407",
"0.47644788",
"0.4752965",
"0.4752752",
"0.47451812",
"0.4741458",
"0.47298568"
]
| 0.6185971 | 0 |
Relation between themes and tags (many to many) | public function tags()
{
return $this->belongsToMany('App\Models\Tag', 'themes_tags');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function themes(){\n return $this->hasMany(Theme::class);\n }",
"public function tag() {\n\n\t\treturn $this->belongsToMany('Tag');\n\n\t}",
"public function tag()\n {\n return $this->belongsToMany('App\\Tag');\n }",
"public function tags()\n {\n return $this->belongsToMany('App\\models\\tagModel', 'blog_post_tag', 'post_id', 'tag_id')->withPivot('type');\n }",
"public function tags(){\n return $this->morphToMany('App\\Models\\Tag','taggable');\n\n }",
"public function getTags()\n{\n return $this->hasMany(Tags::className(), ['id' => 'tag_id'])\n ->viaTable('tag_articles', ['article_id' => 'id']);\n}",
"public function tags()\n {\n return $this->belongsToMany(BlogTag::class, 'blog_map_tags', 'blog_id', 'tag_id');\n }",
"public function getTag(){\n return $this->hasMany(Tags::className(), ['idTag' => 'id_Tag']) -> viaTable('{{%tags_p}}', ['id_Post' => 'idPost']);\n }",
"public function tags()\n {\n return $this->belongsToMany('App\\Model\\Content\\Tag','post_tags','post_id','tag_id');\n }",
"public function getTagArticles()\n{\n return $this->hasMany(\n TagArticles::className(), ['article_id' => 'id']\n );\n}",
"public function tags(){\n\t\treturn $this->belongsToMany('App\\Tag');\n\t}",
"public function tags()\n {\n return $this->morphToMany('App\\Tag', 'taggable');\n }",
"public function tag()\n {\n return $this->belongsToMany('App\\Tag', 'post_tags');\n }",
"public function tags(){\n return $this->morphToMany(Tag::class, 'taggable');\n }",
"public function tags()\n {\n return $this->hasMany('App\\Tag');\n }",
"public function tags()\n {\n return $this->hasMany('App\\Tag');\n }",
"public function tags()\n {\n return $this->belongsToMany('Model\\PostTag', 'post_tag_relation', 'post_id', 'tag_id');\n }",
"public function tags()\n {\n return $this->belongsToMany(\"App\\Tag\");\n }",
"public function tags()\n {\n return $this->hasMany('arts\\Tag', 'post_id', 'post_id');\n }",
"public function tags() {\n return $this->belongsToMany('App\\Tag');\n }",
"public function tags() {\n // refer to tag class and the taggable ID\n return $this->morphToMany('App\\Tag', 'taggable');\n\n }",
"public function tags(){\n\n return $this->morphToMany(Tag::class, 'taggable');\n\n }",
"public function tag()\n {\n return $this->morphMany(Taggable::class, 'taggable');\n }",
"public function tags()\n {\n\t\treturn $this->belongsToMany('App\\Tag');\n }",
"public function tags()\n\t{\n\t\treturn $this->morphToMany('App\\Modules\\Tag\\Tag', 'taggable');\n\t}",
"public function tags() {\n return $this->belongsToMany(Tag::class);\n }",
"public function tags()\n {\n return $this->morphToMany(Tag::class,'taggable');\n }",
"public function tags(){\n return $this->belongsToMany(Tag::class);\n }",
"public function tags(){\n return $this->belongsToMany(Tag::class);\n }",
"public function Tags() {\n return $this->belongsToMany(Tag::class);\n }"
]
| [
"0.6606125",
"0.62111855",
"0.6204236",
"0.6176416",
"0.6155603",
"0.614118",
"0.6121815",
"0.60953104",
"0.6087103",
"0.60855955",
"0.6073352",
"0.6071847",
"0.6065474",
"0.60639113",
"0.6061659",
"0.6061659",
"0.6056938",
"0.60236394",
"0.60232294",
"0.6003639",
"0.5971667",
"0.5946662",
"0.594264",
"0.5942092",
"0.5935588",
"0.5934167",
"0.593347",
"0.59217215",
"0.59217215",
"0.5921101"
]
| 0.76731735 | 0 |
Get themes by `forum_id` | public function getAllThemesByForumId($forum_id)
{
$themes = self::where('is_enable', true)
->where('forum_id', $forum_id)->get();
return $themes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllThemeByForumId($forum_id)\n\t{\n\t\t$themes = self::where('is_enable', true)\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->orderBy('created_at', 'DESC')->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public static function getForumThemesByTag($forum_id, $tag_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);\n\n\t\t$themes = $tag->themes()\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public static function getTheme($id)\r\n {\r\n $db = Zend_Registry::get('db');\r\n $query = $db->select()\r\n ->from('Page_Themes', array('PT_Folder'));\r\n\r\n if (is_numeric($id) && $id > 0){\r\n $query->where('PT_ID = ?', $id);\r\n }elseif(is_string($id) && !empty ($id)){\r\n $query->where('PT_Name = ?', $id);\r\n }\r\n\r\n $theme = $db->fetchOne($query);\r\n\r\n return $theme;\r\n }",
"public function getAllAnswerThemesByClientId($forum_id, $client_id)\n\t{\n\t\t$themes = self::whereHas('messages', function ($query) {\n\t\t\t$query->where(['client_view' => false, 'is_enable' => true]);\n\t\t})->where(['client_id' => $client_id, 'is_enable' => true, 'forum_id' => $forum_id])\n\t\t\t->get();\n\n\t\treturn $themes;\n\t}",
"function wpmu_get_blog_allowedthemes($blog_id = 0)\n {\n }",
"public static function getForumAnswerThemesByTag($forum_id, $tag_id, $client_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);;\n\n\t\t$themes = $tag->themes()->whereHas('messages', function ($query) {\n\t\t\t$query->where('client_view', '=', false)->where('is_enable', '=', true);\n\t\t})->where('client_id', '=', $client_id)\n\t\t\t->where('forum_id', '=', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"private function load_forums($id)\n {\n /*--------------------------------------------------------------------------\n * send the 8 most recent forums to the user who just connected to the group\n *-------------------------------------------------------------------------*/\n $forum_obj = new forum_mdl();\n return $forum_obj->get_forums($id,\"department\");\n }",
"public function actionGetforum($id = null) {\n $id = ($id == null) ? \\Yii::$app->request->get('id') : $id;\n\n echo json_encode(\n (is_numeric($id))\n ? BbiiForum::find()->where(['id' => $id])->asArray()->one()\n : ['error' => 'Unable to retrieve requested information.']\n );\n\n \\Yii::$app->end();\n }",
"public function getAllThemes();",
"function get_forum_posts($forum_id, array $options = array()) {\n $options['forum_id'] = $forum_id;\n return $this->call('get_forum_posts', $options);\n }",
"function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );\n\treturn array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );\n}",
"public function getTheme($id = false)\n {\n try {\n if (!$id) {\n $theme = Theme::orderBy('id', 'asc')->get();\n } else {\n $theme = Theme::findOrFail($id);\n }\n } catch (ModelNotFoundException $e) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n $this->send($theme->toArray());\n }",
"public function detailforum($id_forum){\n\t\t$this->db->join('user','forum.id_user = user.id_user', \"LEFT\");\n\t\t$this->db->join('kategori_forum','forum.id_kategori_forum = kategori_forum.id_kategori_forum', \"LEFT\");\n\t\t$this->db->where('id_forum', $id_forum);\n\t\treturn $this->db->get('forum');\n\t}",
"function phorum_mod_topic_poll_get_forumsettings($forum_id = NULL)\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n if ($forum_id == NULL) {\n $forum_id = $PHORUM[\"forum_id\"];\n }\n\n if (isset($PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id])) {\n return $PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id];\n }\n\n $settings = isset($PHORUM[\"mod_topic_poll\"][$forum_id])\n ? $PHORUM[\"mod_topic_poll\"][$forum_id] : array();\n foreach ($PHORUM[\"mod_topic_poll_defaults\"] as $key => $val) {\n if (!isset($settings[$key])) {\n $settings[$key] = $val;\n }\n }\n\n $GLOBALS[\"PHORUM\"][\"mod_topic_poll_settings_cache\"][$forum_id] = $settings;\n return $settings;\n}",
"public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }",
"function get_themes()\n {\n }",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }",
"public function findTheme($themeName);",
"public function getTheme();",
"public function getId_theme (){\n\t\treturn $this->id_theme;\n\t}",
"function thrive_dashboard_get_all_themes()\n{\n $themes = thrive_dashboard_get_thrive_products('theme');\n $current_theme = wp_get_theme();\n\n foreach ($themes as $key => $theme) {\n\n if ($current_theme->name == $theme->name) {\n unset($themes[$key]);\n continue;\n }\n\n $local_theme = wp_get_theme($theme->tag);\n if ($local_theme->exists()) {\n $theme->installed = true;\n } else {\n $theme->installed = false;\n }\n }\n\n return $themes;\n}",
"public function getUserTheme($userid)\n {\n $theme = R::findOne('finalchoice', 'user_id = ?', [$userid]);\n return $theme->theme_id;\n }",
"public static function GetAllByForumId($forum_id){\n global $db;\n $allPosts = $db->prepare('SELECT * FROM posts WHERE forum_id = :forum_id')->bindValue(':forum_id', $forum_id, PDO::PARAM_INT)->execute();\n $postList = array();\n while ($dataPost = $allPosts->fetch()){\n $newPost = new Post();\n $newPost->fill($dataPost);\n $postList[] = $newPost;\n }\n return $postList;\n }",
"public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}",
"public function getIdTheme()\n {\n return $this->idTheme;\n }",
"public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }",
"public function get($themeId, array $params = array())\n {\n $request = new Request('GET', '/admin/themes/'.$themeId.'.json');\n return $this->getNode($request, $params, Theme::class);\n }",
"public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }",
"public function show(forum $forum)\n {\n //\n }"
]
| [
"0.79470855",
"0.7060002",
"0.65162367",
"0.6413722",
"0.6215883",
"0.61608094",
"0.6125732",
"0.61157477",
"0.60721916",
"0.6021807",
"0.5999539",
"0.59573555",
"0.59133244",
"0.5873607",
"0.58357364",
"0.58238864",
"0.58234704",
"0.5806459",
"0.5758934",
"0.57321024",
"0.56450576",
"0.56353307",
"0.5589892",
"0.55355084",
"0.55249524",
"0.5510624",
"0.550737",
"0.55069774",
"0.5502962",
"0.5498437"
]
| 0.7811868 | 1 |
Get all client`s answers by `client_id` | public function getAllAnswerThemesByClientId($forum_id, $client_id)
{
$themes = self::whereHas('messages', function ($query) {
$query->where(['client_view' => false, 'is_enable' => true]);
})->where(['client_id' => $client_id, 'is_enable' => true, 'forum_id' => $forum_id])
->get();
return $themes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllByClientId($client_id)\n\t{\n\t\t$sql = sprintf('SELECT applicants.*, ats_jobs.id AS job_id,\n\t\t\t\t\t\tats_jobs.uristub, ats_jobs.category,\n\t\t\t\t\t\tats_jobs.location, ats_jobs.name AS job_name\n\t\t\t\t\t\tFROM applicants\n\t\t\t\t\t\tINNER JOIN ats_jobs ON (applicants.job_id = ats_jobs.id)\n\t\t\t\t\t\tWHERE applicants.client_id = %d\n\t\t\t\t\t\tORDER BY applicants.created_ts DESC',\n\t\t\t\t\t\t$client_id);\n\n return $this->_db->query($sql)->fetchAll();\n\t}",
"function get_all_contacts_of_client($client_id) {\n\n $client_access_info = $this->get_access_info(\"client\");\n if ($client_id && ($this->login_user->is_admin || $client_access_info->access_type == \"all\")) {\n $client_contacts = $this->Users_model->get_all_where(array(\"status\" => \"active\", \"client_id\" => $client_id, \"deleted\" => 0))->getResult();\n $client_contacts_array = array();\n\n if ($client_contacts) {\n foreach ($client_contacts as $contacts) {\n $client_contacts_array[] = array(\"type\" => \"contact\", \"id\" => \"contact:\" . $contacts->id, \"text\" => $contacts->first_name . \" \" . $contacts->last_name);\n }\n }\n echo json_encode($client_contacts_array);\n }\n }",
"function get_all($client_id) {\r\n $f3 = \\Base::instance();\r\n\r\n $project_short = $f3->get('PARAMS.project');\r\n $client_short = $f3->get('PARAMS.client');\r\n $projects_db=new DB\\SQL\\Mapper($f3->get('DB'),'projects');\r\n $projects=$projects_db->find(array('client_id=?',$client_id),array('order'=>'project_full'));\r\n\r\n $out = array();\r\n foreach($projects as $project)\r\n {\r\n //if($project->active == 0) continue;\r\n $out[] = array(\r\n \"project_id\"=>$project->project_id,\r\n \"client_id\"=>$project->client_id,\r\n \"project_short\"=>$project->project_short,\r\n \"project_full\"=>$project->project_full,\r\n \"description\"=> $projects->description,\r\n \"active\"=>$projects->active,\r\n \"drafts\"=>$projects->drafts,\r\n \"project_url\"=> $f3->get('site.url').$client_short.\"/\".$project->project_short\r\n );\r\n }\r\n\r\n return $out;\r\n }",
"public function get_packages_by_client($client_id){\r\n $this->db->select('id, title, slug, price, vat, total');\r\n $this->db->where_in($this->package_table.'.id', 'select package_id from '.$this->client_package_table.' where client_id='.$client_id, false);\r\n $query = $this->db->get($this->package_table);\r\n return $query->result_array();\r\n }",
"public static function getNotesByClientId(int $clientId) {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM notes WHERE clientId = ?';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute(\n [$clientId]\n );\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $notesItem = new Notes($row);\n array_push($arr, $notesItem);\n }\n return $arr;\n }",
"public function getIdsForUser($user_id, $client_id);",
"public function get_clientes_by_id($id)\n {\n \n $this->db->select('*');\n $this->db->from('clientes');\n $this->db->where('id', $id);\n $query = $this->db->get();\n\n return $query->result_array(); \n }",
"public function get_clients($id)\n {\n $q=$this->db->where(['client_id'=>$id])->get('clients');\n\t\treturn $res=$q->result_array()[0];\n }",
"public static function getClientById($id):array{\n $client = Clients::findOrFail($id)->toArray();\n\n return $client;\n }",
"function getReviewsByClientId($clientId) {\n $db = phpmotorsConnect();\n $sql = 'SELECT i.invMake, i.invModel, i.invId, r.reviewId, r.reviewDate\n FROM reviews r\n INNER JOIN inventory i ON r.invId=i.invId\n WHERE r.clientId=:clientId\n ORDER BY r.reviewDate DESC';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n $stmt->execute();\n //can't just use fetch() on the next line. You have to use fechAll().\n $reviews = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $reviews; \n }",
"public function getResults($id)\n\t{\n\t\t$answer = $this->answer->getTable();\n\t\t$option = $this->option->getTable();\n\t\t$question = $this->question->getTable();\n\t\t$result = $this->result->getTable();\n\t\t$survey = $this->survey->getTable();\n\n\t\t$results = $this->db->table($survey)\n\t\t\t->select(array(\n\t\t\t\t$this->db->raw(\"$question.id as question_id\"),\n\t\t\t\t$this->db->raw(\"$option.id as option_id\"),\n\t\t\t\t$this->db->raw(\"count($option.label) as count\")\n\t\t\t))\n\t\t\t->join($question, \"$survey.id\", '=', \"$question.survey_id\")\n\t\t\t->join($option, \"$question.id\", '=', \"$option.question_id\")\n\t\t\t->join($answer, \"$option.id\", '=', \"$answer.value\")\n\t\t\t->where(\"$survey.id\", '=', $id)\n\t\t\t->where(\"$answer.custom\", '=', 0)\n\t\t\t->where(\"$question.multiple_choice\", '=', 1)\n\t\t\t->groupBy(\"$answer.value\")\n\t\t\t->orderBy(\"$question.id\")\n\t\t\t->get();\n\n\t\treturn new ResultCollection($results);\n\t\t// SELECT q.label, o.label, count(a.value) FROM survey_surveys s\n\t\t// join survey_questions q on s.id = q.survey_id\n\t\t// join survey_options o on q.id = o.question_id\n\t\t// join survey_answers a on o.id = a.value\n\t\t// where q.multiple_choice = 1\n\t\t// and a.custom = 0\n\t\t// group by a.value\n\t\t// order by q.id\n\t}",
"public function getClientData(int $client): array{\n $this->checkNotConnected();\n if(!$this->ckClientEx($client)) throw new ClientNotFound(\"There's no client #$client\", 1);\n $qr = $this->connection->query(\"SELECT * FROM tb_clients WHERE cd_client = $client;\");\n if($qr === false) die($this->connection->error);\n return $qr->fetch_array();\n }",
"function searchbyId($clientid){\n\t\t$sql = \"SELECT * FROM Client WHERE Client_ID = '$clientid'\";\n\t\t$result = mysql_query($sql);\n\t\t$i = 0;\n\t\t$toReturn;\n\t\twhile ($info = mysql_fetch_array($result,MYSQL_ASSOC)){ //Use assoc, because otherwise we'll get duplicates\n\t\t\t$toReturn[$i] = $info; //Add the results into an array for us to read\n\t\t\t$i++;\n\t\t}\n\t\treturn $toReturn;\n\t}",
"public function get_detail_client($client_id=0){\n\t\t$this->setMainTable('mmi_client');\n\t\treturn $this->find('client_id='.intval($client_id));\n\t}",
"public function index($id)\n {\n\n $trainer_clients = Client::where('trainer_id', '=', $id)->get();\n\n\n return $trainer_clients;\n }",
"public function getQuestionsAnswered($user_id)\n\t{\n\t\t$list = Yii::app()->db->createCommand(\n\t\t\t'select a.user_answer,DATE_FORMAT(a.date_created,\\'%m/%d/%Y\\') as date_created,\n\t\t\tq.content,qc.content as choice,c.display_name as category\n\t\t\tfrom answer a join question q on q.question_id=a.question_id \n\t\t\tleft join question_choice qc on a.question_choice_id = qc.question_choice_id \n\t\t\tleft join category_question cg on cg.question_id = a.question_id \n\t\t\tleft join category c on cg.category_id=c.category_id and a.user_id= :user_id\n\t\t\tand a.is_active = 1')->\n\t\t\tbindValues(array(\n\t\t\t\t':user_id'=>Yii::app()->user->id,\n\t\t\t))->queryAll();\n\t\t\treturn $list;\n\t}",
"public function findByClientId($client_id, $array=false, array $params=array()) {\n // and call the query builder on it\n $query = $this->_em->createQuery(\"SELECT c \"\n . \"FROM Contact\\Entity\\Contact c \"\n . \"JOIN c.client cl \"\n . \"WHERE cl.clientId=\".$client_id.\" \"\n . \"ORDER BY c.forename ASC, c.surname ASC\");\n \n if ($array===true) {\n return $query->getResult(\\Doctrine\\ORM\\AbstractQuery::HYDRATE_ARRAY);\n }\n \n return $query->getResult();\n }",
"public function getAnswers();",
"public function clientList()\n\t{\n\t\treturn $this->client()->latest()\n\t\t\t->where('password_client', true)\n\t\t\t->where('revoked', false)->get()\n\t\t\t->makeVisible('secret');\n\t}",
"function get_survey_answers($question_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM answers\r\n WHERE is_active = '1' AND question = '$question_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}",
"public function getAnswers(array $ids) : array\n {\n\n }",
"public function getCAnswers()\n {\n return $this->hasMany(AnswerOptions::className(), ['id' => 'c_answer'])->viaTable('correct_answers', ['question_id' => 'id']);\n }",
"function smartchoice_get_all_responses($choice) {\n global $DB;\n return $DB->get_records('smartchoice_answers', array('choiceid' => $choice->id));\n}",
"function get_correct_answer($id)\n {\n return $this->db->get_where('correct_answers',array('id'=>$id))->row_array();\n }",
"public function ask_get_answers($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = ?\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\t$res = $query->result();\n\t\t$this->load->model('votes_model', 'votesManager');\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\n\t\t// The answers are sorted by number of votes\n\t\tusort($res, function($a, $b)\n\t\t{\n\t\t\tif($a->nb_votes == $b->nb_votes) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->nb_votes < $b->nb_votes) ? 1 : -1;\n\t\t});\n\n\t\tif( $res )\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn 0;\n\t}",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM clientes';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"function getAllReviews($clientId){\n $db = phpmotorsConnect();\n $sql = 'SELECT * FROM reviews WHERE clientId = :clientId';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':clientId', $clientId, PDO::PARAM_INT);\n $stmt->execute();\n $oldReviews = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $oldReviews;\n }",
"public static function getAll(){\n $rows = DB::table('clients')\n ->join('client_deals', 'clients.id', '=', 'client_deals.client_id')\n ->join('deal_details', 'client_deals.id', '=', 'deal_details.client_deal_id')\n ->orderby('hour')->get(array('clients.id as cid','client_deals.id as cdid','clients.*','deal_details.*','client_deals.*'));\n return $rows;\n }",
"public function get_commande_client($id)\n {\n \n if ($id > 0) {\n $this->db->select('commande.*, client.clientId, client.nomClient');\n $this->db->from('commande');\n $this->db->join('client', 'client.clientId = commande.fk_clientId');\n $this->db->where('client.clientId', $id);\n $query = $this->db->get();\n return $query->result_array();\n }\n }",
"public function retrieveIncidentsResponse($client, $options = array())\n {\n $defaults = array(\n 'status' => null,\n 'sort_by' => 'DESC'\n );\n $options = array_merge($defaults, $options);\n extract($options);\n\n $incidentQuery = new IncidentQuery();\n $incidentQuery->setSortBy($sort_by);\n if (isset($status))\n {\n $incidentQuery->setStatus($status);\n }\n\n $incidentQueryResponse = $client->callService($incidentQuery);\n\n return $incidentQueryResponse;\n }"
]
| [
"0.67993903",
"0.6030589",
"0.5993161",
"0.59843415",
"0.59728545",
"0.59491575",
"0.58764344",
"0.58269924",
"0.58218235",
"0.58067757",
"0.5797485",
"0.57601756",
"0.5730142",
"0.56741756",
"0.5656633",
"0.56470674",
"0.5643799",
"0.56271195",
"0.5611257",
"0.56090677",
"0.55928576",
"0.55455613",
"0.5531658",
"0.55185306",
"0.55171174",
"0.55170995",
"0.55151075",
"0.5490888",
"0.54869664",
"0.5468606"
]
| 0.624575 | 1 |
Get all themes by `forum_id` | public function getAllThemeByForumId($forum_id)
{
$themes = self::where('is_enable', true)
->where('forum_id', $forum_id)
->orderBy('created_at', 'DESC')->paginate(10);
return $themes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllThemesByForumId($forum_id)\n\t{\n\t\t$themes = self::where('is_enable', true)\n\t\t\t->where('forum_id', $forum_id)->get();\n\n\t\treturn $themes;\n\t}",
"public static function getForumThemesByTag($forum_id, $tag_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);\n\n\t\t$themes = $tag->themes()\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function getAllThemes();",
"public function getAllAnswerThemesByClientId($forum_id, $client_id)\n\t{\n\t\t$themes = self::whereHas('messages', function ($query) {\n\t\t\t$query->where(['client_view' => false, 'is_enable' => true]);\n\t\t})->where(['client_id' => $client_id, 'is_enable' => true, 'forum_id' => $forum_id])\n\t\t\t->get();\n\n\t\treturn $themes;\n\t}",
"private function load_forums($id)\n {\n /*--------------------------------------------------------------------------\n * send the 8 most recent forums to the user who just connected to the group\n *-------------------------------------------------------------------------*/\n $forum_obj = new forum_mdl();\n return $forum_obj->get_forums($id,\"department\");\n }",
"function get_forum_posts($forum_id, array $options = array()) {\n $options['forum_id'] = $forum_id;\n return $this->call('get_forum_posts', $options);\n }",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }",
"public static function GetAllByForumId($forum_id){\n global $db;\n $allPosts = $db->prepare('SELECT * FROM posts WHERE forum_id = :forum_id')->bindValue(':forum_id', $forum_id, PDO::PARAM_INT)->execute();\n $postList = array();\n while ($dataPost = $allPosts->fetch()){\n $newPost = new Post();\n $newPost->fill($dataPost);\n $postList[] = $newPost;\n }\n return $postList;\n }",
"public static function getTheme($id)\r\n {\r\n $db = Zend_Registry::get('db');\r\n $query = $db->select()\r\n ->from('Page_Themes', array('PT_Folder'));\r\n\r\n if (is_numeric($id) && $id > 0){\r\n $query->where('PT_ID = ?', $id);\r\n }elseif(is_string($id) && !empty ($id)){\r\n $query->where('PT_Name = ?', $id);\r\n }\r\n\r\n $theme = $db->fetchOne($query);\r\n\r\n return $theme;\r\n }",
"public static function getForumAnswerThemesByTag($forum_id, $tag_id, $client_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);;\n\n\t\t$themes = $tag->themes()->whereHas('messages', function ($query) {\n\t\t\t$query->where('client_view', '=', false)->where('is_enable', '=', true);\n\t\t})->where('client_id', '=', $client_id)\n\t\t\t->where('forum_id', '=', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }",
"public function actionGetforum($id = null) {\n $id = ($id == null) ? \\Yii::$app->request->get('id') : $id;\n\n echo json_encode(\n (is_numeric($id))\n ? BbiiForum::find()->where(['id' => $id])->asArray()->one()\n : ['error' => 'Unable to retrieve requested information.']\n );\n\n \\Yii::$app->end();\n }",
"function thrive_dashboard_get_all_themes()\n{\n $themes = thrive_dashboard_get_thrive_products('theme');\n $current_theme = wp_get_theme();\n\n foreach ($themes as $key => $theme) {\n\n if ($current_theme->name == $theme->name) {\n unset($themes[$key]);\n continue;\n }\n\n $local_theme = wp_get_theme($theme->tag);\n if ($local_theme->exists()) {\n $theme->installed = true;\n } else {\n $theme->installed = false;\n }\n }\n\n return $themes;\n}",
"public function getList()\r\n {\r\n $themes = [];\r\n\r\n $q = $this->_db->query('SELECT id, title, description, thumbnail FROM theme');\r\n\r\n while ($donnees = $q->fetch(PDO::FETCH_ASSOC))\r\n {\r\n $themes[] = new themeClass($donnees);\r\n }\r\n\r\n return $themes;\r\n }",
"function wpmu_get_blog_allowedthemes($blog_id = 0)\n {\n }",
"function get_forum_list() {\n return $this->call('get_forum_list');\n }",
"public function getTheme($id = false)\n {\n try {\n if (!$id) {\n $theme = Theme::orderBy('id', 'asc')->get();\n } else {\n $theme = Theme::findOrFail($id);\n }\n } catch (ModelNotFoundException $e) {\n throw new PushApiException(PushApiException::NOT_FOUND);\n }\n $this->send($theme->toArray());\n }",
"function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {\n\t_deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );\n\treturn array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );\n}",
"public function detailforum($id_forum){\n\t\t$this->db->join('user','forum.id_user = user.id_user', \"LEFT\");\n\t\t$this->db->join('kategori_forum','forum.id_kategori_forum = kategori_forum.id_kategori_forum', \"LEFT\");\n\t\t$this->db->where('id_forum', $id_forum);\n\t\treturn $this->db->get('forum');\n\t}",
"function phorum_mod_topic_poll_get_forumsettings($forum_id = NULL)\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n if ($forum_id == NULL) {\n $forum_id = $PHORUM[\"forum_id\"];\n }\n\n if (isset($PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id])) {\n return $PHORUM[\"mod_topic_poll_settings_cache\"][$forum_id];\n }\n\n $settings = isset($PHORUM[\"mod_topic_poll\"][$forum_id])\n ? $PHORUM[\"mod_topic_poll\"][$forum_id] : array();\n foreach ($PHORUM[\"mod_topic_poll_defaults\"] as $key => $val) {\n if (!isset($settings[$key])) {\n $settings[$key] = $val;\n }\n }\n\n $GLOBALS[\"PHORUM\"][\"mod_topic_poll_settings_cache\"][$forum_id] = $settings;\n return $settings;\n}",
"public function getThemes() {\r\n\t$themes = array();\r\n $themelist = array_merge((array)glob('modules/' . $this->name . '/themes/*', GLOB_ONLYDIR), glob(PROFILE_PATH . $this->name . '/themes/*', GLOB_ONLYDIR));\r\n\tforeach ($themelist as $filename) {\r\n\t $themeName = basename($filename);\r\n\t $themes[$themeName] = $themeName;\r\n\t}\r\n\treturn $themes;\r\n }",
"public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }",
"function get_themes()\n {\n }",
"public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }",
"public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}",
"function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}",
"function getThemes() {\n\n\t$themesPath = '../../content/themes';\n\n\t$list = scandir($themesPath);\n\t$baseUrl = \\Raindrop\\Core\\Config\\Config::item('baseUrl');\n\t$themes = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $dir) {\n\t\t\t$pathThemeDir = $themesPath . '/' . $dir;\n\t\t\t$pathConfig = $pathThemeDir . '/theme.json';\n\t\t\t$pathScreen = $baseUrl . '/content/themes/' . $dir . '/screen.jpg';\n\n\t\t\tif(is_dir($pathThemeDir) and is_file($pathConfig)) {\n\t\t\t\t$config = file_get_contents($pathConfig);\n\t\t\t\t$info = json_decode($config);\n\n\t\t\t\t$info->screen = $pathScreen;\n\t\t\t\t$info->dirTheme = $dir;\n\n\t\t\t\t$themes[] = $info;\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $themes;\n}",
"public function themes(){\n return $this->hasMany(Theme::class);\n }",
"private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }"
]
| [
"0.83503854",
"0.7074914",
"0.67061675",
"0.6700475",
"0.6239612",
"0.62076175",
"0.61503386",
"0.61257225",
"0.61115295",
"0.60488504",
"0.5972905",
"0.5957188",
"0.5957035",
"0.58952844",
"0.5843768",
"0.5826588",
"0.577132",
"0.57596004",
"0.5734089",
"0.57303226",
"0.56869316",
"0.5663317",
"0.56618845",
"0.5661586",
"0.5650907",
"0.5587578",
"0.55868834",
"0.5561107",
"0.5534904",
"0.55295086"
]
| 0.8476483 | 0 |
Get answer`s tags by `forum_id` | public function getAllAnswerTagByForumId($forum_id, $client_id)
{
$themes = $this->getAllAnswerThemesByClientId($forum_id, $client_id);
return $this->uniqueTags($themes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectTagsQuestion($id_question)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tT.id_tag,\n\t\t\t\t\t\tT.tag_name\n\n\t\t\t\tFROM tags AS T\n\t\t\t\tLEFT OUTER JOIN tags_relation AS R ON (R.id_tag = T.id_tag)\n\t\t\t\tWHERE R.id_question = :id_question\";\n\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_question\", $id_question);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetchAll();\n\t}",
"function get_forum_posts($forum_id, array $options = array()) {\n $options['forum_id'] = $forum_id;\n return $this->call('get_forum_posts', $options);\n }",
"public static function getForumAnswerThemesByTag($forum_id, $tag_id, $client_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);;\n\n\t\t$themes = $tag->themes()->whereHas('messages', function ($query) {\n\t\t\t$query->where('client_view', '=', false)->where('is_enable', '=', true);\n\t\t})->where('client_id', '=', $client_id)\n\t\t\t->where('forum_id', '=', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function questionsByTagIdAction($tagid=null)\n {\n\n $sql = \"SELECT * FROM mvc_tag WHERE id='\" . $tagid . \"'\";\n $all = $this->db->executeFetchAll($sql);\n \n if ($all) {\n $tag_info = json_decode(json_encode($all[0]),TRUE);\n \n $sql = \"SELECT idQuestion FROM mvc_tag2question WHERE idTag='\" . $tag_info['id'] . \"'\";\n $all = $this->db->executeFetchAll($sql);\n $all = json_decode(json_encode($all),TRUE);\n $questions = array();\n foreach ($all as $key => $val) {\n $qid = $val['idQuestion'];\n $questions[] = $this->getQuestionById($qid);\n }\n }\n \n $res = array();\n $res['tag_info'] = $tag_info;\n $res['questions'] = $questions;\n \n return $res;\n }",
"public function getTags() {\n\t\t$sql = \"SELECT tags FROM question\";\n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t}",
"public static function GetAllByForumId($forum_id){\n global $db;\n $allPosts = $db->prepare('SELECT * FROM posts WHERE forum_id = :forum_id')->bindValue(':forum_id', $forum_id, PDO::PARAM_INT)->execute();\n $postList = array();\n while ($dataPost = $allPosts->fetch()){\n $newPost = new Post();\n $newPost->fill($dataPost);\n $postList[] = $newPost;\n }\n return $postList;\n }",
"function get_votes_by_answer($answer_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active = '1' AND answer_id = '$answer_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}",
"public static function tags($answer_id)\n\t{\n // @TODO: Tags are **NOT** saving from admin edit screens\n $label = Text::_('JTAG');\n\n $html = <<<EOT\n<div class=\"controls\">\n <label for=\"admin_tags\">$label</label>\n <select\n id=\"tags\"\n name=\"tags\"\n class=\"admin_tags\"\n style=\"display: none;\"\n data-placeholder=\"Choose a tag...\"\n multiple\n >\nEOT;\n\n // get list of all enabled tags on site for user to select from:\n $siteTags = HTMLHelper::_('tag.tags', ['filter.published' => 1]);\n\n if ($siteTags)\n {\n foreach ($siteTags as $siteTag)\n {\n $html .= \"<option value=\\\"$siteTag->value\\\">\" . Text::_($siteTag->text) . \"</option>\";\n }\n }\n\n $html .= '</select></div>';\n\n // get tags for this item:\n $setTags = new TagsHelper;\n $setTags->getItemTags('com_cajobboard.answers', $answer_id);\n\n // add script tag for JQuery Chosen library to set the selected\n // property for tags that are associated with this item:\n if ($setTags->itemTags)\n {\n // @TODO: this could include a link to the tag edit page for each tag:\n // \\JLoader::register('TagsHelperRoute', \\JPATH_SITE . '/components/com_tags/helpers/route.php');\n\t\t\t// $html .= '<a href=\"' . \\JRoute::_(\\TagsHelperRoute::getTagRoute($tag->id)) . '\">';\n\n $selected = array_keys($setTags->itemTags);\n\n $html .= <<<EOT\n<script>\n $(\"#admin_tags\").val($selected).trigger(\"chosen:updated\");\n</script>\nEOT;\n }\n\t\treturn $html;\n }",
"public static function getForumThemesByTag($forum_id, $tag_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);\n\n\t\t$themes = $tag->themes()\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function getAllResponses()\n {\n return SimpleForumResponse::fetchList(array('topic_id'=>$this->attribute('id')));\n }",
"private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }",
"public function getQuestionById($id=null)\n {\n $qry = \"SELECT * FROM mvc_VQuestion\n WHERE id=?\";\n \n $all = $this->db->executeFetchAll($qry, array($id));\n\n $question = json_decode(json_encode($all[0]),TRUE);\n $tags = $question['tags'];\n $tagIdName = array();\n \n if (!empty($tags)) {\n $tagsSep = explode(\",\", $tags);\n \n foreach ($tagsSep as $key => $val) {\n $tag_id = $this->getTagIdAction($val);\n $tagIdName[] = array('id' => $tag_id, 'name' => $val);\n }\n }\n\n $question_data = array($question, $tagIdName);\n\n return $question_data;\n }",
"public function getTagsByPostId($post_id)\n {\n try {\n $statement = $this->database->prepare(\n 'SELECT tags.name, tags.id FROM tags \n JOIN posts_tags ON tags.id = posts_tags.tags_id \n WHERE posts_tags.posts_id = :post_id');\n $statement->bindParam('post_id', $post_id);\n $statement->execute();\n \n $tags = $statement->fetchAll();\n } catch (Exception $e) {\n $e->getMessage();\n }\n\n return $tags;\n }",
"public function getTaggedQuestions($tagName)\n {\n $this->checkDb();\n $questions = $this->db->connect()\n ->select(\"r1_Post.*\")\n ->from($this->tableName)\n ->join(\"r1_PostTag\", \"r1_Post.id = r1_PostTag.postId\")\n ->join(\"r1_Tag\", \"r1_PostTag.tagId = r1_Tag.id\")\n ->where(\"r1_Tag.tag = ?\")\n ->orderBy(\"r1_Post.created DESC\")\n ->execute([$tagName])\n ->fetchAllClass(get_class($this));\n // $questions = $this->findAllWhereOrderBy(\"type = ?\", [\"question\"], \"created DESC\");\n return $questions;\n }",
"public function getAnswersByQuestion($id){\n $question = $this::find()->with('answers')->where(['id' => $id])->one();\n $answers = '';\n $last_key = end(array_keys($question->answers));\n foreach ($question->answers as $key => $value) {\n if($value['dependent_question_id'] == null)\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/create&option_id='.$value['id'].'>Add Dependent Question</a> <br>';\n else\n $answers .= $value['answer_text'].' <a href='. Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/view&id='.$value['dependent_question_id'].'>See Dependent Question </a>, <a href='.Yii::$app->getUrlManager()->getBaseUrl().'/index.php?r=question/detach&option_id='.$value['id'].'> Detach Question</a><br>';\n }\n return $answers;\n }",
"function getRelatedTagsById ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tags/{$id}/related.json\");\n return $this->createResponse($result,'get Related Tags','Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"public static function get_tags_with_links($topic_id) {\n try {\n $db = ADODB::connect();\n //Get tags in this topoic\n if ($topic_id == '') $topic_id = 0;\n $rs = $db->Execute(\"\n SELECT\n bi.*,\n CASE WHEN bl.topic_id IS NULL THEN 0 ELSE 1 END as selected\n FROM\n tbl_tag_item bi\n LEFT OUTER JOIN tbl_tag_link bl on bi.tag_id = bl.tag_id AND bl.topic_id=$topic_id\n ORDER BY\n selected DESC, bi.tag ASC\n \");\n $tag_items = array();\n while (!$rs->EOF) {\n $tag_item = new Tbl_tag;\n $tag_item->tag_id = $rs->fields['tag_id'];\n $tag_item->tag = $rs->fields['tag'];\n $tag_item->image = $rs->fields['image'];\n $tag_item->default_topic_id = $rs->fields['default_topic_id'];\n $tag_item->topic_count = $rs->fields['topic_count'];\n $tag_item->selected = $rs->fields['selected'];\n $tag_items[] = $tag_item; //add this tag_item to array of Tbl_tag\n $rs->MoveNext();\n }\n return $tag_items;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n } \n }",
"private function getSelectedTagIDs($id) {\n $this->db->select(\"idTag\")\n ->from('tag2question')\n ->where(\"idQuestion = ?\")\n ->execute([$id]);\n $tagIDlist = $this->db->fetchAll();\n\n return $tagIDlist;\n }",
"function post_tags($tag_id){\n\t$result = dbQuery(\"\n\t\tSELECT *\n\t\tFROM tags\n\t\tWHERE tag_id = :tag_id\n\t\t\", array(\n\t\t\t'tag_id' => $tag_id\n\t\t))->fetchAll();\n\treturn $result;\n}",
"function listOfPostsRelatedToATag($tagID) {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT * FROM TagPosts INNER JOIN Posts ON TagPosts.post_id = Posts.post_id WHERE TagPosts.tag_id='\".mysqli_real_escape_string($conn,$tagID). \"' ORDER BY Posts.post_rating DESC\";\n\t$result = $conn->query($dbQuery);\n\n\tif(!$result) {\n\t\t\tdie(\"error listing tagpost of \" . $tagID . \" with this error \" . $conn->error);\n\t\t}\n\t//checking the result array for results\n\t$row = $result->fetch_array();\n\n\t//tag names array\n\t$posts = array();\n\t$i = 0;\n\twhile($row) {\n\t\t$posts[$i] = $row;\n\t\t$i++;\n\t\t$row = $result->fetch_array();\n\t}\n\n\t//closing the connection\n\t$conn->close();\n\n\t//return stuff\n\treturn $posts;\n}",
"function getTags($talentID)\r\n\t{\r\n\t\t$db = Database::getInstance ();\r\n\t\t$mysqli = $db->getConnection ();\r\n\t\t$tagArray = array();\r\n\t\t$sql_query = \"select * from talent_has_tag where talent_talentid = \".$talentID;\r\n\t\t$result = $mysqli->query ( $sql_query );\r\n\t\twhile ( $row = $result->fetch_object () ) {\r\n\t\t\t$sql_query2 = \"select * from tag where tagid = \" . $row->tag_tagid;\r\n\t\t\t$result2 = $mysqli->query ( $sql_query2 );\r\n\t\t\t\r\n\t\t\twhile ( $row2 = $result2->fetch_object () ) {\r\n\t\t\tarray_push ( $tagArray, $row2->tagnaam);\r\n\t\t\t}\t\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\t// return an array with tags\r\n\t\treturn $tagArray;\r\n\t}",
"public function get_forum_ids_and_titles() {\n\n\t\tif ( ! function_exists( 'bbp_get_forum_post_type' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$forums = new \\WP_Query( array(\n\t\t\t'post_type' => bbp_get_forum_post_type(),\n\t\t\t'post_status' => 'publish',\n\t\t\t'posts_per_page' => apply_filters( 'wpauwf_get_forum_ids_and_titles_posts_per_page', 20 ),\n\t\t\t'order' => 'ASC',\n\t\t\t'orderby' => 'ID',\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t) );\n\n\t\t// Bail if we don't have anything returned\n\t\tif ( ! isset( $forums->posts ) || ! is_array( $forums->posts ) || empty( $forums->posts ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// Sort our data into just what we need\n\t\t$data = array();\n\n\t\tforeach ( $forums->posts as $key => $forum_object ) {\n\n\t\t\t$this_forum_id = $forum_object->ID;\n\t\t\t$this_form_title = $forum_object->post_title;\n\n\t\t\t$data[ $this_forum_id ] = $this_form_title;\n\t\t}\n\n\t\treturn $data;\n\n\t}",
"function get_user_vote_by_answer($user_id, $answer_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM votes\r\n WHERE is_active = '1' AND user_id = '$user_id' AND answer_id = '$answer_id';\";\r\n\r\n $votes_data = array();\r\n $votes = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $votes;\r\n}",
"public function findTopicsByForum($forumId)\n {\n $qb = $this->repository->createQueryBuilder('t');\n $qb->select('t', 'p.createdAt', 'COUNT(p) as postsCount')\n ->leftJoin('t.forum', 'f')\n ->leftJoin('t.posts', 'p')\n ->leftJoin('p.author', 'u')\n ->where('f.id = :forumId')\n ->setParameter('forumId', $forumId);\n\n $qb->groupBy('t.id')\n ->orderBy('t.id')\n ->addOrderBy('p.createdAt', 'DESC');\n\n $query = $qb->getQuery();\n\n return $query;\n }",
"public function getRelatedData($data) {\n // If $data array not empty, convert question content from markdown to html, and get user data, Gravatars and tags\n if (is_array($data)) {\n foreach ($data as $id => &$question) {\n\n $question->filteredcontent = $this->textFilter->doFilter($question->getProperties()['content'], 'shortcode, markdown');\n // Get user info\n $users = new \\Enax\\Users\\User();\n $users->setDI($this->di);\n $question->user = $users->find($question->getProperties()['questionUserId']);\n $question->user->gravatar = 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($question->user->getProperties()['email']))) . '.jpg?d=identicon';\n $question->user->stats = $this->UsersController->getUserStats($question->getProperties()['questionUserId']);\n // Get associated tags\n $tagIDlist = $this->getSelectedTagIDs($question->getProperties()['id']);\n $question->tags = array();\n foreach ($tagIDlist as $value) {\n $tag = new \\Enax\\Tags\\Tags();\n $tag->setDI($this->di);\n $res = $tag->find($value->idTag);\n if (!$res->deleted) {\n $question->tags[] = $res;\n }\n }\n\n // Sort tags in alphabetical order by name\n usort($question->tags, function($a, $b) {\n return strcmp($a->name, $b->name);\n });\n\n // Get no of answers to question\n $this->db->select(\"COUNT(*) AS noOfAnswers\")\n ->from('answer')\n ->where(\"questionId = \".$question->getProperties()['id'])\n ->execute();\n\n $res = $this->db->fetchAll();\n $question->noOfAnswers = $res[0]->noOfAnswers;\n }\n }\n return $data;\n }",
"public static function get_tags_array($topic_id) {\n try {\n $db = ADODB::connect();\n $query = \"\n SELECT\n tag\n FROM\n tbl_tag_link tl\n INNER JOIN tbl_tag_item ti on tl.tag_id = ti.tag_id\n WHERE\n tl.topic_id=$topic_id\n \";\n $rs = $db->Execute($query);\n $tags = array();\n while (!$rs->EOF) {\n $tags[] = $rs->fields['tag'];\n $rs->MoveNext();\n }\n return $tags;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n }\n }",
"public function ask_get_answers($id)\n\t{\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = ?\";\n\t\t$data = array($id);\n\t\t$query = $this->db->query($sql, $data);\n\t\t$res = $query->result();\n\t\t$this->load->model('votes_model', 'votesManager');\n\t\tfor( $i=0; $i<count($res); $i++ ) {\n\t\t\t$val = $this->votesManager->votes_get_by_ask($res[$i]->id);\n\t\t\t$res[$i]->nb_votes = ($val) ? $val:0;\n\t\t}\n\n\t\t// The answers are sorted by number of votes\n\t\tusort($res, function($a, $b)\n\t\t{\n\t\t\tif($a->nb_votes == $b->nb_votes) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn ($a->nb_votes < $b->nb_votes) ? 1 : -1;\n\t\t});\n\n\t\tif( $res )\n\t\t\treturn $res;\n\t\telse\n\t\t\treturn 0;\n\t}",
"public function getTaggedQuestions($tagName)\n {\n $title = \"Questions tagged with $tagName\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $tag = $this->di->get(\"tag\");\n\n $questions = $post->getTaggedQuestions($tagName);\n foreach ($questions as $question) {\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->findAllWhere(\"id = ?\", [$question->userId])[0];//$user->find(\"id\", $question->userId);\n }\n\n $pag = $this->getPagination($questions);\n $view->add(\"comment/question-list\", [\n \"questions\" => array_slice($questions, $pag[\"offset\"], $pag[\"length\"], true),\n \"pag\" => $pag,\n ]);\n return $pageRender->renderPage([\"title\" => $title]);\n }",
"public static function get_tags(Info $info, $topic_id=0) {\n try {\n //NOTE: If you are super admin, dont bother joining in perm tables to get accurate topic_count by permission\n //Since you are super, you can read ALL articles, so just use the topic_count column in tbl_badge_item \n $db = ADODB::connect();\n if ($topic_id > 0) {\n //Get tags in this topoic\n if ($info->admin) {\n //This does not take into account permissions on topic_count, becuase Im admin\n $query = \"\n SELECT\n ti.*\n FROM\n tbl_tag_link tl\n INNER JOIN tbl_tag_item ti on tl.tag_id = ti.tag_id\n WHERE\n tl.topic_id=$topic_id\n ORDER BY\n ti.tag\n \";\n } else {\n //This uses a true topic count, taking into account your permissions\n $query = \"\n SELECT\n mainti.tag_id,\n mainti.tag,\n mainti.image,\n mainti.default_topic_id,\n (\n SELECT count(DISTINCT t.topic_id) FROM\n tbl_topic t LEFT OUTER JOIN tbl_tag_link tl on t.topic_id = tl.topic_id\n LEFT OUTER JOIN tbl_perm_link pl on t.topic_id = pl.topic_id\n LEFT OUTER JOIN tbl_perm_group_link pgl on pl.perm_group_id = pgl.perm_group_id\n WHERE t.deleted=0 AND tl.tag_id = mainti.tag_id AND ((pl.perm_id = \".Config::STATIC_PERM_READ.\" AND pgl.user_id = $info->user_id) or t.created_by = $info->user_id)\n ) as topic_count\n FROM\n tbl_tag_link maintl\n INNER JOIN tbl_tag_item mainti on maintl.tag_id = mainti.tag_id\n WHERE\n maintl.topic_id = $topic_id\n ORDER BY\n mainti.tag\n \"; \n }\n } else {\n //Get all tags\n if ($info->admin) {\n //This does not take into account permissions on topic_count, becuase Im admin\n $query = \"SELECT * FROM tbl_tag_item ORDER BY tag\";\n } else {\n //This is a true topic count, taking into account your permissions\n $query = \"\n SELECT\n mainti.tag_id,\n mainti.tag,\n (\n SELECT count(DISTINCT t.topic_id) FROM\n tbl_topic t LEFT OUTER JOIN tbl_tag_link tl on t.topic_id = tl.topic_id\n LEFT OUTER JOIN tbl_perm_link pl on t.topic_id = pl.topic_id\n LEFT OUTER JOIN tbl_perm_group_link pgl on pl.perm_group_id = pgl.perm_group_id\n WHERE t.deleted=0 AND tl.tag_id = mainti.tag_id AND ((pl.perm_id = \".Config::STATIC_PERM_READ.\" AND pgl.user_id = $info->user_id) or t.created_by = $info->user_id)\n ) as topic_count\n FROM\n tbl_tag_item mainti\n ORDER BY\n mainti.tag\n \";\n }\n }\n $rs = $db->Execute($query);\n $tag_items = array();\n while (!$rs->EOF) {\n #print $rs->fields[0].' '.$rs->fields['first_name'].'<BR>';\n $tag_item = new Tbl_tag;\n $tag_item->tag_id = $rs->fields['tag_id'];\n $tag_item->tag = $rs->fields['tag'];\n $tag_item->image = $rs->fields['image'];\n $tag_item->default_topic_id = $rs->fields['default_topic_id'];\n $tag_item->topic_count = $rs->fields['topic_count'];\n $tag_items[] = $tag_item; //add this tag_item to array of Tbl_tag\n $rs->MoveNext();\n }\n return $tag_items;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n } \n }",
"public function getListTags()\n {\n return ArrayHelper::map(QuestionTag::find()->all(), 'id', 'name');\n }"
]
| [
"0.5801272",
"0.56734836",
"0.56378305",
"0.56150043",
"0.5606781",
"0.54201764",
"0.540845",
"0.5354212",
"0.5330763",
"0.5324744",
"0.5312951",
"0.52813727",
"0.5245164",
"0.52038825",
"0.5194717",
"0.5180798",
"0.51577455",
"0.5137206",
"0.51355577",
"0.5097489",
"0.5092103",
"0.50738585",
"0.5053641",
"0.50528264",
"0.50463873",
"0.50393766",
"0.5037257",
"0.5035237",
"0.50271034",
"0.5009899"
]
| 0.67138237 | 0 |
Get forum`s themes by tag | public static function getForumThemesByTag($forum_id, $tag_id)
{
$tag = Tag::findOrFail($tag_id);
$themes = $tag->themes()
->where('forum_id', $forum_id)
->where('is_enable', '=', true)
->orderBy('created_at', 'DESC')
->paginate(10);
return $themes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getForumAnswerThemesByTag($forum_id, $tag_id, $client_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);;\n\n\t\t$themes = $tag->themes()->whereHas('messages', function ($query) {\n\t\t\t$query->where('client_view', '=', false)->where('is_enable', '=', true);\n\t\t})->where('client_id', '=', $client_id)\n\t\t\t->where('forum_id', '=', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function getAllThemeByForumId($forum_id)\n\t{\n\t\t$themes = self::where('is_enable', true)\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->orderBy('created_at', 'DESC')->paginate(10);\n\n\t\treturn $themes;\n\t}",
"function get_themes()\n {\n }",
"public function getAllThemesByForumId($forum_id)\n\t{\n\t\t$themes = self::where('is_enable', true)\n\t\t\t->where('forum_id', $forum_id)->get();\n\n\t\treturn $themes;\n\t}",
"function wpmu_get_blog_allowedthemes($blog_id = 0)\n {\n }",
"public function getAllThemes();",
"public function getTheme();",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"function thrive_dashboard_get_all_themes()\n{\n $themes = thrive_dashboard_get_thrive_products('theme');\n $current_theme = wp_get_theme();\n\n foreach ($themes as $key => $theme) {\n\n if ($current_theme->name == $theme->name) {\n unset($themes[$key]);\n continue;\n }\n\n $local_theme = wp_get_theme($theme->tag);\n if ($local_theme->exists()) {\n $theme->installed = true;\n } else {\n $theme->installed = false;\n }\n }\n\n return $themes;\n}",
"public function getTheme($year, $month){\n\t\n\t\t// Formulate Query\n\t\t$query = sprintf(\n\t\t\t\t\"SELECT name, description, tags\n\t\t\t\tFROM themes WHERE year='%s' AND month='%s'\",\n\t\t\t\tmysql_real_escape_string($year),\n\t\t\t\tmysql_real_escape_string($month)\n\t\t\t);\n\t\t\t\n\t\treturn $this->executeSingleResultQuery($query);\n\t}",
"public function findTheme($themeName);",
"function getThemesSelect( $iThemeSelect ){\n global $config;\n\n $content = null;\n foreach( $config['themes'] as $iTheme => $aData ){\n $content .= '<option value=\"'.$iTheme.'\"'.( ( $iTheme == $iThemeSelect ) ? ' selected=\"selected\"' : null ).'>'.$aData[3].'</option>';\n } // end foreach\n return $content;\n}",
"public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }",
"function get_allowed_themes()\n {\n }",
"public static function getThemeTags() {\n\t\t\t$theme_tags = get_transient( 'if_child_gen_theme_tags' );\n\t\t if( ! $theme_tags ) {\n\t\t $response = wp_remote_get( 'https://api.wordpress.org/themes/info/1.1/?action=feature_list' );\n\t\t if( ! is_wp_error( $response ) ) {\n\t\t $theme_tags = wp_remote_retrieve_body( $response );\n\t\t $theme_tags = json_decode( $theme_tags, true );\n\t\t $theme_tags = $theme_tags ? $theme_tags : array();\n\t\t set_transient( 'if_child_gen_theme_tags', $theme_tags, WEEK_IN_SECONDS );\n\t\t } else {\n\t\t \t$theme_tags = array();\n\t\t }\n\t\t }\n\n\t\t return array_merge($theme_tags, array(\n\t\t \t'Colors' => array(\n\t\t \t\t'black', 'blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'silver', 'tan', 'white', 'yellow',\n\t\t \t\t'dark', 'light',\n\t \t\t)\n\t \t));\n\t\t}",
"function wp_get_active_and_valid_themes()\n {\n }",
"protected function getTheme()\n {\n return !empty($_GET['theme']) ? $_GET['theme'] : 'basic';\n }",
"public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }",
"function website_themes() {\n\n\t$websites = get_website_data();\n\n\t$themes = array();\n\n\tforeach ( $websites as $site ) {\n\t\t$themes[] = $site[ 'theme' ];\n\t}\n\n\treturn array_unique( $themes );\n\n}",
"function get_site_allowed_themes()\n {\n }",
"public function get_meta_themes() {\n\t\tSingleton::get_instance( 'Theme', $this )->get_remote_theme_meta();\n\t}",
"function wysiwyg_tinymce_themes($editor, $profile) {\n /*\n $themes = array();\n $dir = $editor['library path'] . '/themes/';\n if (is_dir($dir) && $dh = opendir($dir)) {\n while (($file = readdir($dh)) !== FALSE) {\n if (!in_array($file, array('.', '..', 'CVS', '.svn')) && is_dir($dir . $file)) {\n $themes[$file] = $file;\n }\n }\n closedir($dh);\n asort($themes);\n }\n return $themes;\n */\n return array('advanced', 'simple');\n}",
"function get_mobile_themes()\r\n\t {\r\n\t\tif(!function_exists('get_themes'))\r\n\t\t\treturn null;\r\n\r\n\t\treturn $wp_themes = get_themes();\r\n\r\n\t\t/*foreach($wp_themes as $name=>$theme) {\r\n\t\t\t$stylish_dir = $wp_themes[$name]['Stylesheet Dir'];\r\n\r\n\t\t\tif(is_file($stylish_dir.'/style.css')) {\r\n\t\t\t\t$theme_data = get_theme_data($stylish_dir.'/style.css');\r\n\t\t\t\t$tags = $theme_data['Tags'];\r\n\r\n\t\t\t\tforeach($tags as $tag) {\r\n\t\t\t\t\tif(eregi('Mobile Theme', $tag) || eregi('WPtap', $tag)) {\r\n\t\t\t\t\t\t$wptap_mobile_themes[$name] = $theme;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $wptap_mobile_themes;*/\r\n\t }",
"public function get_themes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $folder = new Folder(self::PATH_THEMES);\n\n $theme_list = array();\n $folder_list = $folder->get_listing();\n\n foreach ($folder_list as $theme) {\n $file = new File(self::PATH_THEMES . '/' . $theme . '/info/info');\n\n if (!$file->exists())\n continue;\n\n // FIXME info/info -> deploy/info.php\n include self::PATH_THEMES . '/' . $theme . '/info/info';\n $theme_list[$theme] = $package;\n }\n\n // TODO: Sort by name, but key by theme directory\n return $theme_list;\n }",
"public function getThemes($context)\n {\n $themeController = new ThemeController();\n $themes = $themeController->getAllThemes();\n $context->local()->addval('themes', $themes); \n $context->local()->addval('topicChoices', $context->user()->userChoices()); \n if ($context->hasStudent())\n {\n return 'studentViews/themes.twig';\n }\n if ($context->hasML())\n {\n return 'moduleLeaderViews/themes.twig';\n }\n if ($context->hasTL())\n {\n return 'themeLeaderViews/themes.twig';\n }\n if ($context->hasSupervisor())\n {\n return 'supervisorViews/themes.twig';\n }\n return 'error/403.twig';\n }",
"public function getThemes()\n {\n return $this->themes;\n }",
"function wp_ajax_query_themes()\n {\n }",
"function find_all_themes($full_details = false)\n{\n if ($GLOBALS['IN_MINIKERNEL_VERSION']) {\n return $full_details ? array('default' => array()) : array('default' => do_lang('DEFAULT'));\n }\n\n require_code('files');\n\n $themes = array();\n $_dir = @opendir(get_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n if (get_custom_file_base() != get_file_base()) {\n $_dir = @opendir(get_custom_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_custom_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_custom_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n }\n if (!array_key_exists('default', $themes)) {\n $details = better_parse_ini_file(get_file_base() . '/themes/default/theme.ini');\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes['default'] = $full_details ? $details : $details['title'];\n }\n\n // Sort\n if ($full_details) {\n sort_maps_by($themes, 'title');\n } else {\n natsort($themes);\n }\n\n // Default theme should go first\n if (isset($themes['default'])) {\n $temp = $themes['default'];\n $temp_2 = $themes;\n $themes = array('default' => $temp) + $temp_2;\n }\n\n // Admin theme should go last\n if (isset($themes['admin'])) {\n $temp = $themes['admin'];\n unset($themes['admin']);\n $themes['admin'] = $temp;\n }\n\n return $themes;\n}",
"public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }",
"function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}"
]
| [
"0.75726724",
"0.6382531",
"0.6274265",
"0.61965376",
"0.6054409",
"0.60051465",
"0.59603804",
"0.5923665",
"0.58768135",
"0.5850707",
"0.5846627",
"0.58184624",
"0.5749552",
"0.5700737",
"0.5689284",
"0.562996",
"0.5629754",
"0.5604316",
"0.5575218",
"0.5535242",
"0.5457751",
"0.5457749",
"0.54181814",
"0.54002917",
"0.5399658",
"0.5396246",
"0.5389859",
"0.53889287",
"0.5382166",
"0.5371435"
]
| 0.8125899 | 0 |
Get theme`s answers by tag | public static function getForumAnswerThemesByTag($forum_id, $tag_id, $client_id)
{
$tag = Tag::findOrFail($tag_id);;
$themes = $tag->themes()->whereHas('messages', function ($query) {
$query->where('client_view', '=', false)->where('is_enable', '=', true);
})->where('client_id', '=', $client_id)
->where('forum_id', '=', $forum_id)
->where('is_enable', '=', true)
->paginate(10);
return $themes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getForumThemesByTag($forum_id, $tag_id)\n\t{\n\t\t$tag = Tag::findOrFail($tag_id);\n\n\t\t$themes = $tag->themes()\n\t\t\t->where('forum_id', $forum_id)\n\t\t\t->where('is_enable', '=', true)\n\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t->paginate(10);\n\n\t\treturn $themes;\n\t}",
"public function getSimilar(string $tag): array;",
"public function questionsByTagAction($tag=null)\n {\n $tag = strtolower($tag);\n\n $sql = \"SELECT * FROM mvc_tag WHERE name='\" . $tag . \"'\";\n $all = $this->db->executeFetchAll($sql);\n \n if ($all) {\n $tag_info = json_decode(json_encode($all[0]),TRUE);\n \n $sql = \"SELECT idQuestion FROM mvc_tag2question WHERE idTag='\" . $tag_info['id'] . \"'\";\n $all = $this->db->executeFetchAll($sql);\n $all = json_decode(json_encode($all),TRUE);\n $questions = array();\n foreach ($all as $key => $val) {\n $qid = $val['idQuestion'];\n $questions[] = $this->getQuestionById($qid);\n }\n }\n \n $res = array();\n $res['tag_info'] = $tag_info;\n $res['questions'] = $questions;\n \n return $res;\n }",
"public function findByTag($tag);",
"private function parse_answers() {\n\t\t\t$answer = array();\n\n\t\t\tforeach ( $this->answer_data as $index => $answer_data ) {\n\t\t\t\t$no_markup_answer = wp_strip_all_tags( $answer_data->getAnswer() );\n\t\t\t\tpreg_match_all( '#\\{(.*?)\\}#im', $no_markup_answer, $matches );\n\n\t\t\t\tforeach ( $matches[1] as $match ) {\n\t\t\t\t\tpreg_match_all( '#\\[([^\\|\\]]+)(?:\\|(\\d+))?\\]#im', $match, $ms );\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Currently only one set of answers are supported by LD.\n\t\t\t\t\t * So as soon as we get matches, we assign and break the loop.\n\t\t\t\t\t */\n\t\t\t\t\tif ( ! empty( $ms[1] ) ) {\n\t\t\t\t\t\t$answer = $ms[1];\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\treturn $answer;\n\t\t}",
"public function findByTag($tag)\n\t{\n\t\t// TODO: Implement findByTag() method.\n\t}",
"public function getByTag(string $tag): array;",
"function scrappy_get_radios($id) {\n $args = array(\n 'posts_per_page' => -1,\n 'offset' => 0,\n 'category' => '',\n 'category_name' => '',\n 'orderby' => 'meta_value',\n 'order' => 'DESC',\n 'include' => '',\n 'exclude' => '',\n 'meta_key' => '',\n 'meta_value' => '',\n 'post_type' => 'radio',\n 'post_mime_type' => '',\n 'post_parent' => '',\n 'author'\t => '',\n 'author_name'\t => '',\n 'post_status' => 'publish',\n 'suppress_filters' => true,\n /*'tax_query' => array(\n array(\n 'taxonomy' => 'radio_category',\n 'field' => 'id',\n 'terms' => 2\n )\n ),*/\n 'meta_key' => 'scrappy_url',\n );\n if ( $id ) {\n $args['post__in'] = ( is_array($id) ? $id : array($id));\n }\n return get_posts( $args );\n}",
"public function tagged($tag)\n {\n $results = [];\n if (isset($this->tags[$tag])) {\n foreach ($this->tags[$tag] as $abstract) {\n $results[] = $this->make($abstract);\n }\n }\n return $results;\n }",
"public function getAnswers();",
"public function getTaggedQuestions($tagName)\n {\n $this->checkDb();\n $questions = $this->db->connect()\n ->select(\"r1_Post.*\")\n ->from($this->tableName)\n ->join(\"r1_PostTag\", \"r1_Post.id = r1_PostTag.postId\")\n ->join(\"r1_Tag\", \"r1_PostTag.tagId = r1_Tag.id\")\n ->where(\"r1_Tag.tag = ?\")\n ->orderBy(\"r1_Post.created DESC\")\n ->execute([$tagName])\n ->fetchAllClass(get_class($this));\n // $questions = $this->findAllWhereOrderBy(\"type = ?\", [\"question\"], \"created DESC\");\n return $questions;\n }",
"function question_tag_get($data)\n\t {\n\t \t$tags_arr = $this->retrieve_tags($data);\n\t \t\n\t \tif($data['lang_code'] == 'zh')\n {\n \t $processed_tags = $this->re_generate_chinese_tags($tags_arr);\n \t $location_tag = $processed_tags['location'];\n \t $tags_arr = $processed_tags['tag'];\n \t\n \t $tags_arr = array_merge($location_tag, $tags_arr);\n }\n return $tags_arr;\n\t }",
"public function fetchByTagName($tag) \n {\n $designs = $this->model->withAllTags($tag)->with('user')->get();\n\n // Then return the results of the search\n return $designs;\n }",
"function get_suit_from_tag($decks,$tag,$def) {\n\tforeach ($decks as $key => $value) {\n\t\tif ($value['tag'] == $tag) return $key;\n\t}\t\n\treturn $def;\n}",
"public static function getThemeTags() {\n\t\t\t$theme_tags = get_transient( 'if_child_gen_theme_tags' );\n\t\t if( ! $theme_tags ) {\n\t\t $response = wp_remote_get( 'https://api.wordpress.org/themes/info/1.1/?action=feature_list' );\n\t\t if( ! is_wp_error( $response ) ) {\n\t\t $theme_tags = wp_remote_retrieve_body( $response );\n\t\t $theme_tags = json_decode( $theme_tags, true );\n\t\t $theme_tags = $theme_tags ? $theme_tags : array();\n\t\t set_transient( 'if_child_gen_theme_tags', $theme_tags, WEEK_IN_SECONDS );\n\t\t } else {\n\t\t \t$theme_tags = array();\n\t\t }\n\t\t }\n\n\t\t return array_merge($theme_tags, array(\n\t\t \t'Colors' => array(\n\t\t \t\t'black', 'blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'silver', 'tan', 'white', 'yellow',\n\t\t \t\t'dark', 'light',\n\t \t\t)\n\t \t));\n\t\t}",
"public function getTags() {\n\t\t$sql = \"SELECT tags FROM question\";\n\t\t$this->db->execute($sql);\n\t\treturn $this->db->fetchAll();\n\t}",
"function publicacoes_relacionadas() { \n $limitpost = 3;\n global $post;\n \n $tags = wp_get_post_tags($post->ID);\n $tag_ids = array();\n foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;\n $args_tags = array( 'tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'order' => 'RAND', 'posts_per_page'=> $limitpost, 'ignore_sticky_posts'=> 1 );\n $my_query_tags = new WP_Query($args_tags);\n \n \n if ($my_query_tags->have_posts()) {\n $i = 1;\n while($my_query_tags->have_posts()) {\n $my_query_tags->the_post();\n ?>\n \n <div class=\"item\" style=\"background-image: url('<?php thumb_url(); ?>');\">\n <a href=\"<?php the_permalink(); ?>\"><h5><?php the_title(); ?></h5></a>\n </div> \n\n\n <?php $i++; }\n }\n \n else {}\n wp_reset_query();\n}",
"public function getTaggedQuestions($tagName)\n {\n $title = \"Questions tagged with $tagName\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n $post = new Post($this->di->get(\"db\"));\n $user = new User($this->di->get(\"db\"));\n $tag = $this->di->get(\"tag\");\n\n $questions = $post->getTaggedQuestions($tagName);\n foreach ($questions as $question) {\n $question->tags = $tag->getPostTags($question->id);\n $question->user = $user->findAllWhere(\"id = ?\", [$question->userId])[0];//$user->find(\"id\", $question->userId);\n }\n\n $pag = $this->getPagination($questions);\n $view->add(\"comment/question-list\", [\n \"questions\" => array_slice($questions, $pag[\"offset\"], $pag[\"length\"], true),\n \"pag\" => $pag,\n ]);\n return $pageRender->renderPage([\"title\" => $title]);\n }",
"public function findByTag(string $tag): iterable;",
"public function findWithTag(string $tag): array\n {\n $definitions = [];\n array_walk_recursive(\n $this->definitions,\n function (Definition $definition) use ($tag, &$definitions) {\n if ($definition->hasTag($tag)) {\n $definitions[] = $definition;\n }\n }\n );\n\n return $definitions;\n }",
"public function getSimilar($tag): array\n {\n return $this->unsignedCall('tag.getSimilar', [\n 'tag' => $tag,\n ]);\n }",
"function getBenchmarksByTag(string $tag){\n $benchmarks = [];\n foreach ($this->benchmarks as $benchmark){\n if($benchmark->hasTag($tag)){\n $benchmarks[] = $benchmark;\n }\n }\n return $benchmarks;\n }",
"function website_get_by_tag( $tag = '', $limit = -1 ) {\n\n\treturn false;\n\n\t$tag_websites = array();\n\t$websites = get_website_data();\n\n\tif ( $tag ) {\n\n\t\tforeach ( $websites as $key => $website ) {\n\t\t\tif ( in_array( $tag, $website[ 'tags' ] ) ) {\n\t\t\t\t$tag_websites[ $key ] = $website;\n\t\t\t}\n\t\t}\n\n\t} else {\n\n\t\t// no tag so change limit to 15\n\t\tif ( $limit < 0 ) {\n\t\t\t$limit = 15;\n\t\t}\n\n\t\tshuffle( $websites );\n\t\t$tag_websites = array_slice( $websites, 0, $limit );\n\n\t}\n\n\tif ( $limit > 0 ) {\n\t\t$tag_websites = array_slice( $tag_websites, 0, $limit );\n\t}\n\n\t// shuffle homepage only\n\tif ( ! $tag ) {\n\t\tshuffle( $tag_websites );\n\t}\n\n\treturn $tag_websites;\n\n}",
"function retrieve_tags($data)\n\t {\n\t\t $text = $data['text'];\n\t\t $lang_code = $data['lang_code'] ? $data['lang_code']:$this->language_translate->check($text);\n\t\t $retArr = array(); \n\t\t \n\t\t switch($lang_code)\n\t\t {\n\t\t case 'zh':\n $retArr = $this->tag_extract->retrieve_zh($text);\n break;\n case 'en':\n $retArr = $this->tag_extract->retrieve_en($text);\n break;\n default:\n\t\t $retArr = $this->tag_extract->retrieve_en($text);\n break;\n\t\t }//switch\n\t\t return $retArr;\n\t }",
"function findAnswer($question, $userValue)\n{\n if(!isset($question[\"form_answers\"])) return null;\n\n $ans = null;\n foreach ($question[\"form_answers\"] as $ans)\n if(matchStrings($userValue, $ans[\"label\"]))\n return $ans;\n if(@$ans[\"data_type\"]) return $ans;\n return null;\n}",
"public function findTagsUsage()\n {\n $model = $this->getTagModel();\n $mapper = $this->getMapper();\n $locales = array();\n\n switch ( $this->mode )\n {\n case static::MODE_STRICT:\n $locales = array( $mapper->getLocale() );\n break;\n\n case static::MODE_PRIMARY:\n default:\n $locales = array( $mapper->getLocale(),\n $mapper->getPrimaryLanguage() );\n break;\n }\n\n return $model->findUsagesByLocales( $locales );\n }",
"public function index($idea_theme = '')\n {\n if(empty($idea_theme)){\n return redirect()->route('admin.home');\n }\n $idea_theme = $this->idea_theme\n ->find($idea_theme);\n\n\n $posts = Post::whereHas('tags', function($query) use($idea_theme){\n $query->where('name', $idea_theme->tag);\n })\n ->withCount('goods')\n ->orderBy('goods_count', 'desc')\n ->get();\n $param = [\n 'idea_theme' => $idea_theme,\n 'posts' => $posts,\n ];\n return view('admin.idea_theme_posts.index', $param);\n }",
"public function searchTermLang ($theme, $term, $lang){\n $json = new JsonFile ($this->host . '/api/' . $theme . '/tw/' . $term . '/' . $lang);\n $json->parse();\n \n return $json;\n }",
"public function questionsByTagIdAction($tagid=null)\n {\n\n $sql = \"SELECT * FROM mvc_tag WHERE id='\" . $tagid . \"'\";\n $all = $this->db->executeFetchAll($sql);\n \n if ($all) {\n $tag_info = json_decode(json_encode($all[0]),TRUE);\n \n $sql = \"SELECT idQuestion FROM mvc_tag2question WHERE idTag='\" . $tag_info['id'] . \"'\";\n $all = $this->db->executeFetchAll($sql);\n $all = json_decode(json_encode($all),TRUE);\n $questions = array();\n foreach ($all as $key => $val) {\n $qid = $val['idQuestion'];\n $questions[] = $this->getQuestionById($qid);\n }\n }\n \n $res = array();\n $res['tag_info'] = $tag_info;\n $res['questions'] = $questions;\n \n return $res;\n }",
"public function tagAction() {\n\n $tag = null;\n\n $qhits = $this->di->request->getGet('hits') ? $this->di->request->getGet('hits') : $this->di->session->get('qhits');\n $qhits = $qhits ? $qhits : 10;\n $this->di->session->set('qhits', $qhits);\n $page = $this->di->request->getGet('page') ? $this->di->request->getGet('page') : 0;\n\n if ($this->di->request->getGet('tag')) {\n $tag = $this->di->request->getGet('tag');\n } else {\n $url = $this->url->create('question');\n $this->response->redirect($url);\n }\n\n $t = new \\Enax\\Tags\\Tags();\n $t->setDI($this->di);\n $tagname = $t->find($tag);\n\n $count = $this->questions->query(\"COUNT(*) AS count\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->execute();\n\n $get = array('tag' => $tag, 'hits' => $qhits, 'page' => $page);\n\n if ($count[0]->count == 0) {\n $pagelinks = $this->pager->paginateGet(1, 'question/tag', $get, $this->customhits);\n } else {\n $pagelinks = $this->pager->paginateGet($count[0]->count, 'question/tag', $get, $this->customhits);\n }\n\n $all = $this->questions->query(\"q.*\")\n ->from('question AS q')\n ->join('tag2question AS t2q', 'q.id = t2q.idQuestion')\n ->where(\"t2q.idTag = \" . $tag)\n ->limit($qhits)\n ->offset($page)\n ->groupBy('q.id')\n ->orderBy('q.created DESC')\n ->execute();\n $all = $this->getRelatedData($all);\n\n $this->theme->setTitle($tagname->getProperties()['name']);\n $this->views->add('forum/forum', [\n 'content' => $all,\n 'pages' => $pagelinks,\n 'title' => 'Frågor om ' . $tagname->getProperties()['name'],\n ]);\n\n $title = $count[0]->count == 1 ? $count[0]->count .' fråga' : $count[0]->count .' frågor';\n $this->views->add('tags/view', [\n 'title' => $title,\n 'tags' => $tagname,\n ]);\n }"
]
| [
"0.58970195",
"0.5617153",
"0.55749303",
"0.539915",
"0.5374884",
"0.5294036",
"0.5270372",
"0.5198976",
"0.51983833",
"0.5172614",
"0.5154571",
"0.514972",
"0.5143937",
"0.51127315",
"0.50876266",
"0.50586367",
"0.50485873",
"0.5046046",
"0.5037922",
"0.49705628",
"0.49692523",
"0.4955004",
"0.49368078",
"0.49306297",
"0.4903668",
"0.4902947",
"0.48979804",
"0.48959765",
"0.48662564",
"0.48496553"
]
| 0.669529 | 0 |
method that checks if file is jpg | public static function isItJpg($tmpName){
if(exif_imagetype($tmpName) != IMAGETYPE_JPEG){
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }",
"function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}",
"function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}",
"public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }",
"function file_is_valid_image($path)\n {\n }",
"function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}",
"public static function isJpegFile($filename)\n {\n try {\n $image = new ImageFile($filename);\n if (strtolower($image->getMime()) !== @image_type_to_mime_type(IMAGETYPE_JPEG)) {\n return false;\n }\n\n return true;\n } catch (\\RuntimeException $ex) {\n return false;\n }\n }",
"function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}",
"public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }",
"function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}",
"function isImage(string $filename) : bool {\n return (bool) preg_match(\"/(png|gif|jpg|jpeg)/\", pathinfo($filename, PATHINFO_EXTENSION));\n}",
"function is_image($file)\n{\n $type = get_image_type($file);\n $mime = get_image_mime_type($type);\n\n return substr($mime, 0, 5) == 'image';\n}",
"function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}",
"function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }",
"function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}",
"function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}",
"function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}",
"public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}",
"function CheckImageExtension($filename)\n{\n\tif(strlen($filename)<4)\n\t\treturn false;\n\t$ext=strtoupper(substr($filename,strlen($filename)-4));\n\tif($ext==\".GIF\" || $ext==\".JPG\" || $ext==\"JPEG\" || $ext==\".PNG\" || $ext==\".BMP\")\n\t\treturn $ext;\n\treturn false;\n}",
"function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}",
"private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}",
"private function hasJPGExtension(string $path): bool\n {\n $extensionIndex = strrpos($path, '.');\n if (false === $extensionIndex) {\n return false;\n }\n $extension = strtolower(substr($path, $extensionIndex));\n return '.jpg' === $extension || '.jpeg' === $extension;\n }",
"public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }",
"function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function check($file){\n if(\\File::exists($file)){\n $mime = mime_content_type($file);\n if(substr($mime, 0, 5) == 'image') {\n // this is an image\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }",
"function isImage($filename) {\n \tglobal $synAbsolutePath;\n if (file_exists($synAbsolutePath.$filename)) {\n if (getimagesize($synAbsolutePath.$filename)!==false) $ret=true;\n else $ret=false;\n } else $ret=false;\n return $ret;\n }",
"public static function isImage($file){\n if(is_file($file)){\n $info = getimagesize($file);\n if(isset($info) && $info[2] > 0)\n return true;\n }\n return false;\n }",
"function isImageType($tempFileName)\n{\n\t$isImage = true;\n\t\n\t// Check if image file is actual image type\n $check = exif_imagetype($tempFileName);\n\t\n if ($check === false) \n\t{\n $isImage = false;\n\t}\n\t\n\treturn $isImage;\n}",
"public function isImage()\n {\n return strtolower(substr($this->getMimeType(), 0, 5)) == 'image';\n }"
]
| [
"0.74149257",
"0.7370129",
"0.7368633",
"0.73174757",
"0.7315612",
"0.7296605",
"0.7282665",
"0.7274301",
"0.72653604",
"0.7217313",
"0.7189205",
"0.71811116",
"0.7179335",
"0.7149777",
"0.7145668",
"0.71277",
"0.70578474",
"0.70335764",
"0.70295227",
"0.6936391",
"0.6931549",
"0.693091",
"0.6906974",
"0.68832135",
"0.6872951",
"0.68592733",
"0.68469054",
"0.6840333",
"0.68265194",
"0.68090487"
]
| 0.7528213 | 0 |
Status relationship. Used to indicate the lease status. | public function status()
{
return $this->belongsTo(RentalStatus::class, 'rental_status_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function status()\n {\n //retorna un solo objeto, ya que el usuario solo tiene un status\n return $this->belongsTo('Vest\\Tables\\Status');\n }",
"public function status()\n\t{\n\t\treturn $this->hasOne('Quill\\Status\\Models\\Status', 'id', 'status');\n\t}",
"public function getStatus () {\n return $this->hasOne('App\\Models\\Admin\\Status', 'id', 'status');\n }",
"public function status() {\n return $this->belongsTo(Status::class);\n }",
"public function status()\n {\n return $this->belongsTo(Status::class);\n }",
"public function status()\n {\n return $this->belongsTo(Status::class);\n }",
"public function status() {\n return $this->hasOne(Status::class, 'id', 'status_id');\n }",
"public function status()\n\t{\n\t\treturn $this->hasOne(Status::class,'id','status_id');\t\t\t\t\n\t}",
"public function status()\n {\n return $this->belongsTo( Status::class );\n }",
"public function getStatus()\n {\n return $this->hasOne(Status::className(), ['id' => 'status_id']);\n }",
"public function status()\n {\n return $this->belongsTo('App\\Status');\n }",
"public function status()\n {\n return $this->belongsTo('App\\Status');\n }",
"public function status()\n {\n return $this->belongsTo('App\\Status');\n }",
"public function status()\n {\n return $this->belongsTo('App\\Status');\n }",
"public function getStatus()\n {\n return $this->hasOne(Status::class, ['id' => 'status_id']);\n }",
"public function status()\n {\n return $this->belongsTo('App\\MasterModel\\MasterFilingStatus', 'status_id', 'id');\n }",
"public function getRelationshipStatus()\n\t{\n\t\treturn $this->relationship_status;\n\t}",
"public function status()\n {\n return $this->belongsTo(\\App\\Models\\CaseFileStatus::class, \"status_id\", \"id\");\n }",
"public function status()\n {\n return $this->hasOne(StatusRequest::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::STATUS_FOREIGN_KEY);\n }",
"public function status()\n {\n return $this->belongsTo('App\\Models\\Article_Status');\n }",
"public function status()\n {\n return $this->status->get($this->entity->status);\n }",
"public function status()\n {\n return $this->belongsTo(StatusAgendamento::class);\n }",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();"
]
| [
"0.68795246",
"0.67221636",
"0.66378355",
"0.6555138",
"0.6515536",
"0.6515536",
"0.6504555",
"0.6492529",
"0.64659667",
"0.6465952",
"0.6437408",
"0.6437408",
"0.6437408",
"0.6437408",
"0.6408961",
"0.6389273",
"0.63399184",
"0.62895423",
"0.6269685",
"0.623214",
"0.6225311",
"0.6210554",
"0.6165694",
"0.6165694",
"0.6165694",
"0.6165694",
"0.6165694",
"0.6165694",
"0.6165694",
"0.6165694"
]
| 0.67563725 | 1 |
Public function plugin_dir. set for plugin dir | public function plugin_dir(){
return trailingslashit(plugin_dir_path( __FILE__ ));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function wp_plugins_dir()\n {\n }",
"public static function set_plugin_folder($dir)\n {\n return Core\\Plugins::SetPluginFolder($dir);\n }",
"public static function set_plugin_folder($dir)\n {\n //=================================================================\n // Validate Directory\n //=================================================================\n if (!$dir || !is_dir($dir)) {\n \ttrigger_error('Error: set_plugin_folder(): Invalid directory passed.');\n \treturn false;\n }\n\n //=================================================================\n // Get the MD5 Hash for indexing\n //=================================================================\n $pf_hash = md5($dir);\n\n //=================================================================\n // Does App Plugin Index Exist?\n //=================================================================\n if (!isset($_SESSION['app_plugin_folder'])) {\n $_SESSION['app_plugin_folder'] = array();\n }\n //=================================================================\n // Check if plugin folder is already set\n //=================================================================\n else if (isset($_SESSION['app_plugin_folder'][$pf_hash])) {\n return true;\n }\n\n //=================================================================\n // Addd New Plugin Folder\n //=================================================================\n \t$_SESSION['app_plugin_folder'][$pf_hash] = $dir;\n \treturn true;\n }",
"function _get_plugin_directory() {\n return __DIR__;\n}",
"public function plugin_dir( $path ) {\n\n\t\t\tif ( ! $this->plugin_dir ) {\n\t\t\t\t$this->plugin_dir = trailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( null != $path ) {\n\t\t\t\treturn $this->plugin_dir . $path;\n\t\t\t}\n\n\t\t\treturn $this->plugin_dir;\n\n\t\t}",
"public function get_plugin_dir_path() {\n\t\treturn $this->plugin_dir_path;\n\t}",
"public function addPluginDir($dir)\r\n {\r\n $this->_smarty->addPluginsDir($dir);\r\n }",
"public static function plugin_dir_url() {\n return plugin_dir_url( __FILE__ );\n }",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"public function getPluginDir (): string {\n return $this->pluginDir;\n }",
"function _get_plugin_directory() {\n return wp_normalize_path( trailingslashit(dirname( __FILE__ )));\n}",
"public function plugin_path() {\n if ( $this->plugin_path ) return $this->plugin_path;\n\n return $this->plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) );\n }",
"public function plugin_plugin_path() {\n\n\t return untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}",
"public function plugin_path()\n {\n return plugin_dir_path(__FILE__);\n }",
"public function get_directory_url() {\n \treturn $this->plugin_dir_url;\n }",
"public function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}",
"public function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}",
"public function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}",
"public static function dirPlugins()\n\t{\n\t\treturn defined('DIR_PLUGINS') ? DIR_PLUGINS : __DIR__ . DIRECTORY_SEPARATOR . 'plugins';\n\t}",
"public function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}",
"function plugin_dir_path($file)\n {\n }",
"function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}",
"function myplugin_get_plugin_path() {\n\t// Gets the absolute path to this plugin directory.\n\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n}",
"public function setDir($dir);",
"public function plugin_path() {\n return untrailingslashit( plugin_dir_path( __FILE__ ) );\n }",
"function es_plugin_path() {\n // gets the absolute path to this plugin directory\n return untrailingslashit( plugin_dir_path( __FILE__ ) );\n}",
"function _add_plugins_dir( $module )\n {\n $modinfo = pnModGetInfo(pnModGetIDFromName($module));\n $modpath = ($modinfo['type'] == 3) ? 'system' : 'modules';\n $mod_plugs = \"$modpath/$modinfo[directory]/pntemplates/plugins\";\n if (file_exists($mod_plugs)) {\n array_push($this->plugins_dir, $mod_plugs);\n }\n\n// uncomment for .8 until modtype=3 for system modules is implemented\n $modpath = 'system';\n $mod_plugs = \"$modpath/$modinfo[directory]/pntemplates/plugins\";\n if (file_exists($mod_plugs)) {\n array_push($this->plugins_dir, $mod_plugs);\n }\n }",
"public function get_plugin_path() {\n\t\t$this->plugin_path = untrailingslashit( plugin_dir_path( dirname( __FILE__ ) ) );\n\t\treturn $this->plugin_path;\n\t}",
"function plugins_url()\n{\n return __DIR__;\n}",
"public static function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( DAHZEXTENDER_PLUGIN_FILE ) );\n\t\t}"
]
| [
"0.7699601",
"0.73883086",
"0.72234905",
"0.72081983",
"0.7188531",
"0.70749605",
"0.6895612",
"0.68757117",
"0.6820582",
"0.6788757",
"0.6752123",
"0.67483205",
"0.6724161",
"0.66757125",
"0.65551674",
"0.6551017",
"0.6551017",
"0.6551017",
"0.65324605",
"0.6531345",
"0.65272814",
"0.6525032",
"0.65211993",
"0.6509842",
"0.65057474",
"0.64753157",
"0.64569294",
"0.64345783",
"0.63793194",
"0.6361581"
]
| 0.76802635 | 1 |
Public function core_url . set for plugin core folder url | public function core_url(){
return $this->plugin_url() . 'core/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_core_url() {\n\t\t\treturn trailingslashit( $this->settings['base_url'] );\n\t\t}",
"public function setup_plugin_url()\n {\n }",
"public function plugin_url(){\n return trailingslashit(plugin_dir_url( __FILE__ ));\n }",
"public function core_dir(){\n return $this->plugin_dir() . 'core/';\n }",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function base_url(){\n return $this->plugin_url() . 'base/';\n }",
"function plugin_url() {\n\t\treturn untrailingslashit( plugin_dir_url( __FILE__ ) );\n\t}",
"public function plugin_url() {\n\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t}",
"function plugin_url() {\n if ( $this->plugin_url ) return $this->plugin_url;\n\n return $this->plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );\n }",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"public function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"public function get_plugin_url() {\n\n\t\t\treturn str_replace( '/classes', '/', untrailingslashit( plugins_url( '/', __FILE__ ) ) );\n\n\t\t}",
"public static function get_url() {\n\t\treturn ( get_bloginfo('wpurl')) . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/';\n\t}",
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"function plugins_url($path = '', $plugin = '')\n {\n }",
"function local_mediacore_fetch_lti_baseurl() {\n global $DB;\n $record = $DB->get_record('config_plugins', array(\n 'plugin' => MEDIACORE_LOCAL_COURSELTI_SETTING_NAME,\n 'name' => 'mediacore_url',\n ));\n if (empty($record) || empty($record->value)) {\n return 'http://demo.mediacore.tv'; //default\n }\n return $record->value;\n}",
"function put_my_url(){\n\treturn (get_home_url());\n}",
"public static function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', DAHZEXTENDER_PLUGIN_FILE ) );\n\t\t}",
"public static function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}",
"public static function getCoreRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '//www.palmettonewmedia.com/foodfinder/core';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'] . '/core';\n }\n }",
"protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}",
"public function utils_url(){\n return $this->plugin_url() . 'utils/';\n }",
"public function plugin_url( $path = null ) {\n\n\t\t\tif ( ! $this->plugin_url ) {\n\t\t\t\t$this->plugin_url = trailingslashit( plugin_dir_url( __FILE__ ) );\n\t\t\t}\n\n\t\t\tif ( null != $path ) {\n\t\t\t\treturn $this->plugin_url . $path;\n\t\t\t}\n\n\t\t\treturn $this->plugin_url;\n\n\t\t}",
"protected function initCurrentUrl() {}",
"protected function initCurrentUrl() {}",
"function base_url(){\n return BASE_URL;\n }",
"function admin_url()\n{\n set_theme_base_url('admin');\n $args = func_get_args();\n $url = call_user_func_array('url', $args);\n revert_theme_base_url();\n return $url;\n}"
]
| [
"0.81152576",
"0.7053546",
"0.6971799",
"0.67860746",
"0.6729122",
"0.6729122",
"0.6729122",
"0.6728827",
"0.67005706",
"0.6665887",
"0.6578553",
"0.65564436",
"0.6536107",
"0.6437337",
"0.64294994",
"0.64270097",
"0.64064085",
"0.6374435",
"0.6344844",
"0.6324784",
"0.6321341",
"0.63196725",
"0.6306524",
"0.6297796",
"0.62805337",
"0.6249124",
"0.62349087",
"0.62349087",
"0.62023896",
"0.6192197"
]
| 0.8654432 | 0 |
Public function core_dir . set for plugin core folder dir | public function core_dir(){
return $this->plugin_dir() . 'core/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}",
"public function getCoreDir()\n {\n if(!Config::has('MAIN/core_path'))\n {\n Config::set('MAIN/core_path', $this->guessCoreDir());\n }\n\n return Config::get('MAIN/core_path');\n }",
"public function getPublicAframeCoreDir()\n {\n return $this->public_core_dir ?? $this->getPublicRoot() . DIRECTORY_SEPARATOR . 'core';\n }",
"protected function getCoreFolder() {\n return 'core/' . $this->getCollectionDirectory();\n }",
"public function getRootDir(){\n\t\treturn str_replace(realpath($_SERVER['DOCUMENT_ROOT']), \"\", realpath(dirname(__DIR__ . \"/../core.php\")));\n\t}",
"function core_path($path = '')\n {\n return phanda()->corePath() . ($path ? DIRECTORY_SEPARATOR . $path : $path);\n }",
"function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}",
"protected function getCorePath()\n {\n $path = $this->source . '/core/';\n if (array_key_exists('core', $this->destinations)) {\n // Custom core destination\n $path = $this->destinations['core'];\n }\n\n return realpath($path);\n }",
"public function core_url(){\n return $this->plugin_url() . 'core/';\n }",
"public function plugin_dir(){\n return trailingslashit(plugin_dir_path( __FILE__ ));\n }",
"public function getAframeCoreSrcDir()\n {\n return $this->public_src_dir ?? $this->public_src_dir = $this->getVendorDir() . DIRECTORY_SEPARATOR . 'mkungla' . DIRECTORY_SEPARATOR . 'aframe' . DIRECTORY_SEPARATOR . 'dist';\n }",
"public function getCorePath()\n {\n return WP::applyFilters('wpmvc_core_path', $this->corePath);\n }",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"protected function action_getUserMainDir() {}",
"protected function _Load_Core() {\r\n $dir = untrailingslashit( plugin_dir_path(__FILE__ ) );\r\n // Recurssively load the directory\r\n $this->_Recusive_Load_Dir($dir.'/core');\r\n // Fire the shortcode init action\r\n do_action('vcff_supports_core_init',$this);\r\n }",
"public function getLibDir()\n {\n return Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'hycube' . DS . 'geoip';\n }",
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"public function wp_plugins_dir()\n {\n }",
"private function getPath()\r\n\t{\r\n\t\treturn WORDWEBPRESS_INCLUDE . \r\n\t\t\t\tWordwebpress::getInstance()->configuration()->get_cfn_value('core_path') .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Wordwebpress' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Admin' .\r\n\t\t\t\tDIRECTORY_SEPARATOR .\r\n\t\t\t\t'Html' .\r\n\t\t\t\tDIRECTORY_SEPARATOR;\r\n\t}",
"public function GetAppDir ();",
"function _get_plugin_directory() {\n return __DIR__;\n}",
"public function utils_dir(){\n return $this->plugin_dir() . 'utils/';\n }",
"function dirPath() {return (\"../../../../\"); }",
"function setDir()\n{\n\t// This script is sometimes called from the other directories - for auto sending, so we need to change the directory\n\t$pos = strrpos(__FILE__, '/');\n\tif ($pos === false)\n\t{\n\t\t$pos = strrpos(__FILE__, '\\\\');\n\t\tif ($pos === false)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\t$dir = substr(__FILE__, 0, $pos);\n\tchdir($dir);\n}",
"public function get_plugin_dir_path() {\n\t\treturn $this->plugin_dir_path;\n\t}",
"function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }",
"public function plugin_path() {\n\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t}",
"public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }",
"public function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}",
"public function plugin_path() {\n\t\t\treturn untrailingslashit( plugin_dir_path( __FILE__ ) );\n\t\t}"
]
| [
"0.824423",
"0.7350552",
"0.70510983",
"0.7047886",
"0.6972011",
"0.6875568",
"0.6677055",
"0.6561827",
"0.6558495",
"0.6552478",
"0.64993",
"0.6490473",
"0.64722234",
"0.6345371",
"0.6291851",
"0.61839974",
"0.6111516",
"0.6099364",
"0.6065931",
"0.6001416",
"0.5996872",
"0.5986834",
"0.59739065",
"0.5957319",
"0.5940399",
"0.59361607",
"0.5931867",
"0.59292346",
"0.5919756",
"0.5919756"
]
| 0.8694093 | 0 |
Public function base_url . set for plugin base folder url | public function base_url(){
return $this->plugin_url() . 'base/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"function base_url(){\n return BASE_URL;\n }",
"function get_base_url() {\n return $this->base_url;\n }",
"function base_url(){\n $url = BASE_URL;\n return $url;\n }",
"public function base_url()\n\t{\n\t\treturn URL::base();\n\t}",
"public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}",
"function set_base_url($url) {\n if($url[strlen($url)-1] != '/') {\n $url .= '/'; \n }\n \n $this->base_url = $url;\n }",
"function base_url() {\r\necho \"<base href=\" . get_site_url() . \">\";\r\n}",
"function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }",
"private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}",
"public function base_url()\n {\n if (isset($_SERVER['HTTP_HOST']) && preg_match('/^((\\[[0-9a-f:]+\\])|(\\d{1,3}(\\.\\d{1,3}){3})|[a-z0-9\\-\\.]+)(:\\d+)?$/i', $_SERVER['HTTP_HOST']))\n {\n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $baseurl = $protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));\n }\n else\n {\n $baseurl = 'http://localhost/';\n }\n\n return $baseurl;\n }",
"public function base_url() {\n\t\t$protocol = ( ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$script = dirname($_SERVER['SCRIPT_NAME']);\n\t\treturn $protocol . '://' . $host . $script . '/';\n\t}",
"function base_url($url = NULL){\n\t\tif ($url != NULL)\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/'.$url;\n\t\t}\n\t\telse\t\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/';\n\t\t}\n\t\t\n\t\treturn $baseurl;\n\t}",
"public static function get_baseurl()\n {\n }",
"public function getBaseUrl ()\n {\n return $this->base_url;\n }",
"private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }",
"function set_base_url($url)\n\t{\n\t\t$this->base_url = $url;\n\t}",
"protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}",
"function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}",
"protected function getBaseUrl()\n {\n return self::BASE_URL;\n }",
"function base_url()\n{\n return APP::getBaseUrl();\n}",
"public function getBaseUrl()\n\t\t{\n\t\t\treturn $this->base_url;\n\t\t}",
"public static function getBaseURL(){\n return self::$baseURL;\n }",
"function lang_base_url()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->lang_base_url;\n\t}",
"function lang_base_url()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->lang_base_url;\n\t}",
"function set_base_url()\n{\n $s = &$_SERVER;\n $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;\n $sp = strtolower($s['SERVER_PROTOCOL']);\n $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');\n $port = $s['SERVER_PORT'];\n $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;\n $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : $s['SERVER_NAME'];\n $uri = $protocol . '://' . $host . $port . dirname($_SERVER['SCRIPT_NAME']);\n define('BASE_URL', rtrim($uri, '/') . '/');\n}"
]
| [
"0.87099916",
"0.86128795",
"0.836425",
"0.810267",
"0.80944675",
"0.7896705",
"0.7790398",
"0.77808136",
"0.7773625",
"0.771061",
"0.7677277",
"0.7674229",
"0.7673578",
"0.76467675",
"0.7633424",
"0.76256096",
"0.7625419",
"0.75904393",
"0.75553817",
"0.7547833",
"0.7534603",
"0.753112",
"0.7505315",
"0.7492946",
"0.74734396",
"0.7458894",
"0.745408",
"0.7446168",
"0.7446168",
"0.74052113"
]
| 0.8965403 | 0 |
Public function base_dir . set for plugin base folder dir | public function base_dir(){
return $this->plugin_dir() . 'base/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }",
"function get_base_dir() {\n return $this->base_dir;\n }",
"function base_path()\n {\n return dirname(__DIR__);\n }",
"function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }",
"public function get_base_dir()\r\n\t\t{\r\n\t\t\treturn str_replace( \"/\", DIRECTORY_SEPARATOR, __DIR__ . \"/../../\" . self::HOME_DIR );\r\n\t\t}",
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"public static function basedir() {\n\t\t$directory = trim($_SERVER['SUBDIRECTORY'], '/');\n\t\t$directory = str_replace('\\\\', '/', $directory);\n\n\t\treturn '/' . $directory;\n\t}",
"public function get_base_dir($base = '.', $verbose = \\false)\n {\n }",
"public function getBaseDir();",
"function tsapress_base_dir(){\n\t$tsapress_base_dir = trim(next(explode(home_url(), site_url())), \"/\"); //grabs base directory structure if wordpress is installed in a subdirectory\n\tif ($tsapress_base_dir != \"\") $tsapress_base_dir .= \"/\";\n\treturn $tsapress_base_dir;\t//outputs \"[base]/\"\n}",
"public function base_url(){\n return $this->plugin_url() . 'base/';\n }",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"public function getBaseDirectory()\n {\n return $this->getParam(DirectoryKeys::BASE);\n }",
"function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}",
"function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }",
"public function getBasePath()\n {\n return __DIR__ . '/..';\n }",
"public function getBasePath()\n {\n return dirname(__DIR__);\n }",
"public function getBasePath()\n {\n return dirname(__DIR__);\n }",
"public function plugin_dir(){\n return trailingslashit(plugin_dir_path( __FILE__ ));\n }",
"protected function getBasePath()\n {\n return getcwd();\n }",
"public static function setBaseDir($dir) {\n\t if(self::$baseDir != $dir) {\n\t self::$baseDir = $dir;\n\t // reset the map and script directories\n\t self::$mapDir = null;\n\t self::$pageDir = null;\n\t self::$scriptDir = null;\n\t }\n\t return $dir;\n\t}",
"public static function basePath()\n {\n if(!self::$BASE_PATH){\n $reflector = new \\ReflectionClass(\\BethelChika\\Laradmin\\LaradminServiceProvider::class);\n self::$BASE_PATH= dirname(dirname($reflector->getFileName()));\n }\n return self::$BASE_PATH;\n }",
"public function getBaseDir()\n\t{\n\t\treturn $this->baseDir;\n\t}",
"function snappy_basedir($typeDir)\t{\r\n\t$newCI =& get_instance();\r\n\t$baseDir = $newCI->config->slash_item('base_url');\r\n\t$sourceDir = 'web/' . 'assets/';\r\n\treturn $baseDir.$sourceDir.$typeDir;\r\n}",
"public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'family'.DS.'file';\n }",
"public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}",
"protected function getAbsoluteBasePath() {}",
"public function getFilesBase();",
"function _get_plugin_directory() {\n return __DIR__;\n}"
]
| [
"0.84436935",
"0.8380311",
"0.7968006",
"0.7862169",
"0.7742449",
"0.77386826",
"0.7634011",
"0.744015",
"0.73941815",
"0.73592985",
"0.733996",
"0.7299054",
"0.7295198",
"0.71965975",
"0.7153129",
"0.7124176",
"0.711739",
"0.71152425",
"0.71152425",
"0.7105606",
"0.7046229",
"0.69736415",
"0.69420063",
"0.69005406",
"0.6891744",
"0.68851906",
"0.68549275",
"0.685321",
"0.6849651",
"0.68364847"
]
| 0.8965946 | 0 |
Public function utils_url . set for plugin utils folder url | public function utils_url(){
return $this->plugin_url() . 'utils/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function plugin_url(){\n return trailingslashit(plugin_dir_url( __FILE__ ));\n }",
"public function utils_dir(){\n return $this->plugin_dir() . 'utils/';\n }",
"public function setup_plugin_url()\n {\n }",
"public static function get_url() {\n\t\treturn ( get_bloginfo('wpurl')) . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/';\n\t}",
"function plugin_url() {\n\t\treturn untrailingslashit( plugin_dir_url( __FILE__ ) );\n\t}",
"function plugin_dir_url($file)\n {\n }",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}",
"public function base_url(){\n return $this->plugin_url() . 'base/';\n }",
"function plugin_url() {\n if ( $this->plugin_url ) return $this->plugin_url;\n\n return $this->plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );\n }",
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"protected function ___url() {\n\t\treturn $this->pagefiles->url . $this->basename;\n\t}",
"function base_url(){\n return BASE_URL;\n }",
"function base_url(){\n $url = BASE_URL;\n return $url;\n }",
"public function get_directory_url() {\n \treturn $this->plugin_dir_url;\n }",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function get_plugin_url() {\n\n\t\t\treturn str_replace( '/classes', '/', untrailingslashit( plugins_url( '/', __FILE__ ) ) );\n\n\t\t}",
"function get_url()\n {\n }",
"public function plugin_url() {\n\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t}",
"function plugins_url($path = '', $plugin = '')\n {\n }",
"public static function get_baseurl()\n {\n }",
"public function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"public static function plugin_dir_url() {\n return plugin_dir_url( __FILE__ );\n }",
"protected function get_admin_url()\n {\n }",
"public function get_url();",
"public function getURL ();",
"public static function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"public function functional_asset_url() {\n\n\t\t$log_url = WP_CONTENT_URL . '/uploads/nginx-helper/';\n\n\t\treturn apply_filters( 'nginx_asset_url', $log_url );\n\n\t}"
]
| [
"0.7000719",
"0.69362754",
"0.693344",
"0.6880488",
"0.6877434",
"0.67640865",
"0.6745987",
"0.671552",
"0.6693124",
"0.66770256",
"0.66383106",
"0.6594576",
"0.6540805",
"0.653574",
"0.6513022",
"0.64964366",
"0.64964366",
"0.64964366",
"0.64859253",
"0.64755255",
"0.6473415",
"0.6458317",
"0.642729",
"0.6424534",
"0.64103436",
"0.63991183",
"0.63978994",
"0.63888115",
"0.6380462",
"0.6369924"
]
| 0.8699511 | 0 |
Public function utils_dir . set for plugin utils folder dir | public function utils_dir(){
return $this->plugin_dir() . 'utils/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function utils_url(){\n return $this->plugin_url() . 'utils/';\n }",
"public function plugin_dir(){\n return trailingslashit(plugin_dir_path( __FILE__ ));\n }",
"function _get_plugin_directory() {\n return __DIR__;\n}",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"protected function action_getUserMainDir() {}",
"public function wp_plugins_dir()\n {\n }",
"public function getDir();",
"public function core_dir(){\n return $this->plugin_dir() . 'core/';\n }",
"protected function initUtils( $options = array() )\n {\n\n $config = $this->di['config'];\n\n // get all the files in app/utils directory\n if ( $handle = opendir($config->application->utilsDir) ) {\n \n while ( false !== ($entry = readdir($handle)) ) {\n if ( $entry != \".\" && $entry != \"..\" ) {\n include_once $config->application->utilsDir . \"/{$entry}\";\n }\n }\n\n closedir($handle);\n }\n\n }",
"public function getLibDir()\n {\n return Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'hycube' . DS . 'geoip';\n }",
"function wp_plugin_directory_constants()\n {\n }",
"public function dir_rewinddir() {}",
"function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}",
"function gutenberg_dir_path() {\n\treturn plugin_dir_path( dirname( __FILE__ ) );\n}",
"static public function get_dir() {\n\t\treturn apply_filters( 'themeisle_site_import_uri', trailingslashit( get_template_directory_uri() ) . self::OBOARDING_PATH );\n\t}",
"public function GetAppDir ();",
"public function setup_constants() {\n\t\tself::$DIR = plugin_dir_path( __FILE__ );\n\t\tself::$URL = plugins_url( '/', __FILE__ );\n\t\tself::$FILE = __FILE__;\n\t}",
"function _get_plugin_directory() {\n return wp_normalize_path( trailingslashit(dirname( __FILE__ )));\n}",
"public function get_core_dir() {\n\t\t\treturn trailingslashit( $this->settings['base_dir'] );\n\t\t}",
"private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }",
"public function getDirectoryVar();",
"public function getLogDir();",
"public function getDir(): string;",
"function dirPath() {return (\"../../../../\"); }",
"function package_resources_dir()\n {\n return\n package_dir().\n DIRECTORY_SEPARATOR.\n 'config'.\n DIRECTORY_SEPARATOR.\n 'resources';\n }",
"function dirPath() { return (\"../\"); }",
"function dirPath () { return (\"../../\"); }",
"function plugins_url()\n{\n return __DIR__;\n}",
"static public function get_base_path(){\r\n return plugin_dir_path(__FILE__) . '/';\r\n }",
"function fn_get_rel_dir($dir)\n{\n return str_replace(\n rtrim(Registry::get('config.dir.root'), '\\\\/') . '/',\n '',\n $dir\n );\n}"
]
| [
"0.6653623",
"0.6561461",
"0.6536426",
"0.64793056",
"0.64419127",
"0.6356196",
"0.6305265",
"0.6292337",
"0.6281124",
"0.6207308",
"0.61978066",
"0.6195792",
"0.607426",
"0.60704607",
"0.60612005",
"0.6050963",
"0.60482746",
"0.6034513",
"0.6026644",
"0.60206395",
"0.60108286",
"0.59696436",
"0.5969603",
"0.59672314",
"0.59475",
"0.59422773",
"0.5930363",
"0.5922781",
"0.5920143",
"0.5886442"
]
| 0.8607643 | 0 |
Public function widgets_url . set for plugin widget folder url | public function widgets_url(){
return $this->plugin_url() . 'widgets/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function widgets_dir(){\n return $this->plugin_dir() . 'widgets/';\n }",
"protected function getWidgetUri() {}",
"protected function getWidgetUri() {}",
"public function getWidgetJsUrl() {\n return check_url(variable_get(AddThis::WIDGET_JS_URL_KEY, AddThis::DEFAULT_WIDGET_JS_URL));\n }",
"public function plugin_url(){\n return trailingslashit(plugin_dir_url( __FILE__ ));\n }",
"public function setup_plugin_url()\n {\n }",
"public function widgetUriAction()\n {\n }",
"public function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"public function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t\t}",
"function plugin_url() {\n if ( $this->plugin_url ) return $this->plugin_url;\n\n return $this->plugin_url = plugins_url( basename( plugin_dir_path(__FILE__) ), basename( __FILE__ ) );\n }",
"public function plugin_url() {\n\t\treturn untrailingslashit( plugins_url( '/', __FILE__ ) );\n\t}",
"public static function plugin_url() {\n\t\t\treturn untrailingslashit( plugins_url( '/', DAHZEXTENDER_PLUGIN_FILE ) );\n\t\t}",
"public function get_plugin_url() {\n\n\t\t\treturn str_replace( '/classes', '/', untrailingslashit( plugins_url( '/', __FILE__ ) ) );\n\n\t\t}",
"function plugin_url() {\n\t\treturn untrailingslashit( plugin_dir_url( __FILE__ ) );\n\t}",
"public static function plugin_url() {\n return untrailingslashit( plugins_url( '/', __FILE__ ) );\n }",
"function ILuvWalkingWidget( ) {\r\n\t\t\tadd_action( 'widgets_init', array( &$this, 'registerWidgets' ) );\r\n\t\t\tadd_action( 'init', array( &$this, 'enqueueNecessaryFiles' ) );\r\n\t\t\t\r\n\t\t\t$this->site = 'http://iluvwalking.com/';\r\n\t\t}",
"static protected function get_base_url(){\r\n return plugins_url(null, __FILE__);\r\n }",
"function plugin_url() {\n\t\t\n\t\treturn AVIA_PHP_URL.'avia_shortcodes/';\n\t}",
"protected function getPluginUrl()\n {\n $filename = 'jquery.colorbox.js';\n \n if ($this->isProduction()) {\n $filename = 'jquery.colorbox-min.js';\n }\n\n return $this->getLocationUrl() . '/jquery-colorbox/' . $filename;\n }",
"function gutenberg_url( $path ) {\n\treturn plugins_url( $path, dirname( __FILE__ ) );\n}",
"public static function plugin_dir_url() {\n return plugin_dir_url( __FILE__ );\n }",
"function plugins_url($path = '', $plugin = '')\n {\n }",
"public function base_url(){\n return $this->plugin_url() . 'base/';\n }",
"public static function get_url() {\n\t\treturn ( get_bloginfo('wpurl')) . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/';\n\t}",
"private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }",
"function sbc_connect_widget() {\n\n class connect_widget extends WP_Widget {\n\n function __construct() {\n parent::__construct(\n\n // Base ID of your widget\n 'connect_widget',\n\n // Widget name will appear in UI\n __('Connect', 'connect_widget_domain'),\n\n // Widget description\n array( 'description' => __( 'Insert your connect links with this widget', 'connect_widget_domain' ), )\n );\n }\n\n // Creating widget output\n public function widget( $args, $instance ) {\n $title = apply_filters( 'widget_title', $instance['title'] );\n\n // echo Title if Title\n echo $args['before_widget'];\n echo '<div class=\"connect-widget\">';\n if ( ! empty( $title ) ):\n echo $args['before_title'] . $title . $args['after_title'];\n endif;\n\n // echo social links if social links available in theme options\n if( have_rows('_about', 'option') ):\n while( have_rows('_about', 'option') ): the_row();\n if( have_rows('connect_media') ):\n// echo 'Follow Us: ';\n while( have_rows('connect_media') ): the_row();\n $link = get_sub_field('link');\n $platform = get_sub_field('platform');\n $icon = '<a href=\"' . $link . '\">' .\n '<i class=\"' . $platform . '\"></i>' .\n '</a>';\n echo $icon;\n endwhile;\n endif;\n endwhile;\n endif;\n\n // This is where you run the code and display the output\n// echo __( 'Hello, World!', 'connect_widget_domain' );\n echo $args['after_widget'];\n echo '</div>';\n }\n\n // Widget Backend\n public function form( $instance ) {\n if ( isset( $instance[ 'title' ] ) ) {\n $title = $instance[ 'title' ];\n }\n else {\n $title = __( 'New title', 'connect_widget_domain' );\n }\n // Widget admin form\n ?>\n <p>\n <label for=\"<?php echo $this->get_field_id( 'title' ); ?>\"><?php _e( 'Title:' ); ?></label>\n <input class=\"widefat\" id=\"<?php echo $this->get_field_id( 'title' ); ?>\" name=\"<?php echo $this->get_field_name( 'title' ); ?>\" type=\"text\" value=\"<?php echo esc_attr( $title ); ?>\" />\n </p>\n <?php\n }\n\n // Updating widget replacing old instances with new\n public function update( $new_instance, $old_instance ) {\n $instance = array();\n $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';\n return $instance;\n }\n\n } // close class\n\n // Register the widget\n register_widget( 'connect_widget' );\n\n}",
"public function get_directory_url() {\n \treturn $this->plugin_dir_url;\n }",
"function slack_dash_widget_callback_function() {\n\techo '<input type=\"url\" name=\"slack_dash_widget_name\" value=\"' . esc_url( get_option('slack_dash_widget_name') ) .'\" /> Explanation text';\n}"
]
| [
"0.75481224",
"0.75085175",
"0.75085175",
"0.7134948",
"0.6839291",
"0.68371606",
"0.67708755",
"0.67261344",
"0.6719828",
"0.6719828",
"0.6719828",
"0.67096794",
"0.6703411",
"0.667098",
"0.6665565",
"0.66460913",
"0.6537809",
"0.6495284",
"0.6461769",
"0.64270973",
"0.64122874",
"0.6370528",
"0.6314362",
"0.6241939",
"0.6239756",
"0.62075263",
"0.62052166",
"0.6158597",
"0.6146873",
"0.6122141"
]
| 0.8961892 | 0 |
Public function widgets_dir . set for plugin widget folder dir | public function widgets_dir(){
return $this->plugin_dir() . 'widgets/';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function widgets_url(){\n return $this->plugin_url() . 'widgets/';\n }",
"public function wp_plugins_dir()\n {\n }",
"function gutenberg_dir_path() {\n\treturn plugin_dir_path( dirname( __FILE__ ) );\n}",
"public function plugin_dir(){\n return trailingslashit(plugin_dir_path( __FILE__ ));\n }",
"function register_widgets() {\n\t if ( ! is_dir( $this->addon->dir . 'include/widgets/' ) ) { return; }\n\t $widget_files = scandir( $this->addon->dir . 'include/widgets/' );\n\t $widget_slug = array();\n\n\t foreach ( $widget_files as $widget_file ) {\n\t\t if ( preg_match( '/^class\\.([^.]*?)\\.php/' , $widget_file , $widget_slug ) === 1 ) {\n\t\t\t require_once( $this->addon->dir . 'include/widgets/' . $widget_file );\n\t\t\t register_widget( 'SLPWidget_' . $widget_slug[1] );\n\t\t }\n\t }\n }",
"public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }",
"public function setDirectoryName($dir)\n {\n // Define a hard theme path for the theme\n $this->path = PUBLIC_THEME_DIR . '/' . $dir;\n $this->directory = $dir;\n }",
"function _get_plugin_directory() {\n return wp_normalize_path( trailingslashit(dirname( __FILE__ )));\n}",
"function add_my_awesome_widgets_collection($folders){\n\t$folders[] = plugin_dir_path(__FILE__).'extra-widgets/';\n\treturn $folders;\n}",
"function _get_plugin_directory() {\n return __DIR__;\n}",
"public static function plugin_dir_url() {\n return plugin_dir_url( __FILE__ );\n }",
"public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}",
"public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}",
"function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}",
"public function load_widgets() {\n\n /**\n * The function responsible for Widgets\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/recent-posts.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/newsletter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/simple-newsletter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/flickr.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/instagram.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/twitter.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info2.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/contact-info3.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/widgets/about-info.php';\n }",
"public function get_plugin_dir_path() {\n\t\treturn $this->plugin_dir_path;\n\t}",
"public function get_directory_url() {\n \treturn $this->plugin_dir_url;\n }",
"function wcccpp_directory_uri() {\n\treturn plugin_dir_url( __FILE__ );\n}",
"function thrive_dashboard_path()\n {\n return plugin_dir_path(dirname(__FILE__));\n }",
"function ourWidgetsInit() {\n // register widget location\n register_sidebar( array(\n 'name' => 'Sidebarr',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"a-special-class\">',\n 'after_title' => '</h2>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 1',\n 'id' => 'footer1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 2',\n 'id' => 'footer2',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 3',\n 'id' => 'footer3',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 4',\n 'id' => 'footer4',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n}",
"private function include_widgets_files() {\n\t\trequire_once( __DIR__ . '/widgets/dropdown.php' );\n\t}",
"private function include_widgets_files() {\n\t\trequire_once( __DIR__ . '/widgets/ele-subcats.php' );\n\t}",
"public function wp_content_dir()\n {\n }",
"function ya_widgets_init() {\n\t// Sidebars\n\t$primary = array(\n\t\t\t'name' => __('Sidebar Primary', 'yatheme'),\n\t\t\t'id' => 'primary',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\"><div class=\"sidebar-right\">',\n\t\t\t'after_widget' => '</div></section>',\n\t\t\t'before_title' => '<h3>',\n\t\t\t'after_title' => '</h3>'\n\t);\n\tregister_sidebar($primary);\n\t$slide = array(\n\t\t\t'name' => __('Sidebar Slideshow', 'yatheme'),\n\t\t\t'id' => 'slideshow',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\">',\n\t\t\t'after_widget' => '</section>',\n\t\t\t'before_title' => '',\n\t\t\t'after_title' => ''\n\t);\n\tregister_sidebar($slide);\n\t$sideba_home = array(\n\t\t\t'name' => __('Sidebar Home', 'yatheme'),\n\t\t\t'id' => 'sidebar-home',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s hwidget\">',\n\t\t\t'after_widget' => '</section>',\n\t\t\t'before_title' => '<h2>',\n\t\t\t'after_title' => '</h2>'\n\t);\n\tregister_sidebar($sideba_home);\n\t$footer = array(\n\t\t\t'name' => __('Footer', 'yatheme'),\n\t\t\t'id' => 'footer',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\"><div class=\"widget-inner\">',\n\t\t\t'after_widget' => '</div></section>',\n\t\t\t'before_title' => '<h4>',\n\t\t\t'after_title' => '</h4>'\n\t);\n\tregister_sidebar($footer);\n\n\t// Widgets\n\tregister_widget('YA_Posts_Widget');\n\tregister_widget('YA_Gallery_Widget');\n}",
"function _thickbox_path_admin_subfolder()\n {\n }",
"function MWX__load_widgets() {\n register_widget( 'widget_MWX__list_pages' );\n}",
"function ILuvWalkingWidget( ) {\r\n\t\t\tadd_action( 'widgets_init', array( &$this, 'registerWidgets' ) );\r\n\t\t\tadd_action( 'init', array( &$this, 'enqueueNecessaryFiles' ) );\r\n\t\t\t\r\n\t\t\t$this->site = 'http://iluvwalking.com/';\r\n\t\t}",
"function _theme_root($dir) {\n\t\treturn $this->theme_root;\n\t}",
"function plugin_dir_path($file)\n {\n }",
"function wp_plugin_directory_constants()\n {\n }"
]
| [
"0.69308823",
"0.66402423",
"0.6449377",
"0.6429668",
"0.62617373",
"0.6112663",
"0.6073773",
"0.60702074",
"0.60697067",
"0.60029876",
"0.5997572",
"0.5968038",
"0.5968038",
"0.5938159",
"0.58983564",
"0.5826198",
"0.5809977",
"0.5773066",
"0.57453793",
"0.5742373",
"0.5736691",
"0.5733806",
"0.5732188",
"0.57115906",
"0.5709899",
"0.57056415",
"0.56883734",
"0.5671494",
"0.5659096",
"0.56540954"
]
| 0.88350195 | 0 |
Retourneert een array met alle ritten in voor de gebruiker met gebruikerId = $gebruikerId | function getAllRitten($gebruikerId) {
$this->db->where('gebruikerIdVrijwilliger', $gebruikerId);
$query = $this->db->get('rit');
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatumOuder($gebruikerId) {\n // geef gebruiker-object met opgegeven $id met de geplande ritten\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip <', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatum($gebruikerId) {\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip >', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"public function get_profile_array($id){\n $query = $this->db->get_where('gebruikers', array('id' => $id));\n return $query->row_array();\n }",
"public function getArrayAllEngineers(){\n $query = $this->db->query(\"\n SELECT \n CONCAT(n_name_user, ' ', n_last_name_user) AS name, \n k_id_user AS id\n FROM user WHERE n_role_user = 'ingeniero'\n \");\n $ingenieros = [];\n for ($i=0; $i < count($query->result_array()); $i++) { \n $ingenieros[$i]['name'] = $query->result_array()[$i]['name'];\n $ingenieros[$i]['id'] = $query->result_array()[$i]['id'];\n }\n return $ingenieros;\n }",
"private function getGriidcStaff(): array\n {\n $entityManager = $this->getDoctrine()->getManager();\n //get user Ids of Griidc Staff to exclude from the report with personDataRepository roles of:\n //Manager (1), Developer (2), Support (3), Subject Matter Expert (4)\n $griidcUserQueryString = 'SELECT account.userId FROM ' . PersonDataRepository::class .\n ' personDataRepository JOIN ' . Person::class .\n ' person WITH person.id = personDataRepository.person JOIN ' . Account::class .\n ' account WITH account.person = person.id WHERE personDataRepository.role in (1, 2, 3, 4) ';\n $griidcUserResult = $entityManager->createQuery($griidcUserQueryString)->getScalarResult();\n return array_column($griidcUserResult, 'userId');\n }",
"public function geefGebruikers() {\n $sql = \"SELECT `id`,\n `voornaam`,\n `tussenvoegsel`,\n `achternaam`,\n `gebruikersnaam`,\n AES_DECRYPT(wachtwoord,:key) AS 'wachtwoord',\n `mail`,\n `gebruikerstype`\n FROM `gebruikers`\";\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':key', $this->key);\n $stmnt->execute();\n $gebruikers = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Gebruiker');\n return $gebruikers;\n }",
"function getAdmittedRolesArray() {\n\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT id_ruolo, ruolo FROM scuola.ruoli_utenti ORDER BY id_ruolo\");\n\n // Perform Query\n $result = mysql_query($query);\n //$array = mysql_fetch_assoc($result);\n }\n $this->closeConnection();\n return $result;\n }",
"function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}",
"public function getDataForMakeIdMethod(): array\n {\n return [\n 0 => [\n 0 => [\n 'userId' => 8,\n ],\n ],\n ];\n }",
"function retrieve_promoter_clients_list(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\t$clients = $this->CI->users_promoters->retrieve_promoter_clients_list($this->promoter->up_id, $this->promoter->team->t_fan_page_id);\n\t\tforeach($clients as $key => &$client){\n\t\t\t\n\t\t\tif($client->pglr_user_oauth_uid === null){\n\t\t\t\tunset($clients[$key]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$client = $client->pglr_user_oauth_uid;\n\t\t}\n\t\treturn $clients;\n\t\t\n\t}",
"public function getByUserId($id) {\r\n $sql = \"SELECT * FROM bestelling inner join bestelregel on bestelregel.bestellingid=bestelling.id where bestelling.userid=?\";\r\n $args = func_get_args();\r\n $stmt = parent::execPreppedStmt($sql, $args);\r\n $resultSet = $stmt->fetchall();\r\n $arr = array();\r\n foreach ($resultSet as $result) {\r\n $bestelling = Bestelling:: create($result['id'], $result['userid'], $result['tijdstip']);\r\n $bestelregel = Bestelregel:: create($result['bestelregelid'], $result['bestelregelprijs'], $bestelling);\r\n $arr[] = $bestelregel;\r\n }\r\n return $arr;\r\n }",
"function kuva_puurid(){\n\tif(isset($_SESSION['user'])) {\n\t\tglobal $connection;\n\t\t$puurid = array();\n\t\t$query = \"SELECT DISTINCT(puur) FROM anita_loomaaed ORDER BY puur\";\n\t\t$result = mysqli_query($connection, $query) or die (\"$query - \". mysqli_error($connection));\n\t\twhile($rida = mysqli_fetch_assoc($result)){\n\t $puuriId = $rida['puur'];\n\t \t$puuriQuery = \"SELECT * FROM anita_loomaaed WHERE puur=$puuriId\";\n\t \t$puuriResult = mysqli_query($connection, $puuriQuery) or die (\"$puuriQuery - \". mysqli_error($connection));\n\t while($puuriLoom = mysqli_fetch_assoc($puuriResult)){ \n \t$puurid[$puuriId][] = $puuriLoom;\n }\n\t}\n\t\tinclude_once('views/puurid.html');\n\t}\n\n\telse {\n\t\tinclude_once('views/login.html');\n\t}\n\t/*\n\techo \"<pre>\";\n\tprint_r($puurid);\n\techo \"</pre>\";\n\t*/\n}",
"function get_user_stakeholder_iata($params) {\n $sql = \"SELECT a.* \n FROM airport a \n LEFT JOIN com_user_bandara b ON b.airport_id = a.airport_id \n WHERE b.user_id = ?\";\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 }",
"function retrieveUserInformation($sunetids) {\n\n $contact = array();\n\n // Retrieve the rest of the data for this contact\n $sql = \"select user_email, user_phone, user_firstname, user_lastname, username \" .\n \" from redcap_user_information \" .\n \" where username in ('\" . implode(\"','\",$sunetids) . \"')\";\n $q = db_query($sql);\n while ($current_db_row = db_fetch_assoc($q)) {\n $sunetid = $current_db_row['username'];\n $contact[$sunetid]['contact_sunetid'] = $sunetid;\n $contact[$sunetid][\"contact_firstname\"] = $current_db_row[\"user_firstname\"];\n $contact[$sunetid][\"contact_lastname\"] = $current_db_row[\"user_lastname\"];\n $contact[$sunetid][\"contact_email\"] = $current_db_row[\"user_email\"];\n $contact[$sunetid][\"contact_phone\"] = $current_db_row[\"user_phone\"];\n }\n\n return $contact;\n}",
"function getParticipantsForMeetings($array)\n {\n $result = array();\n for ($i=0; $i < count($array); $i++) {\n $bookingID = $array[$i][\"id\"];\n\n $obj = $array[$i];\n\n $query = $this->db->query(\"SELECT bookingID, users.* from booking_invitations join users on users.id = booking_invitations.userID where bookingID = $bookingID\");\n if($query->num_rows()>0)\n {\n $obj[\"users\"] = $query->result_array();\n\n }\n else\n {\n $obj[\"users\"] = array();\n\n }\n\n array_push($result, $obj);\n }\n\n return $result;\n }",
"public function getAllRecipients()\n { \n $recipientlist = array();\n\n if(Session::has('prac_id'))\n {\n $practitionerlist = Practitioner::NotCurrent()->get();\n $clientlist = User::MyClient()->get();\n\n $allRecipients = $practitionerlist->merge($clientlist);\n\n foreach($allRecipients as $recipient)\n {\n $recipientlist[] = ['id'=>$recipient->id,\n 'name'=>$recipient->fname . \" \" . $recipient->sname,\n 'email'=>$recipient->email\n ];\n }\n\n }\n elseif(Auth::check())\n {\n $viewer = User::find(Auth::user()->id);\n $viewer_reports = Report::GetUserReports()->get();\n $owner_practitioner = Practitioner::GetThisPractitioner($viewer->prac_id)->get();\n\n foreach($viewer_reports as $report)\n { \n $shared_reports[] = $report->practitioners()->get();\n }\n\n $shared_reports[] = $owner_practitioner;\n\n foreach($shared_reports as $shared_report)\n {\n foreach($shared_report as $report_participants)\n {\n $recipientlist[] = ['id'=>$report_participants->id,\n 'name'=>$report_participants->fname . \" \" . $report_participants->sname,\n 'email'=>$report_participants->email\n ];\n }\n\n }\n \n }\n\n if(count($recipientlist) < 1)\n {\n return null;\n }\n else\n { \n return $recipientlist;\n }\n\n }",
"function getReminders($user_id) {\n\t$user_id = escape($user_id);\n\t\n\t$result = mysql_query(\"SELECT id, title, time FROM reminders WHERE user_id = '$user_id'\");\n\t$reminders = array();\n\t\n\twhile($row = mysql_fetch_array($result)) {\n\t\t$reminders[] = array('id' => $row[0], 'subject' => $row[1], 'time' => $row[2]);\n\t}\n\t\n\treturn $reminders;\n}",
"public function getReguData()\n\t{\n\t\t$this->db->select('id');\n\t\t$this->db->from('regu');\n\t\t$this->db->where('user_id', $this->session->userdata('id'));\n\t\t$this->db->order_by('id', 'ASC');\n\t\treturn $this->db->get()->result_array();\n\t}",
"function lightboxgallery_get_participants($galleryid) {\n global $DB, $CFG;\n\n return $DB->get_records_sql(\"SELECT DISTINCT u.id, u.id\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}lightboxgallery_comments c\n WHERE c.gallery = $galleryid AND u.id = c.userid\");\n}",
"public function getReagents()\n {\n //Definimos un array para almacenar los datos que retornaremos\n $data = array();\n\n $idUser = Auth::user()->id;\n //Consultamos las materias registradas por el usuario\n $dataSubjects = Subject::where('user_id',$idUser)->where('state',true)->get();\n //Consultamos la cantidad de reactivos que tiene cada materia\n foreach ($dataSubjects as $dataSubject) {\n $countReagent = Reagent::where('subject_id','=',$dataSubject->id)->count();\n //Consultamos todas las preguntas que tengan una observacion de rectificación\n $data[] = [\n \"id\" => $dataSubject->id,\n \"subject\" => $dataSubject->subject,\n \"reagents\" => $countReagent,\n \"observations\" => 38\n ];\n }\n //Retornamos los datos a la vista en formato json\n return json_encode($data);\n }",
"function get_survey_ids_by_user($email) {\n\t$mysql = new mysqli ( 'localhost', 'root', 'stu.fudan2013', 'EasyPolling' ) or die ( 'Cannot connect to Database' );\n\t$query = \"SELECT * from Poll where Creator='\" . $email . \"'\";\n\t$result = mysqli_query ( $mysql, $query );\n\t\n\t$returned = array ();\n\twhile ( $row = mysqli_fetch_array ( $result ) ) {\n\t\t$id = $row ['ID'];\n\t\t$survey = get_survey_by_id ( $id );\n\t\tarray_push ( $returned, array (\n\t\t\t\t'id' => $id,\n\t\t\t\t'survey' => $survey \n\t\t) );\n\t}\n\tmysqli_close ( $mysql );\n\t\n\treturn $returned;\n}",
"public function getAllParticipants($event_id) {\r\n$query = $this->db->query(\"SELECT * FROM participated_in where event_id= \" . $event_id . \" AND deleted =0 ORDER BY is_instructor DESC\");\r\n$participants_array = array();\r\n$i = 0;\r\nforeach ($query->result() as $row) {\r\n$person_detail = $this->personModel->getPersonDetail($row->person_id);\r\n$participants_array[$i][0] = $row->person_id;\r\n$participants_array[$i][1] = $person_detail[2]; //$this->personModel->getPersonName($row->person_id);\r\n$participants_array[$i][2] = $row->is_instructor;\r\n$participants_array[$i][3] = $person_detail[7];\r\n$participants_array[$i][4] = $person_detail[12];\r\n$participants_array[$i][5] = $person_detail[11];\r\n\r\n\r\n$i++;\r\n}\r\n\r\nreturn $participants_array;\r\n}",
"function get_data_by_id(){\n\t\tglobal $db;\n\t\t$data=array();\n\t\tif($this->id!=''){\n\t\t\t$sql=\"SELECT * FROM $this->table where id = ? \";\n\t\t\t$db->query($sql, array($this->id));\n\t\t\t$data=$db->fetch_assoc();\n\t\t\t}else{\n\t\t\t $data['id']='0'; $data['email']='';\n\t }\n return $data;\n\t}",
"public function user() {\t\t\n\t\tforeach ($this->db->query(\"SELECT * FROM `gebruikers` where id=?\", \"s\", array($this->userid)) as $row) {\n\t\t\t$result = $row;\n\t\t}\n\t\treturn json_encode($result??[\"error\"=>\"Gebruiker niet gevonden\"]);\n\t}",
"public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreGrupo\" => $this->nombre, \n //\"idag\" => $this->idap, \n );\n }",
"function get_uids($arr){\r\n$ids=array();\r\n\r\nif(count($arr)){\r\n\r\nforeach($arr as $row)\r\n$ids[]=$row['uid'];\r\n\r\n}\r\n\r\nreturn $ids;\r\n}",
"public function get_users() {\n // Return key => value pair array\n $query = $this->db->query(\"SELECT $this->_table_name.*, fname, lname, t2.title FROM $this->_table_name\n LEFT JOIN kompetenzm.job_title as t2 on t2.id = $this->_table_name.job_title_id\");\n $users = $query->result_object();\n $array = array('0' => 'Select');\n if (count($users)) {\n foreach ($users as $user) {\n $array[$user->TITLE][$user->ID] = $user->FNAME . \" \" . $user->LNAME;\n }\n }\n\n return $array;\n }",
"function getUserById($userid)\n {\n $ar_res= array();\n\n }",
"public function listGunners(){\n $sql = \"SELECT j.nome AS nome, \n t.nome AS nome_time, \n j.numero AS numero , \n SUM(gol) AS gols\n FROM dados d,jogador j,time t\n WHERE j.id_jogador = d.jogador_id_jogador\n AND j.time_id_time = t.id_time\n GROUP BY jogador_id_jogador\n ORDER BY gols DESC\";\n $result = $this->connection->dataBase->Execute($sql);\n while($record = $result->FetchNextObject()){\n $gunner['playerName'] = $record->NOME;\n $gunner['teamName'] = $record->NOME_TIME;\n $gunner['amountGoals'] = $record->GOLS;\n $gunner['playerNumber'] = $record->NUMERO;\n $arrayGunner[] = $gunner;\n }\t\n return $arrayGunner;\n\t}",
"function selectRegistos($connectDB, $pesquisa, $grupo)\n{\n $rows = array();\n $this_user = $_SESSION['id'];\n\n $result = mysqli_query($connectDB, \"SELECT idutilizador, nome, email, numero, fotografia \n FROM utilizador \n WHERE nome LIKE '%$pesquisa%' \n OR email LIKE '%$pesquisa%'\n OR numero LIKE '%$pesquisa%'\n ORDER BY nome\");\n\n if (mysqli_num_rows($result) > 0) {\n while ($row = $result->fetch_assoc()) {\n if ($row['idutilizador'] != $this_user) {\n //--\n if (!checkIfMember($connectDB, $grupo, $row['idutilizador'])) {\n $rows[] = $row;\n }\n }\n }\n //-- print do json para ser retornado no ajax da pagina dos contactos\n print json_encode(($rows));\n } else {\n echo \"</br> Não encontrou contacto\";\n }\n}"
]
| [
"0.66370565",
"0.66022515",
"0.63018537",
"0.62152416",
"0.6151891",
"0.60965025",
"0.6089286",
"0.589712",
"0.5876945",
"0.58697027",
"0.5837548",
"0.582954",
"0.58042157",
"0.5798557",
"0.5795764",
"0.57876766",
"0.57618684",
"0.5747476",
"0.5742875",
"0.57122165",
"0.5709903",
"0.5709236",
"0.5692693",
"0.5684359",
"0.5672038",
"0.5669358",
"0.56587946",
"0.5638813",
"0.563482",
"0.5632228"
]
| 0.7032954 | 0 |
Retourneert het ritrecord met ritIdHeenrit = $id | function getByHeenRit($id) {
$this->db->where('ritIdHeenrit', $id);
$query = $this->db->get('rit');
$rit = $query->row();
return $rit;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rechercherId($id)\n {\n }",
"public function getUnCompteRendu($id){\n\t\t$req = \"select * from praticien P,rapport_visite R, visiteur V where R.RAP_NUM='$id' and P.PRA_NUM=R.PRA_NUM and r.vis_matricule = v.vis_matricule\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetch();\n\t\treturn $ligne;\n\t}",
"function get($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('rit');\n $rit = $query->row();\n return $rit;\n }",
"public function getRecidAttribute()\n {\n return $this->id;\n }",
"public function getID(){\n return $this->_idArmure;\n }",
"public function dohvatiJeloId($id) {\n $this->db->select(\"idR,naziv,sadrzaj,obrok,kategorija,spec_prilika,slika\");\n $this->db->from(\"recepti\");\n $this->db->where(\"idR\", $id);\n $query = $this->db->get();\n return $query->result();\n }",
"function getEarnotchID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['earnotch'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function dohvSmestaj($id){\n return ($this->where('id',$id)->find());\n }",
"public function get_id()\t{return $this->id;}",
"public function traerPorId($id)\n {\n }",
"public function traerPorId($id)\n {\n }",
"public function traerPorId($id)\n {\n }",
"public function getRecord($id = null);",
"public function getLesCompteRendu($id){\n\t\t$req = \"select r.rap_num as rapportnum,r.pra_num,p.pra_nom as nomprat ,r.rap_date as daterapport from rapport_visite r, praticien p where VIS_MATRICULE='$id' and r.pra_num=p.pra_num order by r.rap_date\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\treturn $rs;\n\t}",
"function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }",
"public function getIdVit(){\n\t\treturn ($this->id);\n\t}",
"function getdatait( $id = 0 ){\n\t\tif($id === 0){\n\t\t\t$id = intval($this->datasis->dameval(\"SELECT MAX(id) FROM rcobro\"));\n\t\t}\n\t\tif(empty($id)) return '';\n\t\t$grid = $this->jqdatagrid;\n\t\t$mSQL = \"SELECT * FROM smov WHERE rcobro=${id}\";\n\t\t$response = $grid->getDataSimple($mSQL);\n\t\t$rs = $grid->jsonresult( $response);\n\t\techo $rs;\n\t}",
"public function fetch_this($i_id) {\n \n }",
"function verifiRentsDetails($id)\n{\n\n $requete = \"SELECT idSnow FROM rentsdetails where idSnow='$id';\";\n $request = executeQuery($requete);\n\n\n return $request;\n}",
"public function fetch_this($i_id)\r\n { \r\n }",
"public function getIdarl(){\n return $this->idarl;\n }",
"public function getRecenzeClanku($id){\n $sth = $this->db->prepare(\"SELECT * FROM RECENZE\n WHERE PRISPEVKY_id_prispevku = :id\");\n $sth->bindParam(':id', $id);\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }",
"public function pertanyaanId($id){\r\n $sql = \"SELECT * FROM tbl_pertanyaan where id=$id\";\r\n $query = mysql_query($sql);\r\n \t\t $row = mysql_fetch_array($query);\r\n return $row;\r\n }",
"public function byId($id);",
"public function byId($id);",
"public function byId($id);",
"public function byId($id);",
"function get_id(){\n return $this -> id;\n }",
"function get_id(){\n return $this -> id;\n }",
"public function get_id(){ return $this->_id;}"
]
| [
"0.6895093",
"0.6509569",
"0.6400578",
"0.6275626",
"0.62652576",
"0.6261439",
"0.6256555",
"0.62225384",
"0.6209758",
"0.6191946",
"0.6191946",
"0.6191946",
"0.61556596",
"0.6152862",
"0.6130694",
"0.6109842",
"0.61097544",
"0.6104312",
"0.60987496",
"0.60921913",
"0.60870886",
"0.60713845",
"0.6065692",
"0.6055386",
"0.6055386",
"0.6055386",
"0.6055386",
"0.6053429",
"0.6053429",
"0.60486895"
]
| 0.7520295 | 0 |
Retourneert een object van ritrecords (aangevuld met gebruiker en adresgegevens) met gebruikerIdMinderMobiele = $gebruikerId en vertrekTijdstip > nu | function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatum($gebruikerId) {
$nu = date('Y-m-d H:i:s');
$this->db->order_by('vertrekTijdstip');
$this->db->where('gebruikerIdMinderMobiele', $gebruikerId);
$this->db->where('vertrekTijdstip >', $nu);
$query = $this->db->get('rit');
$ritten = $query->result();
foreach ($ritten as $rit) {
$this->load->model('Gebruiker_model');
$rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);
$this->load->model('Adres_model');
$rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);
$rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);
}
return $ritten;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatumOuder($gebruikerId) {\n // geef gebruiker-object met opgegeven $id met de geplande ritten\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip <', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"public function getDAOGebruikerBestelling() {\n $lijst = array();\n $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD);\n $sql = \"select GebruikersId, Wachtwoord, Voornaam, Familienaam, Straat, Huisnummer, Stad, Email, Telefoon, Boodschap, Promotie from gebruikerspizzashop WHERE Email = '[email protected]' and Wachtwoord = 'admin'\";\n $resultSet = $dbh->query($sql);\n if ($resultSet) {\n $rij = $resultSet->fetch();\n if ($rij) {\n $gebruiker = new Gebruiker($rij[\"GebruikersId\"], $rij[\"Wachtwoord\"], $rij[\"Voornaam\"], $rij[\"Familienaam\"], $rij[\"Straat\"], $rij[\"Huisnummer\"], $rij[\"Stad\"], $rij[\"Email\"], $rij[\"Telefoon\"], $rij[\"Boodschap\"], $rij[\"Promotie\"]);\n $dbh = null;\n return $gebruiker;\n } else\n return false;\n } else\n return false;\n }",
"private function stuurmailNaarVorigeBieder(){\n $conn = getConn();\n $sql = \" SELECT G.Emailadres FROM Gebruiker G INNER JOIN Bod B ON G.Gebruikersnaam = B.Gebruikersnaam\n WHERE B.Bodbedrag = (SELECT MAX(B.Bodbedrag) FROM Bod B \n WHERE Bodbedrag < ( SELECT MAX(B.Bodbedrag) FROM Bod b ) AND Voorwerpnummer = ?)\";\n $params=array($this->voorwerpnummer);\n $stmt = sqlsrv_prepare($conn, $sql, $params);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if ($stmt) {\n while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $emailadres = $row['Emailadres'];\n $this->stuurMail($emailadres);\n }\n\n }\n else{\n die(print_r(sqlsrv_errors(), true));\n }\n\n }",
"public function getobjcontrat($idcontrat){\n $uncontrat = R::load('contrat', $idcontrat); //équivalent à \"select * from contrat where idcontrat ='$idcontrat'\"\n $idclient = $uncontrat->idclient; //recupère l'id du client dans une variable\n $client = R::load('client', $idclient); // select * from client en fonction de l'idclient récupérer précedemment \n $idcontact = $client->idcontact; \n $contact = r::load('contact', $idcontact);\n $uncontact = new contact ($contact->email1, $contact->email2, $contact->email3, $contact->bureau, $contact->fax, $contact->tel3);\n $unclient = new client($client->raisonsocial, $uncontact, $client->siret, $client->adr, $client->ville, $client->codepostal);\n $idconsultant = $uncontrat->idutilisateur;\n $consultant = r::getAll('select * from utilisateur join consultant on utilisateur.id=consultant.idutilisateur where idutilisateur='.$idconsultant.'');\n for ($i=0; $i<count($consultant);$i++){\n $unconsultant = new consultant ($consultant[$i]['nom'], $consultant[$i]['prenom'], $consultant[$i]['adresse'], $consultant[$i]['ville'], $consultant[$i]['cp'], $consultant[$i]['tel'], $consultant[$i]['email'], $consultant[$i]['typecontrat'], $consultant[$i]['salaire'], $consultant[$i]['tarif']);\n }\n $contrat = new contrat($uncontrat->id, $unclient, $unconsultant, $uncontrat->datedebut,$uncontrat->datefin, $uncontrat->mission, $uncontrat->salaire, $uncontrat->tarif, $uncontrat->typecontrat);\n //var_dump($contrat);\n return $contrat;\n }",
"function getAllRitten($gebruikerId) {\n $this->db->where('gebruikerIdVrijwilliger', $gebruikerId);\n $query = $this->db->get('rit');\n return $query->result();\n }",
"public function geefGebruikers() {\n $sql = \"SELECT `id`,\n `voornaam`,\n `tussenvoegsel`,\n `achternaam`,\n `gebruikersnaam`,\n AES_DECRYPT(wachtwoord,:key) AS 'wachtwoord',\n `mail`,\n `gebruikerstype`\n FROM `gebruikers`\";\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':key', $this->key);\n $stmnt->execute();\n $gebruikers = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Gebruiker');\n return $gebruikers;\n }",
"public static function getTruhlar($truhlarID){\n $truhlarJmeno = Zamestnanec::where('ID_Zam', '=', $truhlarID)\n ->select(\"Jmeno\", \"Prijmeni\")\n ->first();\n\n $Truhlar = (object) array(\n 'id' => $truhlarID,\n 'jmeno' => $truhlarJmeno->Jmeno,\n 'prijmeni' => $truhlarJmeno->Prijmeni\n );\n\n return $Truhlar;\n }",
"public function getById($idManifiesto) {\n $db = $this->getAdapter();\n $db->setFetchMode(Zend_Db::FETCH_OBJ);\n $select = $db->select();\n $select->from(array('m' => 'manifiesto'), array('id_manifiesto', 'fecha', 'hora', 'despachador', 'viaje',\n 'bus', 'chofer', 'total', 'destino', 'origen', 'estado', 'tipo'));\n $select->joinLeft(array(\"ch\" => \"chofer\"), \"ch.id_chofer=m.chofer\", \"nombre_chofer\");\n $select->joinLeft(array(\"b\" => \"bus\"), \"b.id_bus=m.bus\", \"numero\");\n $select->join(array(\"o\" => \"ciudad\"), \"o.id_ciudad=m.origen\", \"nombre as ciudadOrigen\");\n $select->join(array(\"d\" => \"ciudad\"), \"d.id_ciudad=m.destino\", \"nombre as ciudadDestino\");\n $select->where(\"id_manifiesto=?\", $idManifiesto);\n $results = $db->fetchRow($select);\n return $results;\n }",
"public function getMothers()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$items = array();\n\t\t$mother_id = $app->input->get('id', 0, 'INT');\n\t\t$mother_code = $app->input->get('code', '', 'STRING');\n\n\t\t$listOrder = $app->input->get('listOrder', 'ASC', 'STRING');\n\n\t\t$mother_obj = new VbfModelMothers;\n\n\t\t$mother_obj->setState('list.direction', $listOrder);\n\n\t\tif ($limit)\n\t\t{\n\t\t\t$mother_obj->setState('list.start', $limitstart);\n\t\t\t$mother_obj->setState('list.limit', $limit);\n\t\t}\n\n\t\t// Filter by mother\n\t\tif ($mother_id)\n\t\t{\n\t\t\t$mother_obj->setState('filter.id', $mother_id);\n\t\t}\n\n\t\t// Filter by mother\n\t\tif ($mother_code)\n\t\t{\n\t\t\t$mother_obj->setState('filter.code', $mother_code);\n\t\t}\n\t\t\n\t\t$rows = $mother_obj->getItems();\n\n\t\t$num_mothers = $mother_obj->getTotal();\n\t\t$data[] = new stdClass;\n\n\t\tforeach ($rows as $subKey => $subArray)\n\t\t{\n\t\t\t$data[$subKey]->babybirth = $subArray->babybirth;\n\t\t\t$data[$subKey]->code = $subArray->code;\n\t\t\t$data[$subKey]->lmp = $subArray->lmp;\n\t\t\t$data[$subKey]->name = $subArray->name;\n\t\t\t$data[$subKey]->note = $subArray->note;\n\t\t\t$data[$subKey]->phone = $subArray->phone;\n\t\t\t$data[$subKey]->token = $subArray->token;\n\t\t\t$data[$subKey]->type = $subArray->type;\n\t\t}\n\n\t\t$obj = new stdclass;\n\t\t$result = new stdClass;\n\n\t\tif (count($data) > 0)\n\t\t{\n\t\t\t$result->results = $data;\n\t\t\t$result->total = $num_mothers;\n\t\t\t$obj->success = true;\n\t\t\t$obj->data = $result;\n\n\t\t\treturn $obj;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$obj->success = false;\n\t\t\t$obj->message = 'System does not have items';\n\t\t}\n\n\t\treturn $obj;\n\t}",
"public function show($id){\n $boekenkastMedailles = array();\n // Loop door alle 8 Medaille Slots\n for($i = 1; $i <= 8; $i++){\n $medaille_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('medaille_id_slot' . $i);\n // Als er een Medaille in een Slot staat; voeg deze toe\n if(!is_null($medaille_id)){\n $boekenkastMedailles[] = \\App\\Models\\Medaille::find($medaille_id);\n }\n else{\n // Als er geen medaille in het slot moet komen; voeg default empty slot medaille toe\n $boekenkastMedailles[] = \\App\\Models\\Medaille::where('naam', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Items op uit de boekenkast en stop ze in een array om mee te geven\n $boekenkastItems = array();\n for($i = 1; $i <= 6; $i++){\n $item_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('item_id_slot' . $i);\n // Als er een item in een slot staat; voeg deze toe\n if(!is_null($item_id)){\n $boekenkastItems[] = \\App\\Models\\Item::find($item_id);\n }\n else{\n // Als er geen Item in het slot moet komen; voeg default empty slot Item toe\n $boekenkastItems[] = \\App\\Models\\Item::where('soort', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Medailles op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeMedailles = array();\n // Haal alle 'behaalde medailles' op\n $behaaldeMedaillesId = \\App\\Models\\BehaaldMedaille::where('user_id', '=', $id)->get();\n // Voor elk 'behaald medaille'; pak daarvan de 'medaille' en voeg deze toe aan de array\n foreach($behaaldeMedaillesId as $behaaldeMedailleId){\n $behaaldeMedailles[] = $behaaldeMedailleId->Medaille;\n }\n\n // Haal alle Items op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeItems = array();\n // Haal alle 'behaalde items' op\n $behaaldeItemsId = \\App\\Models\\BehaaldItem::where('user_id', '=', $id)->get();\n // Voor elk 'behaald item'; pak daarvan de 'item' en voeg deze toe aan de array\n foreach($behaaldeItemsId as $behaaldeItemId){\n if($behaaldeItemId->Item->soort === \"Kastdecoratie\"){\n $behaaldeItems[] = $behaaldeItemId->Item;\n }\n \n }\n\n return ['boekenkast' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first(),\n 'eigenaar' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first()->Eigenaar,\n 'boekenkast_medailles' => $boekenkastMedailles,\n 'boekenkast_items' => $boekenkastItems,\n 'behaalde_medailles' => $behaaldeMedailles,\n 'behaalde_items' => $behaaldeItems];\n }",
"public function getRecordatorio() {\n $recordatorio = $this->_db->query(\"SELECT deuda.Id_cliente as dni, nombre as nombre, apellidos as apellido, \n direccion as direccion, telefono as telefono, celular as celular, total as totalDeuda\n FROM pagos as pagos \n INNER JOIN venta as venta ON venta.Id_deuda = pagos.Id_deuda\n INNER JOIN productoventa as prodventa ON venta.cod_busqueda = prodventa.cod_busqueda\n INNER JOIN deuda as deuda ON deuda.Id_deuda = venta.Id_deuda\n INNER JOIN cliente as cliente ON cliente.Id_cliente = deuda.Id_cliente where pagos.estado >= 0 and pagos.Fecha_Pago = CURDATE()\n ORDER BY deuda.Fecha_deuda\"\n );\n return $recordatorio->fetchall();\n }",
"public function modelFetch(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban where maphongban=$maphongban\");\n\t\t\t//tra ve mot ban ghi\n\t\t\treturn $query->fetch();\n\t\t}",
"public function szukajMieszkanieAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->_request->getParam('id');\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t\t\n\t\t\t$this->view->numer = $numer = $this->_request->getParam('numer');\n\t\t\t$this->view->areaFrom = $areaFrom = $this->_request->getParam('metraz_min');\n\t\t\t$this->view->areaTo = $areaTo = $this->getRequest()->getParam('metraz_max');\n\t\t\t$this->view->status = $status = $this->_request->getParam('status');\n\t\t\t$this->view->rooms = $rooms = $this->_request->getParam('pokoje');\n\t\t\t$this->view->floor = $floor = $this->_request->getParam('pietro');\n\n\t\t\t$select_pomieszczenia = $db->select()\n\t\t\t->from('inwestycje_powierzchnia')\n\t\t\t->where('id_inwest = ?', $id)\n\t\t\t->order('sort ASC');\n\t\t\t\n\t\t\tif($numer) {$select_pomieszczenia->where('numer LIKE ?', '%'.$numer.'%');}\n\t\t\tif($status) {$select_pomieszczenia->where('status =?', $status);}\n\t\t\tif($rooms) {$select_pomieszczenia->where('pokoje =?', $rooms);}\n\t\t\tif($floor || $floor == '0') {$select_pomieszczenia->where('numer_pietro =?', $floor);}\n\t\t\tif($areaFrom) {$select_pomieszczenia->where('szukaj_metry >=?', $areaFrom);}\n\t\t\tif($areaTo) {$select_pomieszczenia->where('szukaj_metry <=?', $areaTo);}\n\t\t\t\n\t\t\t$this->view->lista = $result = $db->fetchAll($select_pomieszczenia);\n\t\t}",
"function getMeGustaId($id, $id_usuario) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT val_mg.megusta FROM valoracion_mg val_mg, usuario usu where val_mg.id_usuario=usu.id && val_mg.id_contenido=$id && val_mg.id_usuario=$id_usuario\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return null;\n } \n}",
"public function getTelefones() {\n\n $aTelefones = array();\n $oDaoTelefones = new cl_telefoneescola();\n $sCampos = \"ed26_i_ddd as ddd, ed26_i_numero as numero, ed13_c_descr as tipo_telefone\";\n $sSqlTelefones = $oDaoTelefones->sql_query(null, $sCampos, \"ed26_i_numero\", \"ed26_i_escola = {$this->iCodigoEscola}\" );\n $rsTelefones = db_query($sSqlTelefones);\n\n if ( !$rsTelefones ) {\n throw new DBException(\"Erro ao buscar os telefones.\\n\" . pg_last_error());\n }\n $iTotalTelefones = pg_num_rows($rsTelefones);\n\n $oDadosTelefone = new stdClass();\n $oDadosTelefone->ddd = '';\n $oDadosTelefone->fax = '';\n $oDadosTelefone->telefone = '';\n $oDadosTelefone->telefone_publico = '';\n $oDadosTelefone->telefone_outro = '';\n\n for ($i = 0; $i < $iTotalTelefones; $i++) {\n\n $oTelefone = db_utils::fieldsMemory($rsTelefones, $i);\n\n $oDadosTelefone->ddd = $oTelefone->ddd;\n\n if (strpos(strtoupper($oTelefone->tipo_telefone), \"FAX\") !== false) {\n $oDadosTelefone->fax = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone_publico) && strlen($oTelefone->numero) == 8 ) {\n $oDadosTelefone->telefone_publico = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone) ) {\n $oDadosTelefone->telefone = $oTelefone->numero;\n continue;\n }\n\n\n if ( empty($oDadosTelefone->telefone_outro) ) {\n $oDadosTelefone->telefone_outro = $oTelefone->numero;\n continue;\n }\n }\n\n return $oDadosTelefone;\n }",
"public function getJeloPoObroku($obrok) {\n\n $this->db->select(\"idR\");\n $this->db->from(\"recepti\");\n $this->db->where(\"obrok\", $obrok);\n $tmp = $this->db->get();\n $jela = $tmp->result();\n\n $size = count($jela);\n $ind = mt_rand(0, $size - 1);\n\n return $jela[$ind]->idR;\n }",
"public static function getRoditelji()\n {\n //$data = Korisnik::where('korisnici_roditelj_1','=',NULL)->get();\n //$data = Korisnik::all();\n $dvaRoditelja=\\DB::select('SELECT DISTINCT \n k1.korisnici_roditelj_1, k2.korisnici_roditelj_2,\n k1.prezime as prvi_roditelj_prezime, k1.ime as prvi_roditelj_ime,\n k2.prezime as drugi_roditelj_prezime, k2.ime as drugi_roditelj_ime\n FROM korisnici k1, korisnici k2 \n WHERE (k1.korisnici_roditelj_1 = k2.korisnici_roditelj_1 \n AND k1.korisnici_roditelj_2 = k2.korisnici_roditelj_2)\n ');\n \n $jedanRoditelj=\\DB::select('SELECT DISTINCT \n k1.korisnici_roditelj_1, k2.korisnici_roditelj_2,\n k1.prezime as prvi_roditelj_prezime, k1.ime as prvi_roditelj_ime,\n k2.prezime as drugi_roditelj_prezime, k2.ime as drugi_roditelj_ime\n FROM korisnici k1, korisnici k2 \n WHERE (k1.korisnici_roditelj_1 = k2.korisnici_roditelj_1 \n AND k1.korisnici_roditelj_2 is NULL)');\n\n $dvaRoditelja=json_decode(json_encode($dvaRoditelja),true);\n $jedanRoditelj=json_decode(json_encode($jedanRoditelj),true);\n\n $data3=array_merge($dvaRoditelja,$jedanRoditelj);\n\n $data3=array_unique($data3, SORT_REGULAR);\n\n return compact(['data3']);\n \n }",
"function LancerNouveauRetour($BonID,$articles,$OtID){\n // un objet contient les deux colones : article_id et qtear\n $success=true;\n $UserID = JWTAuth::user()->id;\n $di_bon_retour=prev_bon_retour::create([\n 'bonp_id' => $BonID,\n 'otp_id'=>$OtID,\n 'user_id'=>$UserID\n ]);\n if(!$di_bon_retour){$success=false;}\n $RetourID=$di_bon_retour->RetourID;\n \n foreach($articles as $article){\n if($article->qtear>0){\n $di_bon_retour_det=prev_bon_retour_det::create([\n 'retour_id' => $RetourID,\n 'article_id' => $article->article_id,\n 'qtear' => $article->qtear,\n 'qter' => null\n ]); \n\n if(!$di_bon_retour_det){$success=false;}\n }\n }\n if($success){return $RetourID;}else{return false;}\n }",
"public function kamerselecteren(){\n $this->stmt = $this->conn->prepare(\"SELECT kamerid, kamernummer from kamer\");\n $result = $this->stmt->execute();\n\n if(!$result){\n die('<pre>Oops, Error execute query ' . $result . '</pre><br><pre>' . 'Result code: ' . $result . '</pre>');\n }\n $this->resultSet = $this->stmt->fetchALL(PDO::FETCH_ASSOC);\n\n $result = $this->resultSet;\n\n // return $result so we can use the data\n return $result;\n\n }",
"public function getEntradas(){\n\n $oDaoMatOrdemItem = db_utils::getDao('matordemitem');\n $sWhereOrdemCompra = \"m81_codtipo in (19, 12) and m52_codordem = {$this->iCodigoOrdem}\";\n $sSqlMatOrdemItem = $oDaoMatOrdemItem->sql_query_entradas( null, \"*\", null, $sWhereOrdemCompra);\n $rsMatOrdemItem = $oDaoMatOrdemItem->sql_record($sSqlMatOrdemItem);\n\n $aItensEntrada = array();\n if ($oDaoMatOrdemItem->numrows > 0) {\n\n $iTotalItens = $oDaoMatOrdemItem->numrows;\n for ($iRowItem = 0; $iRowItem < $iTotalItens; $iRowItem++) {\n\n $oDadosMatOrdemItem = db_utils::fieldsMemory($rsMatOrdemItem, $iRowItem);\n $oItem = new Item($oDadosMatOrdemItem->m70_codmatmater);\n $oAlmoxarifado = new Almoxarifado($oDadosMatOrdemItem->m80_coddepto);\n $oTipoMovimentacao = TipoMovimentacaoEstoqueRepository::getTipoMovimentaoPorCodigo($oDadosMatOrdemItem->m81_codtipo);\n\n $oMovimentacaoItem = new MovimentacaoItem($oItem);\n $oMovimentacaoItem->setQuantidade($oDadosMatOrdemItem->m52_quant);\n $oMovimentacaoItem->setQuantidadeEntrada($oDadosMatOrdemItem->m71_quant);\n $oMovimentacaoItem->setValor($oDadosMatOrdemItem->m71_valor);\n $oMovimentacaoItem->setAlmoxarifado($oAlmoxarifado);\n $oMovimentacaoItem->setTipoMovimentacao($oTipoMovimentacao);\n\n $aItensEntrada[] = $oMovimentacaoItem;\n\n }\n }\n return $aItensEntrada;\n }",
"public function merk()\n {\n return $this->belongsTo('App\\Inventori', 'tipe_brg', 'tipe_brg');\n }",
"function getNaujienosVisi() {\n $manoSQL = \"SELECT * FROM naujienos order by id DESC \";\n // $rezultataiOBJ - Mysql Objektas\n $rezultataiOBJ = mysqli_query(getPrisijungimas(), $manoSQL);\n return $rezultataiOBJ;\n}",
"public function givecoordonerplsunom()\r\n {\r\n $request = $this->_bdd->query(\"SELECT gps.`id`, gps.id_bateau, gps.latitude, gps.longitude, bateau.nom FROM gps, bateau WHERE gps.id_bateau = bateau.id ORDER BY `gps`.`id` DESC\");\r\n while ($data = $request->fetch()) {\r\n $modf = \"modifcordoner.php?modfBateau=\" . $data[\"id_bateau\"];\r\n $supr = \"admin.php?suprBateau=\" . $data[\"id\"];\r\n?>\r\n <tr>\r\n <td><?=$data['id']?></td>\r\n <td><?= $data['id_bateau']?></td>\r\n <td>\r\n <a href=\"#\"><?= $data['nom']?></a>\r\n </td>\r\n \r\n <td><?= $data['latitude'] ?></td>\r\n <td><?=$data['longitude']?></td>\r\n <td>\r\n <a href=\"<?=$modf?>\" class=\"settings\" title=\"modifier\" data-toggle=\"tooltip\"><i class=\"material-icons\"></i></a>\r\n <a href=\"<?=$supr?>\" class=\"delete\" title=\"supprimer\" data-toggle=\"tooltip\"><i class=\"material-icons\"></i></a>\r\n </td>\r\n </tr>\r\n<?php\r\n }\r\n }",
"public function murotal_reciter_surah()\n {\n return $this->hasMany(MRS::class, 'id', 'surah_id');\n }",
"public function geefKlant() {\n $klant_id = $_SESSION['gebruiker']->geefKlant_id();\n $sql = 'SELECT * FROM `klanten` WHERE `id` = :id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':id', $klant_id);\n $stmnt->execute();\n $klant = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Klant');\n return $klant[0];\n }",
"function getRest(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE \n a.gebruikerId = ? AND v.actief = 1 \n \n \n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"function getWhereDatum($gebruikerId, $datum) {\n $date = strtotime($datum);\n $weekDag = date('w', $date);\n if ($weekDag != 1) {\n $startdate = strtotime(\"last monday\", $date);\n $enddate = strtotime(\"monday\", $date);\n\n } else {\n $startdate = strtotime(\"today\", $date);\n $enddate = strtotime(\"next monday\", $date);\n }\n $startdate = date('Y-m-d H:i:s', $startdate);\n $enddate = date('Y-m-d H:i:s', $enddate);\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip >', $startdate);\n $this->db->where('vertrekTijdstip <', $enddate);\n $this->db->where('ritIdHeenrit', NULL);\n\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n return $ritten;\n }",
"public function reserveren($naam, $adres, $plaats, $postcode, $telefoon, $van, $tot, $kamerid){\n\n try{ \n //deze sql query insert de dingen die we nodig hebben bij persoon\n $query1 = \"INSERT INTO persoon (naam, adres, plaats, postcode, telefoon) VALUES (:naam, :adres, :plaats, :postcode, :telefoon)\";\n $statement1= $this->conn->prepare($query1);\n $statement1->execute(\n array(\n 'naam'=> $naam,\n 'adres'=> $adres,\n 'plaats'=> $plaats,\n 'postcode'=> $postcode,\n 'telefoon'=> $telefoon \n )\n );\n $last_id = $this->conn->lastInsertId();\n //deze query insert de informatie bij reserveringsoverzicht\n $query3 = \"INSERT INTO reserveringsoverzicht (van, tot, persoon_persoonid, kamer_kamerid) VALUES (:van, :tot, :persoon_persoonid, :kamer_kamerid)\";\n $statement3 = $this->conn->prepare($query3);\n $statement3->execute(\n array(\n 'van' => $van,\n 'tot' => $tot,\n 'persoon_persoonid' => $last_id,\n 'kamer_kamerid' => $kamerid\n )\n );\n // redirect to home page\n header(\"location:index.php\");\n\n }catch(PDOException $error){\n echo $error->getMessage();\n exit(\"An error occured\");\n }\n }",
"function getOrder($object) {\n //foreach($answerObject->Orders as $order) {\n //\n // $myOrder = new Bestellung();\n // ....\n // $object->addCollectionEntry($myOrder); \n //}\n \n $bestelldatum = new DateTime(); \n $lieferdatum = new DateTime(); \n $lieferdatum->add(new DateInterval('P4D'));\n\n $myOrder = new Bestellung();\n\n $myOrder->ShopId = 'sampleOrderId_'.rand(1000, 9999);\n $myOrder->Gesammtkosten = 9.37; \n $myOrder->Versandkosten = 4.99; \n $myOrder->VersandDienstleister = 'DHL National';\n $myOrder->Lieferdatum = $lieferdatum->format('Y-m-d H:i:s'); \n $myOrder->Zahlungsart = Zahlungsart::Nachnahme;\n $myOrder->Waehrung = Waehrung::EURO;\n $myOrder->Status = Status::EingegangenUndFreigegeben;\n $myOrder->Rechnungsnummer = 'sampleInvoiceId_'.rand(1000, 9999);\n $myOrder->Kundenbemerkung = 'Please send the products as fast as you can! Thank you, regards, your buyer'; \n $myOrder->Händlerbemerkung = 'We\\'ll send it tomorow! Regards, your merchant'; \n $myOrder->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder->Kunde = new Kunde(); \n\n $myOrder->Kunde->Kundennummer = 'sampleClientId_'.rand(1000, 9999);\n $myOrder->Kunde->Firma = 'Die Testfirma GmbH';\n $myOrder->Kunde->FirmenZusatz = 'wir testen das!'; \n $myOrder->Kunde->Titel = 'Prof. Dr.';\n $myOrder->Kunde->Vorname = 'Testina';\n $myOrder->Kunde->Nachname = 'Testerin';\n $myOrder->Kunde->Geschlecht = Geschlecht::Weiblich;\n $myOrder->Kunde->Zhd = 'Hr. Einkäufer (Buchhaltung)'; \n $myOrder->Kunde->UStId = 'DE 123456789';\n $myOrder->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Kunde->Telefon = '012 / 345 678 - 9';\n $myOrder->Kunde->Fax = '012 / 987 654 - 3';\n $myOrder->Kunde->Geburtstag = '07.07.1977';\n $myOrder->Kunde->Mobil = '0170 123 456';\n \n $myOrder->Kunde->Adresse = new Adresse();\n \n $myOrder->Kunde->Adresse->Straße = 'Am Testgelände';\n $myOrder->Kunde->Adresse->Hausnummer = '12a';\n $myOrder->Kunde->Adresse->Anmerkung = 'Gebäudekomplex \"Anton\"';\n $myOrder->Kunde->Adresse->PLZ = '12345';\n $myOrder->Kunde->Adresse->Ort = 'Testort';\n $myOrder->Kunde->Adresse->Bundesland = 'Nordrhein-Westfalen';\n $myOrder->Kunde->Adresse->Land = Land::DE();\n\n $myOrder->Lieferanschrift = new Anschrift();\n \n $myOrder->Lieferanschrift->Firma = 'Lagerfirma UG';\n $myOrder->Lieferanschrift->FirmenZusatz = 'denn lagern ist Leidenschaft!'; \n $myOrder->Lieferanschrift->Titel = 'Dipl.-Ing.';\n $myOrder->Lieferanschrift->Vorname = 'Ludwig';\n $myOrder->Lieferanschrift->Nachname = 'Lagerist';\n $myOrder->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Lieferanschrift->Telefon = '098 / 765 432 - 1';\n $myOrder->Lieferanschrift->Fax = '098 / 123 456 - 7';\n $myOrder->Lieferanschrift->Mobil = '0151 654 321';\n \n $myOrder->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder->Lieferanschrift->Adresse->Straße = 'Lagerstraße';\n $myOrder->Lieferanschrift->Adresse->Hausnummer = '211';\n $myOrder->Lieferanschrift->Adresse->Anmerkung = 'Tor 4';\n $myOrder->Lieferanschrift->Adresse->PLZ = '5432';\n $myOrder->Lieferanschrift->Adresse->Ort = 'Lagerstadt';\n $myOrder->Lieferanschrift->Adresse->Bundesland = 'Tirol';\n $myOrder->Lieferanschrift->Adresse->Land = Land::AT();\n \n $myGutschein = new Gutschein();\n \n $myGutschein->GutscheinNummer = 'sampleCouponId_'.rand(1000, 9999); \n $myGutschein->Rabatt = 9.99; \n $myGutschein->Code = 'sampleCouponCode_'.rand(1000, 9999); \n $myGutschein->Bemerkung = 'unicorn 2 is great - coupon!'; \n \n array_push($myOrder->Gutscheine, $myGutschein);\n \n $myArtikel_1 = new Artikel();\n \n $myArtikel_1->ShopId = 'yourArticleIdOnMarketplace_1'; // the returned articleId from function addArticle($article) \n $myArtikel_1->ArtikelNummer = 'productArtNo_1';\n $myArtikel_1->Name = 'sampleProduct_1';\n $myArtikel_1->Hinweis = 'with gift package'; \n $myArtikel_1->Menge = 2; \n $myArtikel_1->Preis = 2.69; // Brutto (with tax included)\n $myArtikel_1->GesammtPreis = 5.38;\n $myArtikel_1->MwSt = Steuer::MwSt7();\n \n array_push($myOrder->Artikel, $myArtikel_1);\n \n $myArtikel_2 = new Artikel();\n \n $myArtikel_2->ShopId = 'yourArticleIdOnMarketplace_2';\n $myArtikel_2->ArtikelNummer = 'productArtNo_2';\n $myArtikel_2->Name = 'sampleProduct_2 with variations Color: blue Size: XXL';\n $myArtikel_2->Menge = 1; \n $myArtikel_2->Preis = 8.99;\n $myArtikel_2->GesammtPreis = 8.99;\n $myArtikel_2->MwSt = Steuer::MwSt19(); \n \n $myVakoArtikel = new VakoArtikel();\n \n $myVakoArtikel->ShopId = 'yourVariationIdOnMarketplace'; // the returned variantId from function addArticle($article) on adding this explicit variation \n $myVakoArtikel->Aktiv = true;\n \n $myVakoEigenschaftName_1 = new EigenschaftBase();\n $myVakoEigenschaftName_1->Name = 'Color';\n $myVakoWertEigenschaft_1 = new WertEigenschaft();\n \n $myVakoWertEigenschaft_1->Name = 'Color';\n $myVakoWertEigenschaft_1->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_1->Wert->Aktiv = true;\n $myVakoWertEigenschaft_1->Wert->Wert = 'blue';\n \n $myVakoEigenschaftName_2 = new EigenschaftBase();\n $myVakoEigenschaftName_2->Name = 'Size'; \n $myVakoWertEigenschaft_2 = new WertEigenschaft();\n\n $myVakoWertEigenschaft_2->Name = 'Size';\n $myVakoWertEigenschaft_2->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_2->Wert->Aktiv = true;\n $myVakoWertEigenschaft_2->Wert->Wert = 'XXL';\n \n array_push($myVakoArtikel->Eigenschaften, $myVakoWertEigenschaft_1, $myVakoWertEigenschaft_2);\n \n array_push($myArtikel_2->EigenschaftenNamen, $myVakoEigenschaftName_1, $myVakoEigenschaftName_2);\n \n array_push($myArtikel_2->VakoArtikel, $myVakoArtikel);\n \n array_push($myOrder->Artikel, $myArtikel_2);\n\n $object->addCollectionEntry($myOrder); \n \n $myOrder2 = new Bestellung();\n\n $myOrder2->ShopId = 'sampleOrderId_2_'.rand(1000, 9999);\n $myOrder2->Gesammtkosten = 34.95; \n $myOrder2->Versandkosten = 14.99; \n $myOrder2->VersandDienstleister = 'DPD Kurier';\n $myOrder2->Zahlungsart = Zahlungsart::Vorkasse;\n $myOrder2->Waehrung = Waehrung::EURO;\n $myOrder2->Status = Status::EingegangenUndFreigegeben;\n $myOrder2->Rechnungsnummer = 'sampleInvoiceId_2_'.rand(1000, 9999);\n $myOrder2->Kundenbemerkung = 'Bitte schnellstmöglich versenden, Danke!'; \n $myOrder2->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder2->Kunde = new Kunde(); \n\n $myOrder2->Kunde->Kundennummer = 'sampleClientId_2_'.rand(1000, 9999);\n $myOrder2->Kunde->Vorname = 'Arno';\n $myOrder2->Kunde->Nachname = 'Nym';\n $myOrder2->Kunde->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Kunde->Adresse = new Adresse();\n \n $myOrder2->Kunde->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Kunde->Adresse->Hausnummer = '1';\n $myOrder2->Kunde->Adresse->PLZ = '13373';\n $myOrder2->Kunde->Adresse->Ort = 'Geheim';\n $myOrder2->Kunde->Adresse->Land = Land::DE();\n \n $myOrder2->Lieferanschrift = new Anschrift();\n\n $myOrder2->Lieferanschrift->Vorname = 'Arno';\n $myOrder2->Lieferanschrift->Nachname = 'Nym';\n $myOrder2->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder2->Lieferanschrift->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Lieferanschrift->Adresse->Hausnummer = '1';\n $myOrder2->Lieferanschrift->Adresse->PLZ = '13373';\n $myOrder2->Lieferanschrift->Adresse->Ort = 'Geheim';\n $myOrder2->Lieferanschrift->Adresse->Land = Land::DE();\n \n $myArtikel = new Artikel();\n \n $myArtikel->ShopId = 'yourArticleIdOnMarketplace_1_2';\n $myArtikel->ArtikelNummer = 'productArtNo_1_2';\n $myArtikel->Name = 'sampleProduct_1_2'; \n $myArtikel->Menge = 4; \n $myArtikel->Preis = 4.99;\n $myArtikel->GesammtPreis = 19.96;\n $myArtikel->MwSt = Steuer::MwSt10P7();\n \n array_push($myOrder2->Artikel, $myArtikel);\n\n $object->addCollectionEntry($myOrder2); \n}",
"function retourneUtilisateur($idUtilisateur){\n\tglobal $connexion; // on définie la variables globale de connection dans la fonction\n\t\n\t$requete = $connexion->query(\"SELECT * FROM utilisateur where idUtilisateur=\".$idUtilisateur.\"\");\n\t$requete->setFetchMode(PDO::FETCH_OBJ);\n\t$enregistrement = $requete->fetch();\n\t\n\n\treturn $enregistrement; // on renvoie un objet utilisateur\n}"
]
| [
"0.6364592",
"0.5968592",
"0.58305526",
"0.5790157",
"0.57139444",
"0.56936586",
"0.5505822",
"0.53827435",
"0.5340461",
"0.53264767",
"0.5299806",
"0.52800167",
"0.52793974",
"0.5265252",
"0.524609",
"0.52343756",
"0.5219409",
"0.5214386",
"0.5195656",
"0.5189321",
"0.5180537",
"0.51801497",
"0.5176244",
"0.51740324",
"0.5169067",
"0.51679313",
"0.51661044",
"0.5159217",
"0.5153646",
"0.514816"
]
| 0.6108982 | 1 |
Retourneert een object van ritrecords (aangevuld met gebruiker en adresgegevens) met gebruikerIdMinderMobiele = $gebruikerId en vertrekTijdstip > nu | function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatumOuder($gebruikerId) {
// geef gebruiker-object met opgegeven $id met de geplande ritten
$nu = date('Y-m-d H:i:s');
$this->db->order_by('vertrekTijdstip');
$this->db->where('gebruikerIdMinderMobiele', $gebruikerId);
$this->db->where('vertrekTijdstip <', $nu);
$query = $this->db->get('rit');
$ritten = $query->result();
foreach ($ritten as $rit) {
$this->load->model('Gebruiker_model');
$rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);
$this->load->model('Adres_model');
$rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);
$rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);
}
return $ritten;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatum($gebruikerId) {\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip >', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"public function getDAOGebruikerBestelling() {\n $lijst = array();\n $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD);\n $sql = \"select GebruikersId, Wachtwoord, Voornaam, Familienaam, Straat, Huisnummer, Stad, Email, Telefoon, Boodschap, Promotie from gebruikerspizzashop WHERE Email = '[email protected]' and Wachtwoord = 'admin'\";\n $resultSet = $dbh->query($sql);\n if ($resultSet) {\n $rij = $resultSet->fetch();\n if ($rij) {\n $gebruiker = new Gebruiker($rij[\"GebruikersId\"], $rij[\"Wachtwoord\"], $rij[\"Voornaam\"], $rij[\"Familienaam\"], $rij[\"Straat\"], $rij[\"Huisnummer\"], $rij[\"Stad\"], $rij[\"Email\"], $rij[\"Telefoon\"], $rij[\"Boodschap\"], $rij[\"Promotie\"]);\n $dbh = null;\n return $gebruiker;\n } else\n return false;\n } else\n return false;\n }",
"private function stuurmailNaarVorigeBieder(){\n $conn = getConn();\n $sql = \" SELECT G.Emailadres FROM Gebruiker G INNER JOIN Bod B ON G.Gebruikersnaam = B.Gebruikersnaam\n WHERE B.Bodbedrag = (SELECT MAX(B.Bodbedrag) FROM Bod B \n WHERE Bodbedrag < ( SELECT MAX(B.Bodbedrag) FROM Bod b ) AND Voorwerpnummer = ?)\";\n $params=array($this->voorwerpnummer);\n $stmt = sqlsrv_prepare($conn, $sql, $params);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if ($stmt) {\n while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $emailadres = $row['Emailadres'];\n $this->stuurMail($emailadres);\n }\n\n }\n else{\n die(print_r(sqlsrv_errors(), true));\n }\n\n }",
"public function getobjcontrat($idcontrat){\n $uncontrat = R::load('contrat', $idcontrat); //équivalent à \"select * from contrat where idcontrat ='$idcontrat'\"\n $idclient = $uncontrat->idclient; //recupère l'id du client dans une variable\n $client = R::load('client', $idclient); // select * from client en fonction de l'idclient récupérer précedemment \n $idcontact = $client->idcontact; \n $contact = r::load('contact', $idcontact);\n $uncontact = new contact ($contact->email1, $contact->email2, $contact->email3, $contact->bureau, $contact->fax, $contact->tel3);\n $unclient = new client($client->raisonsocial, $uncontact, $client->siret, $client->adr, $client->ville, $client->codepostal);\n $idconsultant = $uncontrat->idutilisateur;\n $consultant = r::getAll('select * from utilisateur join consultant on utilisateur.id=consultant.idutilisateur where idutilisateur='.$idconsultant.'');\n for ($i=0; $i<count($consultant);$i++){\n $unconsultant = new consultant ($consultant[$i]['nom'], $consultant[$i]['prenom'], $consultant[$i]['adresse'], $consultant[$i]['ville'], $consultant[$i]['cp'], $consultant[$i]['tel'], $consultant[$i]['email'], $consultant[$i]['typecontrat'], $consultant[$i]['salaire'], $consultant[$i]['tarif']);\n }\n $contrat = new contrat($uncontrat->id, $unclient, $unconsultant, $uncontrat->datedebut,$uncontrat->datefin, $uncontrat->mission, $uncontrat->salaire, $uncontrat->tarif, $uncontrat->typecontrat);\n //var_dump($contrat);\n return $contrat;\n }",
"function getAllRitten($gebruikerId) {\n $this->db->where('gebruikerIdVrijwilliger', $gebruikerId);\n $query = $this->db->get('rit');\n return $query->result();\n }",
"public function geefGebruikers() {\n $sql = \"SELECT `id`,\n `voornaam`,\n `tussenvoegsel`,\n `achternaam`,\n `gebruikersnaam`,\n AES_DECRYPT(wachtwoord,:key) AS 'wachtwoord',\n `mail`,\n `gebruikerstype`\n FROM `gebruikers`\";\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':key', $this->key);\n $stmnt->execute();\n $gebruikers = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Gebruiker');\n return $gebruikers;\n }",
"public static function getTruhlar($truhlarID){\n $truhlarJmeno = Zamestnanec::where('ID_Zam', '=', $truhlarID)\n ->select(\"Jmeno\", \"Prijmeni\")\n ->first();\n\n $Truhlar = (object) array(\n 'id' => $truhlarID,\n 'jmeno' => $truhlarJmeno->Jmeno,\n 'prijmeni' => $truhlarJmeno->Prijmeni\n );\n\n return $Truhlar;\n }",
"public function getById($idManifiesto) {\n $db = $this->getAdapter();\n $db->setFetchMode(Zend_Db::FETCH_OBJ);\n $select = $db->select();\n $select->from(array('m' => 'manifiesto'), array('id_manifiesto', 'fecha', 'hora', 'despachador', 'viaje',\n 'bus', 'chofer', 'total', 'destino', 'origen', 'estado', 'tipo'));\n $select->joinLeft(array(\"ch\" => \"chofer\"), \"ch.id_chofer=m.chofer\", \"nombre_chofer\");\n $select->joinLeft(array(\"b\" => \"bus\"), \"b.id_bus=m.bus\", \"numero\");\n $select->join(array(\"o\" => \"ciudad\"), \"o.id_ciudad=m.origen\", \"nombre as ciudadOrigen\");\n $select->join(array(\"d\" => \"ciudad\"), \"d.id_ciudad=m.destino\", \"nombre as ciudadDestino\");\n $select->where(\"id_manifiesto=?\", $idManifiesto);\n $results = $db->fetchRow($select);\n return $results;\n }",
"public function getMothers()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$items = array();\n\t\t$mother_id = $app->input->get('id', 0, 'INT');\n\t\t$mother_code = $app->input->get('code', '', 'STRING');\n\n\t\t$listOrder = $app->input->get('listOrder', 'ASC', 'STRING');\n\n\t\t$mother_obj = new VbfModelMothers;\n\n\t\t$mother_obj->setState('list.direction', $listOrder);\n\n\t\tif ($limit)\n\t\t{\n\t\t\t$mother_obj->setState('list.start', $limitstart);\n\t\t\t$mother_obj->setState('list.limit', $limit);\n\t\t}\n\n\t\t// Filter by mother\n\t\tif ($mother_id)\n\t\t{\n\t\t\t$mother_obj->setState('filter.id', $mother_id);\n\t\t}\n\n\t\t// Filter by mother\n\t\tif ($mother_code)\n\t\t{\n\t\t\t$mother_obj->setState('filter.code', $mother_code);\n\t\t}\n\t\t\n\t\t$rows = $mother_obj->getItems();\n\n\t\t$num_mothers = $mother_obj->getTotal();\n\t\t$data[] = new stdClass;\n\n\t\tforeach ($rows as $subKey => $subArray)\n\t\t{\n\t\t\t$data[$subKey]->babybirth = $subArray->babybirth;\n\t\t\t$data[$subKey]->code = $subArray->code;\n\t\t\t$data[$subKey]->lmp = $subArray->lmp;\n\t\t\t$data[$subKey]->name = $subArray->name;\n\t\t\t$data[$subKey]->note = $subArray->note;\n\t\t\t$data[$subKey]->phone = $subArray->phone;\n\t\t\t$data[$subKey]->token = $subArray->token;\n\t\t\t$data[$subKey]->type = $subArray->type;\n\t\t}\n\n\t\t$obj = new stdclass;\n\t\t$result = new stdClass;\n\n\t\tif (count($data) > 0)\n\t\t{\n\t\t\t$result->results = $data;\n\t\t\t$result->total = $num_mothers;\n\t\t\t$obj->success = true;\n\t\t\t$obj->data = $result;\n\n\t\t\treturn $obj;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$obj->success = false;\n\t\t\t$obj->message = 'System does not have items';\n\t\t}\n\n\t\treturn $obj;\n\t}",
"public function show($id){\n $boekenkastMedailles = array();\n // Loop door alle 8 Medaille Slots\n for($i = 1; $i <= 8; $i++){\n $medaille_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('medaille_id_slot' . $i);\n // Als er een Medaille in een Slot staat; voeg deze toe\n if(!is_null($medaille_id)){\n $boekenkastMedailles[] = \\App\\Models\\Medaille::find($medaille_id);\n }\n else{\n // Als er geen medaille in het slot moet komen; voeg default empty slot medaille toe\n $boekenkastMedailles[] = \\App\\Models\\Medaille::where('naam', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Items op uit de boekenkast en stop ze in een array om mee te geven\n $boekenkastItems = array();\n for($i = 1; $i <= 6; $i++){\n $item_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('item_id_slot' . $i);\n // Als er een item in een slot staat; voeg deze toe\n if(!is_null($item_id)){\n $boekenkastItems[] = \\App\\Models\\Item::find($item_id);\n }\n else{\n // Als er geen Item in het slot moet komen; voeg default empty slot Item toe\n $boekenkastItems[] = \\App\\Models\\Item::where('soort', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Medailles op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeMedailles = array();\n // Haal alle 'behaalde medailles' op\n $behaaldeMedaillesId = \\App\\Models\\BehaaldMedaille::where('user_id', '=', $id)->get();\n // Voor elk 'behaald medaille'; pak daarvan de 'medaille' en voeg deze toe aan de array\n foreach($behaaldeMedaillesId as $behaaldeMedailleId){\n $behaaldeMedailles[] = $behaaldeMedailleId->Medaille;\n }\n\n // Haal alle Items op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeItems = array();\n // Haal alle 'behaalde items' op\n $behaaldeItemsId = \\App\\Models\\BehaaldItem::where('user_id', '=', $id)->get();\n // Voor elk 'behaald item'; pak daarvan de 'item' en voeg deze toe aan de array\n foreach($behaaldeItemsId as $behaaldeItemId){\n if($behaaldeItemId->Item->soort === \"Kastdecoratie\"){\n $behaaldeItems[] = $behaaldeItemId->Item;\n }\n \n }\n\n return ['boekenkast' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first(),\n 'eigenaar' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first()->Eigenaar,\n 'boekenkast_medailles' => $boekenkastMedailles,\n 'boekenkast_items' => $boekenkastItems,\n 'behaalde_medailles' => $behaaldeMedailles,\n 'behaalde_items' => $behaaldeItems];\n }",
"public function getRecordatorio() {\n $recordatorio = $this->_db->query(\"SELECT deuda.Id_cliente as dni, nombre as nombre, apellidos as apellido, \n direccion as direccion, telefono as telefono, celular as celular, total as totalDeuda\n FROM pagos as pagos \n INNER JOIN venta as venta ON venta.Id_deuda = pagos.Id_deuda\n INNER JOIN productoventa as prodventa ON venta.cod_busqueda = prodventa.cod_busqueda\n INNER JOIN deuda as deuda ON deuda.Id_deuda = venta.Id_deuda\n INNER JOIN cliente as cliente ON cliente.Id_cliente = deuda.Id_cliente where pagos.estado >= 0 and pagos.Fecha_Pago = CURDATE()\n ORDER BY deuda.Fecha_deuda\"\n );\n return $recordatorio->fetchall();\n }",
"public function modelFetch(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban where maphongban=$maphongban\");\n\t\t\t//tra ve mot ban ghi\n\t\t\treturn $query->fetch();\n\t\t}",
"public function szukajMieszkanieAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->_request->getParam('id');\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t\t\n\t\t\t$this->view->numer = $numer = $this->_request->getParam('numer');\n\t\t\t$this->view->areaFrom = $areaFrom = $this->_request->getParam('metraz_min');\n\t\t\t$this->view->areaTo = $areaTo = $this->getRequest()->getParam('metraz_max');\n\t\t\t$this->view->status = $status = $this->_request->getParam('status');\n\t\t\t$this->view->rooms = $rooms = $this->_request->getParam('pokoje');\n\t\t\t$this->view->floor = $floor = $this->_request->getParam('pietro');\n\n\t\t\t$select_pomieszczenia = $db->select()\n\t\t\t->from('inwestycje_powierzchnia')\n\t\t\t->where('id_inwest = ?', $id)\n\t\t\t->order('sort ASC');\n\t\t\t\n\t\t\tif($numer) {$select_pomieszczenia->where('numer LIKE ?', '%'.$numer.'%');}\n\t\t\tif($status) {$select_pomieszczenia->where('status =?', $status);}\n\t\t\tif($rooms) {$select_pomieszczenia->where('pokoje =?', $rooms);}\n\t\t\tif($floor || $floor == '0') {$select_pomieszczenia->where('numer_pietro =?', $floor);}\n\t\t\tif($areaFrom) {$select_pomieszczenia->where('szukaj_metry >=?', $areaFrom);}\n\t\t\tif($areaTo) {$select_pomieszczenia->where('szukaj_metry <=?', $areaTo);}\n\t\t\t\n\t\t\t$this->view->lista = $result = $db->fetchAll($select_pomieszczenia);\n\t\t}",
"function getMeGustaId($id, $id_usuario) {\n $c = new Conexion();\n $resultado = $c->query(\"SELECT val_mg.megusta FROM valoracion_mg val_mg, usuario usu where val_mg.id_usuario=usu.id && val_mg.id_contenido=$id && val_mg.id_usuario=$id_usuario\");\n\n if ($objeto = $resultado->fetch(PDO::FETCH_OBJ)) {\n return $objeto;\n }\n else{\n return null;\n } \n}",
"public function getTelefones() {\n\n $aTelefones = array();\n $oDaoTelefones = new cl_telefoneescola();\n $sCampos = \"ed26_i_ddd as ddd, ed26_i_numero as numero, ed13_c_descr as tipo_telefone\";\n $sSqlTelefones = $oDaoTelefones->sql_query(null, $sCampos, \"ed26_i_numero\", \"ed26_i_escola = {$this->iCodigoEscola}\" );\n $rsTelefones = db_query($sSqlTelefones);\n\n if ( !$rsTelefones ) {\n throw new DBException(\"Erro ao buscar os telefones.\\n\" . pg_last_error());\n }\n $iTotalTelefones = pg_num_rows($rsTelefones);\n\n $oDadosTelefone = new stdClass();\n $oDadosTelefone->ddd = '';\n $oDadosTelefone->fax = '';\n $oDadosTelefone->telefone = '';\n $oDadosTelefone->telefone_publico = '';\n $oDadosTelefone->telefone_outro = '';\n\n for ($i = 0; $i < $iTotalTelefones; $i++) {\n\n $oTelefone = db_utils::fieldsMemory($rsTelefones, $i);\n\n $oDadosTelefone->ddd = $oTelefone->ddd;\n\n if (strpos(strtoupper($oTelefone->tipo_telefone), \"FAX\") !== false) {\n $oDadosTelefone->fax = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone_publico) && strlen($oTelefone->numero) == 8 ) {\n $oDadosTelefone->telefone_publico = $oTelefone->numero;\n continue;\n }\n\n if ( empty($oDadosTelefone->telefone) ) {\n $oDadosTelefone->telefone = $oTelefone->numero;\n continue;\n }\n\n\n if ( empty($oDadosTelefone->telefone_outro) ) {\n $oDadosTelefone->telefone_outro = $oTelefone->numero;\n continue;\n }\n }\n\n return $oDadosTelefone;\n }",
"public function getJeloPoObroku($obrok) {\n\n $this->db->select(\"idR\");\n $this->db->from(\"recepti\");\n $this->db->where(\"obrok\", $obrok);\n $tmp = $this->db->get();\n $jela = $tmp->result();\n\n $size = count($jela);\n $ind = mt_rand(0, $size - 1);\n\n return $jela[$ind]->idR;\n }",
"public static function getRoditelji()\n {\n //$data = Korisnik::where('korisnici_roditelj_1','=',NULL)->get();\n //$data = Korisnik::all();\n $dvaRoditelja=\\DB::select('SELECT DISTINCT \n k1.korisnici_roditelj_1, k2.korisnici_roditelj_2,\n k1.prezime as prvi_roditelj_prezime, k1.ime as prvi_roditelj_ime,\n k2.prezime as drugi_roditelj_prezime, k2.ime as drugi_roditelj_ime\n FROM korisnici k1, korisnici k2 \n WHERE (k1.korisnici_roditelj_1 = k2.korisnici_roditelj_1 \n AND k1.korisnici_roditelj_2 = k2.korisnici_roditelj_2)\n ');\n \n $jedanRoditelj=\\DB::select('SELECT DISTINCT \n k1.korisnici_roditelj_1, k2.korisnici_roditelj_2,\n k1.prezime as prvi_roditelj_prezime, k1.ime as prvi_roditelj_ime,\n k2.prezime as drugi_roditelj_prezime, k2.ime as drugi_roditelj_ime\n FROM korisnici k1, korisnici k2 \n WHERE (k1.korisnici_roditelj_1 = k2.korisnici_roditelj_1 \n AND k1.korisnici_roditelj_2 is NULL)');\n\n $dvaRoditelja=json_decode(json_encode($dvaRoditelja),true);\n $jedanRoditelj=json_decode(json_encode($jedanRoditelj),true);\n\n $data3=array_merge($dvaRoditelja,$jedanRoditelj);\n\n $data3=array_unique($data3, SORT_REGULAR);\n\n return compact(['data3']);\n \n }",
"function LancerNouveauRetour($BonID,$articles,$OtID){\n // un objet contient les deux colones : article_id et qtear\n $success=true;\n $UserID = JWTAuth::user()->id;\n $di_bon_retour=prev_bon_retour::create([\n 'bonp_id' => $BonID,\n 'otp_id'=>$OtID,\n 'user_id'=>$UserID\n ]);\n if(!$di_bon_retour){$success=false;}\n $RetourID=$di_bon_retour->RetourID;\n \n foreach($articles as $article){\n if($article->qtear>0){\n $di_bon_retour_det=prev_bon_retour_det::create([\n 'retour_id' => $RetourID,\n 'article_id' => $article->article_id,\n 'qtear' => $article->qtear,\n 'qter' => null\n ]); \n\n if(!$di_bon_retour_det){$success=false;}\n }\n }\n if($success){return $RetourID;}else{return false;}\n }",
"public function kamerselecteren(){\n $this->stmt = $this->conn->prepare(\"SELECT kamerid, kamernummer from kamer\");\n $result = $this->stmt->execute();\n\n if(!$result){\n die('<pre>Oops, Error execute query ' . $result . '</pre><br><pre>' . 'Result code: ' . $result . '</pre>');\n }\n $this->resultSet = $this->stmt->fetchALL(PDO::FETCH_ASSOC);\n\n $result = $this->resultSet;\n\n // return $result so we can use the data\n return $result;\n\n }",
"public function getEntradas(){\n\n $oDaoMatOrdemItem = db_utils::getDao('matordemitem');\n $sWhereOrdemCompra = \"m81_codtipo in (19, 12) and m52_codordem = {$this->iCodigoOrdem}\";\n $sSqlMatOrdemItem = $oDaoMatOrdemItem->sql_query_entradas( null, \"*\", null, $sWhereOrdemCompra);\n $rsMatOrdemItem = $oDaoMatOrdemItem->sql_record($sSqlMatOrdemItem);\n\n $aItensEntrada = array();\n if ($oDaoMatOrdemItem->numrows > 0) {\n\n $iTotalItens = $oDaoMatOrdemItem->numrows;\n for ($iRowItem = 0; $iRowItem < $iTotalItens; $iRowItem++) {\n\n $oDadosMatOrdemItem = db_utils::fieldsMemory($rsMatOrdemItem, $iRowItem);\n $oItem = new Item($oDadosMatOrdemItem->m70_codmatmater);\n $oAlmoxarifado = new Almoxarifado($oDadosMatOrdemItem->m80_coddepto);\n $oTipoMovimentacao = TipoMovimentacaoEstoqueRepository::getTipoMovimentaoPorCodigo($oDadosMatOrdemItem->m81_codtipo);\n\n $oMovimentacaoItem = new MovimentacaoItem($oItem);\n $oMovimentacaoItem->setQuantidade($oDadosMatOrdemItem->m52_quant);\n $oMovimentacaoItem->setQuantidadeEntrada($oDadosMatOrdemItem->m71_quant);\n $oMovimentacaoItem->setValor($oDadosMatOrdemItem->m71_valor);\n $oMovimentacaoItem->setAlmoxarifado($oAlmoxarifado);\n $oMovimentacaoItem->setTipoMovimentacao($oTipoMovimentacao);\n\n $aItensEntrada[] = $oMovimentacaoItem;\n\n }\n }\n return $aItensEntrada;\n }",
"public function merk()\n {\n return $this->belongsTo('App\\Inventori', 'tipe_brg', 'tipe_brg');\n }",
"function getNaujienosVisi() {\n $manoSQL = \"SELECT * FROM naujienos order by id DESC \";\n // $rezultataiOBJ - Mysql Objektas\n $rezultataiOBJ = mysqli_query(getPrisijungimas(), $manoSQL);\n return $rezultataiOBJ;\n}",
"public function givecoordonerplsunom()\r\n {\r\n $request = $this->_bdd->query(\"SELECT gps.`id`, gps.id_bateau, gps.latitude, gps.longitude, bateau.nom FROM gps, bateau WHERE gps.id_bateau = bateau.id ORDER BY `gps`.`id` DESC\");\r\n while ($data = $request->fetch()) {\r\n $modf = \"modifcordoner.php?modfBateau=\" . $data[\"id_bateau\"];\r\n $supr = \"admin.php?suprBateau=\" . $data[\"id\"];\r\n?>\r\n <tr>\r\n <td><?=$data['id']?></td>\r\n <td><?= $data['id_bateau']?></td>\r\n <td>\r\n <a href=\"#\"><?= $data['nom']?></a>\r\n </td>\r\n \r\n <td><?= $data['latitude'] ?></td>\r\n <td><?=$data['longitude']?></td>\r\n <td>\r\n <a href=\"<?=$modf?>\" class=\"settings\" title=\"modifier\" data-toggle=\"tooltip\"><i class=\"material-icons\"></i></a>\r\n <a href=\"<?=$supr?>\" class=\"delete\" title=\"supprimer\" data-toggle=\"tooltip\"><i class=\"material-icons\"></i></a>\r\n </td>\r\n </tr>\r\n<?php\r\n }\r\n }",
"public function murotal_reciter_surah()\n {\n return $this->hasMany(MRS::class, 'id', 'surah_id');\n }",
"public function geefKlant() {\n $klant_id = $_SESSION['gebruiker']->geefKlant_id();\n $sql = 'SELECT * FROM `klanten` WHERE `id` = :id';\n $stmnt = $this->db->prepare($sql);\n $stmnt->bindParam(':id', $klant_id);\n $stmnt->execute();\n $klant = $stmnt->fetchAll(\\PDO::FETCH_CLASS, __NAMESPACE__ . '\\Klant');\n return $klant[0];\n }",
"function getRest(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE \n a.gebruikerId = ? AND v.actief = 1 \n \n \n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"function getWhereDatum($gebruikerId, $datum) {\n $date = strtotime($datum);\n $weekDag = date('w', $date);\n if ($weekDag != 1) {\n $startdate = strtotime(\"last monday\", $date);\n $enddate = strtotime(\"monday\", $date);\n\n } else {\n $startdate = strtotime(\"today\", $date);\n $enddate = strtotime(\"next monday\", $date);\n }\n $startdate = date('Y-m-d H:i:s', $startdate);\n $enddate = date('Y-m-d H:i:s', $enddate);\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip >', $startdate);\n $this->db->where('vertrekTijdstip <', $enddate);\n $this->db->where('ritIdHeenrit', NULL);\n\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n return $ritten;\n }",
"public function reserveren($naam, $adres, $plaats, $postcode, $telefoon, $van, $tot, $kamerid){\n\n try{ \n //deze sql query insert de dingen die we nodig hebben bij persoon\n $query1 = \"INSERT INTO persoon (naam, adres, plaats, postcode, telefoon) VALUES (:naam, :adres, :plaats, :postcode, :telefoon)\";\n $statement1= $this->conn->prepare($query1);\n $statement1->execute(\n array(\n 'naam'=> $naam,\n 'adres'=> $adres,\n 'plaats'=> $plaats,\n 'postcode'=> $postcode,\n 'telefoon'=> $telefoon \n )\n );\n $last_id = $this->conn->lastInsertId();\n //deze query insert de informatie bij reserveringsoverzicht\n $query3 = \"INSERT INTO reserveringsoverzicht (van, tot, persoon_persoonid, kamer_kamerid) VALUES (:van, :tot, :persoon_persoonid, :kamer_kamerid)\";\n $statement3 = $this->conn->prepare($query3);\n $statement3->execute(\n array(\n 'van' => $van,\n 'tot' => $tot,\n 'persoon_persoonid' => $last_id,\n 'kamer_kamerid' => $kamerid\n )\n );\n // redirect to home page\n header(\"location:index.php\");\n\n }catch(PDOException $error){\n echo $error->getMessage();\n exit(\"An error occured\");\n }\n }",
"function getOrder($object) {\n //foreach($answerObject->Orders as $order) {\n //\n // $myOrder = new Bestellung();\n // ....\n // $object->addCollectionEntry($myOrder); \n //}\n \n $bestelldatum = new DateTime(); \n $lieferdatum = new DateTime(); \n $lieferdatum->add(new DateInterval('P4D'));\n\n $myOrder = new Bestellung();\n\n $myOrder->ShopId = 'sampleOrderId_'.rand(1000, 9999);\n $myOrder->Gesammtkosten = 9.37; \n $myOrder->Versandkosten = 4.99; \n $myOrder->VersandDienstleister = 'DHL National';\n $myOrder->Lieferdatum = $lieferdatum->format('Y-m-d H:i:s'); \n $myOrder->Zahlungsart = Zahlungsart::Nachnahme;\n $myOrder->Waehrung = Waehrung::EURO;\n $myOrder->Status = Status::EingegangenUndFreigegeben;\n $myOrder->Rechnungsnummer = 'sampleInvoiceId_'.rand(1000, 9999);\n $myOrder->Kundenbemerkung = 'Please send the products as fast as you can! Thank you, regards, your buyer'; \n $myOrder->Händlerbemerkung = 'We\\'ll send it tomorow! Regards, your merchant'; \n $myOrder->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder->Kunde = new Kunde(); \n\n $myOrder->Kunde->Kundennummer = 'sampleClientId_'.rand(1000, 9999);\n $myOrder->Kunde->Firma = 'Die Testfirma GmbH';\n $myOrder->Kunde->FirmenZusatz = 'wir testen das!'; \n $myOrder->Kunde->Titel = 'Prof. Dr.';\n $myOrder->Kunde->Vorname = 'Testina';\n $myOrder->Kunde->Nachname = 'Testerin';\n $myOrder->Kunde->Geschlecht = Geschlecht::Weiblich;\n $myOrder->Kunde->Zhd = 'Hr. Einkäufer (Buchhaltung)'; \n $myOrder->Kunde->UStId = 'DE 123456789';\n $myOrder->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Kunde->Telefon = '012 / 345 678 - 9';\n $myOrder->Kunde->Fax = '012 / 987 654 - 3';\n $myOrder->Kunde->Geburtstag = '07.07.1977';\n $myOrder->Kunde->Mobil = '0170 123 456';\n \n $myOrder->Kunde->Adresse = new Adresse();\n \n $myOrder->Kunde->Adresse->Straße = 'Am Testgelände';\n $myOrder->Kunde->Adresse->Hausnummer = '12a';\n $myOrder->Kunde->Adresse->Anmerkung = 'Gebäudekomplex \"Anton\"';\n $myOrder->Kunde->Adresse->PLZ = '12345';\n $myOrder->Kunde->Adresse->Ort = 'Testort';\n $myOrder->Kunde->Adresse->Bundesland = 'Nordrhein-Westfalen';\n $myOrder->Kunde->Adresse->Land = Land::DE();\n\n $myOrder->Lieferanschrift = new Anschrift();\n \n $myOrder->Lieferanschrift->Firma = 'Lagerfirma UG';\n $myOrder->Lieferanschrift->FirmenZusatz = 'denn lagern ist Leidenschaft!'; \n $myOrder->Lieferanschrift->Titel = 'Dipl.-Ing.';\n $myOrder->Lieferanschrift->Vorname = 'Ludwig';\n $myOrder->Lieferanschrift->Nachname = 'Lagerist';\n $myOrder->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Lieferanschrift->Telefon = '098 / 765 432 - 1';\n $myOrder->Lieferanschrift->Fax = '098 / 123 456 - 7';\n $myOrder->Lieferanschrift->Mobil = '0151 654 321';\n \n $myOrder->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder->Lieferanschrift->Adresse->Straße = 'Lagerstraße';\n $myOrder->Lieferanschrift->Adresse->Hausnummer = '211';\n $myOrder->Lieferanschrift->Adresse->Anmerkung = 'Tor 4';\n $myOrder->Lieferanschrift->Adresse->PLZ = '5432';\n $myOrder->Lieferanschrift->Adresse->Ort = 'Lagerstadt';\n $myOrder->Lieferanschrift->Adresse->Bundesland = 'Tirol';\n $myOrder->Lieferanschrift->Adresse->Land = Land::AT();\n \n $myGutschein = new Gutschein();\n \n $myGutschein->GutscheinNummer = 'sampleCouponId_'.rand(1000, 9999); \n $myGutschein->Rabatt = 9.99; \n $myGutschein->Code = 'sampleCouponCode_'.rand(1000, 9999); \n $myGutschein->Bemerkung = 'unicorn 2 is great - coupon!'; \n \n array_push($myOrder->Gutscheine, $myGutschein);\n \n $myArtikel_1 = new Artikel();\n \n $myArtikel_1->ShopId = 'yourArticleIdOnMarketplace_1'; // the returned articleId from function addArticle($article) \n $myArtikel_1->ArtikelNummer = 'productArtNo_1';\n $myArtikel_1->Name = 'sampleProduct_1';\n $myArtikel_1->Hinweis = 'with gift package'; \n $myArtikel_1->Menge = 2; \n $myArtikel_1->Preis = 2.69; // Brutto (with tax included)\n $myArtikel_1->GesammtPreis = 5.38;\n $myArtikel_1->MwSt = Steuer::MwSt7();\n \n array_push($myOrder->Artikel, $myArtikel_1);\n \n $myArtikel_2 = new Artikel();\n \n $myArtikel_2->ShopId = 'yourArticleIdOnMarketplace_2';\n $myArtikel_2->ArtikelNummer = 'productArtNo_2';\n $myArtikel_2->Name = 'sampleProduct_2 with variations Color: blue Size: XXL';\n $myArtikel_2->Menge = 1; \n $myArtikel_2->Preis = 8.99;\n $myArtikel_2->GesammtPreis = 8.99;\n $myArtikel_2->MwSt = Steuer::MwSt19(); \n \n $myVakoArtikel = new VakoArtikel();\n \n $myVakoArtikel->ShopId = 'yourVariationIdOnMarketplace'; // the returned variantId from function addArticle($article) on adding this explicit variation \n $myVakoArtikel->Aktiv = true;\n \n $myVakoEigenschaftName_1 = new EigenschaftBase();\n $myVakoEigenschaftName_1->Name = 'Color';\n $myVakoWertEigenschaft_1 = new WertEigenschaft();\n \n $myVakoWertEigenschaft_1->Name = 'Color';\n $myVakoWertEigenschaft_1->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_1->Wert->Aktiv = true;\n $myVakoWertEigenschaft_1->Wert->Wert = 'blue';\n \n $myVakoEigenschaftName_2 = new EigenschaftBase();\n $myVakoEigenschaftName_2->Name = 'Size'; \n $myVakoWertEigenschaft_2 = new WertEigenschaft();\n\n $myVakoWertEigenschaft_2->Name = 'Size';\n $myVakoWertEigenschaft_2->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_2->Wert->Aktiv = true;\n $myVakoWertEigenschaft_2->Wert->Wert = 'XXL';\n \n array_push($myVakoArtikel->Eigenschaften, $myVakoWertEigenschaft_1, $myVakoWertEigenschaft_2);\n \n array_push($myArtikel_2->EigenschaftenNamen, $myVakoEigenschaftName_1, $myVakoEigenschaftName_2);\n \n array_push($myArtikel_2->VakoArtikel, $myVakoArtikel);\n \n array_push($myOrder->Artikel, $myArtikel_2);\n\n $object->addCollectionEntry($myOrder); \n \n $myOrder2 = new Bestellung();\n\n $myOrder2->ShopId = 'sampleOrderId_2_'.rand(1000, 9999);\n $myOrder2->Gesammtkosten = 34.95; \n $myOrder2->Versandkosten = 14.99; \n $myOrder2->VersandDienstleister = 'DPD Kurier';\n $myOrder2->Zahlungsart = Zahlungsart::Vorkasse;\n $myOrder2->Waehrung = Waehrung::EURO;\n $myOrder2->Status = Status::EingegangenUndFreigegeben;\n $myOrder2->Rechnungsnummer = 'sampleInvoiceId_2_'.rand(1000, 9999);\n $myOrder2->Kundenbemerkung = 'Bitte schnellstmöglich versenden, Danke!'; \n $myOrder2->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder2->Kunde = new Kunde(); \n\n $myOrder2->Kunde->Kundennummer = 'sampleClientId_2_'.rand(1000, 9999);\n $myOrder2->Kunde->Vorname = 'Arno';\n $myOrder2->Kunde->Nachname = 'Nym';\n $myOrder2->Kunde->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Kunde->Adresse = new Adresse();\n \n $myOrder2->Kunde->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Kunde->Adresse->Hausnummer = '1';\n $myOrder2->Kunde->Adresse->PLZ = '13373';\n $myOrder2->Kunde->Adresse->Ort = 'Geheim';\n $myOrder2->Kunde->Adresse->Land = Land::DE();\n \n $myOrder2->Lieferanschrift = new Anschrift();\n\n $myOrder2->Lieferanschrift->Vorname = 'Arno';\n $myOrder2->Lieferanschrift->Nachname = 'Nym';\n $myOrder2->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder2->Lieferanschrift->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Lieferanschrift->Adresse->Hausnummer = '1';\n $myOrder2->Lieferanschrift->Adresse->PLZ = '13373';\n $myOrder2->Lieferanschrift->Adresse->Ort = 'Geheim';\n $myOrder2->Lieferanschrift->Adresse->Land = Land::DE();\n \n $myArtikel = new Artikel();\n \n $myArtikel->ShopId = 'yourArticleIdOnMarketplace_1_2';\n $myArtikel->ArtikelNummer = 'productArtNo_1_2';\n $myArtikel->Name = 'sampleProduct_1_2'; \n $myArtikel->Menge = 4; \n $myArtikel->Preis = 4.99;\n $myArtikel->GesammtPreis = 19.96;\n $myArtikel->MwSt = Steuer::MwSt10P7();\n \n array_push($myOrder2->Artikel, $myArtikel);\n\n $object->addCollectionEntry($myOrder2); \n}",
"function retourneUtilisateur($idUtilisateur){\n\tglobal $connexion; // on définie la variables globale de connection dans la fonction\n\t\n\t$requete = $connexion->query(\"SELECT * FROM utilisateur where idUtilisateur=\".$idUtilisateur.\"\");\n\t$requete->setFetchMode(PDO::FETCH_OBJ);\n\t$enregistrement = $requete->fetch();\n\t\n\n\treturn $enregistrement; // on renvoie un objet utilisateur\n}"
]
| [
"0.611025",
"0.5970957",
"0.58307105",
"0.5790756",
"0.57143456",
"0.5695112",
"0.5505792",
"0.5383273",
"0.5341771",
"0.53266317",
"0.5300774",
"0.52804595",
"0.5280316",
"0.5264856",
"0.5246591",
"0.5233106",
"0.52203745",
"0.52138627",
"0.51959896",
"0.5189928",
"0.5181047",
"0.51800966",
"0.5176214",
"0.51741004",
"0.51703894",
"0.5169279",
"0.5167453",
"0.5159219",
"0.5154664",
"0.5147751"
]
| 0.6365627 | 0 |
Retourneert een object van ritrecords met gebruikerIdMinderMobiele = $gebruikerId en vertrekDatum in de week van $datum | function getWhereDatum($gebruikerId, $datum) {
$date = strtotime($datum);
$weekDag = date('w', $date);
if ($weekDag != 1) {
$startdate = strtotime("last monday", $date);
$enddate = strtotime("monday", $date);
} else {
$startdate = strtotime("today", $date);
$enddate = strtotime("next monday", $date);
}
$startdate = date('Y-m-d H:i:s', $startdate);
$enddate = date('Y-m-d H:i:s', $enddate);
$this->db->order_by('vertrekTijdstip');
$this->db->where('gebruikerIdMinderMobiele', $gebruikerId);
$this->db->where('vertrekTijdstip >', $startdate);
$this->db->where('vertrekTijdstip <', $enddate);
$this->db->where('ritIdHeenrit', NULL);
$query = $this->db->get('rit');
$ritten = $query->result();
return $ritten;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatumOuder($gebruikerId) {\n // geef gebruiker-object met opgegeven $id met de geplande ritten\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip <', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"function getAllByDatumWithGebruikerEnAdresWhereGebruikerEnDatum($gebruikerId) {\n $nu = date('Y-m-d H:i:s');\n $this->db->order_by('vertrekTijdstip');\n $this->db->where('gebruikerIdMinderMobiele', $gebruikerId);\n $this->db->where('vertrekTijdstip >', $nu);\n $query = $this->db->get('rit');\n $ritten = $query->result();\n\n foreach ($ritten as $rit) {\n $this->load->model('Gebruiker_model');\n $rit->chauffeur = $this->Gebruiker_model->getGebruiker($rit->gebruikerIdVrijwilliger);\n $this->load->model('Adres_model');\n $rit->vertrekAdres = $this->Adres_model->getAdres($rit->adresIdVertrek);\n $rit->bestemmingAdres = $this->Adres_model->getAdres($rit->adresIdBestemming);\n }\n return $ritten;\n }",
"public function getReeksenInWeek($maandag, $zondag)\n {\n $this->db->select('id');\n $this->db->from('reeks');\n $this->db->where('datum >=', $maandag->format('Y-m-d'));\n $this->db->where('datum <=', $zondag->format('Y-m-d'));\n $query = $this->db->get();\n if ($query->num_rows() == 0) {\n return null;\n } else {\n return $query->result();\n }\n }",
"function getOrder($object) {\n //foreach($answerObject->Orders as $order) {\n //\n // $myOrder = new Bestellung();\n // ....\n // $object->addCollectionEntry($myOrder); \n //}\n \n $bestelldatum = new DateTime(); \n $lieferdatum = new DateTime(); \n $lieferdatum->add(new DateInterval('P4D'));\n\n $myOrder = new Bestellung();\n\n $myOrder->ShopId = 'sampleOrderId_'.rand(1000, 9999);\n $myOrder->Gesammtkosten = 9.37; \n $myOrder->Versandkosten = 4.99; \n $myOrder->VersandDienstleister = 'DHL National';\n $myOrder->Lieferdatum = $lieferdatum->format('Y-m-d H:i:s'); \n $myOrder->Zahlungsart = Zahlungsart::Nachnahme;\n $myOrder->Waehrung = Waehrung::EURO;\n $myOrder->Status = Status::EingegangenUndFreigegeben;\n $myOrder->Rechnungsnummer = 'sampleInvoiceId_'.rand(1000, 9999);\n $myOrder->Kundenbemerkung = 'Please send the products as fast as you can! Thank you, regards, your buyer'; \n $myOrder->Händlerbemerkung = 'We\\'ll send it tomorow! Regards, your merchant'; \n $myOrder->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder->Kunde = new Kunde(); \n\n $myOrder->Kunde->Kundennummer = 'sampleClientId_'.rand(1000, 9999);\n $myOrder->Kunde->Firma = 'Die Testfirma GmbH';\n $myOrder->Kunde->FirmenZusatz = 'wir testen das!'; \n $myOrder->Kunde->Titel = 'Prof. Dr.';\n $myOrder->Kunde->Vorname = 'Testina';\n $myOrder->Kunde->Nachname = 'Testerin';\n $myOrder->Kunde->Geschlecht = Geschlecht::Weiblich;\n $myOrder->Kunde->Zhd = 'Hr. Einkäufer (Buchhaltung)'; \n $myOrder->Kunde->UStId = 'DE 123456789';\n $myOrder->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Kunde->Telefon = '012 / 345 678 - 9';\n $myOrder->Kunde->Fax = '012 / 987 654 - 3';\n $myOrder->Kunde->Geburtstag = '07.07.1977';\n $myOrder->Kunde->Mobil = '0170 123 456';\n \n $myOrder->Kunde->Adresse = new Adresse();\n \n $myOrder->Kunde->Adresse->Straße = 'Am Testgelände';\n $myOrder->Kunde->Adresse->Hausnummer = '12a';\n $myOrder->Kunde->Adresse->Anmerkung = 'Gebäudekomplex \"Anton\"';\n $myOrder->Kunde->Adresse->PLZ = '12345';\n $myOrder->Kunde->Adresse->Ort = 'Testort';\n $myOrder->Kunde->Adresse->Bundesland = 'Nordrhein-Westfalen';\n $myOrder->Kunde->Adresse->Land = Land::DE();\n\n $myOrder->Lieferanschrift = new Anschrift();\n \n $myOrder->Lieferanschrift->Firma = 'Lagerfirma UG';\n $myOrder->Lieferanschrift->FirmenZusatz = 'denn lagern ist Leidenschaft!'; \n $myOrder->Lieferanschrift->Titel = 'Dipl.-Ing.';\n $myOrder->Lieferanschrift->Vorname = 'Ludwig';\n $myOrder->Lieferanschrift->Nachname = 'Lagerist';\n $myOrder->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n $myOrder->Lieferanschrift->Telefon = '098 / 765 432 - 1';\n $myOrder->Lieferanschrift->Fax = '098 / 123 456 - 7';\n $myOrder->Lieferanschrift->Mobil = '0151 654 321';\n \n $myOrder->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder->Lieferanschrift->Adresse->Straße = 'Lagerstraße';\n $myOrder->Lieferanschrift->Adresse->Hausnummer = '211';\n $myOrder->Lieferanschrift->Adresse->Anmerkung = 'Tor 4';\n $myOrder->Lieferanschrift->Adresse->PLZ = '5432';\n $myOrder->Lieferanschrift->Adresse->Ort = 'Lagerstadt';\n $myOrder->Lieferanschrift->Adresse->Bundesland = 'Tirol';\n $myOrder->Lieferanschrift->Adresse->Land = Land::AT();\n \n $myGutschein = new Gutschein();\n \n $myGutschein->GutscheinNummer = 'sampleCouponId_'.rand(1000, 9999); \n $myGutschein->Rabatt = 9.99; \n $myGutschein->Code = 'sampleCouponCode_'.rand(1000, 9999); \n $myGutschein->Bemerkung = 'unicorn 2 is great - coupon!'; \n \n array_push($myOrder->Gutscheine, $myGutschein);\n \n $myArtikel_1 = new Artikel();\n \n $myArtikel_1->ShopId = 'yourArticleIdOnMarketplace_1'; // the returned articleId from function addArticle($article) \n $myArtikel_1->ArtikelNummer = 'productArtNo_1';\n $myArtikel_1->Name = 'sampleProduct_1';\n $myArtikel_1->Hinweis = 'with gift package'; \n $myArtikel_1->Menge = 2; \n $myArtikel_1->Preis = 2.69; // Brutto (with tax included)\n $myArtikel_1->GesammtPreis = 5.38;\n $myArtikel_1->MwSt = Steuer::MwSt7();\n \n array_push($myOrder->Artikel, $myArtikel_1);\n \n $myArtikel_2 = new Artikel();\n \n $myArtikel_2->ShopId = 'yourArticleIdOnMarketplace_2';\n $myArtikel_2->ArtikelNummer = 'productArtNo_2';\n $myArtikel_2->Name = 'sampleProduct_2 with variations Color: blue Size: XXL';\n $myArtikel_2->Menge = 1; \n $myArtikel_2->Preis = 8.99;\n $myArtikel_2->GesammtPreis = 8.99;\n $myArtikel_2->MwSt = Steuer::MwSt19(); \n \n $myVakoArtikel = new VakoArtikel();\n \n $myVakoArtikel->ShopId = 'yourVariationIdOnMarketplace'; // the returned variantId from function addArticle($article) on adding this explicit variation \n $myVakoArtikel->Aktiv = true;\n \n $myVakoEigenschaftName_1 = new EigenschaftBase();\n $myVakoEigenschaftName_1->Name = 'Color';\n $myVakoWertEigenschaft_1 = new WertEigenschaft();\n \n $myVakoWertEigenschaft_1->Name = 'Color';\n $myVakoWertEigenschaft_1->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_1->Wert->Aktiv = true;\n $myVakoWertEigenschaft_1->Wert->Wert = 'blue';\n \n $myVakoEigenschaftName_2 = new EigenschaftBase();\n $myVakoEigenschaftName_2->Name = 'Size'; \n $myVakoWertEigenschaft_2 = new WertEigenschaft();\n\n $myVakoWertEigenschaft_2->Name = 'Size';\n $myVakoWertEigenschaft_2->Wert = new Eigenschaftswert();\n $myVakoWertEigenschaft_2->Wert->Aktiv = true;\n $myVakoWertEigenschaft_2->Wert->Wert = 'XXL';\n \n array_push($myVakoArtikel->Eigenschaften, $myVakoWertEigenschaft_1, $myVakoWertEigenschaft_2);\n \n array_push($myArtikel_2->EigenschaftenNamen, $myVakoEigenschaftName_1, $myVakoEigenschaftName_2);\n \n array_push($myArtikel_2->VakoArtikel, $myVakoArtikel);\n \n array_push($myOrder->Artikel, $myArtikel_2);\n\n $object->addCollectionEntry($myOrder); \n \n $myOrder2 = new Bestellung();\n\n $myOrder2->ShopId = 'sampleOrderId_2_'.rand(1000, 9999);\n $myOrder2->Gesammtkosten = 34.95; \n $myOrder2->Versandkosten = 14.99; \n $myOrder2->VersandDienstleister = 'DPD Kurier';\n $myOrder2->Zahlungsart = Zahlungsart::Vorkasse;\n $myOrder2->Waehrung = Waehrung::EURO;\n $myOrder2->Status = Status::EingegangenUndFreigegeben;\n $myOrder2->Rechnungsnummer = 'sampleInvoiceId_2_'.rand(1000, 9999);\n $myOrder2->Kundenbemerkung = 'Bitte schnellstmöglich versenden, Danke!'; \n $myOrder2->Bestelldatum = $bestelldatum->format('Y-m-d H:i:s'); \n \n $myOrder2->Kunde = new Kunde(); \n\n $myOrder2->Kunde->Kundennummer = 'sampleClientId_2_'.rand(1000, 9999);\n $myOrder2->Kunde->Vorname = 'Arno';\n $myOrder2->Kunde->Nachname = 'Nym';\n $myOrder2->Kunde->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Kunde->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Kunde->Adresse = new Adresse();\n \n $myOrder2->Kunde->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Kunde->Adresse->Hausnummer = '1';\n $myOrder2->Kunde->Adresse->PLZ = '13373';\n $myOrder2->Kunde->Adresse->Ort = 'Geheim';\n $myOrder2->Kunde->Adresse->Land = Land::DE();\n \n $myOrder2->Lieferanschrift = new Anschrift();\n\n $myOrder2->Lieferanschrift->Vorname = 'Arno';\n $myOrder2->Lieferanschrift->Nachname = 'Nym';\n $myOrder2->Lieferanschrift->Geschlecht = Geschlecht::Männlich; \n $myOrder2->Lieferanschrift->Email = '[email protected]_'.rand(1000, 9999);\n \n $myOrder2->Lieferanschrift->Adresse = new Adresse();\n \n $myOrder2->Lieferanschrift->Adresse->Straße = 'Am geheimen Weg';\n $myOrder2->Lieferanschrift->Adresse->Hausnummer = '1';\n $myOrder2->Lieferanschrift->Adresse->PLZ = '13373';\n $myOrder2->Lieferanschrift->Adresse->Ort = 'Geheim';\n $myOrder2->Lieferanschrift->Adresse->Land = Land::DE();\n \n $myArtikel = new Artikel();\n \n $myArtikel->ShopId = 'yourArticleIdOnMarketplace_1_2';\n $myArtikel->ArtikelNummer = 'productArtNo_1_2';\n $myArtikel->Name = 'sampleProduct_1_2'; \n $myArtikel->Menge = 4; \n $myArtikel->Preis = 4.99;\n $myArtikel->GesammtPreis = 19.96;\n $myArtikel->MwSt = Steuer::MwSt10P7();\n \n array_push($myOrder2->Artikel, $myArtikel);\n\n $object->addCollectionEntry($myOrder2); \n}",
"private function stuurmailNaarVorigeBieder(){\n $conn = getConn();\n $sql = \" SELECT G.Emailadres FROM Gebruiker G INNER JOIN Bod B ON G.Gebruikersnaam = B.Gebruikersnaam\n WHERE B.Bodbedrag = (SELECT MAX(B.Bodbedrag) FROM Bod B \n WHERE Bodbedrag < ( SELECT MAX(B.Bodbedrag) FROM Bod b ) AND Voorwerpnummer = ?)\";\n $params=array($this->voorwerpnummer);\n $stmt = sqlsrv_prepare($conn, $sql, $params);\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if ($stmt) {\n while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {\n $emailadres = $row['Emailadres'];\n $this->stuurMail($emailadres);\n }\n\n }\n else{\n die(print_r(sqlsrv_errors(), true));\n }\n\n }",
"function get_month_min($date, $labels) {\n global $DB;\n\n $fechainicio = new DateTime(\"1-\".$date->month.\"-\".$date->year);\n $maxday = cal_days_in_month(CAL_GREGORIAN, $date->month, $date->year);\n $fechafin = new DateTime($maxday.\"-\".$date->month.\"-\".$date->year);\n $fechafin->setTime(23, 59, 59);\n $result = array();\n foreach ($labels as $label) {\n $result[] = 0;\n }\n\n $sql = \"SELECT id, connectedusers, date FROM {report_user_statistics} WHERE date >= ? AND date <= ? ORDER BY date;\";\n $todaslasconexiones = $DB->get_records_sql($sql, [$fechainicio->getTimestamp(), $fechafin->getTimestamp()]);\n $day = 0;\n $temp = array();\n $i = 1;\n foreach ($todaslasconexiones as $conexiones) {\n $fecha = new DateTime(\"@$conexiones->date\");\n if (($fecha->format('m') == $date->month) && ($fecha->format('Y') == $date->year)) {\n if ($day == 0) {\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n } else if ($day == $fecha->format('d')) {\n $temp[] = $conexiones->connectedusers;\n } else if ($day < $fecha->format('d')) {\n foreach ($temp as $tempkey => $tempvalor) {\n if ($tempvalor == 0) {\n unset($temp[$tempkey]);\n }\n }\n $key = array_search($day, $labels);\n $result[$key] = min($temp);\n $temp = array();\n $day = $fecha->format('d');\n $temp[] = $conexiones->connectedusers;\n }\n if (count($todaslasconexiones) == $i) {\n foreach ($temp as $tempkey => $tempvalor) {\n if ($tempvalor == 0) {\n unset($temp[$tempkey]);\n }\n }\n $key = array_search($day, $labels);\n $result[$key] = min($temp);\n } else if (count($temp) > 1) {\n foreach ($temp as $tempkey => $tempvalor) {\n if ($tempvalor == 0) {\n unset($temp[$tempkey]);\n }\n }\n $key = array_search($day, $labels);\n $result[$key] = min($temp);\n }\n $i++;\n }\n }\n return $result;\n}",
"public function getDAOGebruikerBestelling() {\n $lijst = array();\n $dbh = new PDO(DBConfig::$DB_CONNSTRING, DBConfig::$DB_USERNAME, DBConfig::$DB_PASSWORD);\n $sql = \"select GebruikersId, Wachtwoord, Voornaam, Familienaam, Straat, Huisnummer, Stad, Email, Telefoon, Boodschap, Promotie from gebruikerspizzashop WHERE Email = '[email protected]' and Wachtwoord = 'admin'\";\n $resultSet = $dbh->query($sql);\n if ($resultSet) {\n $rij = $resultSet->fetch();\n if ($rij) {\n $gebruiker = new Gebruiker($rij[\"GebruikersId\"], $rij[\"Wachtwoord\"], $rij[\"Voornaam\"], $rij[\"Familienaam\"], $rij[\"Straat\"], $rij[\"Huisnummer\"], $rij[\"Stad\"], $rij[\"Email\"], $rij[\"Telefoon\"], $rij[\"Boodschap\"], $rij[\"Promotie\"]);\n $dbh = null;\n return $gebruiker;\n } else\n return false;\n } else\n return false;\n }",
"public function getnewlastweekreg()\n {\n if(Request::ajax()){\n\n $req = Request::all();\n\n $req = json_encode($req);\n\n $req = json_decode($req);\n\n $user=Auth::user();\n\n $id_cliente = $this->getIdcliente();\n\n if($req->desde and $req->hasta){\n\n $req->desde = (new DateTime($req->desde))->format('Y-m-d');\n\n $req->hasta = (new DateTime($req->hasta))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') between date_format( '\".$req->desde.\"' ,'%m-%d-%Y') and date_format( '\".$req->hasta.\"' ,'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else\n if($req->desde){\n\n $req->desde = (new DateTime($req->desde))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') > date_format( '\".$req->desde.\"' ,'%m-%d-%Y') \n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else\n if($req->hasta){\n\n $req->hasta = (new DateTime($req->hasta))->format('Y-m-d');\n\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') < date_format( '\".$req->hasta.\"' ,'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }else{\n $sql = \"SELECT date_format(`fecha_registro`,'%m-%d-%Y'), count(date_format(`fecha_registro`,'%m-%d-%Y'))\n FROM `primer_registro_email`\n WHERE `id_cliente` = \".$id_cliente.\n \" AND date_format(`fecha_registro`,'%m-%d-%Y') between date_format(now()-interval 7 day,'%m-%d-%Y') and date_format(now(),'%m-%d-%Y')\n GROUP BY date_format(`fecha_registro`,'%m-%d-%Y')\";\n }\n\n \n \n $results = DB::select($sql);\n\n return $results;\n\n\n }\n }",
"public function getBorrowReminderLost() {\n $dataReminder = DB::table('settings')->where('name', 'daylost')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n\n\n $data = Borrow::where('status', '=', '20')->where( 'ngaydaohan', '<=', $fromDate->toDateTimeString())->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $toDate = Carbon::parse($record['ngaydaohan'])->addDays($dataReminder->content);\n $dataAdd['dateLost'] = $toDate->toDateTimeString();\n $userObj = User::where('id', $record->uid)->first();\n\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'] .' - '.$toDate->toDateTimeString(), 'REMINDER_LOST', $dataAdd);\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '30'));\n }\n } else {\n echo 'No data';\n }\n }",
"function getRest(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE \n a.gebruikerId = ? AND v.actief = 1 \n \n \n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"public function listado_reservaciones(){\n $listado = [];\n #Recorro la jornada....\n $resultados = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false))->get(\"reservaciones\");\n\n foreach ($resultados as $clave => $valor) {\n \n //--\n #Verifico que la jornada sea del dia de hoy\n $fecha_hora_inicio = $valor[\"fecha\"]->toDateTime();\n\n $fecha_hora_ini = $fecha_hora_inicio->format('Y-m-d');\n\n $fecha_actual = date('Y-m-d');\n\n //var_dump($fecha_actual);die('');\n //Solo se muestran las rservaciones de hoy...\n if($fecha_hora_ini==$fecha_actual){\n $valores = $valor;\n\n $valores[\"id_reservaciones\"] = (string)$valor[\"_id\"]->{'$id'};\n $valores[\"precio\"] = number_format($valores[\"precio\"],2);\n $valores[\"id_membresia\"] = $valor[\"id_membresia\"];\n $id_membresia = new MongoDB\\BSON\\ObjectId($valores[\"id_membresia\"]);\n #Recorro la membresia....\n $res_membresia = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false,'_id'=>$id_membresia))->get(\"membresia\");\n //-------------------------------------------------------------\n //$valores[\"id_grupo_empresarial\"] = $res_membresia[0][\"id_grupo_empresarial\"];\n $valores[\"n_membresia\"] = $res_membresia[0][\"n_membresia\"];\n\n $valores[\"identificador_prospecto_cliente\"] = $res_membresia[0][\"identificador_prospecto_cliente\"];\n #Consulto datos personales\n $rfc = $res_membresia[0][\"identificador_prospecto_cliente\"];\n $res_dt = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false,\"rfc_datos_personales\"=>$rfc))->get(\"datos_personales\");\n \n $valores[\"nombre_datos_personales_cliente\"] = $res_dt[0][\"nombre_datos_personales\"];\n \n if(isset($res_dt[0][\"apellido_p_datos_personales\"])){\n $valores[\"nombre_datos_personales_cliente\"].=\" \".$res_dt[0][\"apellido_p_datos_personales\"];\n }\n\n if(isset($res_dt[0][\"apellido_m_datos_personales\"])){\n $valores[\"nombre_datos_personales_cliente\"].= \" \".$res_dt[0][\"apellido_m_datos_personales\"];\n }\n\n #consulto la sala \n $id_sala = new MongoDB\\BSON\\ObjectId($valores[\"id_servicio_sala\"]);\n $res_sala = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false,'_id'=>$id_sala))->get(\"servicios\");\n $valores[\"sala\"] = $res_sala[0][\"descripcion\"];\n #Consulto usuario\n $id = new MongoDB\\BSON\\ObjectId($valor[\"auditoria\"][0]->cod_user);\n $res_us = $this->mongo_db->where(array('_id'=>$id))->get('usuario');\n $vector_auditoria = reset($valor[\"auditoria\"]);\n $valores[\"fec_regins\"] = $vector_auditoria->fecha->toDateTime();\n $valores[\"correo_usuario\"] = $res_us[0][\"correo_usuario\"];\n //--\n if($valores[\"hora_ingreso\"]!=\"\"){\n //$fecha_inicio = $valor[\"hora_ingreso\"]->toDateTime();\n $fecha_inicio = new DateTime(date(\"Y-m-d g:i a\",$valor[\"hora_ingreso\"]));\n $valores[\"hora_ingreso\"] = $fecha_inicio;\n \n }else{\n $valores[\"hora_ingreso\"] = \"\";\n }\n //--Hora inicio\n if($valores[\"hora_inicio\"]!=\"\"){\n //$fecha_inicio_h = $valor[\"hora_inicio\"]->toDateTime();\n $fecha_inicio_h = new DateTime(date(\"Y-m-d g:i a\",$valor[\"hora_inicio\"]));\n $valores[\"hora_inicio\"] = $fecha_inicio_h;\n \n }else{\n $valores[\"hora_inicio\"] = \"\";\n }\n //--Hora fin \n if($valores[\"hora_fin\"]!=\"\"){\n //$fecha_fin_h = $valor[\"hora_fin\"]->toDateTime();\n $fecha_fin_h = new DateTime(date(\"Y-m-d g:i a\" ,$valor[\"hora_fin\"]));\n $valores[\"hora_fin\"] = $fecha_fin_h;\n }else{\n $valores[\"hora_fin\"] = \"\";\n }\n //--\n if($valor[\"hora_salida\"]!='Sin salir'){\n //$fecha_fin = $valor[\"hora_salida\"]->toDateTime();\n $fecha_fin = new DateTime(date(\"Y-m-d g:i a\",$valor[\"hora_salida\"]));\n $valores[\"hora_salida\"] = $fecha_fin;\n }else{\n $valores[\"hora_salida\"] = \"Sin salir\";\n }\n $valores[\"hora_liberada\"] = $valores[\"hora_salida\"];\n $fecha_reservacion = $valor[\"fecha\"]->toDateTime();\n $valores[\"fecha_reservacion\"] = $fecha_reservacion;\n //------------------------------------------------------------\n //$fecha1 = new DateTime($fecha_fin);//fecha inicial\n //$fecha2 = new DateTime($fecha_inicio);//fecha de cierre\n #Calculo de horas contratadas \n $intervalo =$fecha_fin_h->diff($fecha_inicio_h);\n \n if(isset($intervalo)){\n $valores[\"horas_contratadas\"] = $intervalo->format('%H:%i:%s');\n }else{\n $valores[\"horas_contratadas\"] = \"\";\n }\n /*-----------------------------------------------------------------------------*/\n #Calculo de horas consumidas\n if($valores[\"condicion\"]==\"REGISTRADA\"){\n #Si la condicion es registrada: se resta la hora actual a la hora de ingreso\n if($valores[\"hora_ingreso\"]!=\"\"){\n $hoy = new DateTime(\"now\");\n $intervalo2 =$fecha_inicio->diff($hoy);\n $intervaloConsmuidas = $intervalo2;\n if(isset($intervalo2)){\n $valores[\"horas_consumidas\"] = $intervalo2->format('%H:%i:%s');\n }else{\n $valores[\"horas_consumidas\"] = \"\";\n }\n #LAs horas consumidas 2 es la direfencia desde la hora de inicio hasta la hora actual....\n //--Calculo la hora consumida con relacion a la hora de inicio\n $intervalo9 =$fecha_inicio_h->diff($hoy);\n $intervaloConsmuidas2 = $intervalo9;\n if(isset($intervalo9)){\n $valores[\"horas_consumidas2\"] = $intervalo9->format('%H:%i:%s');\n }else{\n $valores[\"horas_consumidas2\"] = \"\";\n }\n //----------\n }else{\n $valores[\"horas_consumidas\"] = \"\";\n $valores[\"horas_consumidas2\"] = \"\";\n } \n } if($valores[\"condicion\"]==\"LIBERADA\"){\n #Si la condicione s liberada: se resta la hora salida a la de ingreso\n $intervalo3 =$fecha_fin->diff($fecha_inicio);\n $intervaloConsmuidas = $intervalo3;\n\n if(isset($intervalo3)){\n $valores[\"horas_consumidas\"] = $intervalo3->format('%H:%i:%s');\n }else{\n $valores[\"horas_consumidas\"] = \"\";\n }\n #LAs horas consumidas 2 es la direfencia desde la hora de inicio hasta la hora actual....\n //--Calculo la hora consumida con relacion a la hora de inicio\n $intervalo10 =$fecha_fin->diff($fecha_inicio_h);\n $intervaloConsmuidas2 = $intervalo10;\n if(isset($intervalo10)){\n $valores[\"horas_consumidas2\"] = $intervalo10->format('%H:%i:%s');\n }else{\n $valores[\"horas_consumidas2\"] = \"\";\n }\n }else if(($valores[\"condicion\"]==\"RESERVADA\")||($valores[\"condicion\"]==\"CANCELADA\")){\n $valores[\"horas_consumidas\"] = \"\";\n $valores[\"horas_consumidas2\"] = \"\";\n }\n //------------------------------------------------------------\n #Horas por consumir\n if(($valores[\"horas_contratadas\"]!=\"\")&&($valores[\"horas_consumidas2\"]!=\"\")){\n //var_dump($intervalo<$intervaloConsmuidas);die('');\n\n $horas_uno = new DateTime($valores[\"horas_contratadas\"]);\n $horas_dos = new DateTime($valores[\"horas_consumidas2\"]);\n #Verifico si se excede\n if($horas_dos>$horas_uno){\n $valores[\"horas_disponibles\"] = \"\";\n }else{\n //----------------------------------------------------------------\n $intervaloDisponibles = $horas_uno->diff($horas_dos);\n $valores[\"horas_disponibles\"] = $intervaloDisponibles->format('%H:%i:%s'); \n /*if($valores[\"horas_disponibles\"]>$valores[\"horas_contratadas\"]){\n $valores[\"horas_disponibles\"] = \"\";\n }*/\n //---------------------------------------------------------------\n }\n \n }else{\n $valores[\"horas_disponibles\"] = \"\";\n }\n //------------------------------------------------------------\n ///xxx\n\n //-------------------------------------------------------------\n # \n $listado[] = $valores;\n }\n //--\n\n }\n return $listado;\n }",
"public function getBorrowReminder() {\n $dataReminder = DB::table('settings')->where('name', 'dayredm')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n $toDate = Carbon::now()->addDays($dataReminder->content);\n\n $data = Borrow::where('status', '<', '20')->whereBetween( 'ngaydaohan', array($fromDate->toDateTimeString(), $toDate->toDateTimeString()) )->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $userObj = User::where('id', $record->uid)->first();\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'], 'REMINDER_1');\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '20'));\n }\n } else {\n echo 'No data';\n }\n }",
"public function get_reservation_per_teacher($res_teach_code=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $res_room_code=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $tm_row=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $res_todate)\n\t\t{\n \t\t\t$where = \" and DATE_FORMAT(res_time_start,'%Y-%m-%d') = '\". date(\"Y-m-d\").\"'\";\n\t\t if(!empty($res_todate))\n\t\t\t $where = \" and DATE_FORMAT(res_time_start,'%Y-%m-%d') = '\".date('Y-m-d',strtotime($res_todate)).\"'\";\n\t\t \n\t\t\t\n\t \n \t\t\t$reservs = $this->db->query(\"select Distinct res_teach_code, res_admin_note from \n\t\t\t\t\t\t\t\t\t\t reservations \n \t\t\t where res_teach_code = \".$res_teach_code.\"\n\t\t\t\t\t\t\t and res_room_code = \".$res_room_code.\"\n\t\t\t\t\t\t\t and DATE_FORMAT(res_time_start, '%H:%i') <= '\".$tm_row.\"'\n\t\t\t\t\t\t\t and DATE_FORMAT(res_time_end, '%H:%i') >= '\".$tm_row.\"' \".\n\t\t\t\t\t\t $where .\n \t\t\t\t\t\t\t \" order by res_code desc \")->result();\n \t\t\t //\t \n\t \n\t\t\treturn $reservs;\n\t\t}",
"function thismonth(){\n\n $where = \"MONTH( reservation_startdate ) = MONTH( NOW() )\";\n\n $reservation = where( 'reservations', $where );\n\n echo json_encode( $reservation );\n exit;\n}",
"public function actionVencimiento_codmon_remito()\n {\n\n $codmon = $_POST['codmon'];\n $deposito = $_POST['deposito'];\n $remito = $_POST['remito'];\n\n $query = Consumo_medicamentos_granel_renglones::find()->where(['PF_CODMON' => $codmon,\n 'PF_DEPOSITO' => $deposito,\n 'PF_NROREM' => $remito]);\n\n $vencimiento = $query->one(); \n\n \n\n if ($vencimiento){\n $fecha_vto= Yii::$app->formatter->asDate($vencimiento->PF_FECVTO,'php:d-m-Y');\n $vencimiento_result['fecha'] = $fecha_vto;\n \n }\n else{\n $fecha_vto='';\n $vencimiento_result['fecha'] = '';\n }\n\n \n\n return \\yii\\helpers\\Json::encode($vencimiento_result);\n \n }",
"public function show($id){\n $boekenkastMedailles = array();\n // Loop door alle 8 Medaille Slots\n for($i = 1; $i <= 8; $i++){\n $medaille_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('medaille_id_slot' . $i);\n // Als er een Medaille in een Slot staat; voeg deze toe\n if(!is_null($medaille_id)){\n $boekenkastMedailles[] = \\App\\Models\\Medaille::find($medaille_id);\n }\n else{\n // Als er geen medaille in het slot moet komen; voeg default empty slot medaille toe\n $boekenkastMedailles[] = \\App\\Models\\Medaille::where('naam', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Items op uit de boekenkast en stop ze in een array om mee te geven\n $boekenkastItems = array();\n for($i = 1; $i <= 6; $i++){\n $item_id = \\App\\Models\\Boekenkast::where('user_id', '=', $id)->value('item_id_slot' . $i);\n // Als er een item in een slot staat; voeg deze toe\n if(!is_null($item_id)){\n $boekenkastItems[] = \\App\\Models\\Item::find($item_id);\n }\n else{\n // Als er geen Item in het slot moet komen; voeg default empty slot Item toe\n $boekenkastItems[] = \\App\\Models\\Item::where('soort', '=', 'Placeholder')->first();\n }\n }\n\n // Haal alle Medailles op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeMedailles = array();\n // Haal alle 'behaalde medailles' op\n $behaaldeMedaillesId = \\App\\Models\\BehaaldMedaille::where('user_id', '=', $id)->get();\n // Voor elk 'behaald medaille'; pak daarvan de 'medaille' en voeg deze toe aan de array\n foreach($behaaldeMedaillesId as $behaaldeMedailleId){\n $behaaldeMedailles[] = $behaaldeMedailleId->Medaille;\n }\n\n // Haal alle Items op die behaald zijn door de gebruiker en stop ze in een array om mee te geven\n $behaaldeItems = array();\n // Haal alle 'behaalde items' op\n $behaaldeItemsId = \\App\\Models\\BehaaldItem::where('user_id', '=', $id)->get();\n // Voor elk 'behaald item'; pak daarvan de 'item' en voeg deze toe aan de array\n foreach($behaaldeItemsId as $behaaldeItemId){\n if($behaaldeItemId->Item->soort === \"Kastdecoratie\"){\n $behaaldeItems[] = $behaaldeItemId->Item;\n }\n \n }\n\n return ['boekenkast' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first(),\n 'eigenaar' => \\App\\Models\\Boekenkast::where('user_id', '=', $id)->first()->Eigenaar,\n 'boekenkast_medailles' => $boekenkastMedailles,\n 'boekenkast_items' => $boekenkastItems,\n 'behaalde_medailles' => $behaaldeMedailles,\n 'behaalde_items' => $behaaldeItems];\n }",
"function getRendimientoPonderado() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\tglobal $usr;\n\n\t\t//DATO PARA LA CONSULTA SQL, LISTA LAS HORAS DEL DÍA\n\t\t//SI ES 0 TRAE LAS 24 HORAS\n\t\t$ponderacion = $usr->getPonderacion();\n\n\t\tif ($ponderacion == null) {\n\t\t\t$ponderacion_id = 0;\n\t\t}\n\t\telse {\n\t\t\t$ponderacion_id = $ponderacion->ponderacion_id;\n\t\t}\n\n\t\t$sql = \"SELECT * FROM reporte.rendimiento_resumen_global_ponderado(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->objetivo_id).\", \".\n\t\t\t\tpg_escape_string($ponderacion_id).\",' \".\n\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\n\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\tif($row = $res->fetchRow()){\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->preserveWhiteSpace = FALSE;\n\t\t\t$dom->loadXML($row['rendimiento_resumen_global_ponderado']);\n\t\t\t$xpath = new DOMXpath($dom);\n\t\t\tunset($row[\"rendimiento_resumen_global_ponderado\"]);\n\t\t}\n\n\t\t$conf_objetivo= $xpath->query(\"/atentus/resultados/propiedades/objetivos/objetivo\")->item(0);\n\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\t\t$conf_ponderaciones = $xpath->query(\"/atentus/resultados/propiedades/ponderaciones/item\");\n\n\t\t//SE MUESTRA TEMPLATE SIN DATOS\n\t\tif ($xpath->query(\"//detalles/detalle/detalles/detalle\")->length == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t//TEMPLATE DEL REPORTE\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'rendimiento_ponderado.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_ITEMS', 'lista_items');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_EVENTOS_TITULOS', 'bloque_eventos_titulos');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_EVENTOS_TOTAL', 'bloque_eventos_total');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_PASOS', 'lista_pasos');\n\n\n\t\t$T->setVar('__paso_id_default', $conf_pasos->item(0)->getAttribute('paso_orden'));\n\t\t//$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\t\t$orden = 1;\n\t\tforeach ($conf_pasos as $conf_paso) {\n\t\t\t$T->setVar('__paso_id', $conf_paso->getAttribute('paso_orden'));\n\t\t\t$T->setVar('__paso_nombre', $conf_paso->getAttribute('nombre'));\n\t\t\t$T->setVar('__paso_orden', $orden);\n\n\t\t\t$total_min_ponderado = 0;\n\t\t\t$total_max_ponderado = 0;\n\t\t\t$total_prom_ponderado = 0;\n\n\t\t\t$T->setVar('lista_items', '');\n\t\t\tforeach ($conf_ponderaciones as $conf_ponderacion) {\n\t\t\t\tif ($conf_ponderacion->getAttribute('valor') == 0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$tag_dato = $xpath->query(\"//detalles/detalle/detalles/detalle[@item_id=\".$conf_ponderacion->getAttribute(\"item_id\").\"]/detalles/detalle[@paso_orden=\".$conf_paso->getAttribute(\"paso_orden\").\"]/datos/dato\")->item(0);\n\n\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\t\t\t\t$T->setVar('__item_inicio', $conf_ponderacion->getAttribute('inicio'));\n\t\t\t\t$T->setVar('__item_termino', $conf_ponderacion->getAttribute('termino'));\n\n\t\t\t\t$T->setVar('__paso_minimo', ($tag_dato == null)?'S/I':number_format($tag_dato->getAttribute('tiempo_min'), 2, ',', ''));\n\t\t\t\t$T->setVar('__paso_maximo', ($tag_dato == null)?'S/I':number_format($tag_dato->getAttribute('tiempo_max'), 2, ',', ''));\n\t\t\t\t$T->setVar('__paso_promedio', ($tag_dato == null)?'S/I':number_format($tag_dato->getAttribute('tiempo_prom'), 2, ',', ''));\n\n\t\t\t\tif ($tag_dato == null) {\n\t\t\t\t\t$tiempo_minimo = 0;\n\t\t\t\t\t$tiempo_maximo = 0;\n\t\t\t\t\t$tiempo_promedio = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$tiempo_minimo = $tag_dato->getAttribute('tiempo_min');\n\t\t\t\t\t$tiempo_maximo = $tag_dato->getAttribute('tiempo_max');\n\t\t\t\t\t$tiempo_promedio = $tag_dato->getAttribute('tiempo_prom');\n\t\t\t\t}\n\n\t\t\t\t//SE CALCULA EL PONDERADO\n\t\t\t\t$total_min_ponderado = (($conf_ponderacion->getAttribute('valor')/100) * $tiempo_minimo) + $total_min_ponderado;\n\t\t\t\t$total_max_ponderado = (($conf_ponderacion->getAttribute('valor')/100) * $tiempo_maximo) + $total_max_ponderado;\n\t\t\t\t$total_prom_ponderado = (($conf_ponderacion->getAttribute('valor')/100) * $tiempo_promedio) + $total_prom_ponderado;\n\n\t\t\t\t//SE ASIGNA VALOR DE LA PONDERACIÓN\n \t\t\t$T->setVar('__item_valor', number_format($conf_ponderacion->getAttribute('valor'), 2, '.', ''));\n\n\t\t\t\t$T->parse('lista_items', 'LISTA_ITEMS', true);\n\t\t\t\t$linea++;\n\t\t\t}\n\n\t\t\t$T->setVar('__min_total', number_format($total_min_ponderado, 2, ',', ''));\n\t\t\t$T->setVar('__max_total', number_format($total_max_ponderado, 2, ',', ''));\n\t\t\t$T->setVar('__prom_total', number_format($total_prom_ponderado, 2, ',', ''));\n\n\t\t\t$T->parse('lista_pasos', 'LISTA_PASOS', true);\n\t\t\t$orden++;\n\t\t}\n\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\t$this->resultado =$T->parse('out', 'tpl_tabla');\n\t}",
"public function get_row($kuesioner_id=0)\r\n\t{\r\n\t\t$query = \"SELECT k.*,\r\n\t\t\ts.survey_type_name AS type_name,\r\n\t\t\tk.contract_min_years AS c_min_y,\r\n\t\t\tk.contract_min_months AS c_min_m,\r\n\t\t\tk.contract_min_days AS c_min_d,\r\n\t\t\tk.contract_max_years AS c_max_y,\r\n\t\t\tk.contract_max_months AS c_max_m,\r\n\t\t\tk.contract_max_days AS c_max_d,\r\n\t\t\tk.permanent_active as p_active,\r\n\t\t\tk.permanent_min_years AS p_min_y,\r\n\t\t\tk.permanent_min_months AS p_min_m,\r\n\t\t\tk.permanent_min_days AS p_min_d,\r\n\t\t\tk.permanent_max_years AS p_max_y,\r\n\t\t\tk.permanent_max_months AS p_max_m,\r\n\t\t\tk.permanent_max_days AS p_max_d,\r\n\t\t\tk.position_min_years AS post_min_y,\r\n\t\t\tk.position_min_months AS post_min_m,\r\n\t\t\tk.position_min_days AS post_min_d,\r\n\t\t\tk.position_max_years AS post_max_y,\r\n\t\t\tk.position_max_months AS post_max_m,\r\n\t\t\tk.position_max_days AS post_max_d\r\n\t\t\tFROM GES_M_kuesioner k,GES_M_survey_type s WHERE k.survey_type_id = s.survey_type_id AND k.kuesioner_id = $kuesioner_id\";\r\n\t\treturn $this->survey->query($query)->row();\r\n\t}",
"public function get_verjaardagen($limit = 3){\n $query = $this->db->query(\n \" SELECT id,naam, DATE_FORMAT(geboortedatum, '%d-%m-%Y') as geboortedatum, DATE_FORMAT(geboortedatum, '%Y') as geboortejaar\n FROM gebruikers \n WHERE DATE_FORMAT(geboortedatum, '%m%d') >= DATE_FORMAT(now(), '%m%d')\n ORDER BY DATE_FORMAT(geboortedatum, '%m%d') ASC\n LIMIT $limit\n \");\n $result = $query->result();\n return $result;\n }",
"public function get_month_data($month = \"January\", $year = 2015){\n\t\t/* if($year==2015)\n\t\t$year = date('y'); */\n\t\t// echo date( 'F Y');\n\t\t$this->loadModel(\"Invoice.Invoice\");\n\t\t$this->loadModel(\"Transaction.Transaction\");\n\t\t$month_first_day = strtotime( 'first day of ' . $month.' '.$year);\n\t\t$month_last_day = strtotime( 'last day of ' . $month.' '.$year);\n\t\t// echo date('Y-m-d',$month_last_day);\n\t\t// $dt = new DateTime('first Monday of this month');\n\t\t$dt = new DateTime('first Monday of '.$month.' '.$year);\n\t\t// echo $dt->format('Y-m-d');\n\t\t$first_week_start = $dt->getTimestamp(); \n\t\t$week_last = $first_week_start;\n\t\t$this->Invoice->belongsTo = array('Client' => array('className'=>\"Usermgmt.Client\",'foreignKey'=>'client_id'));\n\t\t$this->Transaction->belongsTo = array('Invoice' => array('className'=>\"Invoice.Invoice\",'foreignKey'=>'invoice_id'));\n\t\t$this->Transaction->recursive = 2;\n\t\t$this->Transaction->Behaviors->load('Containable');\n\t\t\n\t\t$all_transactoins = array();\n\t\tfor($current =$month_first_day; ($week_last<$month_last_day && $week_last<time()); $week_last += (7*86400)){\n\t\t\t\n\t\t\t\t$transactions = $this->Transaction->find(\"all\",array(\"conditions\"=>array(\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) >\"=>$current,\"UNIX_TIMESTAMP(STR_TO_DATE(Transaction.payment_date, '%m-%d-%Y')) <\"=>$week_last,'Transaction.status'=>1),'contain'=>array(\"Invoice\"=>array(\"fields\"=>array(\"title\",\"client_id\",\"payment\",\"tax\",\"total\")),\"Invoice.Client\"=>array(\"fields\"=>array(\"first_name\",\"last_name\"))),\"fields\"=>array(\"invoice_id\",\"payment_date\",\"method\")));\n\t\t\t\t\n\t\t\t\t$all_transactoins[date('m/d/Y',$current).'-'.date('m/d/Y',$week_last)] = $transactions;\n\t\t\t\t\n\t\t\t\t// pr($transactions); die;\n\t\t\t\n\t\t\t$current =$week_last;\n\t\t}\n\t\treturn $all_transactoins;\n\t\t\n\t}",
"public function getKomendeMaaltijdenVoorLid(Profiel $profiel)\n\t{\n\t\t$maaltijden = $this->maaltijdenRepository->getMaaltijdenTussen(\n\t\t\tdate_create('-1 day'),\n\t\t\tdate_create(\n\t\t\t\tInstellingUtil::instelling('maaltijden', 'toon_ketzer_vooraf')\n\t\t\t)\n\t\t);\n\n\t\t$maaltijden = $this->filterMaaltijdenVoorLid($maaltijden, $profiel, true);\n\t\treturn $maaltijden;\n\t}",
"public function szukajMieszkanieAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->_request->getParam('id');\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t\t\n\t\t\t$this->view->numer = $numer = $this->_request->getParam('numer');\n\t\t\t$this->view->areaFrom = $areaFrom = $this->_request->getParam('metraz_min');\n\t\t\t$this->view->areaTo = $areaTo = $this->getRequest()->getParam('metraz_max');\n\t\t\t$this->view->status = $status = $this->_request->getParam('status');\n\t\t\t$this->view->rooms = $rooms = $this->_request->getParam('pokoje');\n\t\t\t$this->view->floor = $floor = $this->_request->getParam('pietro');\n\n\t\t\t$select_pomieszczenia = $db->select()\n\t\t\t->from('inwestycje_powierzchnia')\n\t\t\t->where('id_inwest = ?', $id)\n\t\t\t->order('sort ASC');\n\t\t\t\n\t\t\tif($numer) {$select_pomieszczenia->where('numer LIKE ?', '%'.$numer.'%');}\n\t\t\tif($status) {$select_pomieszczenia->where('status =?', $status);}\n\t\t\tif($rooms) {$select_pomieszczenia->where('pokoje =?', $rooms);}\n\t\t\tif($floor || $floor == '0') {$select_pomieszczenia->where('numer_pietro =?', $floor);}\n\t\t\tif($areaFrom) {$select_pomieszczenia->where('szukaj_metry >=?', $areaFrom);}\n\t\t\tif($areaTo) {$select_pomieszczenia->where('szukaj_metry <=?', $areaTo);}\n\t\t\t\n\t\t\t$this->view->lista = $result = $db->fetchAll($select_pomieszczenia);\n\t\t}",
"public function saveUrsprung($monat,$jahr){\n $this->db->query(\"delete from dzeitsoll2 where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\");\n $sql_select = \"select * from dzeitsoll where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\";\n $result = $this->db->query($sql_select);\n $vlozeno =0;\n $user = \"PHP_\".$_SERVER[\"REMOTE_ADDR\"];//.\"/\".$_SESSION[\"user\"];\n while($row = $result->fetch()){\n $sql_insert = \"insert into dzeitsoll2 (persnr,datum,oe,stunden,user) values('\".$row['persnr'].\"','\".$row['datum'].\"','\".$row['oe'].\"','\".$row['stunden'].\"','\".$user.\"')\";\n $this->db->query($sql_insert);\n $vlozeno++;\n }\n\n return $vlozeno;\n }",
"function query_richieste($fornitore){\n\t$query = \"SELECT *, R.id, U.num_valutazioni, TIMESTAMPDIFF(MINUTE, NOW(), data_ora + INTERVAL minuti_risposta MINUTE) as minuti_rimanenti,\n\t U.indirizzo, U.email, U.num_valutazioni, U.dati_contatto\n\t FROM Richieste as R LEFT JOIN Users as U ON R.id_utente = U.id\n\t WHERE R.id_fornitore = \".$fornitore.\" AND\n\t esito = 'sospesa' AND\n\t TIMESTAMPDIFF(MINUTE, NOW(), data_ora + INTERVAL minuti_risposta MINUTE) >= 0\";\n\n\t$result = mysql_query($query) or die(mysql_error());\n\n\t$a = array();\n\n\tif($result){\n\n while($row = mysql_fetch_assoc($result)) {\n $a[] = $row;\n }\n $risultati = array('risultati' => $a);\n\t} else {\n\t $a = array('error' => 'dead');\n\t}\n\n\treturn $a;\n\n}",
"function getAllRitten($gebruikerId) {\n $this->db->where('gebruikerIdVrijwilliger', $gebruikerId);\n $query = $this->db->get('rit');\n return $query->result();\n }",
"function getallMounth()\n {\n $id_user = Auth::user()->id;\n\n // Faccio una query al db per prendere tutti i ristoranti con l'id user dell'utente loggato\n $restaurants_list = Restaurant::select()->where('user_id', $id_user)->get();\n\n // Faccio una query al db per prendere tutti gli ordini dei ristoranti dell'utente loggato dove i pagamenti sono andati a buon fine in ordine di delivery time\n $orders_list = Order::orderBy('delivery_time')->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get();\n\n $delivery_time = Order::select('delivery_time')->orderBy('delivery_time')->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get();\n\n // Creo un array di appoggio per salvarmi tutti i delivery time\n $array_date = [];\n\n // Ciclo la collection di delivery time per estrapolarmi tutte le date e pusharle in array_date\n foreach ($delivery_time as $date) {\n array_push($array_date, $date->delivery_time);\n }\n\n // Creo un array vuoto per i mesi\n $array_mounth =[];\n\n // Se l'array delle date non è vuoto\n if (!empty($array_date)) {\n // Ciclo l'array delle date e ad ogni ciclo formatto il mese sia in modo numerico sia in caratteri\n foreach ($array_date as $unfomatted_date) {\n // Salvo la data che sto ciclando in una variabile\n $date = new \\DateTime($unfomatted_date);\n // Salvo il mese nel formato numero\n $mounth_number = $date->format('m');\n // Sakvo il mese in formato caratteri\n $mounth_name = $date->format('M');\n // Faccio push nell'array dei mesi come chiave il numero del mese e come valore il nome del mese\n $array_mounth[$mounth_number] = $mounth_name;\n }\n }\n\n // Faccio return dell'array con tutti i mesi (chiave-valore)\n return $array_mounth;\n }",
"private function getWWMListingData(){\n\t\t\n\t\t// configure show dates\n\t\t$startDate = Date('Ymd');\n\t\t$endDate = Date('Ymd', strtotime('+4 months'));\n\t\t\n\t\t// gather movie data\n\t\t$movie_data = $this->get_data('http://webservice.cinema-source.com/3.8/?apikey=YOUAPIKEY&query=theater&schedule=yes&house_id=34510&sd=yes&showdate='.$startDate.'&enddate='.$endDate);\n\n\t\treturn $movie_data;\t\t\t\t\t\n\t}",
"function getByAlarmData(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE\n a.gebruikerId = ?\n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"public function getobjcontrat($idcontrat){\n $uncontrat = R::load('contrat', $idcontrat); //équivalent à \"select * from contrat where idcontrat ='$idcontrat'\"\n $idclient = $uncontrat->idclient; //recupère l'id du client dans une variable\n $client = R::load('client', $idclient); // select * from client en fonction de l'idclient récupérer précedemment \n $idcontact = $client->idcontact; \n $contact = r::load('contact', $idcontact);\n $uncontact = new contact ($contact->email1, $contact->email2, $contact->email3, $contact->bureau, $contact->fax, $contact->tel3);\n $unclient = new client($client->raisonsocial, $uncontact, $client->siret, $client->adr, $client->ville, $client->codepostal);\n $idconsultant = $uncontrat->idutilisateur;\n $consultant = r::getAll('select * from utilisateur join consultant on utilisateur.id=consultant.idutilisateur where idutilisateur='.$idconsultant.'');\n for ($i=0; $i<count($consultant);$i++){\n $unconsultant = new consultant ($consultant[$i]['nom'], $consultant[$i]['prenom'], $consultant[$i]['adresse'], $consultant[$i]['ville'], $consultant[$i]['cp'], $consultant[$i]['tel'], $consultant[$i]['email'], $consultant[$i]['typecontrat'], $consultant[$i]['salaire'], $consultant[$i]['tarif']);\n }\n $contrat = new contrat($uncontrat->id, $unclient, $unconsultant, $uncontrat->datedebut,$uncontrat->datefin, $uncontrat->mission, $uncontrat->salaire, $uncontrat->tarif, $uncontrat->typecontrat);\n //var_dump($contrat);\n return $contrat;\n }",
"public function getBijbelroosterTussen($van, $tot) {\n\t\treturn $this->find('dag >= ? AND dag <= ?', array(date('Y-m-d', $van), date('Y-m-d', $tot)));\n\t}"
]
| [
"0.58938396",
"0.5671136",
"0.54941076",
"0.54868317",
"0.5335375",
"0.5138461",
"0.51342714",
"0.51205015",
"0.5098303",
"0.50381833",
"0.50342184",
"0.5004879",
"0.4973604",
"0.49680707",
"0.4962915",
"0.49557388",
"0.49355805",
"0.49290976",
"0.49245292",
"0.49144843",
"0.49091077",
"0.490694",
"0.49064672",
"0.49014822",
"0.48965088",
"0.48902318",
"0.4844954",
"0.48434103",
"0.48397204",
"0.4823535"
]
| 0.5830091 | 1 |
Filter TGMPA action links. | function bimber_tgmpa_filter_action_links( $action_links, $item_slug, $item, $view_context ) {
$source = ! empty( $item['source'] ) ? $item['source'] : '';
// Prevent installing theme's premium plugins.
if ( 'Pre-Packaged' === $source && ! bimber_is_theme_registered() ) {
$action_links = array(
'bimber_registration_required' => sprintf( __( '<a style="color: #ff0000;" href="%s">Register theme to unblock it</a>', 'bimber' ), esc_url( admin_url( 'themes.php?page=theme-options&group=registration' ) ) ),
);
}
return $action_links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wp_init_targeted_link_rel_filters()\n {\n }",
"function wp_remove_targeted_link_rel_filters()\n {\n }",
"private function get_filters_links() {\n $links = $this->get_fiters_links();\n $links['orderlink'] = $this->get_link_order();\n\n return $links;\n }",
"public function filter() {\n\t\t$args = func_get_args();\n\t\t$out = new CMS_Navigation3_LinkSet();\n\t\tforeach($this->links as $link) {\n\t\t\t$valid = true;\n\t\t\tforeach($args as $arg) {\n\t\t\t\tif (is_string($arg)&&$arg[0]=='!') {\n\t\t\t\t\t$arg = substr($arg,1);\n\t\t\t\t\tif ($link[$arg]) $valid = false;\n\t\t\t\t}\n\t\t\t\telse if (!$link[$arg]) $valid = false;\n\t\t\t}\t\n\t\t\tif ($valid) $out->links[] = $link;\n\t\t}\n\t\treturn $out;\n\t}",
"public function filter_plugin_actions($links)\n\t\t{\n\t\t\t$settings_link = '<a href=\"' . menu_page_url('mailgun', false) . '\">' . __('Settings', 'mailgun') . '</a>';\n\t\t\tarray_unshift($links, $settings_link);\n\n\t\t\treturn $links;\n\t\t}",
"public function _map_main_filters()\n\t{\n\t\techo '</div><h3>'.Kohana::lang('actionable.actionable').'</h3><ul>';\n\t\tforeach ($this->media_values as $k => $val) {\n\t\t\techo \"<li><a id=\\\"media_$k\\\" href=\\\"#\\\"><span>$val</span></a></li>\";\n\t\t}\n\t\techo '</ul><div>';\n\t}",
"function dacig_filter_plugin_actions( $links, $file ) {\n\t/* Load translations */\n\tdacig_load_textdomain();\n\n\tstatic $this_plugin;\n\n\tif ( ! $this_plugin )\n\t\t$this_plugin = plugin_basename( __FILE__ );\n\n\tif ( $file == $this_plugin ) {\n\t\t$donate_link = '<a href=\"http://blog.milandinic.com/donate/\">' . __( 'Donate', 'descriptions-as-captions-in-galleries' ) . '</a>';\n\t\t$wpdev_link = '<a href=\"http://blog.milandinic.com/wordpress/custom-development/\">' . __( 'WordPress Developer', 'descriptions-as-captions-in-galleries' ) . '</a>';\n\n\t\t$links = array_merge( array( $donate_link, $wpdev_link ), $links ); // Before other links\n\t}\n\n\treturn $links;\n}",
"function filter_plugin_actions($links, $file) {\n //If your plugin is under a different top-level menu than Settiongs (IE - you changed the function above to something other than add_options_page)\n //Then you're going to want to change options-general.php below to the name of your top-level page\n $settings_link = '<a href=\"options-general.php?page=' . basename(__FILE__) . '\">' . __('Settings') . '</a>';\n array_unshift( $links, $settings_link ); // before other links\n\n return $links;\n }",
"function actions_filters()\n\t\t{\n\t\t\tif(is_admin()){\n\t\t\t\tadd_action('admin_menu', array(&$this,'admin_menu_link'));\n\t\t\t\tadd_action('admin_head', array(&$this, 'admin_head'));\n\t\t\t}\n\t\t\telse\n\t\t\t\tadd_action('wp_head', array(&$this,'wp_head'));\n\t\t}",
"public function FilterLinks(): ArrayList\n {\n return $this->getUserPreferencesClass()->getLinksPerType('FILTER');\n }",
"function filter_plugin_actions( $links ) {\n\t\t$settings_link = '<a href=\"plugins.php?page=github-updater\">' . __( 'Setup', 'github_plugin_updater' ) . '</a>';\n\t\tarray_unshift( $links, $settings_link );\n\t\treturn $links;\n\t}",
"function doFilterRelUrl($sContent) {\n $aFilterSettings = getOutputFilterSettings();\n $key = preg_replace('=^.*?filter([^\\.\\/\\\\\\\\]+)(\\.[^\\.]+)?$=is', '\\1', __FILE__);\n if ($aFilterSettings[$key]) {\n $sAppUrl = rtrim(str_replace('\\\\', '/', WB_URL), '/').'/';\n $sAppPath = rtrim(str_replace('\\\\', '/', WB_PATH), '/').'/';\n $sAppRel = preg_replace('/^https?:\\/\\/[^\\/]*(.*)$/is', '$1', $sAppUrl);\n $sDocRoot = preg_replace('/^(.*?)'.preg_quote($sAppRel, '/').'$/', '$1', $sAppUrl);\n $sContent = preg_replace_callback(\n '/((?:href|src|action)\\s*=\\s*\")([^\\?\\\"]+?)/isU',\n function ($aMatches) use ($sAppUrl, $sAppPath, $sAppRel) {\n $aMatches[2] = str_replace('\\\\', '/', $aMatches[2]);\n if ($aMatches[2][0] ='/') { $aMatches[2] = rtrim($sAppUrl, '/').$aMatches[2]; }\n $aMatches[2] = preg_replace('/^'.preg_quote($sAppUrl, '/').'/is', '', $aMatches[2]);\n $aMatches[2] = preg_replace('/(\\.+\\/)|(\\/+)/', '/', $aMatches[2]);\n if (!is_readable($sAppPath.$aMatches[2])) {\n // in case of death link show original link\n return $aMatches[0];\n } else {\n return $aMatches[1].$sAppRel.$aMatches[2];\n }\n },\n $sContent\n );\n/* Original SP7 Manu Fix */\n // restore canonical relation links\n $sContent = preg_replace_callback(\n '/<link\\s[^>]*?\\\"canonical\\\"[^>]*?>/isU',\n function($aMatches) use ($sDocRoot) {\n return preg_replace(\n '/(href\\s*=\\s*\\\")([^\\\"]*?)/siU',\n '\\1'.rtrim($sDocRoot, '/').'\\2',\n $aMatches[0]\n );\n },\n $sContent\n );\n }\n return $sContent;\n }",
"function filter() {\n // the page we will redirect to\n $url['action'] = 'index';\n\n // build a URL will all the search elements in it\n // the resulting URL will be\n // example.com/cake/posts/index/Search.keywords:mykeyword/Search.tag_id:3\n foreach ($this->data as $k => $v) {\n foreach ($v as $kk => $vv) {\n $url[$k . '.' . $kk] = $vv;\n }\n }\n // redirect the user to the url\n $this->redirect($url, null, true);\n }",
"public function indexAction()\n {\n $paginator = $this->get('knp_paginator');\n $request = $this->getRequest();\n $session = $request->getSession();\n $qb = $this->getDoctrine()->getManager()\n ->getRepository('BlogBundle:Link')->getQueryBuilderForFilter();\n $query = $qb->getQuery();\n $filterForm = $this->createForm(new LinkFilterType(), new LinkFilterModel($request));\n $formHandler = new LinkFilterHandler($filterForm, $request, $qb);\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'reset') {\n $session->remove('LinkControllerFilter');\n }\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'filter') {\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n $session->set('LinkControllerFilter', $request);\n }\n }\n\n if ($request->getMethod() == 'GET') {\n if ($session->has('LinkControllerFilter')) {\n $filterForm = $this->createForm(new LinkFilterType(), new LinkFilterModel($session->get('LinkControllerFilter')));\n $formHandler = new LinkFilterHandler($filterForm, $session->get('LinkControllerFilter'), $qb);\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n }\n }\n }\n $filterForm = $formHandler->getFilter();\n\n $pagination = $paginator->paginate(\n $query, $request->get('page', 1), 12\n );\n\n return array(\n 'pagination' => $pagination,\n 'filterForm' => $filterForm->createView(),\n );\n }",
"function applyBulkLinkAction($action,$checked) {\r\n\t$linkNum=sizeof($checked);\r\n\tif($action==\"clear-selected\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tclearLink($linkid);\r\n\t\t}\r\n\t\twpbar_message($linkNum.' external link stats cleared!');\r\n\t}\r\n\tif($action==\"delete-selected\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tdeleteLink($linkid);\r\n\t\t}\r\n\t\twpbar_message($linkNum.' external link stats deleted!');\r\n\t}\r\n\tif($action==\"apply-nofollow\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tapplyNofollow($linkid);\r\n\t\t}\r\n\t\twpbar_message('Nofollow applied to '.$linkNum.' external links!');\r\n\t}\r\n\tif($action==\"remove-nofollow\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tremoveNofollow($linkid);\r\n\t\t}\r\n\t\twpbar_message('Nofollow removed from '.$linkNum.' external links!');\r\n\t}\r\n\tif($action==\"show-wpbar\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tapplyShowWpBar($linkid);\r\n\t\t}\r\n\t\twpbar_message($linkNum.' external links with show The Wordpress Bar!');\r\n\t}\r\n\tif($action==\"redirect-source\") {\r\n\t\tforeach ($checked as $linkid) {\r\n\t\t\tredirectToSource($linkid);\r\n\t\t}\r\n\t\twpbar_message($linkNum.' external links redirect to source!');\r\n\t}\r\n}",
"protected function filterAtts( $atts = array() ) {\n\t\t\t\n\t\t\tforeach($atts as $key => &$att) {\n \t\t\n \t\t$param = $this->params[$key];\n \t\t\n \t\tswitch( $param['type'] ) {\n \t\t\n \t\tcase 'vc_link' :\n \t\t\n \t\t $att = vc_build_link($att);\n \t\t \n break;\n \t\t\n \t\t}\n \t\t\n \t\t}\n \t\t\n \t\treturn $atts;\n \t\t\n\t\t}",
"public function getFrontEndActions();",
"private function filters() {\n\n\n\t}",
"private function filterByPermission(){\n\n }",
"private function filter_action_menu(&$navigationlinks, $filternamesarray) {\n $navigationlinks = array_filter($navigationlinks, function($menu) use ($filternamesarray) {\n return !in_array($menu->titleidentifier, $filternamesarray);\n });\n }",
"function activity_tabs_filtermenu($hook, $type, $returnvalue, $params){\n if(elgg_get_context() == 'activity_tabs' && elgg_is_logged_in()){\n $check = $returnvalue;\n \n foreach($check as $key => $item){\n switch($item->getName()){\n case 'all':\n $url = elgg_get_site_url() . 'activity/all';\n $item->setHref($url);\n $returnvalue[$key] = $item;\n break;\n case 'mine':\n $url = elgg_get_site_url() . 'activity/owner/' . elgg_get_logged_in_user_entity()->username;\n $item->setHref($url);\n $returnvalue[$key] = $item;\n break;\n case 'friend':\n $url = elgg_get_site_url() . 'activity/friends/' . elgg_get_logged_in_user_entity()->username;\n $item->setHref($url);\n $returnvalue[$key] = $item;\n break;\n default:\n break;\n }\n }\n \n return $returnvalue;\n }\n}",
"public function filter_list_to_buttons() {\n\n\t\t\tif ( ( is_shop() || is_product_taxonomy() ) && astra_get_option( 'shop-filter-list-to-buttons' ) ) {\n\n\t\t\t\t// Remove woocommerce filter navigation count.\n\t\t\t\tadd_filter( 'woocommerce_layered_nav_count', '__return_false' );\n\n\t\t\t\tadd_filter( 'woocommerce_layered_nav_term_html', array( $this, 'custom_woocommerce_layered_nav_term_html' ), 10, 4 );\n\t\t\t}\n\t\t}",
"function cd_ab_rel_activity_filter( $action, $activity ) {\n\tswitch ( $activity->component ) {\n\t\tcase 'groups' :\n\t\t\t$cd_ab = get_blog_option( bp_get_root_blog_id(), 'cd_ab' );\n\t\t\tif ( $cd_ab['groups']['status'] === 'on' ) {\n\t\t\t\t$reverse_content = strrev( $action );\n\t\t\t\t$position = strpos( $reverse_content, 'gmi<' );\n\t\t\t\tpreg_match( '~group-(\\d++)-avatar~', $action, $match );\n\t\t\t\t$replace = \"rel='group_{$match[1]}' \";\n\t\t\t\t$action = substr_replace( $action, $replace, - $position + 1, 0 );\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn $action;\n}",
"public static function plugin_action_links($links) {\n\t\tif (current_user_can('manage_options')) {\n\t\t\t$links[] = '<a href=\"' . esc_url(admin_url('tools.php?page=blob-mimes-admin')) . '\">' . __('Debug File Validation', 'blob-mimes') . '</a>';\n\t\t}\n\n\t\t$links[] = '<a href=\"https://github.com/Blobfolio/blob-mimes/tree/master/wp\" target=\"_blank\" rel=\"noopener\">' . esc_html__('Documentation', 'blob-mimes') . '</a>';\n\n\t\treturn $links;\n\t}",
"public static function plugin_action_links($links, $file)\n\t{\n\t\treturn MailPress::plugin_links($links, $file, plugin_basename(__FILE__), 'filter_img');\n\t}",
"public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}",
"public static function filterFormAction() {\n\n $query = Request::segments();\n\n\n foreach ($query as $k => $q) {\n if (preg_match(\"/page-[0-9]+$/\", $q, $match)) {\n unset($query[$k]);\n };\n }\n $query = implode('/', $query);\n $url = Request::root() . \"/$query/\";\n\n return $url;\n }",
"protected function get_links_from_filter($filter)\n {\n $results = [];\n foreach ($filter as $i => $content) {\n $content_crawler = new Crawler($content);\n $results[] = $content_crawler->filter('a')->attr('href');\n }\n return $results;\n }",
"public function preDispatch()\n {\n $this->view->addFilter('TwitterLink');\n }",
"private function get_WeblinkFilters() {\n $info = [];\n\n $filters = [self::$locale['web_0030'], self::$locale['web_0032'], self::$locale['web_0031']];\n\n $wdi = 0;\n foreach ($this->allowed_filters as $type_id => $type) {\n $filter_link = INFUSIONS.\"weblinks/weblinks.php?\".(!empty($this->cat_id) ? \"cat_id=\".$this->cat_id.\"&\" : \"\").\"type=\".$type;\n $info[$type] = [\n 'link' => $filter_link,\n 'name' => $filters[$type_id],\n 'type' => $type,\n 'active' => ((empty($this->type) && (!$wdi)) || (!empty($this->type) && $this->type === $type) ? \"text-dark strong\" : '')\n ];\n unset($filter_link);\n $wdi++;\n }\n\n return (array)$info;\n }"
]
| [
"0.649305",
"0.62755513",
"0.6077105",
"0.6033268",
"0.5906332",
"0.5898134",
"0.58720094",
"0.58420706",
"0.5789285",
"0.57770896",
"0.571849",
"0.57007515",
"0.56969285",
"0.56638736",
"0.56557167",
"0.56387925",
"0.55652237",
"0.5545951",
"0.55104125",
"0.549834",
"0.54867935",
"0.54797006",
"0.5461666",
"0.54438025",
"0.53930134",
"0.5369936",
"0.5335128",
"0.53306127",
"0.5311292",
"0.52892375"
]
| 0.6483531 | 1 |
Return theme plugins configuration | function bimber_get_theme_plugins_config() {
$theme_dir = trailingslashit( get_template_directory() );
$config = array(
array(
'name' => 'WordPress Importer',
'slug' => 'wordpress-importer',
'required' => false,
'version' => '',
),
array(
'name' => 'MailChimp for WordPress',
// The plugin name.
'slug' => 'mailchimp-for-wp',
// The plugin slug (typically the folder name).
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
),
array(
'name' => 'Mashshare Share Buttons',
// The plugin name.
'slug' => 'mashsharer',
// The plugin slug (typically the folder name).
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
),
array(
'name' => 'Wordpress Popular Posts',
// The plugin name.
'slug' => 'wordpress-popular-posts',
// The plugin slug (typically the folder name).
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
),
array(
'name' => 'WP Subtitle',
// The plugin name.
'slug' => 'wp-subtitle',
// The plugin slug (typically the folder name).
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
),
array(
'name' => 'Snax',
// The plugin name.
'slug' => 'snax',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Viral Front-End Uploader with Open Lists', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/snax.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.13.4',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'G1 Socials',
// The plugin name.
'slug' => 'g1-socials',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Social media profile icons', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/g1-socials.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.1.13',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'What\'s your reaction?',
// The plugin name.
'slug' => 'whats-your-reaction',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Share your reaction to a post, using nice looking badges', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/whats-your-reaction.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.2.11',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'Media Ace',
// The plugin name.
'slug' => 'media-ace',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Your media assistant', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/media-ace.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.1.7',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'Ad Ace',
// The plugin name.
'slug' => 'ad-ace',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Ad manager', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/ad-ace.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.1.5',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'PhotoMix',
// The plugin name.
'slug' => 'photomix',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Mix photos without a graphics editor', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/photomix.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '1.0.1',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
'local_plugin' => true,
),
array(
'name' => 'Visual Composer',
// The plugin name.
'slug' => 'js_composer',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Frontend and backend page builder', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/js_composer.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '5.4.5',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
),
array(
'name' => esc_html__( 'Envato Market', 'bimber' ),
// The plugin name.
'slug' => 'envato-market',
// The plugin slug (typically the folder name).
'description' => esc_html__( 'Automatic theme updates', 'bimber' ),
'source' => $theme_dir . 'includes/plugins/zip/envato-market.zip',
// The plugin source.
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
'force_activation' => false,
// If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.
'force_deactivation' => false,
// If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.
'external_url' => '',
// If set, overrides default API URL and points to an external URL.
),
// @todo - Needs to be last entry so setup wizard won't affect other plugins.
array(
'name' => 'WooCommerce',
// The plugin name.
'slug' => 'woocommerce',
// The plugin slug (typically the folder name).
'required' => false,
// If false, the plugin is only 'recommended' instead of required.
'version' => '',
// E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented.
),
);
return apply_filters( 'bimber_tgm_plugins_config', $config );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getContainedPluginConfiguration();",
"private function themes()\n {\n $all_plugins = json_decode(file_get_contents($this->pluginsJson))->themes;\n return $all_plugins;\n }",
"function getPlugins();",
"public function getPlugins() {\n if ( is_null($this->_plugins) ) {\n $this->_plugins = array();\n $plugins = $this->_app->config->getConfig('plugins');\n foreach( $plugins as $name => $conf ) {\n $this->_plugins[ $name ] = new Plugin(\n $this->_app, \n !empty($conf['enabled']) ? $conf['enabled'] : false,\n !empty($conf['options']) ? $conf['options'] : array()\n );\n }\n }\n return $this->_plugins;\n }",
"private function getPluginConfig()\n {\n // get subshop specific config\n $shop = $this->getShop();\n $pluginConfig = Shopware()->Container()->get('shopware.plugin.cached_config_reader')->getByPluginName('RocketBoard', $shop);\n return $pluginConfig;\n }",
"public static function plugins() {\n\t\t\treturn self::$plugins;\n\t\t}",
"static function config() {\n\t\t//\t\tif (self::$configuration === null) {\n\t\t//\t\t\tself::$configuration = include self::themepath().'wpgrade-config'.EXT;\n\t\t//\t\t}\n\t\t//\n\t\t//\t\treturn self::$configuration;\n\t\treturn self::get_config();\n\t}",
"public function get_plugins_list()\n {\n $baseUrl = 'http://prismjs.com/plugins/';\n\n // JS and related CSS file name must be same, except extension\n return [\n 1 => ['name' => 'Autolinker ', 'url' => $baseUrl . 'autolinker/', 'file' => 'prism-autolinker', 'need_css' => 1],\n 2 => ['name' => 'Autoloader ', 'url' => $baseUrl . 'autoloader/', 'file' => 'prism-autoloader', 'need_css' => 0],\n\n 3 => ['name' => 'Command Line', 'url' => $baseUrl . 'command-line/', 'file' => 'prism-command-line', 'need_css' => 1],\n 4 => ['name' => 'Copy to Clipboard', 'url' => $baseUrl . 'copy-to-clipboard/', 'file' => 'prism-copy-to-clipboard', 'need_css' => 1],\n\n 5 => ['name' => 'File Highlight ', 'url' => $baseUrl . 'file-highlight/', 'file' => 'prism-file-highlight', 'need_css' => 0],\n 6 => ['name' => 'Line Highlight', 'url' => $baseUrl . 'line-highlight/', 'file' => 'prism-line-highlight', 'need_css' => 1],\n 7 => ['name' => 'Line Numbers', 'url' => $baseUrl . 'line-numbers/', 'file' => 'prism-line-numbers', 'need_css' => 1],\n\n 8 => ['name' => 'Preview: Base', 'url' => $baseUrl . 'previewer-base/', 'file' => 'prism-previewer-base', 'need_css' => 1],\n 9 => ['name' => 'Preview: Angle', 'url' => $baseUrl . 'previewer-angle/', 'file' => 'prism-previewer-angle', 'need_css' => 1],\n 10 => ['name' => 'Preview: Color', 'url' => $baseUrl . 'previewer-color/', 'file' => 'prism-previewer-color', 'need_css' => 1],\n 11 => ['name' => 'Preview: Easing', 'url' => $baseUrl . 'previewer-easing/', 'file' => 'prism-previewer-easing', 'need_css' => 1],\n 12 => ['name' => 'Preview: Gradient', 'url' => $baseUrl . 'previewer-gradient/', 'file' => 'prism-previewer-gradient', 'need_css' => 1],\n 13 => ['name' => 'Preview: Time', 'url' => $baseUrl . 'previewer-time/', 'file' => 'prism-previewer-time', 'need_css' => 1],\n\n 14 => ['name' => 'Show Invisibles', 'url' => $baseUrl . 'show-invisibles/', 'file' => 'prism-show-invisibles', 'need_css' => 1],\n 15 => ['name' => 'Show Language', 'url' => $baseUrl . 'show-language/', 'file' => 'prism-show-language', 'need_css' => 1],\n // Docs not correctly linking\n // 16 => array('name' => 'WebPlatform Docs', 'url' => $base_url . 'wpd/', 'file' => 'prism-wpd', 'need_css' => 1),\n 16 => ['name' => 'Normalize Whitespace', 'url' => $baseUrl . 'normalize-whitespace/', 'file' => 'prism-normalize-whitespace', 'need_css' => 0],\n ];\n }",
"public function getThemes() {\n if ($this->themes !== null) {\n return $this->themes;\n }\n\n $this->themes = parent::getThemes();\n\n $themes = $this->config->get('theme');\n if (!is_array($themes)) {\n return $this->themes;\n }\n\n foreach ($themes as $name => $theme) {\n if (isset($theme['name'])) {\n $displayName = $theme['name'];\n } else {\n $displayName = $name;\n }\n\n if (isset($theme['engine'])) {\n if (is_array($theme['engine'])) {\n $engines = $theme['engine'];\n } else {\n $engines = array($theme['engine']);\n }\n } else {\n $engines = array();\n }\n\n if (isset($theme['region'])) {\n $regions = $theme['region'];\n } else {\n $regions = array();\n }\n\n if (isset($theme['parent'])) {\n $parent = $theme['parent'];\n } else {\n $parent = null;\n }\n\n $this->themes[$name] = new GenericTheme($name, $displayName, $engines, $regions, $parent);\n }\n\n return $this->themes;\n }",
"public function getPluginConfiguration() {\n return $this->pluginConfiguration;\n }",
"public static function parseInstalledPlugins() {\r\n\t\t$obj = new QPluginConfigParser(QPluginInstaller::getMasterConfigFilePath());\t\t\r\n\t\treturn $obj->parseConfig();\r\n\t}",
"function okcdesign_theme() {\n $themes = array();\n theme_plugins_invoke(__FUNCTION__, $themes);\n return $themes;\n}",
"public function configs() {\n\n\t\t// Recommend plugins\n\t\trequire_once( WPEX_FRAMEWORK_DIR .'config/tgm-plugin-activation-config.php' );\n\n\t\t// Post Series\n\t\tif ( get_theme_mod( 'post_series_enable', true ) ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'post-series/post-series-config.php' );\n\t\t}\n\n\t\t// Portfolio config\n\t\tif ( WPEX_PORTFOLIO_IS_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'portfolio/portfolio-config.php' );\n\t\t}\n\n\t\t// Staff config\n\t\tif ( WPEX_STAFF_IS_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'staff/staff-config.php' );\n\t\t}\n\n\t\t// Testimonials config\n\t\tif ( WPEX_TESTIMONIALS_IS_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'testimonials/testimonials-config.php' );\n\t\t}\n\n\t\t// WooCommerce config\n\t\tif ( WPEX_WOOCOMMERCE_ACTIVE ) {\n\n\t\t\t// WooCommerce core tweaks\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'woocommerce/woocommerce-config.php' );\n\n\t\t}\n\n\t\t// Visual composer config\n\t\tif ( WPEX_VC_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'visual-composer/visual-composer-config.php' );\n\t\t}\n\n\t\t// Tribe events config\n\t\tif ( WPEX_TRIBE_EVENTS_CALENDAR_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'config/tribe-events-config.php' );\n\t\t}\n\n\t\t// Revolution slider config\n\t\tif ( WPEX_REV_SLIDER_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'config/revslider-config.php' );\n\t\t}\n\n\t\t// WPML Config\n\t\tif ( WPEX_WPML_ACTIVE ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'config/wpml-config.php' );\n\t\t}\n\n\t\t// Polylang Config\n\t\tif ( class_exists( 'Polylang' ) ) {\n\t\t\trequire_once( WPEX_FRAMEWORK_DIR .'config/polylang-config.php' );\n\t\t}\n\n\t}",
"protected function getExtraPlugins(): array\n {\n $urlParameters = [\n 'P' => [\n 'table' => $this->formData['tableName'],\n 'uid' => $this->formData['databaseRow']['uid'],\n 'fieldName' => $this->formData['fieldName'] ?? '',\n 'recordType' => $this->formData['recordTypeValue'],\n 'pid' => $this->formData['effectivePid'],\n ]\n ];\n\n if (!isset($this->rteConfiguration['externalPlugins'])\n || !is_array($this->rteConfiguration['externalPlugins'])) {\n $this->rteConfiguration['externalPlugins'] = [];\n }\n\n if (ConfigurationUtility::getExtensionConfiguration()['enablePlaceholders']) {\n $this->rteConfiguration['externalPlugins']['confighelper'] = [\n 'resource' => 'EXT:frontend_editing/Resources/Public/JavaScript/Plugins/confighelper/plugin.js'\n ];\n }\n\n $pluginConfiguration = [];\n\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n foreach ($this->rteConfiguration['externalPlugins'] as $pluginName => $configuration) {\n $pluginConfiguration[$pluginName] = [\n 'resource' => $this->resolveUrlPath($configuration['resource'])\n ];\n unset($configuration['resource']);\n\n if (isset($configuration['route'])) {\n $configuration['routeUrl'] = (string)$uriBuilder->buildUriFromRoute(\n $configuration['route'],\n $urlParameters\n );\n }\n\n $pluginConfiguration[$pluginName]['config'] = $configuration;\n }\n\n return $pluginConfiguration;\n }",
"public function get_available_themes() {\n\t\treturn apply_filters( 'crocoblock-wizard/install-theme/available-themes', array(\n\t\t\t'kava' => array(\n\t\t\t\t'source' => 'crocoblock',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/kava.png',\n\t\t\t),\n\t\t\t'blocksy' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/blocksy.png',\n\t\t\t),\n\t\t\t'oceanwp' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/ocean.png',\n\t\t\t),\n\t\t\t'astra' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/astra.png',\n\t\t\t),\n\t\t\t'generatepress' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/generatepress.png',\n\t\t\t),\n\t\t\t'hello-elementor' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/hello.png',\n\t\t\t),\n\t\t) );\n\t}",
"function Yonk_register_required_plugins() {\n $plugins = array(\n\n // This is an example of how to include a plugin bundled with a theme.\n array(\n 'name' => 'Elementor',\n 'slug' => 'elementor',\n 'source' => 'https://downloads.wordpress.org/plugin/elementor.3.9.2.zip',\n 'required' => true,\n 'version' => '3.9.2',\n 'force_activation' => false,\n 'force_deactivation' => false,\n 'external_url' => 'https://pt.wordpress.org/plugins/elementor/',\n 'is_callable' => '',\n ),\n\n array(\n 'name' => 'Classic Widgets',\n 'slug' => 'classic-widgets',\n 'source' => 'https://downloads.wordpress.org/plugin/classic-widgets.0.3.zip',\n 'required' => true,\n 'version' => '0.3',\n 'force_activation' => false,\n 'force_deactivation' => false,\n 'external_url' => 'https://pt.wordpress.org/plugins/classic-widgets/',\n 'is_callable' => '',\n ),\n\n array(\n 'name' => 'Classic Editor',\n 'slug' => 'classic-editor',\n 'source' => 'https://downloads.wordpress.org/plugin/classic-editor.1.6.2.zip',\n 'required' => true,\n 'version' => '1.6.2',\n 'force_activation' => false,\n 'force_deactivation' => false,\n 'external_url' => 'https://pt.wordpress.org/plugins/classic-editor/',\n 'is_callable' => '',\n ),\n\n );\n\n $config = array(\n 'id' => 'blank', // Unique ID for hashing notices for multiple instances of TGMPA.\n 'default_path' => '', // Default absolute path to bundled plugins.\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\n 'parent_slug' => 'themes.php', // Parent menu slug.\n 'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.\n 'has_notices' => true, // Show admin notices or not.\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\n 'message' => '', // Message to output right before the plugins table.\n );\n\n tgmpa( $plugins, $config );\n }",
"public static function get_theme_options() {\n\t\t\treturn get_option( 'theme_options' );\n\t\t}",
"public function get_select_config() {\n\t\treturn array(\n\t\t\t'next_step' => array(\n\t\t\t\t'selected' => 'cbw-install-theme',\n\t\t\t\t'current' => Plugin::instance()->dashboard->page_url( 'select-skin' ),\n\t\t\t),\n\t\t\t'themes' => $this->get_available_themes(),\n\t\t\t'prev' => Plugin::instance()->dashboard->page_url( 'license' ),\n\t\t);\n\t}",
"function getPlugins() {\n return $this->plugins;\n }",
"public static function get_theme_options() {\n\t\t\treturn get_option( 'ELMT_theme_options' );\n\t\t}",
"public function getThemeConfiguration()\n {\n return $this->getParameter('themeConfiguration');\n }",
"function getEnabledPlugins();",
"public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }",
"public function get_plugins() {\n\t\treturn get_plugins();\n\t}",
"function getPlugins() {\n\n return $this->plugins;\n\n }",
"function techfak_get_theme_options() {\n\treturn get_option( 'techfak_theme_options', techfak_get_default_theme_options() );\n}",
"public function getRequiredPlugins() {}",
"private function get_configurations()\n {\n return [\n Configuration\\Comments::class,\n Configuration\\Editor::class,\n Configuration\\Media::class,\n Configuration\\Misc::class,\n Configuration\\Menu::class,\n Configuration\\Plugins::class,\n ];\n }",
"static final function getPlugins()\n {\n self::initPlugins();\n return self::$plugins;\n }",
"function cpotheme_metadata_plugin()\n{\n $cpotheme_data = array();\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_title',\n 'std' => '',\n 'label' => 'Título del Producto',\n 'type' => 'text',\n 'desc' => 'Indica la etiqueta de título (H1) del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_demo_url',\n 'std' => '',\n 'label' => 'URL de la Demo',\n 'type' => 'text',\n 'desc' => 'Especifica la URL de la demo del tema.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_url',\n 'std' => '',\n 'label' => 'External URL',\n 'type' => 'text',\n 'desc' => 'Especifica la URL del tema si es un archivo externo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_product',\n 'std' => '',\n 'label' => 'ID de Producto',\n 'type' => 'select',\n 'option' => cpotheme_metadata_productlist_optional(),\n 'desc' => 'Indica la ID del producto para enlazarlo.'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'plugin_changelog',\n 'std' => '',\n 'label' => 'Changelog',\n 'type' => 'textarea',\n 'desc' => 'Muestra el registro de cambios de la descarga.'\n );\n\n return $cpotheme_data;\n}"
]
| [
"0.71704435",
"0.70302963",
"0.68747675",
"0.6801109",
"0.6757872",
"0.66214865",
"0.66013813",
"0.65928006",
"0.6592423",
"0.6583772",
"0.6569586",
"0.6545915",
"0.65457976",
"0.6529554",
"0.65286434",
"0.6520017",
"0.65032184",
"0.64953524",
"0.6490531",
"0.64849985",
"0.6458922",
"0.6445362",
"0.64314127",
"0.6428826",
"0.63959616",
"0.6387512",
"0.6368714",
"0.63626146",
"0.6352765",
"0.6328601"
]
| 0.79785675 | 0 |
Helper method to return model of requested project or false if project id is missing or invalid. | protected function getRequestedProject()
{
$id = $this->getEvent()->getRouteMatch()->getParam('project');
$p4Admin = $this->getServiceLocator()->get('p4_admin');
// attempt to retrieve the specified project
// translate invalid/missing id's into a 404
try {
return Project::fetch($id, $p4Admin);
} catch (NotFoundException $e) {
} catch (\InvalidArgumentException $e) {
}
$this->getResponse()->setStatusCode(404);
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getProject($id)\n {\n $projectApi = new Project($this->mainModel->getDb());\n $answer = $projectApi->get($id);\n\n if (isset($answer['error'])) {\n return false;\n } else {\n $this->project = $answer['project'];\n return true;\n }\n }",
"public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }",
"function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}",
"private function validateProject(int $projectId): bool\n {\n $return = false;\n try {\n $project = Project::where('id', $projectId)\n ->firstOrFail();\n $return = true;\n } catch (ModelNotFoundException $exception) {\n LogHelper::throwError($exception);\n }\n\n return $return;\n }",
"public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }",
"function _check_project()\n {\n if (!$this->has_arg('pid'))\n $this->_error('No project id specified');\n if (!$this->has_arg('ty'))\n $this->_error('No item type specified');\n if (!$this->has_arg('iid'))\n $this->_error('No item id specified');\n\n\n $ret = 0;\n\n if (array_key_exists($this->arg('ty'), $this->types))\n {\n $t = $this->types[$this->arg('ty')];\n\n $rows = $this->db->pq(\"SELECT projectid FROM $t[0] WHERE projectid=:1 AND $t[1]=:2\", array($this->arg('pid'), $this->arg('iid')));\n\n if (sizeof($rows))\n $ret = 1;\n }\n\n $this->_output($ret);\n }",
"public function getProject($id) {\n foreach ($this->_projects as $project) {\n if ($project->id == $id) return $project;\n }\n return false;\n }",
"public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }",
"public function getProject($projectId) {\n\t\t$db = $this->connection();\n\t\t$sql = 'SELECT * FROM projects WHERE projectId = :projectId';\n\t\t$params = array(':projectId' => $projectId);\n\t\t$query = $db->prepare($sql);\n\t\t$status = $query->execute($params);\n\n\t\tif (!$status) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$project = $query->fetchObject();\n\n\t\tif ($project === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$returnProject = new Project($project);\n\n\t\treturn $returnProject;\n\t}",
"public function getSingle($p_id) {\n $project = Project::find($p_id);\n\n return response()->success(compact('project'));\n }",
"function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}",
"static function hasProject($project)\n\t{\n\t\tGLOBAL $_MIND;\n\t\t$projectfile= Mind::$projectsDir.$project;\n\t\t$noAccess= true;\n\n\t\t$db= new MindDB();\n\t\t$hasProject= \"SELECT pk_project,\n\t\t\t\t\t\t\t project.name as name\n\t\t\t\t\t\tfrom project_user,\n\t\t\t\t\t\t\t project\n\t\t\t\t\t where fk_user= \".$_SESSION['pk_user'].\"\n\t\t\t\t\t\t and project.name = '\".$project.\"'\n\t\t\t\t\t\t and fk_project = pk_project\n\t\t\t\t\t \";\n\t\t$data= $db->query($hasProject);\n\t\tif(sizeof($data)>0)\n\t\t\tforeach($data as $row)\n\t\t\t{\n\t\t\t\t$noAccess= false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tif(!file_exists($projectfile) || $noAccess)\n\t\t{\n\t\t\tMind::write('noProject', true, $project);\n\t\t\treturn false;\n\t\t}\n\t\treturn $row;\n\t}",
"public function getProject() {\n return $this->hasOne(Projects::className(), ['id' => 'project_id']);\n }",
"public function getProject()\n {\n return $this->hasOne(Project::className(), ['id' => 'project_id']);\n }",
"public function getProject()\n {\n return $this->hasOne(Project::className(), ['id' => 'project_id']);\n }",
"static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}",
"static function isValidProject($project)\n {\n $Model = [\n 'name' => '',\n 'startDate' => '',\n 'endDate' => '',\n 'status' => '',\n 'manager' => '',\n 'code' => '',\n 'poValue' => '',\n 'expenses' => '',\n 'link' => ''\n ];\n\n return DataValidator::payloadValidator($Model, $project);\n }",
"public function findOrFail($id)\n {\n return $this->project->findOrFail($id);\n }",
"function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }",
"public function singleProject($project_id, $db)\r\n {\r\n $sql = \"SELECT * FROM projects\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst-> execute();\r\n $p = $pst->fetch(PDO::FETCH_OBJ);\r\n return $p;\r\n }",
"public function hasProject() {\n return $this->_has(1);\n }",
"public function getProject()\n {\n return $this->hasOne(Project::class, ['id' => 'project_id']);\n }",
"public function hasProject() {\n return $this->_has(4);\n }",
"private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }",
"public function loadModel($id) {\n $model = Project::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested project does not exist.');\n return $model;\n }",
"public function findModel($uri) {\n $sessionToken = Yii::$app->session['access_token'];\n $projectModel = new YiiProjectModel(null, null);\n $requestRes = $projectModel->findByURI($sessionToken, $uri);\n \n if ($requestRes === true) {\n return $projectModel;\n } else if (isset($requestRes[\"token\"])) {\n return \"token\";\n } else {\n throw new NotFoundHttpException('The requested page does not exist');\n }\n }",
"public function checkCorrectProject($id)\n {\n return $this->getProject($id);\n }",
"public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new Project($statement->fetch(PDO::FETCH_ASSOC));\n }",
"protected function requireProjectId() {\n if (empty($this->projectId) || !is_numeric($this->projectId)) {\n GeneralUtility::kill(\"Project id is required\");\n }\n }",
"public function a_user_can_see_single_project()\n {\n $project = factory(Project::class)->create();\n\n $this->get('/api/projects/' . $project->id)->assertStatus(200)->assertJson([\n 'data' => [\n 'id' => $project->id,\n 'name' => $project->name,\n 'description' => $project->description,\n ],\n ]);\n }"
]
| [
"0.6882084",
"0.6690252",
"0.66104275",
"0.6608943",
"0.6607745",
"0.6571419",
"0.6557458",
"0.65093",
"0.64032704",
"0.62749475",
"0.6199846",
"0.6193035",
"0.61827403",
"0.6165755",
"0.6165755",
"0.61609715",
"0.6155599",
"0.6154056",
"0.6152766",
"0.61515874",
"0.6135951",
"0.6092822",
"0.6079545",
"0.60783786",
"0.6056944",
"0.604948",
"0.6047073",
"0.59804666",
"0.5960262",
"0.59560263"
]
| 0.80008286 | 1 |
Applies a global order discount rate, for the current product (i.e detail) Calls ObjectModel::update() | public function applyGlobalDiscount($discount_rate)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function calculateDiscount() : void{\r\n $percentage = ($this->discounted_value * 100) / $this->order->getTrueTotal();\r\n $new_total = $this->order->getTrueTotal() - $this->discounted_value;\r\n\r\n $this->order_discount_value = $this->discounted_value;\r\n $this->order_discount_percentage = $percentage;\r\n $this->order_discount_reason = \"For every \" . $this->products_nr . \" products from category #\" . $this->category_id . \" you get one free. You got: \";\r\n foreach($this->items_matching as $item){\r\n $this->order_discount_reason .= floor($item[\"qty\"] / $this->products_nr) . \" x '\" . $item[\"description\"] . \"' (€\". $item[\"price\"] .\" each) ; \";\r\n }\r\n $this->order_new_total = $new_total;\r\n }",
"public static function update_item_with_discount($detail_id,$order_promotion,$order_discount_id,$order_discount_amt){\r\tif(is_gt_zero_num($detail_id)){\r\t\t$objtbl_order_details=new tbl_order_details();\r\t\tif($objtbl_order_details->readObject(array(ORD_DTL_ID=>$detail_id))){\r\t\t\t$objtbl_order_details->setordprom_promotion($order_promotion);\r\t\t\t$objtbl_order_details->setordprom_discount_id($order_discount_id);\r\t\t\t$objtbl_order_details->setordprom_discount_amt($order_discount_amt);\r\t\t\t$objtbl_order_details->insert();\r\t\t\treturn 1;\r\t\t}\r\t\tunset($objtbl_order_details);\t\r\t} \r\treturn 0;\t\r }",
"public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }",
"public function apply(OrderItem $item)\n {\n $product = $item->model;\n $order = $item->order;\n\n $originalPrice = $product->getPrice($order->currency, $item->options);\n\n $discount = 0;\n if ($this->type == self::TYPE_FIXED) {\n $discount = $this->discount;\n } elseif ($this->type == self::TYPE_PERCENTAGE) {\n $discount = ($originalPrice / 100) * $this->discount;\n }\n $item->update([\n 'title' => $product->getTitle(),\n 'price' => $originalPrice,\n 'discount' => $discount,\n ]);\n }",
"function beforeSave(){\n\t\t\t// Get the rate\n\t\t\t$rate = 1 / $this->_getRate();\n\n\t\t\t// Convert it back to USD\n\t\t\tif(!empty($this->data['Product']['rrp'])){\n\t\t\t\t$this->data['Product']['rrp'] = $this->data['Product']['rrp'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['start_price'])){\n\t\t\t\t$this->data['Product']['start_price'] \t= $this->data['Product']['start_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['delivery_cost'])){\n\t\t\t\t$this->data['Product']['delivery_cost'] = $this->data['Product']['delivery_cost'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['fixed_price'])){\n\t\t\t\t$this->data['Product']['fixed_price'] \t= $this->data['Product']['fixed_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['minimum_price'])){\n\t\t\t\t$this->data['Product']['minimum_price'] = $this->data['Product']['minimum_price'] * $rate;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function AssignDiscount()\n\t{\t\n\t}",
"private function updateProductDiscount(\n ProductInterface $product,\n Request $request\n ): void {\n $discountPercent = $request->request->get('discount_percent') !== '' ? (float) $request->request->get('discount_percent') : null;\n $discountLimitType = $request->request->get('discount_limit_type') !== '' ? $request->request->get('discount_limit_type') : null;\n $discountFromDate = $request->request->get('discount_from_date') !== '' ? $request->request->get('discount_from_date') : null;\n $discountToDate = $request->request->get('discount_to_date') !== '' ? $request->request->get('discount_to_date') : null;\n\n $variants = $product->getVariants();\n foreach ($variants as $variant) {\n // Variant to change\n $variantPricing = $variant->getChannelPricings()->first();\n\n // Change percent\n if ($discountPercent !== null) {\n $variantPricing->setDiscount($discountPercent / 100);\n }\n\n // Continue if no change type\n if ($discountLimitType === self::LIMIT_NO_CHANGE) {\n continue;\n }\n // Discount type\n $variantPricing->setDiscountLimitType($discountLimitType === self::LIMIT_NONE ? null : $discountLimitType);\n\n // Date type discount\n if ($discountLimitType === self::LIMIT_DATETIME) {\n if ($discountFromDate && $discountToDate) {\n $dateFrom = \\DateTime::createFromFormat('Y-m-d', $discountFromDate);\n $dateTo = \\DateTime::createFromFormat('Y-m-d', $discountToDate);\n\n $variantPricing->setDiscountFrom($dateFrom);\n $variantPricing->setDiscountTo($dateTo);\n }\n\n if ($discountFromDate && !$discountToDate) {\n $dateFrom = \\DateTime::createFromFormat('Y-m-d', $discountFromDate);\n\n $variantPricing->setDiscountFrom($dateFrom);\n $variantPricing->setDiscountTo(null);\n }\n\n if (!$discountFromDate && $discountToDate) {\n $dateTo = \\DateTime::createFromFormat('Y-m-d', $discountToDate);\n\n $variantPricing->setDiscountFrom(null);\n $variantPricing->setDiscountTo($dateTo);\n }\n }\n }\n }",
"public function updated(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }",
"public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }",
"function update_promo() {\n\tconnect_to_db(DB_SERVER, DB_UN, DB_PWD, DB_NAME);\n\n\t$price = 0;\n\n\t$promo_code = mysql_real_escape_string($_POST['promoCode']);\n\t$promo_name = mysql_real_escape_string($_POST['promoName']);\n\t$promo_description = mysql_real_escape_string($_POST['promoDesc']);\n\t$promo_type = mysql_real_escape_string($_POST['promoType']);\n\t$promo_amount = mysql_real_escape_string($_POST['promoAmount']);\n\n\t// first we grab the pre-existing entry and reapply amounts to the stored item values\n\t$statement_getAmount = \"select PromotionItem.ItemNumber, Item.FullRetailPrice, Promotion.AmountOff, Promotion.PromoType from Promotion, PromotionItem, Item where (Item.ItemNumber=PromotionItem.ItemNumber) AND (Promotion.PromoCode = PromotionItem.PromoCode) AND Promotion.PromoCode='$promo_code'\";\n\t$returnResult = mysql_query($statement_getAmount);\n\n\t// next we grab the PromotionItem table and reapply the sale price.\n\t// this is then recalculated after the edit has been made.\n\t// should've resulted in a 1 output query, any more then the schema must broken. Any less, we skip this step\n\tif(mysql_num_rows($returnResult) > 0) {\n\t\twhile($the_row = mysql_fetch_assoc($returnResult)) {\n\t\t\t// run loop evaluating prices\n\t\t\t$myAmount = $the_row['AmountOff'];\n\t\t\t$myType \t= $the_row['PromoType'];\n\t\t\t$myNumber\t= $the_row['ItemNumber'];\t// was leading to an infamous bug where it would simply grab the first number since were table hopping.\n\t\t\t$myRetail = $the_row['FullRetailPrice'];\t// part two of the glitch, reapply the previous price. If 0 then the number could've been negative, lets fix that\n\n\t\t\t$statement_getSalePrice = \"select SalePrice from PromotionItem where PromoCode='$promo_code' and ItemNumber='$myNumber'\";\n\t\t\t$returnResultItem = mysql_query($statement_getSalePrice);\n\n\t\t\t$the_row_item = mysql_fetch_array($returnResultItem);\n\t\t\t$myPrice\t= $the_row_item['SalePrice'];\n\n\t\t\t$price = recalculatePrice($myAmount, $myType, $myPrice, $myRetail);\n\n\t\t\t// calculate new price\n\t\t\t$new_price = calculatePrice($promo_amount, $promo_type, $price);\n\t\t\t\t//display_result(\"Recalc $price, Calc $new_price values Amount $myAmount, Type $myType, Price $myPrice, FullRetail $myRetail, Promo Amount $promo_amount, Promo Type $promo_type\");\n\n\t\t\t// new price achieved, now add it back into the Promotion Item database\n\t\t\t$update_statement = \"update PromotionItem set SalePrice='$new_price' where PromoCode='$promo_code' AND ItemNumber='$myNumber'\";\n\t\t\t$update_result = mysql_query($update_statement);\n\t\t}\n\t}\n\n\t$promo_amount = applyDecimal($promo_amount);\n\n\t// append string\n\t$appendString=\"\";\n\n\t// setup string\n\tif($promo_code != '')\t\t\t$appendString .= \"PromoCode='$promo_code', \";\n\tif($promo_name != '') $appendString .= \"Name='$promo_name', \";\n\tif($promo_description != '') $appendString .= \"Description='$promo_description', \";\n\tif($promo_type != '') $appendString .= \"PromoType='$promo_type', \";\n\tif($promo_amount != '') $appendString .= \"AmountOff='$promo_amount', \";\n\n\t$appendString = str_lreplace(\",\",\"\",$appendString);\n\t// create the statement\n\t$insertStatement = \"update Promotion set $appendString where PromoCode='$promo_code';\";\n\n\t$result = mysql_query($insertStatement);\n\n\t$message = \"\";\n\n\tif(!$result) {\n\t\t$message = \"Error in updating promo: $promo_code: \". mysql_error();\n\t} else {\n\t\t$message = \"Promotion Successfully Updated for PromoCode: $promo_code.\";\n\t}\n\n\tdisplay_result($message);\n}",
"function pp_edd_auto_apply_discount() {\n\n\tif ( function_exists( 'edd_is_checkout' ) && edd_is_checkout() ) {\n\n\t\tif ( ! edd_cart_has_discounts() && edd_is_discount_valid( 'BFCM2016', '', false ) ) {\n\t\t\tedd_set_cart_discount( 'BFCM2016' );\n\t\t}\n\n\t}\n\n}",
"protected function _applyObjectProperty()\n\t{\n\t\tparent::_applyObjectProperty();\n\n\t\t$modelName = $this->_object->getModelName();\n\n\t\tswitch ($modelName)\n\t\t{\n\t\t\tcase 'shop_discount':\n\t\t\t\t// Скидка не может быть больше 100%\n\t\t\t\tif ($this->_object->type == 0 && $this->_object->value > 100)\n\t\t\t\t{\n\t\t\t\t\t$this->_object->value = 0;\n\t\t\t\t\t$this->_object->save();\n\n\t\t\t\t\t$this->addMessage(\n\t\t\t\t\t\tCore_Message::get(Core::_('Shop_Discount.percent_error'), 'error')\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Группа доступа\n\t\t\t\t$aSiteuser_Groups = array(0 => Core::_('Structure.all'));\n\n\t\t\t\tif (Core::moduleIsActive('siteuser'))\n\t\t\t\t{\n\t\t\t\t\t$oSiteuser_Controller_Edit = new Siteuser_Controller_Edit($this->_Admin_Form_Action);\n\t\t\t\t\t$aSiteuser_Groups = $aSiteuser_Groups + $oSiteuser_Controller_Edit->fillSiteuserGroups($this->_object->Shop->site_id);\n\t\t\t\t}\n\n\t\t\t\t$aTmp = array();\n\n\t\t\t\t$aShop_Discount_Siteuser_Groups = $this->_object->Shop_Discount_Siteuser_Groups->findAll(FALSE);\n\t\t\t\tforeach ($aShop_Discount_Siteuser_Groups as $oShop_Discount_Siteuser_Group)\n\t\t\t\t{\n\t\t\t\t\t!in_array($oShop_Discount_Siteuser_Group->siteuser_group_id, $aTmp)\n\t\t\t\t\t\t&& $aTmp[] = $oShop_Discount_Siteuser_Group->siteuser_group_id;\n\t\t\t\t}\n\n\t\t\t\tforeach ($aSiteuser_Groups as $siteuser_group_id => $name)\n\t\t\t\t{\n\t\t\t\t\t$bSiteuserGroupChecked = Core_Array::getPost('siteuser_group_' . $siteuser_group_id);\n\n\t\t\t\t\tif ($bSiteuserGroupChecked)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($siteuser_group_id, $aTmp))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$oShop_Discount_Siteuser_Group = Core_Entity::factory('Shop_Discount_Siteuser_Group');\n\t\t\t\t\t\t\t$oShop_Discount_Siteuser_Group->siteuser_group_id = $siteuser_group_id;\n\t\t\t\t\t\t\t$this->_object->add($oShop_Discount_Siteuser_Group);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (in_array($siteuser_group_id, $aTmp))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oShop_Discount_Siteuser_Group = $this->_object->Shop_Discount_Siteuser_Groups->getObject($this->_object, $siteuser_group_id);\n\n\t\t\t\t\t\t\t!is_null($oShop_Discount_Siteuser_Group)\n\t\t\t\t\t\t\t\t&& $oShop_Discount_Siteuser_Group->delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tCore_Event::notify(get_class($this) . '.onAfterRedeclaredApplyObjectProperty', $this, array($this->_Admin_Form_Controller));\n\n\t\treturn $this;\n\t}",
"private function _calculateTotal()\n {\n\n if (!is_null($this->shipping_option_id)) {\n $this->total = $this->unit_price * $this->quantity - $this->promotion_amount -\n $this->discount_amount;\n $this->save();\n return;\n }\n\n if ($this->quantity == 0) {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if (is_null($pricing = $this->getPricing()) && $this->unit_price_overridden == 'false') {\n if ($this->total > 0) {\n $this->total = '0.00';\n $this->save();\n }\n return;\n }\n\n if ($this->unit_price_overridden != 'true') {\n $this->unit_price = $pricing->price;\n }\n\n // Reset promotion to capture any adjustments affecting discount\n if (!is_null($promotion = $this->promotion)) {\n $this->save();//flush current values to db for promo calculations\n $promotion->calculate($this->invoice);\n $this->refresh();\n }\n\n /**\n * Multipay discount\n */\n if (!$this->invoice->discount_id && 'incomplete' == $this->invoice->status) {\n $discount = $this->invoice->user->account()->discounts()->active()->first();\n } else {\n $discount = $this->invoice->discount;\n }\n if ($discount) {\n // flush current values to db prior to calculations\n if (count($this->getDirty())) {\n $this->save();\n }\n $discount->calculate($this->invoice);\n $this->refresh();\n }\n\n $this->total = $this->getSubTotal() - $this->promotion_amount - $this->discount_amount;\n $this->save();\n }",
"public function applyDefaults()\n {\n $addressInfo = $this->_getDefaultAddress();\n $this->saveBilling(\n $addressInfo['billing'],\n $addressInfo['billing']['customer_address_id'],\n false\n );\n if (!$addressInfo['billing']['use_for_shipping']) {\n $this->saveShipping(\n $addressInfo['shipping'],\n $addressInfo['shipping']['customer_address_id'],\n false\n );\n }\n\n /**\n * @var Mage_Sales_Model_Quote\n */\n $quote = $this->getQuote();\n $shippingAddress = $quote->getShippingAddress();\n\n // weight vs destination fix\n $weight = 0;\n foreach($quote->getAllItems() as $item) {\n $weight += ($item->getWeight() * $item->getQty()) ;\n }\n $shippingAddress->setFreeMethodWeight($weight)->setWeight($weight);\n\n $shippingAddress->collectTotals()->collectShippingRates()->save();\n $this->applyShippingMethod();\n // shipping method may affect the total in both sides (discount on using shipping address)\n $quote->collectTotals();\n\n $ajaxHelper = Mage::helper('firecheckout/ajax');\n if ($ajaxHelper->getIsShippingMethodDependsOn('total')) {\n // changing total by shipping price may affect the shipping prices theoretically\n // (free shipping may be canceled or added)\n $shippingAddress->setCollectShippingRates(true)->collectShippingRates();\n // if shipping price was changed, we need to recalculate totals again.\n // Example: SELECTED SHIPPING METHOD NOW BECOMES FREE\n // previous method added a discount and selected shipping method wasn't free\n // but removing the previous shipping method removes the discount also\n // and selected shipping method is now free\n $quote->setTotalsCollectedFlag(false)->collectTotals();\n }\n\n $this->applyPaymentMethod();\n if ($ajaxHelper->getIsTotalDependsOn('payment-method')) { // @todo && method is changed\n // recollect totals again because adding/removing payment\n // method may add/remove some discounts in the order\n\n // to recollect discount rules need to clear previous discount\n // descriptions and mark address as modified\n // see _canProcessRule in Mage_SalesRule_Model_Validator\n $shippingAddress->setDiscountDescriptionArray(array())->isObjectNew(true);\n\n $quote->setTotalsCollectedFlag(false)->collectTotals();\n }\n\n $quote->save();\n\n return $this;\n }",
"public function calculateDiscount(array $order): float;",
"public function updatePercentage(Discount $discount)\n {\n }",
"public function addDiscountToOrder($ord_dtl_id,$discount){\r\t\tif(is_gt_zero_num($ord_dtl_id) && is_gt_zero_num($discount)){\r\t\t\tif ($this->readObject(array(ORD_DTL_ID=>$ord_dtl_id))){\r\t\t\t\t//..get the discount value\r\t\t\t\t$discount_val=0;\r\t\t\t\t$discount_detail=tbl_discounts::GetInfo($discount);\r\t\t\t\t\r\t\t\t\tif(is_not_empty($discount_detail)){\r\t\t\t\t\t\tif($discount_detail[DISCOUNT_TYPE]=='PERCENT'){\r\t\t\t\t\t\t\t$discount_val=($this->getord_dtl_price()*($discount_detail[DISCOUNT_PERCENT]/100));\r\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t$discount_val=($discount_detail[DISCOUNT_PERCENT]);\r\t\t\t\t\t\t}\r\t\t\t\t}\t\t\t\t\r\t\t\t\t\r\t\t\t\t$qry = \"UPDATE \".TBL_ORDER_DETAILS.RET.\"SET\".RET.\"\r\t\t\t\".ORD_DTL_DISCOUNT.\" = \".$discount_val.\" WHERE \".ORD_DTL_ID.\"={$ord_dtl_id}\";\r\t\t\t\t$res = mysql_query($qry);\r\t\t\t\tif($res){\r\t\t\t\t\treturn 1;\r\t\t\t\t}\r\t\t\t}\r\t\t}\r\t\treturn 0;\r\t}",
"private function calculateOrderAmount()\n {\n if ($this->getOffer() instanceof Offer) {\n //recalculates the new amount\n $this->getOffer()->calculateInvoiceAmount();\n Shopware()->Models()->persist($this->getOffer());\n }\n }",
"public function updateAffectedPlans(Discount $discount)\n {\n }",
"function discount_rate($discount_rate=null)\n {\n if (isset($discount_rate)) $this->discount_rate = $discount_rate;\n return $this->discount_rate;\n }",
"public function discountBifurcation(Varien_Event_Observer $observer)\n {\n $rule = $observer->getEvent()->getRule();\n $result = $observer->getEvent()->getResult();\n $itemId = $observer->getEvent()->getItem()->getItemId();\n //set Unique key\n $curUnique= $rule->getRuleId().'_'.$itemId;\n //check if Mage registry unique call set\n if(Mage::registry('uniqueCall')!==null){\n //if check in array\n $uniqueCalls = Mage::registry('uniqueCall');\n if( in_array($curUnique,$uniqueCalls)){\n return;\n }else{\n //unset existing registry. also take existing array in variable\n Mage::unregister('uniqueCall');\n $uniqueCalls[]= $curUnique ;\n //set registry again with new array include $uniqueCall into it\n Mage::register('uniqueCall',$uniqueCalls);\n }\n }else{\n //set registry again with new array include $uniqueCall into it\n $array = array();\n $array[]=$rule->getRuleId().'_'.$itemId;\n Mage::register('uniqueCall',$array);\n\n } \n\n //condition for the Promotional coupons\n if ( $rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON ) {\n $promotionDiscount = 0;\n $promotionDiscount = Mage::registry('promotion');\n if (Mage::registry('promotion')!==null){\n Mage::unregister('promotion');\n }\n if (Mage::registry('promo_lable')!==null){\n Mage::unregister('promo_lable');\n }\n $promotionDiscount += $result->getDiscountAmount();\n Mage::register('promotion', $promotionDiscount);\n Mage::register('promo_lable',$rule->getName());\n } elseif ( $rule->getCouponType() == self::COUPON_TYPE_FUE_GENERATED ) {\n $couponDiscount = 0;\n $couponDiscount = Mage::registry('coupon');\n if(Mage::registry('coupon')!==null){\n Mage::unregister('coupon');\n }\n //sum up all the values of discounted coupons\n $couponDiscount += $result->getDiscountAmount();\n Mage::register('coupon',$couponDiscount);\n }\n $quote = $observer->getEvent()->getQuote();\n $quoteAddress = $observer->getEvent()->getAddress();\n //set discounted coupons and promotional coupons amount in quote\n $quote->setCouponDiscount(Mage::registry('coupon'));\n $quote->setPromotionalDiscount(Mage::registry('promotion'));\n\n if (Mage::getStoreConfig('promodiscount/promodiscount/use_default')) {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n } else {\n if (Mage::registry('promo_lable')) {\n $quote->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quote->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }\n \n $quoteAddress->setCouponDiscount(Mage::registry('coupon'));\n $quoteAddress->setPromotionalDiscount(Mage::registry('promotion'));\n if (Mage::registry('promo_lable')) {\n $quoteAddress->setPromoLable(Mage::registry('promo_lable'));\n } else {\n $quoteAddress->setPromoLable(Mage::getStoreConfig('promodiscount/promodiscount/default_lable'));\n }\n }",
"public function setStoreToOrderRate($rate);",
"public function getStoreToOrderRate();",
"protected function applyDiscounts()\n {\n $discounts = $this->booking->bookingDiscounts;\n $this->discountedPeriodsTotal = $this->periodsTotal;\n $discountedTotal = $this->periodsTotal;\n\n if (!$discounts) return;\n\n // Apply discounts based on the order of discount sequence.\n foreach ($this->discountSequence as $sequence) {\n // Filter discounts so that we don't have to loop through all of them.\n $filteredDiscounts = $discounts->where('type', $sequence);\n\n $methodName = \"apply\" . Str::studly($sequence) . \"Discount\";\n\n // Apply and store discount information.\n foreach ($filteredDiscounts as $filteredDiscount) {\n $discountInformation = ['beforeDiscount' => $discountedTotal];\n $discountedTotal = $this->$methodName($discountedTotal, $filteredDiscount);\n $discountInformation['afterDiscount'] = $discountedTotal;\n\n if (!$this->discountApplied($discountInformation['beforeDiscount'], $discountInformation['afterDiscount'])) {\n continue;\n }\n\n $discountInformation['discount'] = $filteredDiscount;\n $this->appliedDiscounts[] = $discountInformation;\n }\n }\n\n $this->discountedPeriodsTotal = $discountedTotal;\n }",
"public function applyCoupon()\n {\n // check if the current coupon we are trying to apply is associated to a booking.\n // if it is, we will have to calculate the discount based on the the used coupon.\n if ($this->booking->isUsingCoupon($this->coupon)) {\n $this->coupon = $this->getUsedCoupon();\n }\n\n // if this coupon is not the one that's associated to the booking, we will\n // need to ensure the coupon meets the application criteria.\n if ($this->coupon instanceof Coupon && !$this->canApplyCoupon()) return;\n\n $couponInformation = ['beforeDiscount' => $this->discountedPeriodsTotal];\n $this->discountedPeriodsTotal = $this->coupon->apply($this->discountedPeriodsTotal);\n $couponInformation['afterDiscount'] = $this->discountedPeriodsTotal;\n $couponInformation['coupon'] = $this->coupon;\n $this->appliedCoupon = $couponInformation;\n }",
"public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $product = $observer->getProduct();\n $_pricePerPound = $product->getPricePerPound();\n if($_pricePerPound > 0){\n $weight = $product->getWeight() ? $product->getWeight() : 1;\n $_pricePerPound = str_replace(',', '', $_pricePerPound);\n $price = $_pricePerPound * $weight;\n $product->setPrice($price);\n }\n }",
"public function calc_price_with_ro($product_price, $ro_combs, $special=0, $stock=false, $ro_price_modificator=0, $quantity=false) {\n \t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$lp_settings = $this->getLivePriceSettings();\n\t\t\n\t\t$ro_price = $product_price;\n\t\t$ro_discount_addition_total = 0;\n\t\t$ro_special_addition_total = 0;\n\t\t/*\n\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t$ro_price = $product_price;\n\t\t} else {\n\t\t\t$ro_price = false;\n\t\t}\n\t\t*/\n\t\t$in_stock = null;\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t\n\t\t\t\tif ( !empty($ro_settings['spec_price']) ) {\n\t\t\t\t\t\n\t\t\t\t\t//if (isset($ro_comb['price']) && $ro_comb['price']!=0) {\n\t\t\t\t\t\t// \"+\" may has effect even without price (by discounts)\n\t\t\t\t\t\tif (isset($ro_settings['spec_price_prefix']) && $ro_settings['spec_price_prefix'] && ($ro_comb['price_prefix'] == '+' || $ro_comb['price_prefix'] == '-') ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ro_price_addition = $ro_comb['price'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '-' ) {\n\t\t\t\t\t\t\t\t$ro_price_addition = -$ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!empty($ro_price_addition)) {\n\t\t\t\t\t\t\t\t//$ro_price+= $ro_price_addition;\n\t\t\t\t\t\t\t\t$ro_price_modificator+= $ro_price_addition;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty($lp_settings['ropro_discounts_addition']) ) {\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total+= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_discount_addition_total-= $this->calc_price_with_ro_get_discount($ro_comb, $quantity);\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\n\t\t\t\t\t\t\tif ( !empty($lp_settings['ropro_specials_addition']) && $ro_comb['specials'] && $ro_comb['specials'][0] ) {\n\t\t\t\t\t\t\t\t$ro_special_row = $ro_comb['specials'][0];\n\t\t\t\t\t\t\t\tif ( $ro_comb['price_prefix'] == '+' ) {\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total+= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t} else { // -\n\t\t\t\t\t\t\t\t\t$ro_special_addition_total-= $ro_special_row['price'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t} elseif ( !empty($ro_comb['price']) && (float)$ro_comb['price'] ) {\n\t\t\t\t\t\t\t$ro_price = $ro_comb['price'];\n\t\t\t\t\t\t}\n\t\t\t\t\t//}\n\t\t\t\t\t\n\t\t\t\t\tif (isset($ro_comb['current_customer_group_special_price']) && $ro_comb['current_customer_group_special_price']) {\n\t\t\t\t\t\t$special = $ro_comb['current_customer_group_special_price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !empty($ro_settings['spec_ofs']) ) {\n\t\t\t\t\t$stock = $ro_comb['stock'];\n\t\t\t\t} elseif ( $this->config->get('config_stock_display') ) {\n\t\t\t\t\t$stock = (int)$ro_comb['quantity'];\n\t\t\t\t} else {\n\t\t\t\t\t$stock = false;\n\t\t\t\t}\n\t\t\t\t$in_stock = $ro_comb['in_stock'];\n\t\t\t}\n\t\t\t$ro_price+= $ro_price_modificator; // apply + and - modifiers at the last step (after = )\n\t\t}\n\t\treturn array('price'=>$ro_price,\n\t\t\t\t\t\t\t\t 'special'=>$special,\n\t\t\t\t\t\t\t\t 'stock'=>$stock,\n\t\t\t\t\t\t\t\t 'in_stock'=>$in_stock,\n\t\t\t\t\t\t\t\t 'price_modificator'=>$ro_price_modificator,\n\t\t\t\t\t\t\t\t 'discount_addition'=>$ro_discount_addition_total,\n\t\t\t\t\t\t\t\t 'special_addition'=>$ro_special_addition_total,\n\t\t\t\t\t\t\t\t );\n\t\t\n\t}",
"public function setBaseToOrderRate($rate);",
"public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }",
"public function applyPromotion()\n {\n $this->promotion->setOrder($this);\n }"
]
| [
"0.66205096",
"0.63782066",
"0.62608457",
"0.6247467",
"0.6152046",
"0.60483706",
"0.6009718",
"0.5935301",
"0.58970153",
"0.58650887",
"0.5856778",
"0.58481663",
"0.5845637",
"0.57789",
"0.5757204",
"0.5734323",
"0.5731829",
"0.5723026",
"0.57144916",
"0.5701318",
"0.5678779",
"0.5648059",
"0.56454515",
"0.5644807",
"0.5614338",
"0.56066203",
"0.5603926",
"0.55914146",
"0.557838",
"0.55758905"
]
| 0.73999894 | 0 |
Sets the remember cookie on a response. | public function remember(ResponseInterface $response, AccessToken $token)
{
if (! ($token instanceof RememberAccessToken)) {
trigger_error('Parameter $token of type AccessToken is deprecated in beta 16, must be instance of RememberAccessToken in beta 17', E_USER_DEPRECATED);
$token->type = 'session_remember';
$token->save();
}
return FigResponseCookies::set(
$response,
$this->cookie->make(self::COOKIE_NAME, $token->token, RememberAccessToken::rememberCookieLifeTime())
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function setCookie() {\n $response = new Response();\n $cookie = new Cookie(login_user, $this->_user, time() + 3600 * 24, '/', 'unoi.com', false, false);\n $response->headers->setCookie($cookie);\n $response->send();\n }",
"protected function setRememberMe()\n {\n $value = make_hash($this->getAuth('id'));\n $token = token(250);\n\n setcookie(\"remember_me\", $value, time()+(60*60*24*30), '/', getenv('APP_DOMAIN'));\n setcookie(\"remember_token\", $token, time()+(60*60*24*30), '/', getenv('APP_DOMAIN'));\n\n $this->update([\n $this->getAuthRememberTokenColumn() => $token,\n ], [\n $this->primary => $this->getAuth('id'),\n ]);\n }",
"protected function setRememberMeCookie(): void\n\t{\n\t\tif($this->options['cookie_options']['secure'] && !$this->request->isSecure())\n\t\t{\n\t\t\tthrow new GatekeeperException('Attempted to set a secure cookie over a non-secure connection.');\n\t\t}\n\n\t\t$this->response->getCookies()->addSigned($this->options['auth_key'], $this->user->getAccessToken(), (3600 * 24 * 365), $this->options['cookie_options']);\n\t}",
"public function set_cookie()\n {\n }",
"public static function remember_from_cookies() {\n\t\tif (isset($_COOKIE['remember']) && !(self::logged_in())) {\n\t\t\t$user_id = explode(\"==\", $_COOKIE['remember'])[0];\n\t\t\t$user = User::find_where(\"users\", array(\"id\" => $user_id));\n\t\t\t$expected = $user_id.\"==\".$user[0][\"remember_token\"];\n\t\t\tif ($user_id && $user && $expected == $_COOKIE['remember']) {\n\t\t\t\tSession::write(\"user\", $user);\n\t\t\t\t$remember_token = $user[0][\"remember_token\"];\n\t\t\t\tsetcookie(\"remember\", $user[0][\"id\"]. \"==\". $remember_token, time()+60*60*24*7);\n\t\t\t} else {\n\t\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\t}\n\t\t}\n\t}",
"private function setSession($remember)\n {\n // generate random encrypted key for validation\n $enkey = $this->_generate_enckey();\n\n if ($remember === 1) {\n // store encrypted user info in cookie\n set_cookie(array(\n 'name' => $this->config->item('auth_cookie_id'),\n 'value' => $this->_user->enc_key,\n 'expire' => $this->config->item('auth_cookie_expiry'),\n 'httponly' => TRUE\n ));\n\n // store encrypted key in cookie\n set_cookie(array(\n 'name' => $this->config->item('auth_cookie_key'),\n 'value' => $enkey,\n 'expire' => $this->config->item('auth_cookie_expiry'),\n 'httponly' => TRUE\n ));\n } else {\n // set what will be stored in the session\n $data = array(\n $this->config->item('auth_session_id') => $this->_user->enc_key,\n $this->config->item('auth_session_enkey') => $enkey\n );\n\n // store data in the session\n $this->session->set_userdata($data);\n }\n\n // add a new row in login history table and return the result\n return $this->auth_model->update_last_login($this->_user, $enkey, $remember);\n }",
"private function addCookieToResponse(Request $request, Response $response): void\n {\n $response->cookie($this->name, $this->session->id(), [\n 'expires' => 0, // Cookie expires after browser is closed\n 'encrypt' => false, // Encryption helps identify system\n 'secure' => $request->server('HTTPS') !== null,\n 'httpOnly' => true,\n 'sameSite' => 'strict' // TODO: test in different senarios\n ]);\n }",
"protected function setSessionCookie() {}",
"public function set()\n {\n setcookie($this->name, $this->value, $this->time);\n\n }",
"public static function setCookie(\n ResponseInterface $response,\n /*# string */ $name,\n /*# string */ $value = null,\n /*# int */ $ttl = null,\n /*# string */ $path = null,\n /*# string */ $domain = null,\n /*# bool */ $secure = false,\n /*# bool */ $httponly = true\n )/*# : ResponseInterface */ {\n $cookie = urlencode($name) . '=' . urlencode($value);\n\n self::addExpire($cookie, $ttl);\n\n self::addDomain($cookie, $domain);\n\n self::addPath($cookie, $path);\n\n self::addSecure($cookie, $secure);\n\n self::addHttpOnly($cookie, $httponly);\n\n return $response->withAddedHeader('Set-Cookie', $cookie);\n }",
"public function modifyResponse(string $view, Response $response): Response\n {\n $response->headers->setCookie($this->createCookie($view));\n\n return $response;\n }",
"protected function remember($token) {\n\t\t$token = Crypter::encrypt($token.'|'.Str::random(40));\n\t\t$this->cookie($this->recaller(), $token, Cookie::forever);\n\t}",
"public function setCookie($cookie) {\n //TODO: add error control when the cookie array is not valid\n if (isset($cookie[\"expires\"])) {\n $cookie[\"expires\"] = intval($cookie[\"expires\"]) * 1000;\n }\n $cookie['value'] = urlencode($cookie['value']);\n return $this->command('set_cookie', $cookie);\n }",
"private function processRememberDirective() {\n // if the user is not signed in yet\n if (!$this->isLoggedIn()) {\n // if there is currently no cookie for the 'remember me' feature\n if (!isset($_COOKIE[$this->rememberCookieName])) {\n // if an old cookie for that feature from versions v1.x.x to v6.x.x has been found\n if (isset($_COOKIE['auth_remember'])) {\n // use the value from that old cookie instead\n $_COOKIE[$this->rememberCookieName] = $_COOKIE['auth_remember'];\n }\n }\n\n // if a remember cookie is set\n if (isset($_COOKIE[$this->rememberCookieName])) {\n // assume the cookie and its contents to be invalid until proven otherwise\n $valid = false;\n\n // split the cookie's content into selector and token\n $parts = \\explode(self::COOKIE_CONTENT_SEPARATOR, $_COOKIE[$this->rememberCookieName], 2);\n\n // if both selector and token were found\n if (!empty($parts[0]) && !empty($parts[1])) {\n $rememberData = $this->CI->db\n ->query(\n 'SELECT a.user, a.token, a.expires, b.email, b.username, b.status, b.roles_mask, b.force_logout\n FROM ' . $this->makeTableName('users_remembered') . ' AS a\n JOIN ' . $this->makeTableName('users') . ' AS b ON a.user = b.id\n WHERE a.selector = ?',\n [ $parts[0] ]\n )\n ->row_array();\n\n if (!empty($rememberData)) {\n if ($rememberData['expires'] >= \\time()) {\n if (\\password_verify($parts[1], $rememberData['token'])) {\n // the cookie and its contents have now been proven to be valid\n $valid = true;\n\n $this->onLoginSuccessful($rememberData['user'], $rememberData['email'], $rememberData['username'], $rememberData['status'], $rememberData['roles_mask'], $rememberData['force_logout'], true);\n }\n }\n }\n }\n\n // if the cookie or its contents have been invalid\n if (!$valid) {\n // mark the cookie as such to prevent any further futile attempts\n $this->setRememberCookie('', '', \\time() + 60 * 60 * 24 * 365.25);\n }\n }\n }\n }",
"function mySetcookie($c){\r\n\t\tif($c['sticky'] != 1 AND $c['expires'] <= 0){\r\n\t\t\t$c['expires'] = TIMENOW + $this->vars['sessionLifetime']; //follow session option\r\n\t\t}else{\r\n\t\t\tif($c['sticky'] == 1){\r\n\t\t\t\t$c['expires'] = TIMENOW + 31536000; //365 days\r\n\t\t\t}elseif($c['expires'] > 0){\r\n\t\t\t\t$c['expires'] = TIMENOW + $c['expires'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($c['path'] == ''){\r\n\t\t\t$c['path'] = '/';\r\n\t\t}\r\n\t\tif($c['domain'] == ''){\r\n\t\t\t$c['domain'] == $_SERVER['HTTP_HOST'];\r\n\t\t}\r\n\t\t@setcookie($c['name'], $c['value'], $c['expires'], $c['path'], $c['domain']);\r\n\t}",
"public function setCookie($cookie) {\n $this->cookie = $cookie;\n }",
"function setCookies() {\r\n\t\t//cookies are set to 1 month, or 30 days, from now.\r\n\t\tsetcookie(\"phoneNumber\", $this->phone_number, time() + (60 * 60 * 24 * 30));\r\n\t\tsetcookie(\"email\", $this->email, time() + (60 * 60 * 24 * 30));\r\n\t}",
"function remember($username, $password) \r\n {\r\n \tif(strlen($password) < 25) {\r\n \t\t$password = AuthComponent::password($password);\r\n \t}\r\n \t\r\n $cookie = array(); \r\n $cookie[$this->Auth->fields['username']] = $username; \r\n $cookie[$this->Auth->fields['password']] = $password; \r\n \r\n $this->writeCookie($cookie);\r\n }",
"static function viaRemember()\n\t{\n\t\treturn self::$cookie;\n\t}",
"public function setRememberToken(string $value);",
"private function setToken() {\n $this->admin->rememberToken = password_hash($this->admin->username.generateSalt().time().generateSalt(), PASSWORD_DEFAULT);\n\n setcookie(\"adminUsername\", $this->admin->username, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n setcookie(\"adminToken\", $this->admin->rememberToken, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n\n $_SESSION['adminRemember'] = true;\n }",
"public function store()\n {\n return response('200')->cookie(\n 'cookie-popup',\n 'checked',\n time() + (365 * 24 * 60 * 60)\n );\n }",
"public function setRememberToken($value)\n {\n }",
"public function setRememberToken($value)\n {\n }",
"public function setRememberToken($value)\n {\n }",
"public function setRememberToken($value)\n {\n }",
"public function set_remember_cookie( $user ) {\n\n\t\tif ( ! $token = ITSEC_Lib::generate_token() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $hashed = ITSEC_Lib::hash_token( $token ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$expires = ITSEC_Core::get_current_time_gmt() + MONTH_IN_SECONDS;\n\n\t\tif ( ! add_user_meta( $user->ID, self::REMEMBER_META_KEY, $data = compact( 'hashed', 'expires' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tITSEC_Log::add_debug( 'two_factor', 'remember_generated', $data, array( 'user_id' => $user->ID ) );\n\n\t\treturn setcookie( self::REMEMBER_COOKIE, $token, $expires, ITSEC_Lib::get_home_root(), COOKIE_DOMAIN, is_ssl(), true );\n\t}",
"public function clear_remember_cookie() {\n\t\treturn setcookie( self::REMEMBER_COOKIE, ' ', ITSEC_Core::get_current_time_gmt() - YEAR_IN_SECONDS, ITSEC_Lib::get_home_root(), COOKIE_DOMAIN, is_ssl(), true );\n\t}",
"public function setRememberToken($value)\n\t{\n\t\t$this->remember_token = $value;\n\t}",
"public function setRememberToken($value)\n\t{\n\t\t$this->remember_token = $value;\n\t}"
]
| [
"0.7340634",
"0.7018385",
"0.6920309",
"0.6896249",
"0.68249524",
"0.6551554",
"0.65460366",
"0.6421704",
"0.64086604",
"0.632997",
"0.63134307",
"0.6309957",
"0.63045454",
"0.629619",
"0.6291996",
"0.6279641",
"0.6273503",
"0.6272951",
"0.6272082",
"0.6263274",
"0.61910534",
"0.6178502",
"0.6178426",
"0.6178426",
"0.6178426",
"0.6178426",
"0.6176457",
"0.6149878",
"0.6147384",
"0.6147384"
]
| 0.71953785 | 1 |
Get wifi AP list of a room | public function actionRoomGetApList($roomId) {
if (Room::get($roomId) === null) {
throw new RException("Room not exist");
}
$roomApList = RoomApList::find("roomId", $roomId)->first();
if ($roomApList === null) {
$roomApList = new RoomApList();
$roomApList->roomId = $roomId;
}
$roomApList->apList = array();
// First method: Get AP list from original wifi fingerprint
/*
$wifiFingerPrint = WifiFingerprint::find("roomId", $roomId)->all();
foreach ($wifiFingerPrint as $point) {
$point->unpack();
foreach ($point->wifiData as $wifiScanItem) {
foreach ($wifiScanItem as $bssidrssiPair) {
array_push($roomApList->apList, $bssidrssiPair->bssid);
}
}
}*/
// Second method: Get AP from distribution after filtering out temperate aps
$distribution = WifiRssiDistribution::find("roomId", $roomId)->all();
foreach ($distribution as $item) {
array_push($roomApList->apList, $item->bssid);
}
$roomApList->apList = array_unique($roomApList->apList);
$roomApList->pack();
$roomApList->save();
echo json_encode(array("response" => "ok"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getApnList()\n {\n \t$activeApn = $this->getApn();\t//get the current apn being used by the device\n \tdebug('(cell_controller.inc|getApnList()) current apn being used on the device'.$activeApn); \t\t\t\t//DEBUG\n \t\n \t$sh_args = 'getapnlist';\t\t//admin client command for getting secondary apn list\n \t$sh_out = atsexec(escapeshellcmd($sh_args));\t//socket call\n \tdebug('(cell_controller.inc|getApnList()) admin client api command getapnlist output: sh_out', $sh_out); \t//DEBUG\n \t\n \tif(($sh_out != 'phpcmd: fail') && ($sh_out != 'phpcmd: invalid command'))\n \t{\n \t\t$xml = new SimpleXMLElement($sh_out);\t//create SimpleXML object\n\t \t$html =''; \t\t\t\t\t\t\t\t\t//store the html markup\n\t \tdebug('(cell_controller.inc|getApnList()) apn list converted into SimpleXMLElement object '.$xml); \t\t//DEBUG\n\t \t\n\t \tforeach($xml->network as $network)\t\t\t\n\t \t{\n\t \t\t$html .= '<optgroup label=\"'.$network->attributes()->name.'\">';\t \t\t//create Carrier section\n\t \t\tforeach ($network->apn as $apn)\t\t\t\t\t\t\t\t\t\t\t//group apns under each Carrier\n\t \t\t{\n\t \t\t\tdebug('(cell_controller.inc|getApnList()) $apn '.$apn); \t\t//DEBUG\n\t \t\t\t$html .= '<option '.((strcasecmp($apn,$activeApn) == 0) ? 'selected=\"selected\"':'').' value=\"'.$apn.'\">'.$apn.'</option>';\n\t \t\t}\n\t \t\t$html .= '</optgroup>';\n\t \t}\n\n\t \treturn $html;\n \t}\n \telse\n \t{\n \t\treturn '<option value=\"\">Failed to retrieve APN list</option>';\n \t}\n }",
"public static function getPlacesByWiFi() {\n\t\t$sql = \"SELECT * FROM Buildings WHERE wifi = 'Y' GROUP BY name ORDER BY name ASC\";\n\t\t$places = self::getPlaces($sql);\n\t\t$convertedPlaces = self::convertPlaces($places);\n\t\treturn $convertedPlaces;\n\t}",
"public function get_wifi_name()\n {\n $out = array();\n $sql = \"SELECT COUNT(CASE WHEN ssid <> '' AND ssid IS NOT NULL THEN 1 END) AS count, ssid \n FROM wifi\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter().\"\n GROUP BY ssid\n ORDER BY count DESC\";\n \n foreach ($this->query($sql) as $obj) {\n if (\"$obj->count\" !== \"0\") {\n $obj->ssid = $obj->ssid ? $obj->ssid : 'Unknown';\n $out[] = $obj;\n }\n }\n \n return $out;\n }",
"public function get_rooms()\n\t\t{\n\t\t\t$this->db->where(\"room_active\",1);\n\t\t\t$rooms = $this->db->get(\"rooms\");\n\t\t\treturn $rooms;\n\t\t}",
"public function getOnlineDeviceList(){\n $query = \"select * from $this->onlineDevice_tableName\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0 ){\n return $result->fetchAll();\n }\n return null;\n }",
"function getconnectedAP()\n {\n $arMatches = array();\n \n exec( $this->arfilelocation['iwconfig'] . ' '\n . escapeshellarg($this->interface), $arMatches );\n\n $essidreg = '/ESSID:\"([^\"]+)\"/';\n\n $match = array();\n if(preg_match($essidreg, $arMatches[0], $match))\n return $match[1];\n else\n return '';\n }",
"public function get_connections() {\n\t\t$sql = \"SELECT `id` FROM `devices` WHERE `tech` <> 'custom'\";\n\t\t$alldevices = FreePBX::create()->Database->query($sql)->fetchAll(PDO::FETCH_COLUMN, 0);\n\t\t$devices = array_flip($alldevices);\n\n\t\t$protocols = array(\"sip\", \"iax2\", \"pjsip\");\n\t\t$vars = array(\n\t\t\t\"users_online\", \"users_offline\", \"users_total\",\n\t\t\t\"trunks_online\", \"trunks_offline\", \"trunks_total\",\n\t\t\t\"registrations_online\", \"registrations_offline\", \"registrations_total\",\n\t\t);\n\n\t\t// Build array to return\n\t\tforeach ($protocols as $p) {\n\t\t\tforeach ($vars as $v) {\n\t\t\t\t$retarr[$p.\"_\".$v] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Add Totals\n\t\tforeach ($vars as $v) {\n\t\t\t$retarr[$v] = 0;\n\t\t}\n\n\t\tif (!$this->astman) {\n\t\t\treturn $retarr;\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"sip show peers\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$blacklist = \\FreePBX::Dashboard()->extIgnoreList();\n\t\tforeach ($astout as $line) {\n\t\t\t// Previous bug IRT trunks starting or ending with /'s here. Investigate.\n\t\t\t$exploded = preg_split('/\\s+/', $line);\n\t\t\tif (strpos($exploded[0], '/') === false) {\n\t\t\t\t$name = $exploded[0];\n\t\t\t} else {\n\t\t\t\tlist($name, $null) = explode('/', $exploded[0]);\n\t\t\t}\n\t\t\t//prefix blacklist\n\t\t\tforeach($blacklist as $num)\n\t\t\tif(substr($name,0,$num['length']) == $num['value'] && $name !== $num['value']){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// How to we see if a trunk is down?\n\t\t\tif ( $exploded[1] == \"(Unspecified)\" || // No IP Address\n\t\t\t\t$exploded[5] == \"UNREACHABLE\" || $exploded[6] == \"UNREACHABLE\") {\n\t\t\t\t// This is a device that's down\n\t\t\t\tif (!isset($devices[$name])) {\n\t\t\t\t\t// It is, actually a TRUNK that's down.\n\t\t\t\t\t$retarr['sip_trunks_offline']++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['sip_users_offline']++;\n\t\t\t\t}\n\t\t\t} elseif (filter_var($exploded[1], FILTER_VALIDATE_IP)) {\n\t\t\t\t// This is a device that's up.\n\t\t\t\tif (!isset($devices[$name])) {\n\t\t\t\t\t$retarr['sip_trunks_online']++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['sip_users_online']++;\n\t\t\t\t}\n\t\t\t} // else it's not a device.\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"sip show registry\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$pos = false;\n\t\tforeach ($astout as $line) {\n\t\t\tif (trim($line) != '') {\n\t\t\t\tif ($pos===false) {\n\t\t\t\t\t// find the position of \"State\" in the first line\n\t\t\t\t\t$pos = strpos($line,\"State\");\n\t\t\t\t} else {\n\t\t\t\t\t// subsequent lines, check if it says \"Registered\" at that position\n\t\t\t\t\tif (substr($line,$pos,10) == \"Registered\") {\n\t\t\t\t\t\t$retarr['sip_registrations_online']++;\n\t\t\t\t\t} elseif (strlen($line) > $pos) {\n\t\t\t\t\t\t$retarr['sip_registrations_offline']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"iax2 show peers\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\tforeach ($astout as $line) {\n\t\t\tif (preg_match('/^(([a-z0-9\\-_]+)(\\/([a-z0-9\\-_]+))?)\\s+(\\([a-z]+\\)|\\d{1,3}(\\.\\d{1,3}){3})/i', $line, $matches)) {\n\t\t\t\t//matches: [2] = name, [4] = username, [5] = host, [6] = part of ip (if IP)\n\n\t\t\t\t// have an IP address listed, so its online\n\t\t\t\t$online = !empty($matches[6]);\n\n\t\t\t\tif (!isset($devices[$matches[2]])) {\n\t\t\t\t\t// this is a trunk\n\t\t\t\t\t//TODO match trunk tech as well?\n\t\t\t\t\t$retarr['iax2_trunks_'.($online?'online':'offline')]++;\n\t\t\t\t} else {\n\t\t\t\t\t$retarr['iax2_users_'.($online?'online':'offline')]++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"iax2 show registry\"));\n\t\t$astout = explode(\"\\n\",$response['data']);\n\t\t$pos = false;\n\t\tforeach ($astout as $line) {\n\t\t\tif (trim($line) != '') {\n\t\t\t\tif ($pos===false) {\n\t\t\t\t\t// find the position of \"State\" in the first line\n\t\t\t\t\t$pos = strpos($line,\"State\");\n\t\t\t\t} else {\n\t\t\t\t\t// subsequent lines, check if it syas \"Registered\" at that position\n\t\t\t\t\tif (substr($line,$pos,10) == \"Registered\") {\n\t\t\t\t\t\t$retarr['iax2_registrations_online']++;\n\t\t\t\t\t} elseif (strlen($line) > $pos) {\n\t\t\t\t\t\t$retarr['iax2_registrations_offline']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$response = $this->astman->send_request('Command',array('Command'=>\"pjsip show endpoints\"));\n\t\t// This is an amazingly awful format to parse.\n\t\t$lines = explode(\"\\n\", $response['data']);\n\t\t$inheader = true;\n\t\t$istrunk = $isendpoint = false;\n\t\tforeach ($lines as $l) {\n\t\t\tif ($inheader) {\n\t\t\t\tif (isset($l[1]) && $l[1] == \"=\") {\n\t\t\t\t\t// Last line of the header.\n\t\t\t\t\t$inheader = false;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$l = trim($l);\n\t\t\tif (!$l) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If we have a line starting with 'Endpoint:' then we found one!\n\t\t\tif (strpos($l, \"Endpoint:\") === 0) {\n\t\t\t\tif (preg_match(\"/Endpoint:\\s+(.+)\\/(.+?)\\b\\s+(.+)/\", $l, $out)) {\n\t\t\t\t\t// Found a device\n\t\t\t\t\t$isendpoint = $out[1];\n\t\t\t\t\t$istrunk = false;\n\t\t\t\t\tif (isset($out[3]) && strpos($out[3], \"Unavail\") === 0) {\n\t\t\t\t\t\t// Unavailable endpoint.\n\t\t\t\t\t\t$retarr['pjsip_users_offline']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$retarr['pjsip_users_online']++;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif (preg_match(\"/Endpoint:\\s+(.+?)\\b/\", $l, $out)) {\n\t\t\t\t\t// Found a trunk\n\t\t\t\t\t$isendpoint = false;\n\t\t\t\t\t$istrunk = $out[1];\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\Exception(\"Unable to parse endpoint $l\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If we have a Contact: line, then that's something that's registered!\n\t\t\tif (strpos($l, \"Contact:\") === 0) {\n\t\t\t\tif ($isendpoint !== false) {\n\t\t\t\t\t// This is a registered endpoint\n\t\t\t\t\t$retarr['pjsip_registrations_online']++;\n\t\t\t\t} elseif ($istrunk !== false) {\n\t\t\t\t\t// Trunk status... Check for 'avail'\n\t\t\t\t\tif (strpos($l, \"Avail \") === false) {\n\t\t\t\t\t\t// Trunk down.\n\t\t\t\t\t\t$retarr['pjsip_trunks_offline']++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$retarr['pjsip_trunks_online']++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new \\Exception(\"Found a contact before I figured out what it is!\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Now figure out the totals.\n\t\tforeach ($protocols as $p) {\n\t\t\t$users = $retarr[$p.\"_users_online\"]+$retarr[$p.\"_users_offline\"];\n\t\t\t$retarr[$p.\"_users_total\"] = $users;\n\n\t\t\t$trunks = $retarr[$p.\"_trunks_online\"]+$retarr[$p.\"_trunks_offline\"];\n\t\t\t$retarr[$p.\"_trunks_total\"] = $trunks;\n\n\t\t\t$regs = $retarr[$p.\"_registrations_online\"]+$retarr[$p.\"_registrations_offline\"];\n\t\t\t$retarr[$p.\"_registrations_total\"] = $regs;\n\t\t}\n\n\t\tforeach ($vars as $v) {\n\t\t\tforeach ($protocols as $p) {\n\t\t\t\t$retarr[$v] += $retarr[$p.\"_\".$v];\n\t\t\t}\n\t\t}\n\n\t\treturn $retarr;\n\t}",
"public function roomList()\n\t{\n\t\techo json_encode($this->room_list->fetchData());\n\t}",
"public static function muc_online_rooms($host = 'global') {\n\t\treturn self::runCommand(\"muc_online_rooms \". escapeshellarg($host));\n\t}",
"function get_padlist() \n {\n $MYSQL_SERVER = \"localhost\";\n $MYSQL_USER = \"etherpad\";\n $MYSQL_PASS = \"eth3r!pad!\";\n $MYSQL_DB = \"etherpad\";\n \n \n $con=mysqli_connect($MYSQL_SERVER,$MYSQL_USER,$MYSQL_PASS,$MYSQL_DB);\n // Check connection\n $cont = \"\";\n if (mysqli_connect_errno())\n {\n $cont .= \"Failed to connect to MySQL: \" . mysqli_connect_error();\n }\n\n $result = mysqli_query($con,'select distinct substring(store.key,5,locate(\":\",store.key,5)-5) AS pads from store where store.key like \"pad:%\"');\n\n while($row = mysqli_fetch_array($result))\n {\n $cont .= '<div class=\"etherpad-item\"><a href=\"http://stura.hft-leipzig.de/pad/'.$row['pads'].'\" target=\"_blank\">' . $row['pads'] . '</a></div>';\n }\n\n mysqli_close($con);\n \n return $cont;\n }",
"public function listRooms()\n\t{\n\t\treturn $this->execute('roomlist', 'roomlist');\n\t}",
"function rooms_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n \n // Load the device model\n $this->load->model('device_model');\n\n if($this->get('id')){\n $roomList = $this->device_model->getAvailableRooms($this->get('id'));\n }else{\n $roomList = $this->device_model->getAvailableRooms();\n }\n\n // If the deviceList is not FALSE or NULL\n if($roomList){\n $this->response($roomList, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }",
"public function actionRpGetApList($roomId) {\n\t\tif (Room::get($roomId) === null) {\n\t\t\tthrow new RException(\"Room not exist\");\n\t\t}\n\n\t\t$roomRpList = RoomRpList::find(\"roomId\", $roomId)->first();\n\t\tif (Room::get($roomId) === null) {\n\t\t\tthrow new RException(\"Room rp list not created\");\n\t\t}\n\t\t$roomRpList->unpack();\n\t\tforeach ($roomRpList->rpList as $rp) {\n\t\t\t$rpApList = RpApList::getRpApList($roomId, $rp->x, $rp->y, $rp->z);\n\t\t\tif ($rpApList === null) {\n\t\t\t\t$rpApList = new RpApList();\n\t\t\t\t$rpApList->roomId = $roomId;\n\t\t\t\t$rpApList->x = $rp->x;\n\t\t\t\t$rpApList->y = $rp->y;\n\t\t\t\t$rpApList->z = $rp->z;\n\t\t\t}\n\t\t\t$rpApList->apList = array();\n\n\t\t\t$distribution = WifiRssiDistribution::getWifiRssiDistribution($roomId, $rp->x, $rp->y, $rp->z);\n\t\t\tforeach ($distribution as $item) {\n\t\t\t\tarray_push($rpApList->apList, $item->bssid);\n\t\t\t}\n\n\t\t\t$rpApList->apList = array_unique($rpApList->apList);\n\t\t\t$rpApList->pack();\n\t\t\t$rpApList->save();\n\t\t}\n\n\t\techo json_encode(array(\"response\" => \"ok\"));\n\t}",
"function getAPinfo()\n\t{\n\t\t$wifi_dat = file($this->confpath);\t\t//open the conf file for reading\n\t\tdebug('(wifi_controller.inc|getAPinfo()) reading wifi conf file at: '.$this->confpath); \t//LOG\n\t\t\n\t\t$ap_data = array();\n\t\t\n\t\tif($wifi_dat)\n\t\t{\n\t\t\tforeach ($wifi_dat as $data)\n\t\t\t{\n\t\t\t\tif(strpos($data,\"SSID=\") === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$ssid = explode('=', $data);\r\n\t\t\t\t\t$ap_data['ssid'] = trim($ssid[1]);\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(strpos($data,\"AuthMode=\") === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$auth = explode('=', $data);\r\n\t\t\t\t\t$ap_data['auth'] = trim($auth[1]);\r\n\t\t\t\t}\n\t\t\t\tif(strpos($data,\"EncrypType=\") === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$encryp = explode('=', $data);\n\t\t\t\t\t$ap_data['encryp'] = trim($encryp[1]);\r\n\t\t\t\t}\r\n\t\t\t\tif(strpos($data,\"Key1Str=\") === 0 && (strcasecmp($ap_data['encryp'],'WEP') == 0))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pass = explode('=', $data);\n\t\t\t\t\t$ap_data['pass'] = $pass[1];\r\n\t\t\t\t}\n\t\t\t\tif(strpos($data,\"WPAPSK=\") === 0 && ((strcasecmp($ap_data['encryp'],'TKIP') == 0) || (strcasecmp($ap_data['encryp'],'AES') == 0) || (strcasecmp($ap_data['encryp'],'TKIPAES') == 0)))\n\t\t\t\t{\n\t\t\t\t\t$pass = explode('=', $data);\n\t\t\t\t\t$ap_data['pass'] = $pass[1];\n\t\t\t\t} \n\t\t\t\tif(strpos($data,\"Channel=\") === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$channel = explode('=', $data);\r\n\t\t\t\t\t$ap_data['channel'] = trim($channel[1]);\r\n\t\t\t\t}\n\t\t\t}\n\t\t} //END if\n\t\tdebug('(wifi_controller.inc|getAPinfo()) wifi ap data read from conf file', $ap_data); \t//LOG\n\t\treturn $ap_data;\n\t}",
"public function onDevices()\n {\n return $this->hasMany('App\\Device', 'ROOM_ID')->where('ONLINE_FLAG',1);\n }",
"abstract public function listDevices();",
"public function getAllRoom(){\n $query = \"select * from $this->rooms_tableName where 1\";\n $result = $this->dbh->query($query);\n if($result->rowCount() > 0){\n return $result->fetchAll();\n }\n return null;\n }",
"function getRooms($id) {\n\t\t$query = \"SELECT node FROM sentinels WHERE profId='$id' AND deleted!='1' ORDER BY timeBuilt DESC\";\n\n\t\t$dbc = connect_to_db();\n\t\t$result = perform_query($dbc, $query);\n\n\t\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t\t$online[] = $row;\n\t\t}\n\t\tdisconnect_from_db($dbc, $result);\n\n\t\t$resultAr = array();\n\t\tif (!empty($online)) {\n\t\t\tforeach ($online as $a => $b) {\n\t\t\t\tforeach ($b as $c => $a) {\n\t\t\t\t\tarray_push($resultAr, $b[$c]);\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\t\treturn $resultAr;\n\t}",
"public static function list_devices()\n {\n return self::$devices;\n }",
"public function getOnlineList()\n {\n $online = [];\n if ( $this->online )\n {\n $id = 0;\n $pack = pack( 'N*', -1, 1, $id ) . $this->gamed->packString( '1' );\n $pack = $this->gamed->createHeader( 352, $pack );\n $send = $this->gamed->SendToDelivery( $pack );\n $data = $this->gamed->deleteHeader($send);\n $data = $this->gamed->unmarshal( $data, $this->data['RoleList'] );\n\n if ( isset( $data['users'] ) )\n {\n foreach ( $data['users'] as $user )\n {\n $online[] = $user;\n //$id = $this->gamed->MaxOnlineUserID( $data['users'] );\n }\n }\n }\n return $online;\n }",
"public function getAllOnline()\n {\n return $this->query()->online()->get();\n }",
"public function showRooms()\n {\n $roomModel = new \\BAServer\\Models\\Room();\n $rooms = $roomModel->getRooms();\n\n var_dump($rooms);\n return 'Rooms';\n }",
"function common_wlan_scan(){\r\n\tglobal $text;\r\n\t//get output dari iwlist\r\n\t$iw_ssid = shell_exec('sudo /sbin/iwlist wlan0 scan');\r\n\t$iw_mac = $iw_ssid;\r\n\t$iw_quality = $iw_ssid;\r\n\t\r\n\t$iw_ssid = explode('ESSID:\"', $iw_ssid);\r\n\t$iw_mac = explode('Address:', $iw_mac);\r\n\t$iw_quality = explode('Quality=', $iw_quality);\r\n\t\r\n\t//get sssid\r\n\t$data_ssid = array();\r\n\t$counter = 0;\r\n\tforeach($iw_ssid as $ssid){\r\n\t\t$tmp = explode('\"',$ssid);\r\n\t\tif(!empty($tmp[0]) && $counter != 0){\r\n\t\t\t$data_ssid[] = $tmp[0];\r\n\t\t}\r\n\t\t$counter++;\r\n\t}\r\n\t\r\n\t//get mac address\r\n\t$data_mac = array();\r\n\t$counter = 0;\r\n\tforeach($iw_mac as $mac){\r\n\t\t$tmp = explode(' ',$mac);\r\n\t\tif(!empty($tmp[1]) && $counter != 0){\r\n\t\t\t$data_mac[] = $tmp[1];\r\n\t\t}\r\n\t\t$counter++;\r\n\t}\r\n\t\r\n\t//get kekuatan sinyal\r\n\t$data_quality = array();\r\n\t$counter = 0;\r\n\tforeach($iw_quality as $signal){\r\n\t\t$tmp = explode(' ',$signal);\r\n\t\tif(!empty($tmp[0]) && $counter != 0){\r\n\t\t\t$tmpb = explode('/',$tmp[0]);\r\n\t\t\t$a = $tmpb[0];\r\n\t\t\t$b = $tmpb[1];\r\n\t\t\t$c = number_format(($a/$b) * 100,0,',','.');\r\n\t\t\t$data_quality[] = $c;\r\n\t\t}\r\n\t\t$counter++;\r\n\t}\r\n\t\r\n\t$result = array(\r\n\t\t'ssid' \t\t=> $data_ssid,\r\n\t\t'mac' \t\t=> $data_mac,\r\n\t\t'signal'\t=> $data_quality\r\n\t);\t\r\n\treturn $result;\r\n}",
"public function getOnlineAccountList() {\n\t\t$result = $this->db->queryFetch(\"SELECT * FROM \"._TBL_MS_.\" WHERE \"._CLMN_CONNSTAT_.\" = ?\", array(1));\n\t\tif(!is_array($result)) return;\n\t\treturn $result;\n\t}",
"public function getAllRooms()\n {\n $db = PDOController::getInstance();\n $req = $db->prepare('SELECT roomtypes.name, rooms.id, rooms.name AS roomName, services.name AS serviceName\n FROM rooms JOIN roomtypes ON roomtypes.id= rooms.type_id\n JOIN services ON services.id=rooms.service_id');\n $req->execute([]);\n \n return $req->fetchAll();\n }",
"public function prepare_getVillaRoomList($params)\n\t{\n\t\t$xml_string = \"strVillaID=\".$params['strVillaID'].\"\";\n\t\treturn $xml_string;\n\t}",
"function devices_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n // Load the device model\n $this->load->model('device_model');\n\n // If the optional roomid parameter is supplied\n if($this->get('roomid')){\n // Get the devices from particular room\n $deviceList = $this->device_model->getAvailableDevicesByRoom( $this->get('roomid') );\n }else{\n // Get the from all rooms\n $deviceList = $this->device_model->getAvailableDevices();\n }\n\n // If the deviceList is not FALSE or NULL\n if($deviceList){\n $this->response($deviceList, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }",
"function getRooms(){\n\t\t$stmt = $this->connect->prepare(\"SELECT id,Name,RoomNo, Description from roominfo\");\n\t\t$stmt->execute();\n\t\t$stmt->bind_result($id, $name, $RoomNo, $Description);\n\t\t\n\t\t$rooms = array(); \n\t\t\n\t\twhile($stmt->fetch()){\n\t\t\t$room = array();\n\t\t\t$room['id'] = $id; \n\t\t\t$room['Name'] = $name; \n\t\t\t$room['RoomNo'] = $RoomNo; \n $room['Description'] = $Description; \n\t\t\tarray_push($rooms, $room); \n\t\t}\n\t\t\n\t\treturn $rooms; \n\t}",
"public function index()\n\t{\n\t\treturn $this->room->all();\n\t}",
"public function detectWifiChannelAction(Request $request){\n $iwinfo='wlan0 ESSID: \" Wifi HotSpot 2\" Access Point: D4:6E:0E:7D:BF:56 Mode: Master Channel: 8 (2.447 GHz) Tx-Power: unknown Link Quality: unknown/70 Signal: unknown Noise: unknown Bit Rate: unknown Encryption: WPA2 PSK (CCMP) Type: nl80211 HW Mode(s): 802.11bgn Hardware: unknown [Generic MAC80211] TX power offset: unknown Frequency offset: unknown Supports VAPs: yes PHY name: phy0 Cell 01 - Address: 9C:50:EE:29:43:9C ESSID: \"Anh Quoc\" Mode: Master Channel: 1 Signal: -74 dBm Quality: 36/70 Encryption: mixed WPA/WPA2 PSK (TKIP, CCMP) Cell 02 - Address: 9C:50:EE:1C:AF:3C ESSID: \"Su Bin\" Mode: Master Channel: 1 Signal: -90 dBm Quality: 20/70 Encryption: mixed WPA/WPA2 PSK (TKIP, CCMP) Cell 03 - Address: C4:A3:66:F8:1E:24 ESSID: \"Khong biet\" Mode: Master Channel: 2 Signal: -85 dBm Quality: 25/70 Encryption: mixed WPA/WPA2 PSK (CCMP) Cell 04 - Address: F4:F2:6D:FD:27:8E ESSID: \" Wifi Hotspot\" Mode: Master Channel: 3 Signal: -12 dBm Quality: 70/70 Encryption: none Cell 05 - Address: C6:E9:84:F0:69:4C ESSID: \"Wifi\" Mode: Master Channel: 8 Signal: -39 dBm Quality: 70/70 Encryption: WPA2 PSK (CCMP) Cell 06 - Address: A0:65:18:3E:D3:4E ESSID: \"Chau sa\" Mode: Master Channel: 7 Signal: -78 dBm Quality: 32/70 Encryption: WPA2 PSK (CCMP) Cell 07 - Address: 92:F6:52:21:57:B6 ESSID: \"Wifi\" Mode: Master Channel: 8 Signal: -71 dBm Quality: 39/70 Encryption: WPA2 PSK (CCMP) Cell 08 - Address: 62:65:18:07:82:E4 ESSID: \"PPPOE\" Mode: Master Channel: 8 Signal: -9 dBm Quality: 70/70 Encryption: none Cell 09 - Address: A0:65:18:07:82:E5 ESSID: unknown Mode: Master Channel: 8 Signal: -8 dBm Quality: 70/70 Encryption: mixed WPA/WPA2 PSK (TKIP, CCMP) Cell 10 - Address: 00:1C:E0:54:3D:47 ESSID: \"BICH THAO\" Mode: Master Channel: 13 Signal: -70 dBm Quality: 40/70 Encryption: mixed WPA/WPA2 PSK (CCMP)';\n $matches=array();\n $iwinfo= str_replace(\"unknown/70\", \"0/70\", $iwinfo);\n preg_match_all(\"/Channel:\\s+(\\d+)/\", $iwinfo, $matches);\n if(count($matches)<2) return new Response(serialize(array('0',\"option channel auto\")));\n $channels=$matches[1];\n if(count($channels)<2) return new Response(serialize(array('0',\"option channel auto\")));\n //\n preg_match_all(\"/Quality:\\s+(\\d+)/\", $iwinfo, $matches);\n if(count($matches)<2) return new Response(serialize(array('0',\"option channel auto\")));\n $qualities=$matches[1];\n if(count($qualities)<2) return new Response(serialize(array('0',\"option channel auto\")));\n //\n\n $qualities[0]=\"0\";\n $currentWifiChannel=$channels[0];\n unset($channels[0]);\n unset($qualities[0]);\n arsort($qualities);\n $suppress=true;\n $threshold=30;\n\n if(count($qualities)>10) $threshold=35;\n if(count($qualities)>15) $threshold=40;\n while($suppress==true && count($qualities)>0){\n $index=array_search(min($qualities), $qualities);\n if(intval($qualities[$index])<intval($threshold)){\n unset($qualities[$index]);\n unset($channels[$index]);\n }\n else{\n $suppress=false;\n }\n }\n if(count($qualities)==0) return new Response(serialize(array('0',\"option channel auto\")));\n $range=array(1,2,3,4,5,6,7,8,9,10,11);\n $possible=array_diff($range,$channels);\n if(empty($possible)){\n $currentWifiChannel=$channels[array_search(min($qualities), $qualities)];\n dump( array('1',\"option channel \".$currentWifiChannel));\n }\n elseif(false===array_search($currentWifiChannel, $possible)){\n dump(array('1',\"option channel \".min($possible)));\n\n }\n else{\n dump(array('0',\"option channel auto\"));\n }\n\n return new Response('<html></html>');\n }"
]
| [
"0.6101868",
"0.6091867",
"0.59596974",
"0.5951872",
"0.5898301",
"0.58981127",
"0.58890194",
"0.58882856",
"0.58540964",
"0.58312696",
"0.58200306",
"0.58151156",
"0.57952356",
"0.57654935",
"0.57170105",
"0.5487522",
"0.5479854",
"0.5475225",
"0.5395573",
"0.53636783",
"0.5339427",
"0.53297013",
"0.5314421",
"0.53134567",
"0.5295509",
"0.5276499",
"0.52747613",
"0.5251583",
"0.52513885",
"0.5232804"
]
| 0.66659236 | 0 |
Generate the desired repository interface. | protected function makeRepositoryInterface()
{
if ($this->files->exists($path = $this->getInterfacePath())) {
return $this->error($this->classParts() . 'Interface already exists!');
}
$this->makeDirectory($path);
$this->files->put($path, $this->compileInterfaceStub());
$this->info('Repository Interface created successfully.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getRepository();",
"abstract public function getRepository();",
"abstract protected function getRepository();",
"public abstract function getRepository();",
"protected function getRepository() {}",
"protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }",
"abstract public function repository();",
"public function getRepository();",
"public function repository()\n {\n return GenreRepositoryInterface::class;\n }",
"public function createRepository()\n {\n if (!interface_exists('Puli\\Repository\\Api\\ResourceRepository')) {\n throw new RuntimeException('Please install puli/repository to create ResourceRepository instances.');\n }\n\n $repo = new JsonRepository(__DIR__.'/path-mappings.json', __DIR__.'/..', true);\n\n return $repo;\n }",
"function repositoryCustom()\n {\n }",
"public function repository(): RepositoryContract;",
"abstract protected function getRepositoryName();",
"public function getRepository(string $className): IRepository;",
"public function repository()\n {\n return Repository::i();\n }",
"protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }",
"private function createRepositoryDefinition()\n {\n $id = $this->getServiceId('repository');\n if (!$this->container->has($id)) {\n $definition = new Definition($class = $this->getServiceClass('repository'));\n $definition->setArguments([\n new Reference($this->getServiceId('manager')),\n new Reference($this->getServiceId('metadata'))\n ]);\n if (is_array($this->options['translation'])) {\n $definition\n ->addMethodCall('setLocaleProvider', [new Reference('ekyna_core.locale_provider.request')]) // TODO alias / configurable ?\n ->addMethodCall('setTranslatableFields', [$this->options['translation']['fields']])\n ;\n }\n $this->container->setDefinition($id, $definition);\n }\n }",
"protected function compileRepositoryStub()\n {\n $stub = $this->files->get(__DIR__ . '/stubs/repository.stub');\n $this\n ->replaceAppNamespace($stub)\n ->replaceClassName($stub)\n ->replaceEntityName($stub);\n\n return $stub;\n }",
"public function getRepository($className);",
"public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }",
"protected function compileInterfaceStub()\n {\n $stub = $this->files->get(__DIR__ . '/stubs/repository-interface.stub');\n $this\n ->replaceAppNamespace($stub)\n ->replaceClassName($stub)\n ->replaceEntityName($stub);\n\n return $stub;\n }",
"public function createRepository()\n {\n $schema = $this->getConnection()->getSchemaBuilder();\n\n $schema->create($this->table, function ($table) {\n $table->increments('id');\n $table->string('plugin');\n $table->string('migration');\n $table->integer('batch');\n });\n }",
"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 getRepository(): EntityRepository;",
"public function getRepository(){\n return $this->repository;\n }",
"protected function getDefaultStubName()\n {\n return 'repository';\n }",
"protected function getInterfacesStub()\n {\n return __DIR__.'/../stubs/repository.interface.stub';\n }",
"public function initRepository(): void;",
"protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }",
"public function findOneTypo3OrgRepository() {}"
]
| [
"0.6903667",
"0.6903667",
"0.6869004",
"0.67828953",
"0.66138655",
"0.658999",
"0.6575007",
"0.6565357",
"0.6488982",
"0.63568676",
"0.6350663",
"0.63174576",
"0.614974",
"0.6013378",
"0.6006632",
"0.59842753",
"0.5977535",
"0.5906042",
"0.5851541",
"0.5829884",
"0.58255273",
"0.5792098",
"0.5781076",
"0.5739732",
"0.57015413",
"0.5697236",
"0.56887335",
"0.56518173",
"0.56359",
"0.5598347"
]
| 0.7097743 | 0 |
Get the path to where we should create the repository. | protected function getRepositoryPath()
{
return './app/Repositories/' . $this->className . '.php';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getRepositoryPath()\n {\n $vendorDirectory = $this->getVendorDirectory();\n\n // @CHECKME: Couldn't this code break if a custom `vendor-dir` is used?\n $parts = explode(DIRECTORY_SEPARATOR, $vendorDirectory);\n array_pop($parts); // Remove 'vendor'\n $path = implode(DIRECTORY_SEPARATOR, $parts);\n\n return $path;\n }",
"public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}",
"protected function getLocalRepoPath()\n {\n return sfConfig::get('sf_data_dir').'/'.str_replace(array('/',':'), '_', $this->getScm()->getHost()).'/'.str_replace(array('/'), '_', $this->getScm()->getPath());\n }",
"public function getRepositoryUrl() {\n\t\t\t// we need to clean the combination of the 2 again because if the subfolder is empty in the config\n\t\t\t// then this will result in 2 slashes\n\t\t\treturn File::getCleanedPath($this->config->svn->getRoot() . $this->config->svn->getSubfolder());\n\t\t}",
"private function getPdeRepositoryDir() {\n return DOKU_INC . $this->command->getConf('processingPdeRepository');\n }",
"public function path() {\n\t\t\treturn rtrim($this->application->configuration([ \"packagemanager\", \"directory\" ]), \"/\") . \"/\" . $this->package_directory;\n\t\t}",
"protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}",
"public function getRootPath()\n {\n return $this->getRepositoryRoot();\n }",
"protected function outputPath()\n {\n $destination = $this->ask('Where do you want to save the file? (Press enter for the current directory)'); \n $output_path = !is_null($destination) ? $destination : generate_path($this->config('source'));\n \n if (!file_exists($output_path)) {\n mkdir($output_path, 0744, true);\n }\n\n return $output_path;\n }",
"protected function savePath()\n {\n if ($this->_savePath) {\n return $this->_savePath;\n }\n\n $this->_savePath = rtrim($this->savePath, '/').'/';\n if (substr($this->savePath, 0, 1) == '@') {\n $this->_savePath = Yii::getAlias($this->_savePath).'/';\n }\n\n if (!is_dir($this->_savePath)) {\n mkdir($this->_savePath);\n }\n return $this->_savePath;\n }",
"public function getPath()\n {\n return $this->getBasePath() . '/Repositories/' . $this->getClass() . 'RepositoryEloquent.php';\n }",
"protected function buildPath()\n\t{\n\t\treturn $this->getDir() . DIRECTORY_SEPARATOR . $this->getSubDir()\n\t\t\t. DIRECTORY_SEPARATOR . $this->getName();\n\t}",
"protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }",
"public function getGitDirectory() : string\n {\n return !empty($this->settings['git-directory'])\n ? dirname($this->path) . DIRECTORY_SEPARATOR . $this->settings['git-directory']\n : getcwd() . DIRECTORY_SEPARATOR . '.git';\n }",
"protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }",
"function parcelcheckout_getRootPath()\n\t{\n\t\t$sRootPath = dirname(dirname(dirname(__FILE__)));\n\n\t\tif(strpos($sRootPath, '\\\\') !== false)\n\t\t{\n\t\t\t$sRootPath .= '\\\\';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sRootPath .= '/';\n\t\t}\n\n\t\treturn $sRootPath;\n\t}",
"private function getSavePath()\n\t{\n\t\t$todoDir = $this->todoDir;\n\t\t$fileExtendedName = $this->addExtension();\n\t\treturn $todoDir . $fileExtendedName;\n\t}",
"public function getWritePath();",
"function cemhub_get_files_repository_path($drupal_internal_path = FALSE) {\n $private_files_path = cemhub_get_private_file_system_path(TRUE);\n $stored_path = variable_get('cemhub_repository_files');\n\n $files_repository_path = $private_files_path . '/' . $stored_path;\n\n // If the directory does not exist, it is created\n cemhub_create_directory($files_repository_path);\n\n if ($drupal_internal_path) {\n $files_repository_path = 'private://' . $stored_path;\n }\n\n return $files_repository_path;\n}",
"public function getPath()\n {\n $path = Yii::getAlias('@webroot') .\n DIRECTORY_SEPARATOR . \"uploads\" .\n DIRECTORY_SEPARATOR . $this->folder_uploads .\n DIRECTORY_SEPARATOR . $this->guid;\n\n if (!is_dir($path)) {\n mkdir($path);\n }\n\n return $path;\n }",
"function dirPath () { return (\"../../\"); }",
"protected function createPathIfNeeded() {}",
"public function createFolderPath()\n {\n return \"uploads/\".date('Y').\"/\".date('m').\"/\";\n }",
"protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }",
"public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }",
"public function getRootDir()\n {\n return sys_get_temp_dir() . '/base-kernel/' . 'kernel-' . substr(\n hash(\n 'md5',\n json_encode([\n $this->bundlesToLoad,\n $this->configuration,\n $this->routes,\n ])\n ),\n 0,\n 10\n );\n }",
"public function getBaseDir();",
"public function getPath()\n {\n return $this->_folder . DIRECTORY_SEPARATOR . $this->_name;\n }",
"public function path()\n {\n return $this->basePath.DIRECTORY_SEPARATOR.'lumen'.DIRECTORY_SEPARATOR.'app';\n }",
"protected function getGeneratorConfigPath(): string\n {\n if (null === $this->genConfigPath) {\n\n /**\n * @var $container LightServiceContainerInterface\n */\n $container = $this->getContextVar(\"container\");\n $appDir = $container->getApplicationDir();\n $planet = $this->getContextVar(\"planet\");\n $galaxy = $this->getContextVar(\"galaxy\");\n $planetDir = $this->getContextVar(\"planetDir\");\n $createFile = $this->getContextVar(\"createFile\");\n $tablePrefix = DeveloperWizardGenericHelper::getTablePrefix($planetDir, $createFile);\n $this->genConfigPath = $appDir . \"/config/data/$galaxy.$planet/Ling.Light_BreezeGenerator/$tablePrefix.generated.byml\";\n }\n return $this->genConfigPath;\n }"
]
| [
"0.6984464",
"0.69362307",
"0.6673991",
"0.6530278",
"0.64360493",
"0.63879204",
"0.63877285",
"0.6342921",
"0.6316849",
"0.626338",
"0.623049",
"0.62047714",
"0.6184292",
"0.6178374",
"0.6152304",
"0.6143194",
"0.6133895",
"0.60434467",
"0.60169035",
"0.5962764",
"0.5957067",
"0.5953263",
"0.59409034",
"0.59213376",
"0.5892699",
"0.58758706",
"0.5852022",
"0.58488595",
"0.57971025",
"0.5777147"
]
| 0.73534447 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.